{"problem_id":"p02570","language":"Python","original_status":"Runtime Error","pass":"D = int(input())\nT = int(input())\nS = int(input())\n\nif D <= T * S:\n print(\"Yes\")\nelse:\n print(\"NO\")\n","fail":"D, T, S = map(int, input().split())\n\nif D <= T * S:\n print(\"Yes\")\nelse:\n print(\"No\")\n","change":"replace","i1":0,"i2":8,"j1":0,"j2":6,"error":"ValueError: invalid literal for int() with base 10: '1000 15 80'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02570\/Python\/s595588431.py\", line 1, in \n D = int(input())\nValueError: invalid literal for int() with base 10: '1000 15 80'\n","stdout":null} {"problem_id":"p02570","language":"Python","original_status":"Runtime Error","pass":"D, T, S = list(map(input().split()))\n\nif D <= S * T:\n print(\"Yes\")\nelse:\n print(\"No\")\n","fail":"D, T, S = list(map(int, input().split()))\n\nif D <= S * T:\n print(\"Yes\")\nelse:\n print(\"No\")\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"TypeError: map() must have at least two arguments.","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02570\/Python\/s822730167.py\", line 1, in \n D, T, S = list(map(input().split()))\nTypeError: map() must have at least two arguments.\n","stdout":null} {"problem_id":"p02571","language":"Python","original_status":"Runtime Error","pass":"S = input()\nT = input()\n\nfor i in range(len(S) - len(T)):\n count = 0\n maxcount = 0\n for j in range(len(T)):\n if S[i + j] == T[j]:\n count += 1\n maxcount = max(maxcount, count)\nprint(len(T) - maxcount)\n","fail":"S = input()\nT = input()\n\nmaxcount = 0\nfor i in range(len(S) - len(T) + 1):\n count = 0\n for j in range(len(T)):\n if S[i + j] == T[j]:\n count += 1\n maxcount = max(maxcount, count)\nprint(len(T) - maxcount)\n","change":"replace","i1":3,"i2":6,"j1":3,"j2":6,"error":"WA","stderr":null,"stdout":2.0} {"problem_id":"p02571","language":"Python","original_status":"Runtime Error","pass":"#!\/Library\/Frameworks\/Python.framework\/Versions\/3.5\/bin\/python3\n\ns = input()\nt = input()\n\na = []\nfor i in range(len(s) - len(t)):\n cnt = 0\n for j in range(len(t)):\n if t[j] == s[i + j]:\n cnt += 1\n a.append(cnt)\nprint(len(t) - max(a))\n","fail":"#!\/Library\/Frameworks\/Python.framework\/Versions\/3.5\/bin\/python3\n\ns = input()\nt = input()\n\na = []\nfor i in range(len(s) - len(t) + 1):\n cnt = 0\n for j in range(len(t)):\n if t[j] == s[i + j]:\n cnt += 1\n a.append(cnt)\nprint(len(t) - max(a))\n","change":"replace","i1":6,"i2":7,"j1":6,"j2":7,"error":"0","stderr":null,"stdout":1.0} {"problem_id":"p02571","language":"Python","original_status":"Time Limit Exceeded","pass":"S = input()\nT = input()\n\ncount = len(T)\n\nfor i in range(len(T)):\n for j in range(len(S)):\n if T[i] == S[j]:\n start = j - i\n end = j + (len(T) - i)\n if start < 0 or end > len(S):\n continue\n else:\n s = S[start:end]\n c = 0\n for k in range(len(T)):\n if T[k] != s[k]:\n c += 1\n count = min(count, c)\nprint(count)\n","fail":"n_gram = lambda t, n: [t[i : i + n] for i in range(len(t) - n + 1)]\n\nS = input()\nT = input()\n\nt_len = len(T)\ncount = t_len\n\ns_list = n_gram(S, t_len)\n\nfor s in s_list:\n c = 0\n for i in range(len(s)):\n if s[i] != T[i]:\n c += 1\n count = min(count, c)\n\nprint(count)\n","change":"replace","i1":0,"i2":19,"j1":0,"j2":17,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02571","language":"Python","original_status":"Runtime Error","pass":"s = input().strip()\nt = input().strip()\n\nif t in s:\n print(0)\nelse:\n ans = 1000\n for i in range(len(s) - len(t) - 1):\n count = len(t) - 1\n for j in range(len(t) - 1):\n if s[i + j] == t[i]:\n count -= 1\n ans = min(count, ans)\n print(ans)\n","fail":"s = input().strip()\nt = input().strip()\n\nif t in s:\n print(0)\nelse:\n ans = 10001\n for i in range(len(s) - len(t) + 1):\n count = 0\n cnt = i\n for j in range(len(t)):\n if s[cnt] != t[j]:\n count += 1\n cnt += 1\n ans = min(count, ans)\n print(ans)\n","change":"replace","i1":6,"i2":12,"j1":6,"j2":14,"error":"0","stderr":null,"stdout":1.0} {"problem_id":"p02572","language":"Python","original_status":"Time Limit Exceeded","pass":"import sys\nfrom collections import defaultdict\n\ninput = sys.stdin.buffer.readline\nN = int(input())\nA = list(map(int, input().split()))\nMOD = 10**9 + 7\n\nD = defaultdict(int)\nfor i in range(N - 1):\n for j in range(i + 1, N):\n v = A[i] * A[j] % MOD\n D[v] += 1\n# print(D)\n\nans = 0\nfor key, item in D.items():\n ans += key * item\n # ans = (ans + (key * item)) % MOD\nans %= MOD\nprint(ans)\n","fail":"import sys\n\ninput = sys.stdin.buffer.readline\nMOD = 10**9 + 7\n\nN = int(input())\nA = [0] + list(map(int, input().split()))\n\nC = [0]\nfor i in range(1, len(A)):\n C.append(C[-1] + A[i])\n\nans = 0\nfor i in range(1, N):\n ans += A[i] * (C[-1] - C[i])\n\nans %= MOD\nprint(ans)\n","change":"replace","i1":1,"i2":19,"j1":1,"j2":16,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02572","language":"Python","original_status":"Time Limit Exceeded","pass":"import itertools\n\nN = int(input())\nA = list(map(int, input().split()))\n\nC = list(itertools.combinations(A, 2))\n\nans = 0\nfor i, j in C:\n ans += i * j\n ans = ans % (1e9 + 7)\nprint(int(ans))\n","fail":"n = int(input())\nA = list(map(int, input().split()))\n\nS = sum(A)\nS2 = sum(map(lambda x: x * x, A))\n\nprint((S * S - S2) \/\/ 2 % 1000000007)\n","change":"replace","i1":0,"i2":12,"j1":0,"j2":7,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02572","language":"Python","original_status":"Runtime Error","pass":"import numpy as np\n\n\ndef mo(v):\n return v % 1000000007\n\n\nn = int(input())\na = mo(np.array(list(map(int, input().split()))))\ns = 0\nfor i in range(0, n - 1, 1):\n for j in range(i + 1, n, 1):\n s += mo(a[i] * a[j])\nprint(mo(s))\n","fail":"n = int(input())\na = list(map(int, input().split()))\ns = [0]\nans = 0\nMOD = 1000000007\nfor i in range(0, n, 1):\n s.append((s[i] + a[i]) % MOD)\n\nfor i in range(0, n, 1):\n ans += ((s[n] - s[i + 1]) * a[i]) % MOD\n\nprint(ans % MOD)\n","change":"replace","i1":0,"i2":14,"j1":0,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02572","language":"Python","original_status":"Time Limit Exceeded","pass":"import itertools\n\n_ = input()\nA = list(map(int, input().split()))\nmod = 10**9 + 7\n\nprint(sum([(ai * aj) % mod for ai, aj in itertools.combinations(A, 2)]) % mod)\n","fail":"_ = input()\nA = list(map(int, input().split()))\nmod = 10**9 + 7\n\ns = 0\na = 0\nfor _a in A:\n s += _a * a\n a = (a + _a) % mod\nprint(s % mod)\n","change":"replace","i1":0,"i2":7,"j1":0,"j2":10,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02572","language":"Python","original_status":"Time Limit Exceeded","pass":"import itertools\n\nN = int(input())\nA_list = list(map(int, input().split()))\nA_list.insert(0, 0)\nproduct_dict = {}\nfor i, j in itertools.combinations(range(len(A_list)), 2):\n product_dict[str(i) + \"&\" + str(j)] = A_list[i] * A_list[j]\n\nsum = 0\nfor i in range(1, N):\n for j in range(i + 1, N + 1):\n sum += product_dict[str(i) + \"&\" + str(j)]\n sum = sum % 1000000007\nprint(sum)\n","fail":"N = int(input())\nA_list = list(map(int, input().split()))\nA_list.insert(0, 0)\n\ncum_sum = 0\ncum_sum_list = []\nfor i in range(N + 1):\n cum_sum += A_list[i]\n cum_sum_list.append(cum_sum)\n\nans = 0\nfor i in range(1, N + 1):\n ans += A_list[i] * (cum_sum_list[N] - cum_sum_list[i])\n ans = ans % 1000000007\nprint(ans)\n","change":"replace","i1":0,"i2":15,"j1":0,"j2":15,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02572","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = [int(x) for x in input().split()]\n\ngokei = 0\nfor i in range(len(A)):\n gokei += A[i] * sum(A)\n gokei -= A[i] * A[i]\ngokei = gokei \/\/ 2\nans = gokei % 1000000007\nprint(ans)\n","fail":"N = int(input())\nA = [int(x) for x in input().split()]\n\ngokei = sum(A) ** 2\nfor i in range(len(A)):\n gokei -= A[i] * A[i]\ngokei = gokei \/\/ 2\nans = gokei % 1000000007\nprint(ans)\n","change":"replace","i1":3,"i2":6,"j1":3,"j2":5,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02572","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = list(map(int, input().split()))\nans = 0\nfor i in range(len(A)):\n ans += A[i] * sum(A[0:i])\nans = ans % 1000000007\nprint(ans)\n","fail":"N = int(input())\nA = list(map(int, input().split()))\nans = 0\na_sum = 0\nfor i in range(len(A)):\n ans += A[i] * a_sum\n a_sum += A[i]\nans = ans % 1000000007\nprint(ans)\n","change":"replace","i1":3,"i2":5,"j1":3,"j2":7,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02572","language":"Python","original_status":"Time Limit Exceeded","pass":"#!\/usr\/bin\/env python3\n\nfrom itertools import combinations\n\nN = int(input())\nA = map(int, input().split())\n\ntotal = sum([x * y for x, y in list(combinations(A, 2))])\nresult = total % (10**9 + 7)\nprint(result)\n","fail":"#!\/usr\/bin\/env python3\n\n\ndef solve(N, A):\n MOD = 10**9 + 7\n total = sum(A)\n ans = 0\n\n for i in range(N - 1):\n total -= A[i]\n ans += A[i] * total\n ans %= MOD\n\n return ans\n\n\ndef main():\n N = int(input())\n A = list(map(int, input().split()))\n\n ans = solve(N, A)\n\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":2,"i2":10,"j1":2,"j2":27,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02572","language":"Python","original_status":"Time Limit Exceeded","pass":"#!\/usr\/bin\/env python3\n\n# from typing import Optional\n# from typing import List\n# from typing import Dict\n# from typing import Tuple\n# from typing import Sequence\n\n\ndef main():\n N = int(input())\n A = list(map(lambda x: int(x), input().split()))\n\n sum = 0\n mod = 1000000000 + 7\n for i in range(N - 1):\n for j in range(i + 1, N):\n sum += A[i] * A[j]\n sum = sum % mod\n\n print(sum)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"#!\/usr\/bin\/env python3\n\n# from typing import Optional\n# from typing import List\n# from typing import Dict\n# from typing import Tuple\n# from typing import Sequence\n\n\ndef main():\n N = int(input())\n A = list(map(lambda x: int(x), input().split()))\n\n sum = 0\n mod = 1000000000 + 7\n\n sumJ = 0\n for j in range(N):\n sumJ += A[j]\n\n for i in range(N - 1):\n sumJ -= A[i]\n sum += A[i] * sumJ\n sum = sum % mod\n\n print(sum)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":15,"i2":19,"j1":15,"j2":24,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02572","language":"Python","original_status":"Time Limit Exceeded","pass":"import itertools\n\nN = int(input())\nA = [int(n) for n in input().split()]\nans = 0\nm = 1000000007\n\nfor x, y in itertools.combinations(A, 2):\n ans += x * y\n\nprint(ans % m)\n","fail":"N = int(input())\nA = list(map(int, input().split()))\nans = 0\nm = 1000000007\n\ns = 0\nfor i in range(N):\n ans += A[i] * s\n s += A[i]\n\nprint(ans % m)\n","change":"replace","i1":0,"i2":9,"j1":0,"j2":9,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02572","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = list(map(int, input().split()))\nans = 0\nfor i in range(n - 1):\n for j in range(i + 1, n):\n ans += a[i] * a[j]\nans %= 1000000007\nprint(ans)\n","fail":"n = int(input())\na = list(map(int, input().split()))\nans = 0\na_sum = sum(a)\na_sum -= a[0]\nfor i in range(n - 1):\n ans += a[i] * a_sum\n a_sum -= a[i + 1]\nans %= 1000000007\nprint(ans)\n","change":"replace","i1":3,"i2":6,"j1":3,"j2":8,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02572","language":"Python","original_status":"Time Limit Exceeded","pass":"#!\/usr\/bin\/env python\n# -*- coding: utf-8 -*-\n\n\ndef main():\n N = int(input())\n A = list(map(int, input().split()))\n\n ans = 0\n\n for i in range(N):\n for j in range(i + 1, N):\n ans += A[i] * A[j]\n\n print(ans % (10**9 + 7))\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"#!\/usr\/bin\/env python\n# -*- coding: utf-8 -*-\n\n\ndef main():\n N = int(input())\n A = list(map(int, input().split()))\n\n s = sum(A)\n ans = 0\n mod = 10**9 + 7\n for i in A:\n ans = ans + i * (s - i)\n print((ans \/\/ 2) % mod)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":8,"i2":15,"j1":8,"j2":14,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02572","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = list(map(int, input().split()))\ns = 0\nfor i in range(n):\n for j in range(i + 1, n):\n s += a[i] * a[j]\n s %= 1000000007\nprint(s % 1000000007)\n","fail":"n = int(input())\na = list(map(int, input().split()))\ns1 = sum(a)\ns2 = 0\nans = 0\nfor i in range(n - 1):\n s2 += a[i]\n ans += a[i] * (s1 - s2)\nprint(ans % 1000000007)\n","change":"replace","i1":2,"i2":8,"j1":2,"j2":9,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02573","language":"Python","original_status":"Runtime Error","pass":"def solve(N, M, fridens):\n parents = {}\n groups = {}\n for A, B in friends:\n parents[B] = A\n if A not in groups:\n if A not in parents:\n groups[A] = [A]\n else:\n continue\n groups[A].append(B)\n\n ans = len(max(groups.values(), key=len))\n print(ans)\n\n\nif __name__ == \"__main__\":\n N, M = map(int, input().split())\n friends = []\n for _ in range(M):\n AB = sorted([x - 1 for x in map(int, input().split())])\n if AB not in friends:\n friends.append(AB)\n solve(N, M, friends)\n","fail":"n, m = map(int, input().split())\npar = list(range(n))\n\n\ndef find(x):\n while par[x] != x:\n par[x] = par[par[x]]\n x = par[x]\n return x\n\n\ndef union(x, y):\n x1 = find(x)\n y1 = find(y)\n if x1 != y1:\n par[x1] = y1\n\n\nfor j in range(m):\n a, b = map(int, input().split())\n union(a - 1, b - 1)\n\ns = [0 for i in range(n + 1)]\n\nfor k in range(n):\n s[find(k)] += 1\n\n\nprint(max(s))\n","change":"replace","i1":0,"i2":24,"j1":0,"j2":29,"error":"0","stderr":null,"stdout":"3\n"} {"problem_id":"p02573","language":"Python","original_status":"Time Limit Exceeded","pass":"import numpy as np\nfrom collections import deque\n\nN, M = map(int, input().split())\nAB = [list(map(int, input().split())) for i in range(M)]\n\nseen = [0] * N\nvisitm = [True] * M\nlistm = np.arange(M)\nq = deque()\ngroup = []\n\nfor i in range(N):\n if seen[i]:\n continue\n q.append(i)\n seen[i] = 1\n k = 1\n while q:\n t = q.popleft()\n for j in listm[visitm]:\n if AB[j][0] == i + 1 and seen[AB[j][1] - 1] != 1:\n q.append(AB[j][1])\n seen[AB[j][1] - 1] = 1\n k += 1\n if AB[j][1] == i + 1 and seen[AB[j][0] - 1] != 1:\n q.append(AB[j][0] - 1)\n seen[AB[j][0] - 1] = 1\n k += 1\n visitm[j] = False\n group.append(k)\n\nprint(max(group))\n","fail":"N, M = map(int, input().split())\nAB = [list(map(int, input().split())) for i in range(M)]\n\n\nclass UnionFind:\n def __init__(self, n):\n self.n = n\n self.parents = [-1] * n\n\n def find(self, x): # \u8981\u7d20x\u304c\u5c5e\u3059\u308b\u30b0\u30eb\u30fc\u30d7\u306e\u6839\u3092\u8fd4\u3059\n if self.parents[x] < 0:\n return x\n else:\n self.parents[x] = self.find(self.parents[x])\n return self.parents[x]\n\n def union(self, x, y): # \u8981\u7d20x\u304c\u5c5e\u3059\u308b\u30b0\u30eb\u30fc\u30d7\u3068\u8981\u7d20y\u304c\u5c5e\u3059\u308b\u30b0\u30eb\u30fc\u30d7\u3068\u3092\u4f75\u5408\u3059\u308b\n x = self.find(x)\n y = self.find(y)\n if x == y:\n return\n if self.parents[x] > self.parents[y]:\n x, y = y, x\n self.parents[x] += self.parents[y]\n self.parents[y] = x\n\n def same(self, x, y): # \u8981\u7d20x, y\u304c\u540c\u3058\u30b0\u30eb\u30fc\u30d7\u306b\u5c5e\u3059\u308b\u304b\u3069\u3046\u304b\u3092\u8fd4\u3059\n return self.find(x) == self.find(y)\n\n def size(self, x): # \u8981\u7d20x\u304c\u5c5e\u3059\u308b\u30b0\u30eb\u30fc\u30d7\u306e\u30b5\u30a4\u30ba\uff08\u8981\u7d20\u6570\uff09\u3092\u8fd4\u3059\n return -self.parents[self.find(x)]\n\n def members(self, x): # \u8981\u7d20x\u304c\u5c5e\u3059\u308b\u30b0\u30eb\u30fc\u30d7\u306b\u5c5e\u3059\u308b\u8981\u7d20\u3092\u30ea\u30b9\u30c8\u3067\u8fd4\u3059\n root = self.find(x)\n return [i for i in range(self.n) if self.find(i) == root]\n\n def roots(self): # \u3059\u3079\u3066\u306e\u6839\u306e\u8981\u7d20\u3092\u30ea\u30b9\u30c8\u3067\u8fd4\u3059\n return [i for i, x in enumerate(self.parents) if x < 0]\n\n def group_count(self): # \u30b0\u30eb\u30fc\u30d7\u306e\u6570\u3092\u8fd4\u3059\n return len(self.roots())\n\n def all_group_members(self): # {\u30eb\u30fc\u30c8\u8981\u7d20: [\u305d\u306e\u30b0\u30eb\u30fc\u30d7\u306b\u542b\u307e\u308c\u308b\u8981\u7d20\u306e\u30ea\u30b9\u30c8], ...}\u306e\u8f9e\u66f8\u3092\u8fd4\u3059\n return {r: self.members(r) for r in self.roots()}\n\n def __str__(self): # \u30eb\u30fc\u30c8\u8981\u7d20: [\u305d\u306e\u30b0\u30eb\u30fc\u30d7\u306b\u542b\u307e\u308c\u308b\u8981\u7d20\u306e\u30ea\u30b9\u30c8]\u3092\u6587\u5b57\u5217\u3067\u8fd4\u3059\n return \"\\\\n\".join(\"{}: {}\".format(r, self.members(r)) for r in self.roots())\n\n\nuf = UnionFind(N)\nfor i in range(M):\n uf.union(AB[i][0] - 1, AB[i][1] - 1)\nl = []\nfor i in range(N):\n l.append(uf.size(i))\nprint(max(l))\n","change":"replace","i1":0,"i2":33,"j1":0,"j2":56,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02573","language":"Python","original_status":"Runtime Error","pass":"#!\/usr\/bin\/env python3\n\nimport sys\nfrom collections import namedtuple\n\nDEBUG = False\n\n\ndef read(t):\n return t(sys.stdin.readline().rstrip())\n\n\ndef read_list(t, sep=\" \"):\n return [t(s) for s in sys.stdin.readline().rstrip().split(sep)]\n\n\ndef dprint(*args, **kwargs):\n if DEBUG:\n print(*args, **kwargs)\n return\n\n\nPoint = namedtuple(\"Point\", (\"id\", \"to\"))\npoints = {}\n\n\ndef scc_forward(p, visited, rev_scc_ponints):\n if p in visited:\n return\n visited.add(p)\n for to in points[p].to:\n scc_forward(to, visited, rev_scc_ponints)\n rev_scc_ponints.append(p)\n\n\ndef scc_backword(p, visited, cur_sc):\n if p in visited:\n return 0\n visited.add(p)\n cur_sc.add(p)\n for to in points[p].to:\n scc_backword(to, visited, cur_sc)\n return len(cur_sc)\n\n\ndef count_max_sc_size(points):\n rev_scc_points = []\n visited_forward = set()\n for p in points:\n scc_forward(p, visited_forward, rev_scc_points)\n\n max_sc_size = 0\n visited_backward = set()\n for p in rev_scc_points:\n cur_sc_size = scc_backword(p, visited_backward, set())\n if cur_sc_size > max_sc_size:\n max_sc_size = cur_sc_size\n return max_sc_size\n\n\ndef main():\n _n, m = read_list(int)\n for _ in range(0, m):\n a, b = read_list(int)\n a -= 1\n b -= 1\n\n if a not in points:\n points[a] = Point(a, set())\n if b not in points:\n points[b] = Point(b, set())\n f = points[a]\n t = points[b]\n f.to.add(b)\n t.to.add(a)\n print(count_max_sc_size(points))\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"#!\/usr\/bin\/env python3\n\nimport sys\nfrom collections import namedtuple\n\nDEBUG = False\n\n\ndef read(t):\n return t(sys.stdin.readline().rstrip())\n\n\ndef read_list(t, sep=\" \"):\n return [t(s) for s in sys.stdin.readline().rstrip().split(sep)]\n\n\ndef dprint(*args, **kwargs):\n if DEBUG:\n print(*args, **kwargs)\n return\n\n\nPoint = namedtuple(\"Point\", (\"id\", \"to\"))\npoints = {}\n\n\nclass UnionFind:\n def __init__(self, n):\n self.n = n\n self.parents = [-1] * n\n\n def find(self, x):\n if self.parents[x] < 0:\n return x\n else:\n self.parents[x] = self.find(self.parents[x])\n return self.parents[x]\n\n def union(self, x, y):\n x = self.find(x)\n y = self.find(y)\n\n if x == y:\n return\n\n if self.parents[x] > self.parents[y]:\n x, y = y, x\n\n self.parents[x] += self.parents[y]\n self.parents[y] = x\n\n def size(self, x):\n return -self.parents[self.find(x)]\n\n def same(self, x, y):\n return self.find(x) == self.find(y)\n\n def members(self, x):\n root = self.find(x)\n return [i for i in range(self.n) if self.find(i) == root]\n\n def roots(self):\n return [i for i, x in enumerate(self.parents) if x < 0]\n\n def group_count(self):\n return len(self.roots())\n\n def all_group_members(self):\n return {r: self.members(r) for r in self.roots()}\n\n def __str__(self):\n return \"\\\\n\".join(\"{}: {}\".format(r, self.members(r)) for r in self.roots())\n\n\ndef scc_forward(p, visited, rev_scc_ponints):\n if p in visited:\n return\n visited.add(p)\n for to in points[p].to:\n scc_forward(to, visited, rev_scc_ponints)\n rev_scc_ponints.append(p)\n\n\ndef scc_backword(p, visited, cur_sc):\n if p in visited:\n return 0\n visited.add(p)\n cur_sc.add(p)\n for to in points[p].to:\n scc_backword(to, visited, cur_sc)\n print(repr(cur_sc))\n return len(cur_sc)\n\n\ndef count_max_sc_size(points):\n rev_scc_points = []\n visited_forward = set()\n for p in points:\n scc_forward(p, visited_forward, rev_scc_points)\n\n max_sc_size = 1\n visited_backward = set()\n for p in rev_scc_points:\n cur_sc_size = scc_backword(p, visited_backward, set())\n if cur_sc_size > max_sc_size:\n max_sc_size = cur_sc_size\n return max_sc_size\n\n\ndef old_main():\n _n, m = read_list(int)\n for _ in range(0, m):\n a, b = read_list(int)\n a -= 1\n b -= 1\n\n if a not in points:\n points[a] = Point(a, set())\n if b not in points:\n points[b] = Point(b, set())\n f = points[a]\n t = points[b]\n f.to.add(b)\n t.to.add(a)\n print(count_max_sc_size(points))\n\n\ndef main():\n n, m = read_list(int)\n union_find = UnionFind(n)\n for _ in range(0, m):\n a, b = read_list(int)\n a -= 1\n b -= 1\n union_find.union(a, b)\n\n max_size = 1\n for i in range(0, n):\n if union_find.size(i) > max_size:\n max_size = union_find.size(i)\n print(max_size)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":26,"i2":78,"j1":26,"j2":143,"error":"0","stderr":null,"stdout":"3\n"} {"problem_id":"p02573","language":"Python","original_status":"Time Limit Exceeded","pass":"#!\/usr\/bin\/env python3\nN, M = map(int, input().split())\nA = [0] * M\nB = [0] * M\nfor i in range(M):\n A[i], B[i] = map(int, input().split())\n\nfriend = [[0]]\nfor i in range(M):\n for f in friend:\n if A[i] not in f and B[i] not in f:\n friend.append([A[i], B[i]])\n elif A[i] in f and B[i] not in f:\n f.append(B[i])\n elif A[i] not in f and B[i] in f:\n f.append(A[i])\n else:\n pass\n\nans = 0\nfor f in friend:\n ans = max(ans, len(f))\nprint(ans)\n","fail":"#!\/usr\/bin\/env python3\nimport sys\n\n\ndef input():\n return sys.stdin.readline()[:-1]\n\n\n# uf = UnionFind(\u8981\u7d20\u6570) \u3067\u4f7f\u7528\nclass UnionFind:\n def __init__(self, n):\n self.n = n\n self.parents = [-1] * n # \u5404\u8981\u7d20\u306e\u89aa\u8981\u7d20\u306e\u756a\u53f7\u3092\u683c\u7d0d\u3059\u308b\u30ea\u30b9\u30c8 \u8981\u7d20\u304c\u6839\u306e\u5834\u5408\u306f-(\u30b0\u30eb\u30fc\u30d7\u306e\u8981\u7d20\u6570)\u3092\u683c\u7d0d\n\n def find(self, x): # \u8981\u7d20x\u304c\u5c5e\u3059\u308b\u30b0\u30eb\u30fc\u30d7\u306e\u6839\u3092\u8fd4\u3059\n if self.parents[x] < 0:\n return x\n else:\n self.parents[x] = self.find(self.parents[x])\n return self.parents[x]\n\n def union(self, x, y): # \u8981\u7d20x\u304c\u5c5e\u3059\u308b\u30b0\u30eb\u30fc\u30d7\u3068\u3001\u8981\u7d20y\u304c\u5c5e\u3059\u308b\u30b0\u30eb\u30fc\u30d7\u3068\u3092\u4f75\u5408\u3059\u308b\n x = self.find(x)\n y = self.find(y)\n if x == y:\n return\n if self.parents[x] > self.parents[y]:\n x, y = y, x\n self.parents[x] += self.parents[y]\n self.parents[y] = x\n\n def size(self, x): # \u8981\u7d20x\u304c\u5c5e\u3059\u308b\u30b0\u30eb\u30fc\u30d7\u306e\u30b5\u30a4\u30ba(\u8981\u7d20\u6570)\u3092\u8fd4\u3059\n return -self.parents[self.find(x)]\n\n def same(self, x, y): # \u8981\u7d20x\u3068\u8981\u7d20y\u304c\u540c\u3058\u30b0\u30eb\u30fc\u30d7\u306b\u5c5e\u3059\u308b\u304b\u3069\u3046\u304b\u3092\u8fd4\u3059\n return self.find(x) == self.find(y)\n\n def members(self, x): # \u8981\u7d20x\u304c\u5c5e\u3059\u308b\u30b0\u30eb\u30fc\u30d7\u306b\u5c5e\u3059\u308b\u8981\u7d20\u3092\u30ea\u30b9\u30c8\u3067\u8fd4\u3059\n root = self.find(x)\n return [i for i in range(self.n) if self.find(i) == root]\n\n def roots(self): # \u3059\u3079\u3066\u306e\u6839\u306e\u8981\u7d20\u3092\u30ea\u30b9\u30c8\u3067\u8fd4\u3059\n return [i for i, x in enumerate(self.parents) if x < 0]\n\n def group_count(self): # \u30b0\u30eb\u30fc\u30d7\u306e\u6570\u3092\u8fd4\u3059\n return len(self.roots())\n\n def all_group_members(self): # {\u30eb\u30fc\u30c8\u8981\u7d20: [\u305d\u306e\u30b0\u30eb\u30fc\u30d7\u306b\u542b\u307e\u308c\u308b\u8981\u7d20\u306e\u30ea\u30b9\u30c8], ...} \u306e\u8f9e\u66f8\u3092\u8fd4\u3059\n return {r: self.members(r) for r in self.roots()}\n\n def __str__(self):\n return \"\\\\n\".join(\"{}: {}\".format(r, self.members(r)) for r in self.roots())\n\n\ndef main():\n N, M = map(int, input().split())\n A = [0] * M\n B = [0] * M\n for i in range(M):\n A[i], B[i] = map(int, input().split())\n\n uf = UnionFind(N + 1)\n for i in range(M):\n uf.union(A[i], B[i])\n\n ans = 0\n for i in range(1, N + 1):\n ans = max(ans, uf.size(i))\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":1,"i2":23,"j1":1,"j2":73,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02573","language":"Python","original_status":"Runtime Error","pass":"N, M = list(map(int, input().split()))\n\nd = {i: [] for i in range(1, N + 1)}\nfor _ in range(M):\n a, b = list(map(int, input().split()))\n d[a].append(b)\n d[b].append(a)\n\nvisited = [False for _ in range(N + 1)]\n\n\ndef visit(x):\n if visited[x]:\n return 0\n visited[x] = True\n\n z = 1\n for y in d[x]:\n z += visit(y)\n return z\n\n\nm = 1\nfor i in range(1, N + 1):\n r = visit(i)\n if m < r:\n m = r\n\nprint(m)\n","fail":"import sys\n\nsys.setrecursionlimit(10000000)\n\nN, M = list(map(int, input().split()))\n\nd = {i: [] for i in range(1, N + 1)}\nfor _ in range(M):\n a, b = list(map(int, input().split()))\n d[a].append(b)\n d[b].append(a)\n\nvisited = [False for _ in range(N + 1)]\n\n\ndef visit(x):\n if visited[x]:\n return 0\n visited[x] = True\n\n z = 1\n for y in d[x]:\n z += visit(y)\n return z\n\n\nm = 1\nfor i in range(1, N + 1):\n r = visit(i)\n if m < r:\n m = r\n\nprint(m)\n","change":"insert","i1":0,"i2":0,"j1":0,"j2":4,"error":"0","stderr":null,"stdout":"3\n"} {"problem_id":"p02574","language":"Python","original_status":"Runtime Error","pass":"import math\nfrom functools import reduce\n\nn = int(input())\na_list = list(map(int, input().split()))\nmax = a_list[n - 1] + 100\nmemo = [0] * max\n\nfor a in a_list:\n memo[a] += 1\n\nfor i in range(2, max):\n if sum(memo[i::i]) > 1:\n if reduce(math.gcd, a_list) == 1:\n print(\"setwise coprime\")\n exit()\n else:\n print(\"not coprime\")\n exit()\n\nprint(\"pairwise coprime\")\n","fail":"import math\nfrom functools import reduce\n\nn = int(input())\na_list = list(map(int, input().split()))\nmax = 10**6 + 1\nmemo = [0] * max\n\nfor a in a_list:\n memo[a] += 1\n\nfor i in range(2, max):\n if sum(memo[i::i]) > 1:\n if reduce(math.gcd, a_list) == 1:\n print(\"setwise coprime\")\n exit()\n else:\n print(\"not coprime\")\n exit()\n\nprint(\"pairwise coprime\")\n","change":"replace","i1":5,"i2":6,"j1":5,"j2":6,"error":"0","stderr":null,"stdout":"pairwise coprime\n"} {"problem_id":"p02574","language":"Python","original_status":"Runtime Error","pass":"import math\nfrom functools import reduce\n\nn = int(input())\na_list = list(map(int, input().split()))\nmax = a_list[-1] + 1\nmemo = [0] * max\n\nfor a in a_list:\n memo[a] += 1\n\nfor i in range(2, max):\n if sum(memo[i::i]) > 1:\n if reduce(math.gcd, a_list) == 1:\n print(\"setwise coprime\")\n exit()\n else:\n print(\"not coprime\")\n exit()\n\nprint(\"pairwise coprime\")\n","fail":"import math\nfrom functools import reduce\n\nn = int(input())\na_list = list(map(int, input().split()))\nmax = 10**6 + 1\nmemo = [0] * max\n\nfor a in a_list:\n memo[a] += 1\n\nfor i in range(2, max):\n if sum(memo[i::i]) > 1:\n if reduce(math.gcd, a_list) == 1:\n print(\"setwise coprime\")\n exit()\n else:\n print(\"not coprime\")\n exit()\n\nprint(\"pairwise coprime\")\n","change":"replace","i1":5,"i2":6,"j1":5,"j2":6,"error":"0","stderr":null,"stdout":"pairwise coprime\n"} {"problem_id":"p02574","language":"Python","original_status":"Runtime Error","pass":"import math\nfrom functools import reduce\n\nn = int(input())\na_list = list(map(int, input().split()))\nmemo = [0] * (a_list[-1] + 1)\n\nfor a in a_list:\n memo[a] += 1\n\nfor i in range(2, a_list[-1] + 1):\n if sum(memo[i::i]) > 1:\n if reduce(math.gcd, a_list) == 1:\n print(\"setwise coprime\")\n exit()\n else:\n print(\"not coprime\")\n exit()\n\nprint(\"pairwise coprime\")\n","fail":"import math\nfrom functools import reduce\n\nL = 10**6 + 1\nn = int(input())\na_list = list(map(int, input().split()))\nmemo = [0] * L\n\nfor a in a_list:\n memo[a] += 1\n\nfor i in range(2, L):\n if sum(memo[i::i]) > 1:\n if reduce(math.gcd, a_list) == 1:\n print(\"setwise coprime\")\n exit()\n else:\n print(\"not coprime\")\n exit()\n\nprint(\"pairwise coprime\")\n","change":"replace","i1":3,"i2":11,"j1":3,"j2":12,"error":"0","stderr":null,"stdout":"pairwise coprime\n"} {"problem_id":"p02574","language":"Python","original_status":"Time Limit Exceeded","pass":"from math import gcd\n\nn = int(input())\n\n\ndef p(x):\n a = []\n i = 2\n while True:\n if x % i == 0:\n j = 0\n while x % i == 0:\n x \/\/= i\n j += 1\n a.append((i, j))\n if i * i > x:\n break\n i += 1\n if x != 1:\n a.append((x, 1))\n return a\n\n\npp = set()\na = [int(i) for i in input().split()]\n\nj = 0\nfor i in a:\n j = gcd(j, i)\nok1 = j == 1\n\nok2 = True\nfor i in a:\n for (j, _) in p(i):\n if j in pp:\n ok2 = False\n else:\n pp.add(j)\nif ok2:\n print(\"pairwise coprime\")\nelse:\n if ok1:\n print(\"setwise coprime\")\n else:\n print(\"not coprime\")\n","fail":"from math import gcd\n\nn = int(input())\n\n\ndef p(x):\n a = []\n i = 2\n while True:\n if x % i == 0:\n j = 0\n while x % i == 0:\n x \/\/= i\n j += 1\n a.append((i, j))\n if i * i > x:\n break\n i += 1\n if x != 1:\n a.append((x, 1))\n return a\n\n\npp = set()\na = [int(i) for i in input().split()]\n\nj = 0\nfor i in a:\n j = gcd(j, i)\nok1 = j == 1\n\nma = 2 * 10**6\ntable = [0] * ma\nfor i in a:\n table[i] += 1\nok2 = True\nfor i in range(2, ma):\n s = 0\n for j in range(i, ma, i):\n s += table[j]\n if s > 1:\n ok2 = False\n\nif ok2:\n print(\"pairwise coprime\")\nelse:\n if ok1:\n print(\"setwise coprime\")\n else:\n print(\"not coprime\")\n","change":"replace","i1":31,"i2":38,"j1":31,"j2":43,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02577","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\nsum = 0\nwhile n > 0:\n sum += n % 10\n n = n \/\/ 10\nif sum % 9 == 0:\n print(\"Yes\")\nelse:\n print(\"No\")\n","fail":"n = int(input())\nif n % 9 == 0:\n print(\"Yes\")\nelse:\n print(\"No\")\n","change":"replace","i1":1,"i2":6,"j1":1,"j2":2,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02577","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = 0\nwhile n:\n a += n % 10\n n \/\/= 10\nif a % 9 == 0:\n print(\"Yes\")\nelse:\n print(\"No\")\n","fail":"n = list(input())\na = 0\nfor i in range(len(n)):\n a += int(n[i])\nif a % 9 == 0:\n print(\"Yes\")\nelse:\n print(\"No\")\n","change":"replace","i1":0,"i2":5,"j1":0,"j2":4,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02577","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\ns = 0\n\nwhile N != 0:\n s = s + N % 10\n N = N \/\/ 10\n\nif s % 9 == 0:\n print(\"Yes\")\nelse:\n print(\"No\")\n","fail":"N = int(input())\ns = 0\n\ns = sum(list(map(int, str(N))))\n\nif s % 9 == 0:\n print(\"Yes\")\nelse:\n print(\"No\")\n","change":"replace","i1":3,"i2":6,"j1":3,"j2":4,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02577","language":"Python","original_status":"Time Limit Exceeded","pass":"# -*- coding: utf-8 -*-\n\n# Input#\nn = list(input())\n# n, k = map(int, input().split())\n# a = list(map(int, input().split()))\n\nsum = 0\nwhile len(n) > 1:\n sum += int(n.pop(0))\n\n\nsum += int(n[0])\nif sum % 9 == 0:\n print(\"Yes\")\nelse:\n print(\"No\")\n\n\n# print(\"{}\".format(ans))\n","fail":"# -*- coding: utf-8 -*-\n\n# Input#\nn = list(input())\n# n, k = map(int, input().split())\n# a = list(map(int, input().split()))\nsum = 0\nfor i in n:\n sum += int(i)\n\nif sum % 9 == 0:\n print(\"Yes\")\nelse:\n print(\"No\")\n\n\n# print(\"{}\".format(ans))\n","change":"replace","i1":6,"i2":13,"j1":6,"j2":10,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02577","language":"Python","original_status":"Runtime Error","pass":"n = input()\n\n\ndef solve1(n: int) -> str:\n k = 0\n for i in range(len(n)):\n k += int(n[i])\n\n if k % 9 == 0:\n return \"Yes\"\n else:\n return \"No\"\n\n\ndef solve2(n: int) -> str:\n if n % 9 == 0:\n return \"Yes\"\n else:\n return \"No\"\n\n\nsolve2(n)\n","fail":"n = int(input())\n\n\ndef solve1(n: int) -> str:\n k = 0\n for i in range(len(n)):\n k += int(n[i])\n\n if k % 9 == 0:\n return \"Yes\"\n else:\n return \"No\"\n\n\ndef solve2(n: int) -> str:\n if n % 9 == 0:\n return \"Yes\"\n else:\n return \"No\"\n\n\nprint(solve2(n))\n","change":"replace","i1":0,"i2":22,"j1":0,"j2":22,"error":"TypeError: not all arguments converted during string formatting","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02577\/Python\/s983642794.py\", line 22, in \n solve2(n)\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02577\/Python\/s983642794.py\", line 16, in solve2\n if n % 9 == 0:\nTypeError: not all arguments converted during string formatting\n","stdout":null} {"problem_id":"p02577","language":"Python","original_status":"Time Limit Exceeded","pass":"a = input()\n\na = int(a)\n\nb = a\n\nb = int(b)\n\nif a % 9 == 0:\n\n for i in range(a):\n b += b % pow(10, i)\n\nelse:\n print(\"No\")\n exit()\n\nif b % 9 == 0:\n print(\"Yes\")\nelse:\n print(\"No\")\n","fail":"a = input()\n\na = int(a)\n\nif a % 9 == 0:\n print(\"Yes\")\nelse:\n print(\"No\")\n","change":"replace","i1":4,"i2":18,"j1":4,"j2":5,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02577","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nsummer = 0\n\nwhile N > 0:\n digit = N % 10\n summer += digit\n N = N \/\/ 10\nif summer % 9 == 0:\n print(\"Yes\")\nelse:\n print(\"No\")\n","fail":"N = int(input())\nif N % 9 == 0:\n print(\"Yes\")\nelse:\n print(\"No\")\n","change":"replace","i1":1,"i2":8,"j1":1,"j2":2,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02577","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\n\nhantei = 0\n\nwhile N != 0 or N < 1:\n hantei += N % 10\n N = N \/\/ 10\n\nif hantei % 9 == 0:\n ans = \"Yes\"\nelse:\n ans = \"No\"\n\nprint(ans)\n","fail":"N = input()\n\nhantei = 0\n\nfor i in range(len(N)):\n hantei += int(N[i])\n\nif hantei % 9 == 0:\n ans = \"Yes\"\nelse:\n ans = \"No\"\n\nprint(ans)\n","change":"replace","i1":0,"i2":7,"j1":0,"j2":6,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02578","language":"Python","original_status":"Time Limit Exceeded","pass":"#!\/usr\/local\/bin\/python3\nN = int(input())\nA = list(map(int, input().split()))[::-1]\n\nans = 0\nwhile N != 0:\n m = max(A)\n idx = A.index(m) + 1\n ans += (len(A[:idx]) * m) - sum(A[:idx])\n A = A[idx:]\n N -= idx\n\nprint(ans)\n","fail":"#!\/usr\/local\/bin\/python3\nN = int(input())\nA = list(map(int, input().split()))\n\nm = ans = 0\nfor i in range(N):\n m = max(m, A[i])\n ans += m - A[i]\n\nprint(ans)\n","change":"replace","i1":2,"i2":11,"j1":2,"j2":8,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02578","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = list(map(int, input().split()))\n\nres = []\nfor i in range(len(A) - 1, 0, -1):\n val = A[i]\n max_val = -1\n for j in A[:i]:\n if max_val < j:\n max_val = j\n\n if max_val > val:\n res.append(max_val - val)\n else:\n res.append(0)\n\nprint(sum(res))\n","fail":"N = int(input())\nA = list(map(int, input().split()))\n\nres = 0\nmax_val = -1\nfor a in A:\n if a >= max_val:\n max_val = a\n else:\n res += max_val - a\n\nprint(res)\n","change":"replace","i1":3,"i2":17,"j1":3,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02579","language":"Python","original_status":"Runtime Error","pass":"# D - Wizard in Maze\nimport sys\nfrom collections import deque\nfrom typing import List, Tuple\n\n\nclass WarpableMaze:\n __slots__ = [\"height\", \"width\", \"start\", \"goal\", \"road\", \"wall\", \"grid\"]\n\n def __init__(\n self,\n height: int,\n width: int,\n start: Tuple[int, int],\n goal: Tuple[int, int],\n grid: List[str],\n road: str = \".\",\n wall: str = \"#\",\n ) -> None:\n # Values of start and goal must be 0-origin.\n self.height = height + 4\n self.width = width + 4\n self.start = self._flatten_coordinate(*start)\n self.goal = self._flatten_coordinate(*goal)\n self.road = road\n self.wall = wall\n self.grid = self._flatten_grid(grid)\n\n def _flatten_coordinate(self, h: int, w: int) -> int:\n return self.width * (h + 2) + w + 2\n\n def _flatten_grid(self, grid: List[str]) -> str:\n flat_grid = self.wall * self.width * 2\n for row in grid:\n flat_grid += self.wall * 2 + row + self.wall * 2\n flat_grid += self.wall * self.width * 2\n return flat_grid\n\n def bfs(self) -> int:\n w = self.width\n move = (w, w, -1, 1)\n warp = [-2 * w - 2, -2 * w - 1, -2 * w, -2 * w + 1, -2 * w + 2]\n warp.extend([-w - 2, -w - 1, -w + 1, -w + 2, -2, 2])\n warp.extend([w - 2, w - 1, w + 1, w + 2])\n warp.extend([2 * w - 2, 2 * w - 1, 2 * w, 2 * w + 1, 2 * w + 2])\n\n unsearched = -1\n dist = [unsearched] * (self.height * self.width)\n dist[self.start] = 0\n queue = deque([self.start])\n while queue:\n x = queue.popleft()\n cur_dist = dist[x]\n print(x, cur_dist)\n\n for dx in move:\n nx = x + dx\n if self.grid[nx] == self.wall:\n continue\n if dist[nx] == unsearched or dist[nx] > cur_dist:\n dist[nx] = cur_dist\n queue.append(nx)\n\n for dx in warp:\n nx = x + dx\n if self.grid[nx] == self.wall:\n continue\n if dist[nx] == unsearched or dist[nx] > cur_dist + 1:\n dist[nx] = cur_dist + 1\n queue.append(nx)\n\n return dist[self.goal]\n\n def debug(self):\n print(f\"\\\\n{self.start=}, {self.goal=}\", file=sys.stderr)\n for row in zip(*[iter(self.grid)] * self.width):\n print(*row, file=sys.stderr)\n\n\ndef main():\n H, W, CH, CW, DH, DW, *S = open(0).read().split()\n start, goal = (int(CH) - 1, int(CW) - 1), (int(DH) - 1, int(DW) - 1)\n maze = WarpableMaze(int(H), int(W), start, goal, S)\n print(maze.bfs())\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"# D - Wizard in Maze\nimport sys\nfrom collections import deque\nfrom typing import List, Tuple\n\n\nclass WarpableMaze:\n __slots__ = [\"height\", \"width\", \"start\", \"goal\", \"road\", \"wall\", \"grid\"]\n\n def __init__(\n self,\n height: int,\n width: int,\n start: Tuple[int, int],\n goal: Tuple[int, int],\n grid: List[str],\n road: str = \".\",\n wall: str = \"#\",\n ) -> None:\n # Values of start and goal must be 0-origin.\n self.height = height + 4\n self.width = width + 4\n self.start = self._flatten_coordinate(*start)\n self.goal = self._flatten_coordinate(*goal)\n self.road = road\n self.wall = wall\n self.grid = self._flatten_grid(grid)\n\n def _flatten_coordinate(self, h: int, w: int) -> int:\n return self.width * (h + 2) + w + 2\n\n def _flatten_grid(self, grid: List[str]) -> str:\n flat_grid = self.wall * self.width * 2\n for row in grid:\n flat_grid += self.wall * 2 + row + self.wall * 2\n flat_grid += self.wall * self.width * 2\n return flat_grid\n\n def bfs(self) -> int:\n w = self.width\n move = (-w, w, -1, 1)\n warp = [-2 * w - 2, -2 * w - 1, -2 * w, -2 * w + 1, -2 * w + 2]\n warp.extend([-w - 2, -w - 1, -w + 1, -w + 2, -2, 2])\n warp.extend([w - 2, w - 1, w + 1, w + 2])\n warp.extend([2 * w - 2, 2 * w - 1, 2 * w, 2 * w + 1, 2 * w + 2])\n\n unsearched = 1 << 30\n dist = [unsearched] * (self.height * self.width)\n dist[self.start] = 0\n queue = deque([self.start])\n while queue:\n x = queue.popleft()\n cur_dist = dist[x]\n\n for dx in move:\n nx = x + dx\n if self.grid[nx] == self.wall:\n continue\n if dist[nx] > cur_dist:\n dist[nx] = cur_dist\n queue.appendleft(nx)\n\n for dx in warp:\n nx = x + dx\n if self.grid[nx] == self.wall:\n continue\n if dist[nx] > cur_dist + 1:\n dist[nx] = cur_dist + 1\n queue.append(nx)\n\n return dist[self.goal] if dist[self.goal] != unsearched else -1\n\n def debug(self):\n print(f\"\\\\nstart={self.start}, goal={self.goal}\", file=sys.stderr)\n for row in zip(*[iter(self.grid)] * self.width):\n print(*row, file=sys.stderr)\n\n\ndef main():\n H, W, CH, CW, DH, DW, *S = open(0).read().split()\n start, goal = (int(CH) - 1, int(CW) - 1), (int(DH) - 1, int(DW) - 1)\n maze = WarpableMaze(int(H), int(W), start, goal, S)\n # maze.debug()\n print(maze.bfs())\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":40,"i2":83,"j1":40,"j2":83,"error":"WA","stderr":null,"stdout":"18 0\n26 0\n19 0\n27 0\n34 0\n36 1\n34 0\n27 0\n42 0\n44 1\n21 1\n29 1\n37 1\n45 1\n42 0\n1\n"} {"problem_id":"p02579","language":"Python","original_status":"Time Limit Exceeded","pass":"import sys\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef main():\n INF = 10**7\n h, w = [int(i) for i in input().split()]\n c_h, c_w = [int(i) for i in input().split()]\n d_h, d_w = [int(i) for i in input().split()]\n grid = [[\"#\"] * (w + 2)]\n for _ in range(h):\n line = [\"#\"] + list(input()) + [\"#\"]\n grid.append(line)\n grid.append([\"#\"] * (w + 2))\n warp_count = [[INF] * (w + 2) for _ in range(h + 2)]\n directions = ((1, 0), (-1, 0), (0, 1), (0, -1))\n warps = []\n for x in range(-2, 3):\n for y in range(-2, 3):\n if x == 0 and y == 0:\n continue\n if (x, y) not in directions:\n warps.append((x, y))\n\n stack = []\n warp_count[c_h][c_w] = 0\n stack.append((c_h, c_w, 0))\n\n while stack:\n _h, _w, warp = stack.pop()\n warp_count[_h][_w] = warp\n\n cnt = 0\n # walk\n for _a, _b in directions:\n if grid[_h + _a][_w + _b] != \"#\" and warp_count[_h + _a][_w + _b] > warp:\n cnt += 1\n stack.append((_h + _a, _w + _b, warp))\n\n if cnt == 4: # 4\u65b9\u5411\u884c\u3051\u308b\u3068\u304d\u306b\u30ef\u30fc\u30d7\u306f\u4e0d\u8981\n continue\n\n # warp\n for x, y in warps:\n if _h + x < 0 or _h + x > h or _w + y < 0 or _w + y > w:\n continue\n elif grid[_h + x][_w + y] == \"#\":\n continue\n\n if warp_count[_h + x][_w + y] > warp + 1:\n stack.append((_h + x, _w + y, warp + 1))\n\n if warp_count[d_h][d_w] == INF:\n print(-1)\n else:\n print(warp_count[d_h][d_w])\n return\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"import sys\nfrom collections import deque\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef main():\n INF = 10**7\n h, w = [int(i) for i in input().split()]\n c_h, c_w = [int(i) for i in input().split()]\n d_h, d_w = [int(i) for i in input().split()]\n grid = [[\"#\"] * (w + 2)]\n for _ in range(h):\n line = [\"#\"] + list(input()) + [\"#\"]\n grid.append(line)\n grid.append([\"#\"] * (w + 2))\n warp_count = [[INF] * (w + 2) for _ in range(h + 2)]\n directions = ((1, 0), (-1, 0), (0, 1), (0, -1))\n warps = []\n for x in range(-2, 3):\n for y in range(-2, 3):\n if x == 0 and y == 0:\n continue\n if (x, y) not in directions:\n warps.append((x, y))\n\n stack = deque()\n warp_count[c_h][c_w] = 0\n stack.append((c_h, c_w, 0))\n\n while stack:\n _h, _w, warp = stack.pop()\n if warp > warp_count[_h][_w]:\n continue\n warp_count[_h][_w] = warp\n\n # walk\n for _a, _b in directions:\n if grid[_h + _a][_w + _b] != \"#\" and warp_count[_h + _a][_w + _b] > warp:\n stack.append((_h + _a, _w + _b, warp))\n\n # warp\n for x, y in warps:\n if _h + x < 0 or _h + x > h or _w + y < 0 or _w + y > w:\n continue\n elif grid[_h + x][_w + y] == \"#\":\n continue\n if warp_count[_h + x][_w + y] > warp + 1:\n stack.appendleft((_h + x, _w + y, warp + 1))\n\n if warp_count[d_h][d_w] == INF:\n print(-1)\n else:\n print(warp_count[d_h][d_w])\n return\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":1,"i2":54,"j1":1,"j2":51,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02579","language":"Python","original_status":"Time Limit Exceeded","pass":"# -*- coding: utf-8 -*-\nfrom collections import deque\nimport sys\n\nf_inf = float(\"inf\")\n\n# Input#\n# n = int(input())\nh, w = map(int, input().split())\nc_h, c_w = map(int, input().split())\nd_h, d_w = map(int, input().split())\n\ngrid = []\n\nd = deque()\n\n\nfor i in range(h + 1):\n if i == 0:\n array_tmp = \"#\" * w\n else:\n array_tmp = str(input().strip())\n array_tmp = \"#\" + array_tmp\n grid.append(list(array_tmp))\n\n\ngrid[c_h][c_w] = 0\n\nd.append((c_h, c_w))\n\n\ndef check(tar_h, tar_w):\n if tar_h > h or tar_h < 1:\n return -1\n if tar_w > w or tar_w < 1:\n return -1\n if grid[tar_h][tar_w] == \".\":\n return f_inf\n if grid[tar_h][tar_w] == \"#\":\n return -1\n else:\n return grid[tar_h][tar_w]\n\n\nwhile len(d) != 0:\n tar_h, tar_w = d.popleft()\n tar_num = grid[tar_h][tar_w]\n if tar_num == \"#\":\n continue\n\n for i in range(5):\n for j in range(5):\n if check(tar_h + i - 2, tar_w + j - 2) > tar_num:\n if (\n (i == 2 and j == 1)\n or (i == 2 and j == 3)\n or (i == 1 and j == 2)\n or (i == 3 and j == 2)\n ):\n grid[tar_h + i - 2][tar_w + j - 2] = tar_num\n d.appendleft((tar_h + i - 2, tar_w + j - 2))\n if tar_h == d_h and tar_w == d_w:\n print(\"{}\".format(tar_num))\n sys.exit()\n else:\n grid[tar_h + i - 2][tar_w + j - 2] = tar_num + 1\n d.append((tar_h + i - 2, tar_w + j - 2))\n\nif check(d_h, d_w) == f_inf:\n ans = -1\nelse:\n ans = check(d_h, d_w)\n\nprint(\"{}\".format(ans))\n","fail":"# -*- coding: utf-8 -*-\nfrom collections import deque\nimport sys\n\nf_inf = float(\"inf\")\n\n# Input#\n# n = int(input())\nh, w = map(int, input().split())\nc_h, c_w = map(int, input().split())\nd_h, d_w = map(int, input().split())\n\ngrid = []\n\nd = deque()\n\n\nfor i in range(h + 1):\n if i == 0:\n array_tmp = \"#\" * w\n else:\n array_tmp = str(input().strip())\n array_tmp = \"#\" + array_tmp\n grid.append(list(array_tmp))\n\n\ngrid[c_h][c_w] = 0\n\nd.append((c_h, c_w))\n\n\ndef check(tar_h, tar_w):\n if tar_h > h or tar_h < 1:\n return -1\n if tar_w > w or tar_w < 1:\n return -1\n if grid[tar_h][tar_w] == \".\":\n return f_inf\n if grid[tar_h][tar_w] == \"#\":\n return -1\n else:\n return grid[tar_h][tar_w]\n\n\nwhile len(d) != 0:\n tar_h, tar_w = d.popleft()\n tar_num = grid[tar_h][tar_w]\n if tar_num == \"#\":\n continue\n\n for i in range(5):\n for j in range(5):\n checknum = check(tar_h + i - 2, tar_w + j - 2)\n if checknum > tar_num:\n if (\n (i == 2 and j == 1)\n or (i == 2 and j == 3)\n or (i == 1 and j == 2)\n or (i == 3 and j == 2)\n ):\n grid[tar_h + i - 2][tar_w + j - 2] = tar_num\n d.appendleft((tar_h + i - 2, tar_w + j - 2))\n if tar_h == d_h and tar_w == d_w:\n print(\"{}\".format(tar_num))\n sys.exit()\n else:\n if checknum > tar_num + 1:\n grid[tar_h + i - 2][tar_w + j - 2] = tar_num + 1\n d.append((tar_h + i - 2, tar_w + j - 2))\n\nif check(d_h, d_w) == f_inf:\n ans = -1\nelse:\n ans = check(d_h, d_w)\n\nprint(\"{}\".format(ans))\n","change":"replace","i1":52,"i2":67,"j1":52,"j2":69,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02579","language":"Python","original_status":"Runtime Error","pass":"from collections import defaultdict\nfrom heapq import heappush, heappop\n\n\nclass DisjointSet:\n def __init__(self, n):\n self.n = n\n self.parents = [-1] * n\n\n def find(self, x):\n if self.parents[x] < 0:\n return x\n else:\n self.parents[x] = self.find(self.parents[x])\n return self.parents[x]\n\n def union(self, x, y):\n x = self.find(x)\n y = self.find(y)\n if x == y:\n return\n if self.parents[x] > self.parents[y]:\n x, y = y, x\n self.parents[x] += self.parents[y]\n self.parents[y] = x\n\n def same(self, x, y):\n return self.find(x) == self.find(y)\n\n\ndef dijkstra(adj_list, start):\n dist = defaultdict(lambda: float(\"inf\"))\n dist[start] = 0\n\n pq = []\n heappush(pq, (0, start))\n visited = set()\n while pq:\n w, v = heappop(pq)\n if dist[v] < w:\n continue\n visited.add(v)\n for nv, nw in adj_list[v]:\n if nv in visited:\n continue\n if dist[nv] > dist[v] + nw:\n dist[nv] = dist[v] + nw\n heappush(pq, (dist[nv], nv))\n return dist\n\n\ndef solve():\n H, W = map(int, input().split())\n C_h, C_w = map(lambda x: int(x) - 1, input().split())\n D_h, D_w = map(lambda x: int(x) - 1, input().split())\n field = [list(input()) for _ in range(H)]\n\n ds = DisjointSet(H * W)\n for i in range(H):\n for j in range(W):\n if field[i][j] == \"#\":\n continue\n for di, dj in ((1, 0), (-1, 0), (0, 1), (0, -1)):\n ni = i + di\n nj = j + dj\n if 0 <= ni < H and 0 <= nj < W and field[ni][nj] != \"#\":\n ds.union(j + i * H, nj + ni * H)\n\n g = defaultdict(set)\n for i in range(H):\n for j in range(W):\n if field[i][j] == \"#\":\n continue\n for di in range(-2, 3):\n for dj in range(-2, 3):\n if di == 0 and dj == 0:\n continue\n ni = i + di\n nj = j + dj\n if not (0 <= ni < H and 0 <= nj < W and field[ni][nj] != \"#\"):\n continue\n if ds.same(j + i * H, nj + ni * H):\n g[(i, j)].add(((ni, nj), 0))\n g[(ni, nj)].add(((i, j), 0))\n else:\n g[(i, j)].add(((ni, nj), 1))\n g[(ni, nj)].add(((i, j), 1))\n\n dist = dijkstra(g, (C_h, C_w))\n ans = dist[(D_h, D_w)]\n print(-1) if ans == float(\"inf\") else print(ans)\n\n\nsolve()\n","fail":"from collections import deque\n\n\ndef solve():\n H, W = map(int, input().split())\n C_h, C_w = map(lambda x: int(x) - 1, input().split())\n D_h, D_w = map(lambda x: int(x) - 1, input().split())\n field = [list(input()) for _ in range(H)]\n dp = [[float(\"inf\")] * W for _ in range(H)]\n dp[C_h][C_w] = 0\n\n q = deque([(C_h, C_w)])\n visited = set()\n while q:\n i, j = q.popleft()\n if (i, j) in visited:\n continue\n visited.add((i, j))\n for di in range(-2, 3):\n for dj in range(-2, 3):\n if (di, dj) == (0, 0):\n continue\n ni = i + di\n nj = j + dj\n if not (0 <= ni < H and 0 <= nj < W and field[ni][nj] == \".\"):\n continue\n\n if (di, dj) in ((1, 0), (-1, 0), (0, 1), (0, -1)):\n dp[ni][nj] = min(dp[ni][nj], dp[i][j])\n q.appendleft((ni, nj))\n else:\n dp[ni][nj] = min(dp[ni][nj], dp[i][j] + 1)\n q.append((ni, nj))\n ans = dp[D_h][D_w]\n print(-1) if ans == float(\"inf\") else print(ans)\n\n\nsolve()\n","change":"replace","i1":0,"i2":90,"j1":0,"j2":34,"error":"0","stderr":null,"stdout":"1\n"} {"problem_id":"p02579","language":"Python","original_status":"Time Limit Exceeded","pass":"def main():\n from collections import deque\n import sys\n\n input = sys.stdin.readline\n warp_up = [\n (-2, -2),\n (-1, -2),\n (0, -2),\n (1, -2),\n (2, -2),\n (-2, -1),\n (-1, -1),\n (1, -1),\n (2, -1),\n ]\n warp_do = [\n (2, 2),\n (1, 2),\n (0, 2),\n (-1, 2),\n (-2, 2),\n (2, 1),\n (1, 1),\n (-1, 1),\n (-2, 1),\n ]\n warp_ri = [\n (2, -2),\n (2, -1),\n (2, 0),\n (2, 1),\n (2, 2),\n (1, -2),\n (1, -1),\n (1, 1),\n (1, 2),\n ]\n warp_le = [\n (-2, 2),\n (-2, 1),\n (-2, 0),\n (-2, -1),\n (-2, -2),\n (-1, 2),\n (-1, 1),\n (-1, -1),\n (-1, -2),\n ]\n\n h, w = map(int, input().split())\n ch, cw = map(int, input().split())\n dh, dw = map(int, input().split())\n c = [input().rstrip() for _ in range(h)]\n cw -= 1\n ch -= 1\n dw -= 1\n dh -= 1\n c[ch] = c[ch][:cw] + \"=\" + c[ch][cw + 1 :]\n d1 = deque([[cw, ch]])\n d2 = deque([])\n\n for cnt in range(30000):\n for _ in range(70000):\n for _ in range(len(d1)):\n now_x, now_y = d1.popleft()\n for next_x, next_y in zip([1, 0, -1, 0], [0, 1, 0, -1]):\n x, y = now_x + next_x, now_y + next_y\n if 0 <= x < w and 0 <= y < h:\n if x == dw and y == dh:\n print(cnt)\n exit()\n c_xy = c[y][x]\n if c_xy == \"#\":\n next = [next_x, next_y]\n if next == [1, 0]:\n warp = warp_ri.copy()\n elif next == [0, 1]:\n warp = warp_do.copy()\n elif next == [-1, 0]:\n warp = warp_le.copy()\n elif next == [0, -1]:\n warp = warp_up.copy()\n for next_x, next_y in warp:\n x, y = now_x + next_x, now_y + next_y\n if 0 <= x < w and 0 <= y < h:\n if c[y][x] not in \"#=!\":\n c[y] = c[y][:x] + \"!\" + c[y][x + 1 :]\n d2.append([x, y])\n elif c_xy != \"=\":\n c[y] = c[y][:x] + \"=\" + c[y][x + 1 :]\n d1.append([x, y])\n else:\n if [dw, dh] in d2:\n print(cnt + 1)\n exit()\n if not d2:\n print(-1)\n exit()\n d1 = d2.copy()\n d2.clear()\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"def main():\n from collections import deque\n import sys\n\n input = sys.stdin.readline\n h, w = map(int, input().split())\n ch, cw = map(int, input().split())\n dh, dw = map(int, input().split())\n c = [input().rstrip() for _ in range(h)]\n cw -= 1\n ch -= 1\n dw -= 1\n dh -= 1\n c[ch] = c[ch][:cw] + \"=\" + c[ch][cw + 1 :]\n bfs = deque([[cw, ch]])\n warp_before = set()\n warp_after = set()\n\n for cnt in range(1000000): # \u30ef\u30fc\u30d7\u56de\u6570\u306e\u30ab\u30a6\u30f3\u30c8\n while bfs: # \u30ef\u30fc\u30d7\u305b\u305a\u306b\u6b69\u3044\u3066\u3069\u3053\u307e\u3067\u884c\u3051\u308b\u304b\n for _ in range(len(bfs)):\n now_x, now_y = bfs.popleft()\n for next_x, next_y in zip([1, 0, -1, 0], [0, 1, 0, -1]):\n x, y = now_x + next_x, now_y + next_y\n if 0 <= x < w and 0 <= y < h:\n if x == dw and y == dh:\n print(cnt)\n exit()\n c_next = c[y][x]\n if c_next == \"#\": # \u58c1\u306e\u96a3\u30de\u30b9\u306e\u5ea7\u6a19\u3092warp_before\u306b\u52a0\u3048\u308b\n warp_before.add((now_x, now_y))\n if c_next == \".\": # \u8d70\u67fb\u6e08\u30de\u30fc\u30af\n c[y] = c[y][:x] + \"=\" + c[y][x + 1 :]\n bfs.append([x, y])\n else:\n if not warp_before:\n print(-1)\n exit()\n for now_x, now_y in warp_before:\n # \u58c1\u306e\u96a3\u30de\u30b9\u306e\u5ea7\u6a19\u3092\u4e2d\u5fc3\u306b5*5\u30de\u30b9\u306e\u7bc4\u56f2\u3067\u3001\u58c1\u306e\u5916\u5074\u306e\u672a\u5230\u9054\u30de\u30b9\u306e\u5ea7\u6a19\u3092warp_after\u306b\u52a0\u3048\u308b\n if c[now_y][now_x] == \"=\":\n for next_y in range(-2, 3):\n for next_x in range(-2, 3):\n x, y = now_x + next_x, now_y + next_y\n if 0 <= x < w and 0 <= y < h:\n warp_after.add((x, y))\n for x, y in warp_after:\n # \u58c1\u306e\u5916\u5074\u306e\u672a\u5230\u9054\u30de\u30b9\u306e\u5ea7\u6a19\u306e\u30b4\u30fc\u30eb\u5224\u5b9a\u30fb\u8d70\u67fb\u6e08\u30de\u30fc\u30af\u300c=\u300d\u3092\u4ed8\u3051\u3066bfs\u306b\u683c\u7d0d\n if c[y][x] == \".\":\n if x == dw and y == dh: # \u7d42\u4e86(\u30b4\u30fc\u30eb)\u5224\u5b9a\n print(cnt + 1)\n exit()\n c[y] = c[y][:x] + \"=\" + c[y][x + 1 :]\n bfs.append([x, y])\n warp_before = set()\n warp_after = set()\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":5,"i2":101,"j1":5,"j2":56,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02580","language":"Python","original_status":"Runtime Error","pass":"H, W, M = map(int, input().split())\nhw = [list(map(int, input().split())) for _ in range(M)]\n\nboard = [[0] * (W + 1) for _ in range(H + 1)]\n\nh_cnt = [0] * (H + 1)\nw_cnt = [0] * (W + 1)\n\nfor h, w in hw:\n h_cnt[h] += 1\n w_cnt[w] += 1\n board[h][w] = 1\n\nh_mx = max(h_cnt)\nw_mx = max(w_cnt)\n\ncnt = h_cnt.count(h_mx) * w_cnt.count(w_mx)\nfor h, w in hw:\n val = h_cnt[h] + w_cnt[w]\n if val == h_mx + w_mx:\n cnt -= 1\n\nif cnt:\n ans = h_mx + w_mx\nelse:\n ans = h_mx + w_mx - 1\n\nprint(ans)\n","fail":"H, W, M = map(int, input().split())\nhw = [list(map(int, input().split())) for _ in range(M)]\n\nh_cnt = [0] * (H + 1)\nw_cnt = [0] * (W + 1)\n\nfor h, w in hw:\n h_cnt[h] += 1\n w_cnt[w] += 1\n\nh_mx = max(h_cnt)\nw_mx = max(w_cnt)\n\ncnt = h_cnt.count(h_mx) * w_cnt.count(w_mx)\nfor h, w in hw:\n val = h_cnt[h] + w_cnt[w]\n if val == h_mx + w_mx:\n cnt -= 1\n\nif cnt:\n ans = h_mx + w_mx\nelse:\n ans = h_mx + w_mx - 1\n\nprint(ans)\n","change":"replace","i1":2,"i2":12,"j1":2,"j2":9,"error":"0","stderr":null,"stdout":"3\n"} {"problem_id":"p02580","language":"Python","original_status":"Runtime Error","pass":"from abc import abstractmethod\nfrom collections import defaultdict\n\n\nclass Edge:\n def __init__(self):\n self.flow = 0\n self.residual: Edge\n self.from_node = None\n self.to_node = None\n self.capacity = None\n\n @classmethod\n def by_nodes(cls, from_node, to_node, capacity):\n c = cls()\n c.connect(from_node, to_node, capacity)\n return c\n\n def connect(self, from_node, to_node, capacity):\n self.from_node = from_node\n self.to_node = to_node\n self.capacity = capacity\n\n def is_residual(self):\n return self.capacity == 0\n\n def remaining_capacity(self):\n return self.capacity - self.flow\n\n def augument(self, bottle_neck):\n self.flow += bottle_neck\n self.residual.flow -= bottle_neck\n\n def __repr__(self):\n return f\"{self.from_node}-({self.flow}\/{self.capacity})->{self.to_node}\"\n\n\nclass NetworkFlowSolverBase:\n def __init__(self, n, s, t):\n self.visited_token = 1\n self.visited = defaultdict(int)\n self.solved = False\n self.max_flow = 0\n self.graph = defaultdict(list)\n # n: the number of nodes in the graph including s(src) and t(sink)\n self.n = n\n # s: the index of the src node\n self.s = s\n # t: the index of the sink node\n self.t = t\n\n def add_edge(self, from_node, to_node, capacity):\n assert capacity >= 0, f\"forward-edge capacity must be >= 0: input={capacity}\"\n e_f = Edge.by_nodes(from_node, to_node, capacity)\n e_b = Edge.by_nodes(to_node, from_node, 0)\n e_f.residual = e_b\n e_b.residual = e_f\n self.graph[from_node].append(e_f)\n self.graph[to_node].append(e_b)\n\n def get_graph(self):\n self.execute()\n return self.graph\n\n def get_max_flow(self):\n self.execute()\n return self.max_flow\n\n def execute(self):\n if self.solved:\n return\n self.solve()\n self.solved = True\n\n @abstractmethod\n def solve(self):\n pass\n\n\nclass FordFulkersonDfsSover(NetworkFlowSolverBase):\n def __init__(self, n, s, t):\n super().__init__(n, s, t)\n\n def solve(self):\n while True:\n f = self.dfs(self.s, float(\"inf\"))\n self.visited_token += 1\n self.max_flow += f\n if f == 0:\n break\n\n def dfs(self, nd, flow):\n if nd == self.t:\n return flow\n self.visited[nd] = self.visited_token\n\n for e in self.graph[nd]:\n if (\n e.remaining_capacity() > 0\n and self.visited[e.to_node] != self.visited_token\n ):\n bottle_neck = self.dfs(e.to_node, min(flow, e.remaining_capacity()))\n if bottle_neck > 0:\n e.augument(bottle_neck)\n return bottle_neck\n return 0\n\n\nif __name__ == \"__main__\":\n H, W, M, *subjects = map(int, open(0).read().split())\n S = H + W\n T = H + W + 1\n g = FordFulkersonDfsSover(H + W + 2, S, T)\n for i in range(H):\n g.add_edge(S, i, 1)\n for i in range(W):\n g.add_edge(i + H, T, 1)\n [g.add_edge(h - 1, w - 1 + H, 1) for h, w in zip(*[iter(subjects)] * 2)]\n print(g.get_max_flow() + 1)\n","fail":"H, W, M, *hw = map(int, open(0).read().split())\nH_cnt = [0] * (H + 1)\nW_cnt = [0] * (W + 1)\nbombs = [(h, w) for h, w in zip(*[iter(hw)] * 2)]\nfor h, w in bombs:\n H_cnt[h] += 1\n W_cnt[w] += 1\n\nH_max_cnt = max(H_cnt)\nW_max_cnt = max(W_cnt)\n\nH_max = {i for i in range(1, H + 1) if H_cnt[i] == H_max_cnt}\nW_max = {i for i in range(1, W + 1) if W_cnt[i] == W_max_cnt}\n\ncomb_cnt = len(H_max) * len(W_max)\nfor h, w in bombs:\n if H_cnt[h] == H_max_cnt and W_cnt[w] == W_max_cnt:\n comb_cnt -= 1\n\nans = H_max_cnt + W_max_cnt\nprint(ans if comb_cnt else ans - 1)\n","change":"replace","i1":0,"i2":119,"j1":0,"j2":21,"error":"0","stderr":null,"stdout":"3\n"} {"problem_id":"p02580","language":"Python","original_status":"Time Limit Exceeded","pass":"from collections import defaultdict\n\n\ndef solve(H, M, W, bombs):\n count_h = defaultdict(int)\n count_w = defaultdict(int)\n for b in bombs:\n h = str(b[0])\n count_h[h] += 1\n w = str(b[1])\n count_w[w] += 1\n max_h = max(count_h.values())\n max_w = max(count_w.values())\n points_h = [int(k) for k in count_h.keys() if count_h[k] == max_h]\n points_w = [int(k) for k in count_w.keys() if count_w[k] == max_w]\n ans = max_h + max_w\n if _find_cross_bomb(points_h, points_w, bombs):\n ans -= 1\n print(ans)\n\n\ndef _find_cross_bomb(points_h, points_w, bombs):\n c = 0\n for b in bombs:\n if (b[0]) in points_h:\n if (b[1]) in points_w:\n c += 1\n return c == len(points_h) * len(points_w)\n\n\nif __name__ == \"__main__\":\n H, W, M = map(int, input().split())\n bombs = [list(map(lambda x: int(x) - 1, input().split())) for i in range(M)]\n solve(H, M, W, bombs)\n","fail":"import sys\n\n\ndef solve():\n readline = sys.stdin.readline\n H, W, M = map(int, readline().split())\n h = [0] * H\n w = [0] * W\n b = set()\n for _ in range(M):\n y, x = map(int, readline().split())\n x -= 1\n y -= 1\n h[y] += 1\n w[x] += 1\n b.add(y * W + x)\n h = sorted(zip(h, range(H)), reverse=True)\n ans = 0\n for i in range(W):\n x = w[i]\n for y, j in h:\n if x + y > ans:\n if j * W + i in b:\n ans = x + y - 1\n else:\n ans = x + y\n break\n else:\n break\n print(ans)\n\n\nif __name__ == \"__main__\":\n solve()\n","change":"replace","i1":0,"i2":34,"j1":0,"j2":34,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02580","language":"Python","original_status":"Time Limit Exceeded","pass":"H, W, M = map(int, input().split())\nhw = []\nsum_h = [0] * W\nsum_w = [0] * H\nfor _ in range(M):\n h, w = map(int, input().split())\n hw.append([h, w])\n h -= 1\n w -= 1\n sum_h[w] += 1\n sum_w[h] += 1\n\n\nmax_h = max(sum_h)\nmax_w = max(sum_w)\n\nnew_H = [h for h in range(H) if sum_w[h] == max_w]\nnew_W = [w for w in range(W) if sum_h[w] == max_h]\n\nmax_num = max_h + max_w - 1\nfor i in new_H:\n for j in new_W:\n if [i + 1, j + 1] not in hw:\n print(max_h + max_w)\n exit()\n else:\n continue\n break\n\nprint(max_num)\n","fail":"H, W, M = map(int, input().split())\nhw = set()\nsum_h = [0] * W\nsum_w = [0] * H\nfor _ in range(M):\n h, w = map(int, input().split())\n hw.add((h, w))\n h -= 1\n w -= 1\n sum_h[w] += 1\n sum_w[h] += 1\n\n\nmax_h = max(sum_h)\nmax_w = max(sum_w)\n\nnew_H = [h for h in range(H) if sum_w[h] == max_w]\nnew_W = [w for w in range(W) if sum_h[w] == max_h]\n\nmax_num = max_h + max_w - 1\nfor i in new_H:\n for j in new_W:\n if (i + 1, j + 1) not in hw:\n print(max_h + max_w)\n exit()\n else:\n continue\n break\n\nprint(max_num)\n","change":"replace","i1":1,"i2":23,"j1":1,"j2":23,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02580","language":"Python","original_status":"Runtime Error","pass":"H, W, M = map(int, input().split())\n\nB = [list(map(int, input().split())) for _ in range(M)]\n\nbombs_row = [0] * H\nbombs_col = [0] * W\n\nfor b in B:\n bombs_row[b[0] - 1] += 1\n bombs_col[b[1] - 1] += 1\n\nrow_max = max(bombs_row)\ncol_max = max(bombs_col)\n\nrow_max_count = bombs_row.count(row_max)\ncol_max_count = bombs_col.count(col_max)\n\nans = row_max + col_max\n\npossible_point = row_max_count * col_max_count\n\nbombed_point = 0\n\nfor b in B:\n if bombs_row[b[0]] == row_max and bombs_col[b[1]] == col_max:\n bombed_point += 1\n\nif bombed_point == possible_point:\n ans -= 1\n\nprint(ans)\n","fail":"H, W, M = map(int, input().split())\n\nB = [list(map(int, input().split())) for _ in range(M)]\n\nbombs_row = [0] * H\nbombs_col = [0] * W\n\nfor b in B:\n bombs_row[b[0] - 1] += 1\n bombs_col[b[1] - 1] += 1\n\nrow_max = max(bombs_row)\ncol_max = max(bombs_col)\n\nrow_max_count = bombs_row.count(row_max)\ncol_max_count = bombs_col.count(col_max)\n\nans = row_max + col_max\n\npossible_point = row_max_count * col_max_count\n\nbombed_point = 0\n\nfor b in B:\n if bombs_row[b[0] - 1] == row_max and bombs_col[b[1] - 1] == col_max:\n bombed_point += 1\n\nif bombed_point == possible_point:\n ans -= 1\n\nprint(ans)\n","change":"replace","i1":24,"i2":25,"j1":24,"j2":25,"error":"IndexError: list index out of range","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02580\/Python\/s510602402.py\", line 25, in \n if bombs_row[b[0]] == row_max and bombs_col[b[1]] == col_max:\nIndexError: list index out of range\n","stdout":null} {"problem_id":"p02580","language":"Python","original_status":"Time Limit Exceeded","pass":"import sys\n\n\nH, W, M = map(int, input().split())\nX = [set() for _ in range(H)]\nY = [set() for _ in range(W)]\nfor s in sys.stdin.readlines():\n h, w = map(lambda x: int(x) - 1, s.split())\n X[h].add(w)\n Y[w].add(h)\ncntX = []\ncntY = []\nfor x in X:\n cntX.append((len(x), x))\nfor w, y in enumerate(Y):\n cntY.append((len(y), w))\n\ncntX.sort(reverse=True)\ncntY.sort(reverse=True)\nmaxX = cntX[0][0]\nmaxY = cntY[0][0]\nans = 0\nfor cnt, x in cntX:\n if cnt < maxX:\n break\n for tmp, w in cntY:\n if tmp < maxY:\n break\n tmp += cnt - (w in x)\n if ans < tmp:\n ans = tmp\n if cnt == maxX + maxY:\n break\nprint(ans)\n","fail":"import sys\n\n\nH, W, M = map(int, input().split())\nbomb = [tuple(map(lambda x: int(x) - 1, s.split())) for s in sys.stdin.readlines()]\nX = [0] * H\nY = [0] * W\nfor h, w in bomb:\n X[h] += 1\n Y[w] += 1\nmaxX = max(X)\nmaxY = max(Y)\n\nR = []\nC = []\nfor h, x in enumerate(X):\n if x == maxX:\n R.append(h)\nfor w, y in enumerate(Y):\n if y == maxY:\n C.append(w)\n\nif len(R) * len(C) > M:\n ans = maxX + maxY\nelse:\n done = set()\n for r in R:\n for c in C:\n done.add((r, c))\n for b in bomb:\n if b in done:\n done.remove(b)\n if len(done) > 0:\n ans = maxX + maxY\n else:\n ans = maxX + maxY - 1\nprint(ans)\n","change":"replace","i1":4,"i2":33,"j1":4,"j2":36,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02580","language":"Python","original_status":"Time Limit Exceeded","pass":"import sys\n\nH, W, M = map(int, input().split())\nh = [0] * M\nw = [0] * M\n\nh_bom = [0] * H\nw_bom = [0] * W\n\nfor i in range(M):\n h[i], w[i] = map(int, input().split())\n\n h_bom[h[i] - 1] += 1\n w_bom[w[i] - 1] += 1\n\nh_max = max(h_bom)\nw_max = max(w_bom)\n\nh_list = []\nw_list = []\n\nfor i in range(len(h_bom)):\n if h_bom[i] == h_max:\n h_list.append(i)\n\nfor i in range(len(w_bom)):\n if w_bom[i] == w_max:\n w_list.append(i)\n\nfor y in h_list:\n for x in w_list:\n flag = True\n for i in range(M):\n if y == (h[i] - 1) and x == (w[i] - 1):\n flag = False\n\n if flag:\n print(h_max + w_max)\n sys.exit()\n\nprint(h_max + w_max - 1)\n","fail":"import sys\n\n\nH, W, M = map(int, input().split())\nbomb = [tuple(map(lambda x: int(x) - 1, s.split())) for s in sys.stdin.readlines()]\nX = [0] * H # X:\u5404\u884c\u306e\u7206\u7834\u5bfe\u8c61\u306e\u500b\u6570\nY = [0] * W # Y:\u5404\u5217\u306e\u7206\u7834\u5bfe\u8c61\u306e\u500b\u6570\nfor h, w in bomb:\n X[h] += 1\n Y[w] += 1\nmaxX = max(X)\nmaxY = max(Y)\n\nR = [h for h, x in enumerate(X) if x == maxX] # R:\u7206\u7834\u5bfe\u8c61\u306e\u6570\u304c\u6700\u5927\u3068\u306a\u308b\u884c\u306e\u756a\u53f7\nC = [w for w, y in enumerate(Y) if y == maxY] # C:\u7206\u7834\u5bfe\u8c61\u306e\u6570\u304c\u6700\u5927\u3068\u306a\u308b\u5217\u306e\u756a\u53f7\n\nbomb = set(bomb)\nfor r in R:\n for c in C:\n # (r, c)\u306b\u7206\u7834\u5bfe\u8c61\u304c\u5b58\u5728\u3057\u306a\u3044\u3068\u304d, maxX + maxY \u304c\u7b54\u3048\u3068\u306a\u308b\u3053\u3068\u304c\u78ba\u5b9a\u3059\u308b\u305f\u3081,\n # \u5373\u5ea7\u306b\u63a2\u7d22\u3092\u7d42\u4e86\u3059\u308b.\n if (r, c) not in bomb:\n print(maxX + maxY)\n exit()\nprint(maxX + maxY - 1)\n","change":"replace","i1":2,"i2":41,"j1":2,"j2":25,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02580","language":"Python","original_status":"Time Limit Exceeded","pass":"H, W, M = map(int, input().split())\ncnth = [[0, i] for i in range(H)]\ncntw = [[0, i] for i in range(W)]\nL = [[False for _ in range(W)] for _ in range(H)]\nfor _ in range(M):\n h, w = map(lambda x: int(x) - 1, input().split())\n cnth[h][0] += 1\n cntw[w][0] += 1\n L[h][w] = True\ncnth.sort(reverse=True)\ncntw.sort(reverse=True)\nmh = set()\nph = cnth[0]\nfor h in cnth:\n if ph[0] == h[0]:\n mh.add(h[1])\n else:\n break\n ph = h\nmw = set()\npw = cntw[0]\nfor w in cntw:\n if pw[0] == w[0]:\n mw.add(w[1])\n else:\n break\n pw = w\nmax = cnth[0][0] + cntw[0][0]\nfor h in mh:\n for w in mw:\n if not (L[h][w]):\n print(max)\n break\n else:\n continue\n break\nelse:\n print(max - 1)\n","fail":"def main():\n H, W, M = map(int, input().split())\n cnth = [[0, i] for i in range(H)]\n cntw = [[0, i] for i in range(W)]\n L = set()\n for _ in range(M):\n h, w = map(lambda x: int(x) - 1, input().split())\n cnth[h][0] += 1\n cntw[w][0] += 1\n L.add((h, w))\n cnth.sort(reverse=True)\n cntw.sort(reverse=True)\n mh = set()\n ph = cnth[0]\n for h in cnth:\n if ph[0] == h[0]:\n mh.add(h[1])\n else:\n break\n ph = h\n mw = set()\n pw = cntw[0]\n for w in cntw:\n if pw[0] == w[0]:\n mw.add(w[1])\n else:\n break\n pw = w\n maxans = cnth[0][0] + cntw[0][0]\n for h in mh:\n for w in mw:\n if not ((h, w) in L):\n print(maxans)\n break\n else:\n continue\n break\n else:\n print(maxans - 1)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":0,"i2":38,"j1":0,"j2":43,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02580","language":"Python","original_status":"Time Limit Exceeded","pass":"h, w, m = map(int, input().split())\nhw = []\nh_cnt = [0] * h\nw_cnt = [0] * w\nhw = []\nhw_set = set()\nfor _ in range(m):\n r, c = map(int, input().split())\n r -= 1\n c -= 1\n h_cnt[r] += 1\n w_cnt[c] += 1\n hw.append((r, c))\n hw_set.add((r, c))\nmh = max(h_cnt)\nmw = max(w_cnt)\nans = mh + mw\nis_exist = False\nfor i in range(h):\n if h_cnt[i] != mh:\n continue\n for j in range(w):\n if w_cnt[j] == mw:\n if not (i, j) in hw_set:\n is_exist = True\n print(ans)\n exit()\nprint(ans - 1)\n","fail":"h, w, m = map(int, input().split())\nhw = []\nh_cnt = [0] * h\nw_cnt = [0] * w\nhw = []\nhw_set = set()\nfor _ in range(m):\n r, c = map(int, input().split())\n r -= 1\n c -= 1\n h_cnt[r] += 1\n w_cnt[c] += 1\n hw.append((r, c))\n hw_set.add((r, c))\nmh = max(h_cnt)\nmw = max(w_cnt)\ncand_r = []\nfor i in range(h):\n if h_cnt[i] == mh:\n cand_r.append(i)\ncand_c = []\nfor j in range(w):\n if w_cnt[j] == mw:\n cand_c.append(j)\nans = mh + mw\nfor i in cand_r:\n for j in cand_c:\n if not (i, j) in hw_set:\n print(ans)\n exit()\nprint(ans - 1)\n","change":"replace","i1":16,"i2":27,"j1":16,"j2":30,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02580","language":"Python","original_status":"Runtime Error","pass":"H, W, m = map(int, input().split())\nxs = [[0] * W for _ in range(H)]\nfor _ in range(m):\n h, w = map(int, input().split())\n xs[h - 1][w - 1] += 1\n\nmxx = [0] * H\nfor i in range(H):\n sm = 0\n for j in range(W):\n sm += xs[i][j]\n mxx[i] = sm\nmxy = [0] * W\nfor i in range(W):\n sm = 0\n for j in range(H):\n sm += xs[j][i]\n mxy[i] = sm\nans = 0\nfor i in range(H):\n for j in range(W):\n ans = max(ans, mxx[i] + mxy[j] - xs[i][j])\nprint(ans)\n","fail":"H, W, m = map(int, input().split())\nxs = [0] * H\nys = [0] * W\ns = set()\nfor _ in range(m):\n h, w = map(int, input().split())\n h -= 1\n w -= 1\n xs[h] += 1\n ys[w] += 1\n s.add((h, w))\n\nmx = max(xs)\nmy = max(ys)\nmxs = set()\nfor i in range(H):\n if xs[i] == mx:\n mxs.add(i)\nmys = set()\nfor i in range(W):\n if ys[i] == my:\n mys.add(i)\nfor x in mxs:\n for y in mys:\n if not (x, y) in s:\n print(mx + my)\n exit()\nprint(mx + my - 1)\n","change":"replace","i1":1,"i2":23,"j1":1,"j2":28,"error":"0","stderr":null,"stdout":"3\n"} {"problem_id":"p02580","language":"Python","original_status":"Time Limit Exceeded","pass":"import sys\nfrom collections import Counter\n\n\ndef main():\n input = sys.stdin.buffer.readline\n h, w, m = map(int, input().split())\n h = [0] * m\n w = [0] * m\n object_set = set()\n for i in range(m):\n h[i], w[i] = map(int, input().split())\n object_set.add((h[i], w[i]))\n h_counter = Counter(h)\n w_counter = Counter(w)\n max_h_num = h_counter.most_common()[0][1]\n max_w_num = w_counter.most_common()[0][1]\n ans = max_h_num + max_w_num\n\n h_cand = []\n w_cand = []\n for e, n in h_counter.most_common():\n if n == max_h_num:\n h_cand.append(e)\n for e, n in w_counter.most_common():\n if n == max_w_num:\n w_cand.append(e)\n\n ok = False\n for h_e in h_cand:\n for w_e in w_cand:\n if (h_e, w_e) not in object_set:\n ok = True\n\n print(ans if ok else ans - 1)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"import sys\nfrom collections import Counter\n\n\ndef main():\n input = sys.stdin.buffer.readline\n h, w, m = map(int, input().split())\n h = [0] * m\n w = [0] * m\n object_set = set()\n for i in range(m):\n h[i], w[i] = map(int, input().split())\n object_set.add((h[i], w[i]))\n h_counter = Counter(h)\n w_counter = Counter(w)\n max_h_num = h_counter.most_common()[0][1]\n max_w_num = w_counter.most_common()[0][1]\n ans = max_h_num + max_w_num\n\n h_cand = set()\n w_cand = set()\n for e, n in h_counter.most_common():\n if n == max_h_num:\n h_cand.add(e)\n for e, n in w_counter.most_common():\n if n == max_w_num:\n w_cand.add(e)\n\n cnt = 0\n for h_e, w_e in object_set:\n if h_e in h_cand and w_e in w_cand:\n cnt += 1\n\n print(ans if cnt < len(h_cand) * len(w_cand) else ans - 1)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":19,"i2":35,"j1":19,"j2":34,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02580","language":"Python","original_status":"Time Limit Exceeded","pass":"from operator import itemgetter\n\nh, w, m = (int(x) for x in input().split())\nH = [0] * h\nW = [0] * w\nHW = []\nfor _ in range(m):\n h_, w_ = (int(x) - 1 for x in input().split())\n HW.append((h_, w_))\n H[h_] += 1\n W[w_] += 1\nhmax = max(H)\nwmax = max(W)\nhindex = []\nwindex = []\nans = hmax + wmax - 1\n\nHW.sort(key=itemgetter(0, 1))\nfor y in range(h):\n if H[y] == hmax:\n hindex.append(y)\nfor x in range(w):\n if W[x] == wmax:\n windex.append(x)\n\nHW_set = set(HW)\nfor y in hindex:\n for x in windex:\n if not (y, x) in HW_set:\n ans = hmax + wmax\n\nprint(ans)\n","fail":"from operator import itemgetter\n\nh, w, m = (int(x) for x in input().split())\nH = [0] * h\nW = [0] * w\nHW = []\nfor _ in range(m):\n h_, w_ = (int(x) - 1 for x in input().split())\n HW.append((h_, w_))\n H[h_] += 1\n W[w_] += 1\nhmax = max(H)\nwmax = max(W)\nhindex = set()\nwindex = set()\n\nHW.sort(key=itemgetter(0, 1))\nfor y in range(h):\n if H[y] == hmax:\n hindex.add(y)\nfor x in range(w):\n if W[x] == wmax:\n windex.add(x)\n\ncount = 0\nfor h, w in HW:\n if h in hindex and w in windex:\n count += 1\n\nif count == len(hindex) * len(windex):\n ans = hmax + wmax - 1\nelse:\n ans = hmax + wmax\n\nprint(ans)\n","change":"replace","i1":13,"i2":30,"j1":13,"j2":33,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02580","language":"Python","original_status":"Runtime Error","pass":"H, W, m = map(int, input().split())\nhw = [list(map(int, input().split())) for _ in range(m)]\n\nmat = [[0] * W for _ in range(H)]\nfor h, w in hw:\n mat[h - 1][w - 1] = 1\n\nrowcnt = [sum(row) for row in mat]\ncolcnt = []\nfor col in range(W):\n colcnt.append(sum(row[col] for row in mat))\n\nrowmax, colmax = max(rowcnt), max(colcnt)\nprint(rowmax + colmax - 1)\n","fail":"H, W, m = map(int, input().split())\nhw = [list(map(int, input().split())) for _ in range(m)]\n\nrow, col = [0] * H, [0] * W\nfor h, w in hw:\n row[h - 1] += 1\n col[w - 1] += 1\n\nrowmax, colmax = max(row), max(col)\ncnt = row.count(rowmax) * col.count(colmax)\nfor h, w in hw:\n if row[h - 1] == rowmax and col[w - 1] == colmax:\n cnt -= 1\nprint(rowmax + colmax - (cnt == 0))\n","change":"replace","i1":3,"i2":14,"j1":3,"j2":14,"error":"WA","stderr":null,"stdout":"2\n"} {"problem_id":"p02580","language":"Python","original_status":"Time Limit Exceeded","pass":"h, w, m = map(int, input().split())\ntarget_points = {tuple(map(lambda x: int(x) - 1, input().split())) for _ in range(m)}\n\nrow_points = [0] * h\ncol_points = [0] * w\nfor row, col in target_points:\n row_points[row] += 1\n col_points[col] += 1\n\nrow_max = max(row_points)\ncol_max = max(col_points)\n\nrow_max_indexes = [i for i in range(h) if row_points[i] == row_max]\ncol_max_indexes = [i for i in range(w) if col_points[i] == col_max]\n\ncrossing_points = {(row, col) for row in row_max_indexes for col in col_max_indexes}\n\nprint(row_max + col_max - (not (crossing_points - target_points)))\n","fail":"h, w, m = map(int, input().split())\ntarget_points = {tuple(map(lambda x: int(x) - 1, input().split())) for _ in range(m)}\n\nrow_points = [0] * h\ncol_points = [0] * w\nfor row, col in target_points:\n row_points[row] += 1\n col_points[col] += 1\n\nrow_max = max(row_points)\ncol_max = max(col_points)\n\nrow_max_indexes = [i for i in range(h) if row_points[i] == row_max]\ncol_max_indexes = [i for i in range(w) if col_points[i] == col_max]\n\nempty_crossing_exist = False\nfor row in row_max_indexes:\n for col in col_max_indexes:\n if (row, col) not in target_points:\n empty_crossing_exist = True\n break\n if empty_crossing_exist:\n break\n\nprint(row_max + col_max - (not empty_crossing_exist))\n","change":"replace","i1":15,"i2":18,"j1":15,"j2":25,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02580","language":"Python","original_status":"Time Limit Exceeded","pass":"H, W, M = map(int, input().split())\n\nX = [0] * W\nY = [0] * H\nMap = []\n\nfor _ in range(M):\n h, w = map(int, input().split())\n h -= 1\n w -= 1\n Y[h] += 1\n X[w] += 1\n Map.append((h, w))\n\nMX = max(X)\nMY = max(Y)\nans = MX + MY\nXans = []\nYans = []\nfor i, x in enumerate(X):\n if x == MX:\n Xans.append(i)\nfor i, y in enumerate(Y):\n if y == MY:\n Yans.append(i)\nflag = False\ncnt = 0\nfor h, w in Map:\n if h in Yans and w in Xans:\n cnt += 1\nif cnt == len(Xans) * len(Yans):\n ans -= 1\nprint(ans)\n","fail":"import sys\n\ninput = sys.stdin.buffer.readline\n\nH, W, M = map(int, input().split())\n\nX = [0] * W\nY = [0] * H\nMap = []\n\nfor _ in range(M):\n h, w = map(int, input().split())\n h -= 1\n w -= 1\n Y[h] += 1\n X[w] += 1\n Map.append((h, w))\n\nMX = max(X)\nMY = max(Y)\nans = MX + MY\nXans = set()\nYans = set()\nfor i, x in enumerate(X):\n if x == MX:\n Xans.add(i)\nfor i, y in enumerate(Y):\n if y == MY:\n Yans.add(i)\ncnt = 0\nfor h, w in Map:\n if h in Yans and w in Xans:\n cnt += 1\nif cnt == len(Xans) * len(Yans):\n ans -= 1\nprint(ans)\n","change":"replace","i1":0,"i2":26,"j1":0,"j2":29,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02580","language":"Python","original_status":"Time Limit Exceeded","pass":"from collections import defaultdict\n\n\nH, W, M = map(int, input().split())\n\nh = [-1]\nw = [-1]\nhw_dict = defaultdict(int)\nfor _ in range(M):\n hi, wi = map(int, input().split())\n h.append(hi)\n w.append(wi)\n hw_dict[(hi, wi)] = 1\n# print(h)\n# print(w)\n# print(hw)\nh_cnt = [0] * (H + 1)\nw_cnt = [0] * (W + 1)\nfor i in range(1, M + 1):\n h_cnt[h[i]] += 1\n w_cnt[w[i]] += 1\n# print(h_cnt)\n# print(w_cnt)\n\nh_max = max(h_cnt)\nw_max = max(w_cnt)\n\nh_max_idx = []\nw_max_idx = []\n\n\nfor i in range(1, H + 1):\n if h_cnt[i] == h_max:\n h_max_idx.append(i)\n\nfor i in range(1, W + 1):\n if w_cnt[i] == w_max:\n w_max_idx.append(i)\n\n# print(h_max_idx)\n# print(w_max_idx)\n\n# if len(h_max_idx)>=10**2:\n# h_max_idx = h_max_idx[:10**2]\n# if len(w_max_idx)>=10**2:\n# w_max_idx = w_max_idx[:10**2]\n\nans = 0\n\nfor i in h_max_idx:\n for j in w_max_idx:\n tmp = h_cnt[i] + w_cnt[j]\n if hw_dict[(i, j)] == 1:\n tmp -= 1\n ans = max(ans, tmp)\nprint(ans)\n","fail":"from collections import defaultdict\n\n\nH, W, M = map(int, input().split())\n\nh = [-1]\nw = [-1]\nhw_dict = defaultdict(int)\nfor _ in range(M):\n hi, wi = map(int, input().split())\n h.append(hi)\n w.append(wi)\n hw_dict[(hi, wi)] = 1\n# print(h)\n# print(w)\n# print(hw)\nh_cnt = [0] * (H + 1)\nw_cnt = [0] * (W + 1)\nfor i in range(1, M + 1):\n h_cnt[h[i]] += 1\n w_cnt[w[i]] += 1\n# print(h_cnt)\n# print(w_cnt)\n\nh_max = max(h_cnt)\nw_max = max(w_cnt)\n\nh_max_idx = []\nw_max_idx = []\n\n\nfor i in range(1, H + 1):\n if h_cnt[i] == h_max:\n h_max_idx.append(i)\n\nfor i in range(1, W + 1):\n if w_cnt[i] == w_max:\n w_max_idx.append(i)\n\n\n# print(h_max_idx)\n# print(w_max_idx)\n\nans = 0\n\nfor i in h_max_idx:\n for j in w_max_idx:\n tmp = h_cnt[i] + w_cnt[j]\n if hw_dict[(i, j)] == 1:\n tmp -= 1\n ans = max(ans, tmp)\n else:\n ans = tmp\n break\n\nprint(ans)\n","change":"replace","i1":39,"i2":55,"j1":39,"j2":55,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02581","language":"Python","original_status":"Time Limit Exceeded","pass":"def upd(a, b, v):\n global N\n dp[a][b] = max(dp[a][b], v)\n dp[b][a] = max(dp[b][a], v)\n dp[N][a] = max(dp[N][a], v)\n dp[N][b] = max(dp[N][b], v)\n dp[a][N] = max(dp[a][N], v)\n dp[b][N] = max(dp[b][N], v)\n dp[N][N] = max(dp[N][N], v)\n\n\nN = int(input())\nA = list(map(lambda x: int(x) - 1, input().split()))\n\nINF = 1 << 32\ndp = [[-INF] * (N + 1) for _ in range(N + 1)]\nupd(A[0], A[1], 0)\nbase = 0\nq = [None] * (3 * N + 3)\n\nfor i in range(2, 3 * N - 1, 3):\n x, y, z = A[i], A[i + 1], A[i + 2]\n if x == y == z: # x, y, z 3\u6587\u5b57\u3059\u3079\u3066\u7b49\u3057\u3044\u3068\u304d\n base += 1\n else:\n cur = 0\n for _ in range(3):\n # a, b, x, y, z \u306e\u3046\u3061, b, y, z \u3092\u6d88\u3059\u3068\u304d\n for k in range(N):\n v = dp[k][N]\n if y == z:\n v = max(v, dp[k][y] + 1)\n q[cur] = (k, x, v)\n cur += 1\n # a, b, x, y, z \u306e\u3046\u3061, a, b, z \u3092\u6d88\u3059\u3068\u304d\n v = max(dp[z][z] + 1, dp[N][N])\n q[cur] = (x, y, v)\n cur += 1\n # x, y, z \u3092\u30ed\u30fc\u30c6\u30fc\u30c8\n x, y, z = z, x, y\n for j in range(cur):\n upd(*q[j])\n\nl = A[-1]\nans = max(dp[N][N], dp[l][l] + 1)\nprint(ans + base)\n","fail":"from collections import deque\n\n\ndef upd(a, b, v):\n global N\n dp[a][b] = max(dp[a][b], v)\n dp[b][a] = max(dp[b][a], v)\n dp[N][a] = max(dp[N][a], v)\n dp[N][b] = max(dp[N][b], v)\n dp[a][N] = max(dp[a][N], v)\n dp[b][N] = max(dp[b][N], v)\n dp[N][N] = max(dp[N][N], v)\n\n\nN = int(input())\nA = list(map(lambda x: int(x) - 1, input().split()))\n\nINF = 1 << 32\ndp = [[-INF] * (N + 1) for _ in range(N + 1)]\nupd(A[0], A[1], 0)\nbase = 0\nq = deque()\n\nfor i in range(2, 3 * N - 1, 3):\n x, y, z = A[i], A[i + 1], A[i + 2]\n if x == y == z: # x, y, z 3\u6587\u5b57\u3059\u3079\u3066\u7b49\u3057\u3044\u3068\u304d\n base += 1\n else:\n for _ in range(3):\n # a, b, x, y, z \u306e\u3046\u3061, b, y, z \u3092\u6d88\u3059\u3068\u304d\n for k in range(N):\n v = dp[k][N]\n if y == z:\n v = max(v, dp[k][y] + 1)\n q.append((k, x, v))\n # a, b, x, y, z \u306e\u3046\u3061, a, b, z \u3092\u6d88\u3059\u3068\u304d\n v = max(dp[z][z] + 1, dp[N][N])\n q.append((x, y, v))\n # x, y, z \u3092\u30ed\u30fc\u30c6\u30fc\u30c8\n x, y, z = z, x, y\n while q:\n a, b, v = q.popleft()\n upd(a, b, v)\n\nl = A[-1]\nans = max(dp[N][N], dp[l][l] + 1)\nprint(ans + base)\n","change":"replace","i1":0,"i2":42,"j1":0,"j2":43,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02582","language":"Python","original_status":"Runtime Error","pass":"s = input()\n\nif s in \"R\":\n ans = 1\nif s in \"RR\":\n ans = 2\nif s in \"RRR\":\n ans = 3\nprint(ans)\n","fail":"s = input()\nans = 0\nif \"R\" in s:\n ans = 1\nif \"RR\" in s:\n ans = 2\nif \"RRR\" in s:\n ans = 3\nprint(ans)\n","change":"replace","i1":1,"i2":7,"j1":1,"j2":7,"error":"NameError: name 'ans' is not defined. Did you mean: 'abs'?","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02582\/Python\/s575008241.py\", line 9, in \n print(ans)\nNameError: name 'ans' is not defined. Did you mean: 'abs'?\n","stdout":null} {"problem_id":"p02582","language":"Python","original_status":"Runtime Error","pass":"s = input()\n\ncnt = 0\nL = []\nfor i in s:\n if i == \"R\":\n cnt += 1\n else:\n L.append(cnt)\n cnt = 0\n\nprint(max(L))\n","fail":"s = input()\n\ncnt = 0\nL = []\nfor i in s:\n if i == \"R\":\n cnt += 1\n else:\n L.append(cnt)\n cnt = 0\nL.append(cnt)\nprint(max(L))\n","change":"replace","i1":10,"i2":11,"j1":10,"j2":11,"error":"0","stderr":null,"stdout":"2\n"} {"problem_id":"p02582","language":"Python","original_status":"Runtime Error","pass":"s = input()\n\nif \"RRR\" in s:\n ans = 3\nelif \"RR\" in s:\n ans = 2\nelif \"R\" in s:\n ans = 1\n\nprint(ans)\n","fail":"s = input()\n\nif \"RRR\" in s:\n ans = 3\nelif \"RR\" in s:\n ans = 2\nelif \"R\" in s:\n ans = 1\nelse:\n ans = 0\n\nprint(ans)\n","change":"insert","i1":8,"i2":8,"j1":8,"j2":10,"error":"0","stderr":null,"stdout":"2\n"} {"problem_id":"p02582","language":"Python","original_status":"Runtime Error","pass":"s = input()\n\nans = s.index(\"S\")\n\nprint(ans)\n","fail":"s = input()\n\nif \"RRR\" in s:\n print(3)\nelif \"RR\" in s:\n print(2)\nelif \"R\" in s:\n print(1)\nelse:\n print(0)\n","change":"replace","i1":2,"i2":5,"j1":2,"j2":10,"error":"0","stderr":null,"stdout":"2\n"} {"problem_id":"p02582","language":"Python","original_status":"Runtime Error","pass":"S = input()\n\nR = []\nr = 0\nfor s in S:\n if s == \"R\":\n r += 1\n if s == \"S\":\n R.append(r)\n r = 0\n\nprint(max(R))\n","fail":"S = input()\n\nR = []\nr = 0\nfor s in S:\n if s == \"R\":\n r += 1\n if s == \"S\":\n R.append(r)\n r = 0\n R.append(r)\n\nprint(max(R))\n","change":"insert","i1":10,"i2":10,"j1":10,"j2":11,"error":"0","stderr":null,"stdout":"2\n"} {"problem_id":"p02583","language":"Python","original_status":"Runtime Error","pass":"# -*- coding: utf-8 -*-\n\nN = int(input())\nL = list(map(int, input().split()))\nt = 0\n\nfor a in range(N - 2):\n for b in range(N - 2):\n for count in range(N - 2):\n x = L[a], L[a + b + 1], L[a + 1 + count]\n mylist = list(x)\n mylist.sort()\n if mylist[0] + mylist[1] > mylist[2]:\n t += 1\n\nprint(t)\n","fail":"N = int(input())\nL = list(map(int, input().split()))\nl = sorted(L)\n\nt = 0\n\nfor a in range(N):\n for b in range(a + 1, N):\n for c in range(b + 1, N):\n\n if l[a] < l[b] < l[c] and l[a] + l[b] > l[c]:\n t += 1\n\nprint(t)\n","change":"replace","i1":0,"i2":13,"j1":0,"j2":11,"error":"IndexError: list index out of range","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02583\/Python\/s163511837.py\", line 10, in \n x = L[a], L[a + b + 1], L[a + 1 + count]\nIndexError: list index out of range\n","stdout":null} {"problem_id":"p02584","language":"Python","original_status":"Time Limit Exceeded","pass":"x, k, d = map(int, input().split())\nx = abs(x)\nwhile k > 0:\n x = min(abs(x + d), abs(x - d))\n k -= 1\nprint(x)\n","fail":"x, k, d = map(int, input().split())\nx = abs(x)\n\nk_ = min(k, x \/\/ d)\nk = k - k_\nx = x - k_ * d\n\nif k % 2 != 0:\n x = abs(x - d)\nprint(x)\n","change":"replace","i1":2,"i2":5,"j1":2,"j2":9,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02584","language":"Python","original_status":"Time Limit Exceeded","pass":"X, K, D = map(int, input().split())\ngoal = []\ntimes = 0\npos = [0]\nmovement = []\n\nwhile times < K:\n for i in pos:\n plus = i + 1\n minus = i - 1\n movement.append(plus)\n movement.append(minus)\n times += 1\n pos.clear()\n for j in movement:\n pos.append(j)\n movement.clear()\n\nfor i in pos:\n goal.append(i * D + X)\n\nprint(abs(min(goal, key=abs)))\n","fail":"import math\n\nX, K, D = map(int, input().split())\nans = 0\nif K * D < abs(X):\n ans = abs(X) - K * D\nelif (K - math.floor(abs(X) \/ D)) % 2 == 0:\n ans = abs(X) - (math.floor(abs(X) \/ D)) * D\nelse:\n ans = abs(X) - (math.floor(abs(X) \/ D)) * D - D\n\nprint(abs(int(ans)))\n","change":"replace","i1":0,"i2":22,"j1":0,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02584","language":"Python","original_status":"Runtime Error","pass":"X, K, D = map(int, input().split())\n\n\ndef f(C):\n NX = float(\"inf\")\n if C > K:\n return NX\n\n if K % 2 == 0:\n if C % 2 == 0:\n NX = abs(abs(X) - C * D)\n else:\n NX = abs(abs(X) - (C + 1) * D)\n if C > 0:\n NX = min(NX, abs(abs(X) - (C - 1) * D))\n else:\n if C % 2 == 0:\n NX = abs(NX, abs(X) - (C + 1) * D)\n if C > 0:\n NX = min(NX, abs(abs(X) - (C - 1) * D))\n else:\n NX = abs(abs(X) - C * D)\n\n return NX\n\n\nC = min(abs(X) \/\/ D, K)\n\nprint(min(f(C), f(C + 1)))\n","fail":"X, K, D = map(int, input().split())\n\n\ndef f(C):\n NX = float(\"inf\")\n if C > K:\n return NX\n\n if K % 2 == 0:\n if C % 2 == 0:\n NX = abs(abs(X) - C * D)\n else:\n NX = abs(abs(X) - (C + 1) * D)\n if C > 0:\n NX = min(NX, abs(abs(X) - (C - 1) * D))\n else:\n if C % 2 == 0:\n NX = abs(abs(X) - (C + 1) * D)\n if C > 0:\n NX = min(NX, abs(abs(X) - (C - 1) * D))\n else:\n NX = abs(abs(X) - C * D)\n\n return NX\n\n\nC = min(abs(X) \/\/ D, K)\n\nprint(min(f(C), f(C + 1)))\n","change":"replace","i1":17,"i2":18,"j1":17,"j2":18,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p02584","language":"Python","original_status":"Time Limit Exceeded","pass":"X, K, D = map(int, input().split())\n\nx = abs(X)\nk = K\nwhile x > 0 and k > 0:\n x -= D\n k -= 1\n\nif k % 2 == 1:\n x += D\n\nprint(abs(x))\n","fail":"X, K, D = map(int, input().split())\n\nx = abs(X)\nk = K\n\nxd = min(x \/\/ D + 1, K)\nx -= D * xd\nk -= xd\n\nif k % 2 == 1:\n x += D\n\nprint(abs(x))\n","change":"replace","i1":4,"i2":7,"j1":4,"j2":8,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02584","language":"Python","original_status":"Time Limit Exceeded","pass":"dates = [int(i) for i in input().split(\" \")]\nX = dates[0]\nK = dates[1]\nD = dates[2]\n\nif X >= 0:\n while X > 0 and K > 0:\n X -= D\n K -= 1\nelse:\n while X <= 0 and K > 0:\n X += D\n K -= 1\n\nif X >= 0:\n if K % 2 == 0:\n print(abs(X))\n else:\n print(abs(X - D))\nelse:\n if K % 2 == 0:\n print(abs(X))\n else:\n print(abs(X + D))\n","fail":"import math\n\ndates = [int(i) for i in input().split(\" \")]\nX = dates[0]\nK = dates[1]\nD = dates[2]\nnumDiv = math.ceil(abs(X) \/ D)\n\nif numDiv < K:\n if X >= 0:\n X -= numDiv * D\n K -= numDiv\n else:\n X += numDiv * D\n K -= numDiv\nelse:\n if X >= 0:\n X -= K * D\n K = 0\n else:\n X += K * D\n K = 0\n\nif X >= 0:\n if K % 2 == 0:\n print(abs(X))\n else:\n print(abs(X - D))\nelse:\n if K % 2 == 0:\n print(abs(X))\n else:\n print(abs(X + D))\n","change":"replace","i1":0,"i2":13,"j1":0,"j2":22,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02585","language":"Python","original_status":"Runtime Error","pass":"import sys\nfrom itertools import accumulate\n\ninput = sys.stdin.readline\n\n\nclass UnionFind:\n \"\"\"Union Find class.\n\n \"Path compression\" and \"Union by rank\" are used.\n\n References:\n \n \"\"\"\n\n def __init__(self, N):\n self.N = N\n self.__make_set()\n\n def __make_set(self):\n self._parent = list(range(self.N + 1))\n self._rank = [0] * (self.N + 1)\n self._size = [1] * (self.N + 1)\n\n def find(self, x):\n if self._parent[x] != x:\n self._parent[x] = self.find(self._parent[x])\n return self._parent[x]\n\n def union(self, x, y):\n x_root = self.find(x)\n y_root = self.find(y)\n\n if x_root == y_root:\n return\n\n x_rank = self._rank[x_root]\n y_rank = self._rank[y_root]\n if x_rank > y_rank:\n self._parent[y_root] = x_root\n self._size[x_root] += self._size[y_root]\n elif x_rank < y_rank:\n self._parent[x_root] = y_root\n self._size[y_root] += self._size[x_root]\n else:\n self._parent[y_root] = x_root\n self._rank[x_root] += 1\n self._size[x_root] += self._size[y_root]\n\n def same_set(self, x, y):\n return self.find(x) == self.find(y)\n\n def size(self, x):\n return self._size[self.find(x)]\n\n\ndef main():\n N, K = map(int, input().split())\n P = list(map(int, input().split()))\n C = list(map(int, input().split()))\n\n uf = UnionFind(N)\n for i, p in enumerate(P, 1):\n uf.union(i, p)\n\n ans = -float(\"inf\")\n visited_cc = set()\n for i in range(1, N + 1):\n cc = uf.find(i)\n if cc in visited_cc:\n continue\n visited_cc.add(cc)\n\n CC = []\n j = P[i - 1]\n while True:\n CC.append(C[j - 1])\n if i == j:\n break\n j = P[j - 1]\n n_CC = len(CC)\n loop_cost = sum(CC)\n CC = list(accumulate([0] + CC * 2))\n\n if K < n_CC:\n cost = [-float(\"inf\")] * n_CC\n for n_move in range(1, K):\n for j in range(n_CC):\n tmp = CC[j + n_move] - CC[j]\n cost[n_move - 1] = max(cost[n_move - 1], tmp)\n res = max(cost)\n else:\n cost = [-float(\"inf\")] * n_CC\n for n_move in range(1, n_CC):\n for j in range(n_CC):\n tmp = CC[j + n_move] - CC[j]\n cost[n_move - 1] = max(cost[n_move - 1], tmp)\n q, r = divmod(K, n_CC)\n if loop_cost > 0:\n res = max(loop_cost * q + max(cost[:r]), loop_cost * (q - 1) + max(cost))\n else:\n res = max(cost)\n\n ans = max(ans, res)\n\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"import sys\nfrom itertools import accumulate\n\ninput = sys.stdin.readline\n\n\nclass UnionFind:\n \"\"\"Union Find class.\n\n \"Path compression\" and \"Union by rank\" are used.\n\n References:\n \n \"\"\"\n\n def __init__(self, N):\n self.N = N\n self.__make_set()\n\n def __make_set(self):\n self._parent = list(range(self.N + 1))\n self._rank = [0] * (self.N + 1)\n self._size = [1] * (self.N + 1)\n\n def find(self, x):\n if self._parent[x] != x:\n self._parent[x] = self.find(self._parent[x])\n return self._parent[x]\n\n def union(self, x, y):\n x_root = self.find(x)\n y_root = self.find(y)\n\n if x_root == y_root:\n return\n\n x_rank = self._rank[x_root]\n y_rank = self._rank[y_root]\n if x_rank > y_rank:\n self._parent[y_root] = x_root\n self._size[x_root] += self._size[y_root]\n elif x_rank < y_rank:\n self._parent[x_root] = y_root\n self._size[y_root] += self._size[x_root]\n else:\n self._parent[y_root] = x_root\n self._rank[x_root] += 1\n self._size[x_root] += self._size[y_root]\n\n def same_set(self, x, y):\n return self.find(x) == self.find(y)\n\n def size(self, x):\n return self._size[self.find(x)]\n\n\ndef main():\n N, K = map(int, input().split())\n P = list(map(int, input().split()))\n C = list(map(int, input().split()))\n\n uf = UnionFind(N)\n for i, p in enumerate(P, 1):\n uf.union(i, p)\n\n ans = -float(\"inf\")\n visited_cc = set()\n for i in range(1, N + 1):\n cc = uf.find(i)\n if cc in visited_cc:\n continue\n visited_cc.add(cc)\n\n CC = []\n j = P[i - 1]\n while True:\n CC.append(C[j - 1])\n if i == j:\n break\n j = P[j - 1]\n n_CC = len(CC)\n loop_cost = sum(CC)\n CC = list(accumulate([0] + CC * 2))\n\n if K < n_CC:\n cost = [-float(\"inf\")] * n_CC\n for n_move in range(1, K + 1):\n for j in range(n_CC):\n tmp = CC[j + n_move] - CC[j]\n cost[n_move - 1] = max(cost[n_move - 1], tmp)\n res = max(cost)\n else:\n cost = [-float(\"inf\")] * n_CC\n for n_move in range(1, n_CC):\n for j in range(n_CC):\n tmp = CC[j + n_move] - CC[j]\n cost[n_move - 1] = max(cost[n_move - 1], tmp)\n q, r = divmod(K, n_CC)\n if loop_cost > 0:\n if r > 0:\n res = max(\n loop_cost * q + max(cost[:r]), loop_cost * (q - 1) + max(cost)\n )\n else:\n res = max(loop_cost * q, loop_cost * (q - 1) + max(cost))\n else:\n res = max(cost)\n\n ans = max(ans, res)\n\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":86,"i2":100,"j1":86,"j2":105,"error":"0","stderr":null,"stdout":8.0} {"problem_id":"p02585","language":"Python","original_status":"Time Limit Exceeded","pass":"(N, K) = [int(x) for x in input().split()]\nP = [int(x) - 1 for x in input().split()] # 0 indexed\nC = [int(x) for x in input().split()]\n\n\ninf = float(\"inf\")\n\n\nans = max(C) # at least one move\nfor pos in range(N):\n i = pos\n score = 0\n cycleLen = None\n cycleGain = None\n bestInc = 0\n for k in range(K):\n i = P[i]\n score += C[i]\n ans = max(ans, score)\n bestInc = max(bestInc, score)\n\n if cycleLen is not None and k == K % cycleLen:\n numCycles = (K - k) \/\/ cycleLen\n\n ans = max(ans, cycleGain * numCycles + bestInc)\n break\n\n if i == pos:\n cycleLen = k\n cycleGain = score\n\nprint(ans)\n","fail":"(N, K) = [int(x) for x in input().split()]\nP = [int(x) - 1 for x in input().split()] # 0 indexed\nC = [int(x) for x in input().split()]\n\n\ninf = float(\"inf\")\n\n\nans = max(C) # at least one move\nfor pos in range(N):\n i = pos\n score = 0\n cycleLen = None\n cycleGain = None\n bestInc = 0\n k = 0\n while k < K:\n i = P[i]\n score += C[i]\n ans = max(ans, score)\n\n if i == pos:\n cycleLen = k + 1\n numCycles = max(0, (K - k - cycleLen) \/\/ cycleLen)\n if k + numCycles * cycleLen < K:\n k += numCycles * cycleLen\n score += numCycles * score\n k += 1\n\nprint(ans)\n","change":"replace","i1":15,"i2":30,"j1":15,"j2":28,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02585","language":"Python","original_status":"Time Limit Exceeded","pass":"N, K = map(int, input().split())\nP = list(map(int, input().split()))\nC = list(map(int, input().split()))\n\nP = [None] + P\nC = [None] + C\n\nall_max = C[1]\nfor st in range(1, N + 1):\n scores = []\n visit = set()\n p = st\n\n while p not in visit and len(visit) < K:\n next_p = P[p]\n scores.append(C[next_p])\n visit.add(p)\n p = next_p\n\n num_elem = len(scores)\n all_sum = sum(scores)\n\n q, r = divmod(K, num_elem)\n\n max_ = scores[0]\n temp = scores[0]\n\n max_r = scores[0]\n temp_r = scores[0]\n for x in range(1, num_elem):\n if x < r:\n temp_r += scores[x]\n max_r = max(max_r, temp_r)\n\n temp += scores[x]\n max_ = max(max_, temp)\n\n temp_max = scores[0]\n if all_sum > 0 and q > 0:\n if r > 0:\n temp_max = max(all_sum * (q - 1) + max_, all_sum * q + max_r)\n else:\n temp_max = all_sum * (q - 1) + max_\n else:\n temp_max = max_\n\n all_max = max(all_max, temp_max)\n\nprint(all_max)\n","fail":"N, K = map(int, input().split())\nP = list(map(int, input().split()))\nC = list(map(int, input().split()))\n\nP = [None] + P\nC = [None] + C\n\nall_max = C[1]\nfor st in range(1, N + 1):\n scores = []\n visit = set()\n p = st\n\n while p not in visit and len(visit) < K:\n next_p = P[p]\n scores.append(C[next_p])\n visit.add(p)\n p = next_p\n\n num_elem = len(scores)\n all_sum = sum(scores)\n\n q, r = divmod(K, num_elem)\n\n max_ = scores[0]\n temp = scores[0]\n\n max_r = scores[0]\n temp_r = scores[0]\n for x in range(1, num_elem):\n if x < r:\n temp_r += scores[x]\n max_r = max(max_r, temp_r)\n\n temp += scores[x]\n max_ = max(max_, temp)\n\n temp_max = scores[0]\n if all_sum > 0 and q > 0:\n if r > 0:\n temp_max = max(all_sum * (q - 1) + max_, all_sum * q + max_r)\n else:\n temp_max = all_sum * (q - 1) + max_\n else:\n temp_max = max_\n\n all_max = max(all_max, temp_max)\n\n\nprint(all_max)\n","change":"insert","i1":48,"i2":48,"j1":48,"j2":49,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02586","language":"Python","original_status":"Time Limit Exceeded","pass":"R, C, k = map(int, input().split())\nxs = [[0] * C for _ in range(R)]\nfor _ in range(k):\n r, c, v = map(int, input().split())\n xs[r - 1][c - 1] = v\n\ndp = [[[0] * 4 for _ in range(C + 1)] for _ in range(R + 1)]\nfor i in range(R):\n for j in range(C):\n for k in range(2, -1, -1):\n dp[i][j][k + 1] = max(dp[i][j][k + 1], dp[i][j][k] + xs[i][j])\n for k in range(4):\n dp[i][j + 1][k] = max(dp[i][j + 1][k], dp[i][j][k])\n dp[i + 1][j][0] = max(dp[i + 1][j][0], dp[i][j][k])\nprint(max(dp[R - 1][C - 1]))\n","fail":"R, C, k = map(int, input().split())\nxs = [[0] * C for _ in range(R)]\nfor _ in range(k):\n r, c, v = map(int, input().split())\n xs[r - 1][c - 1] = v\n\ndp = [[[0] * (C + 1) for _ in range(R + 1)] for _ in range(4)]\nfor i in range(R):\n for j in range(C):\n for k in range(2, -1, -1):\n dp[k + 1][i][j] = max(dp[k + 1][i][j], dp[k][i][j] + xs[i][j])\n for k in range(4):\n dp[k][i][j + 1] = max(dp[k][i][j + 1], dp[k][i][j])\n dp[0][i + 1][j] = max(dp[0][i + 1][j], dp[k][i][j])\nans = 0\nfor k in range(4):\n ans = max(ans, dp[k][R - 1][C - 1])\nprint(ans)\n","change":"replace","i1":6,"i2":15,"j1":6,"j2":18,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02586","language":"Python","original_status":"Time Limit Exceeded","pass":"import sys\n\nr, c, k = map(int, sys.stdin.buffer.readline().split())\nitems = [[0] * (c + 1) for _ in range(r + 1)]\nrcv = map(int, sys.stdin.buffer.read().split())\nfor r_, c_, v in zip(rcv, rcv, rcv):\n items[r_][c_] = v\n\ndp = [[[0, 0, 0, 0] for _ in range(c + 1)] for _ in range(r + 1)]\n\nfor i in range(1, r + 1):\n for j in range(1, c + 1):\n up = dp[i - 1][j][3]\n for w in range(4):\n dp[i][j][w] = max(dp[i][j - 1][w], up)\n v = items[i][j]\n if v == 0:\n continue\n for w in range(2, -1, -1):\n dp[i][j][w + 1] = max(dp[i][j][w + 1], dp[i][j][w] + v)\n\nprint(dp[-1][-1][3])\n","fail":"import os\nimport sys\n\nimport numpy as np\n\n\ndef solve(inp):\n r, c, k = inp[:3]\n items = np.zeros((r + 1, c + 1), dtype=np.int64)\n rrr = inp[3::3]\n ccc = inp[4::3]\n vvv = inp[5::3]\n for r_, c_, v in zip(rrr, ccc, vvv):\n items[r_][c_] = v\n\n dp = np.zeros((r + 1, c + 1, 4), dtype=np.int64)\n\n for i in range(1, r + 1):\n for j in range(1, c + 1):\n up = dp[i - 1][j][3]\n for w in range(4):\n dp[i][j][w] = max(dp[i][j - 1][w], up)\n v = items[i][j]\n if v == 0:\n continue\n for w in range(2, -1, -1):\n dp[i][j][w + 1] = max(dp[i][j][w + 1], dp[i][j][w] + v)\n\n return dp[-1][-1][3]\n\n\nif sys.argv[-1] == \"ONLINE_JUDGE\":\n from numba.pycc import CC\n\n cc = CC(\"my_module\")\n cc.export(\"solve\", \"(i8[:],)\")(solve)\n cc.compile()\n exit()\n\nif os.name == \"posix\":\n # noinspection PyUnresolvedReferences\n from my_module import solve\nelse:\n from numba import njit\n\n solve = njit(\"(i8[:],)\", cache=True)(solve)\n print(\"compiled\", file=sys.stderr)\n\ninp = np.fromstring(sys.stdin.read(), dtype=np.int64, sep=\" \")\nans = solve(inp)\nprint(ans)\n","change":"replace","i1":0,"i2":22,"j1":0,"j2":51,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02586","language":"Python","original_status":"Time Limit Exceeded","pass":"import numpy as np\n\n\ndef solve():\n dp = np.zeros((R + 1, C + 1, 4), dtype=np.int64)\n for i in range(R):\n for j in range(C):\n for k in range(2, -1, -1):\n dp[i][j][k + 1] = max(\n dp[i][j][k + 1], dp[i][j][k] + items.get((i, j), 0)\n )\n for k in range(4):\n dp[i + 1][j][0] = max(dp[i + 1][j][0], dp[i][j][k])\n dp[i][j + 1][k] = max(dp[i][j + 1][k], dp[i][j][k])\n return dp[R][C - 1][0]\n\n\nR, C, K, *rcv = map(int, open(0).read().split())\nitems = {(r - 1, c - 1): v for r, c, v in zip(*[iter(rcv)] * 3)}\nprint(solve())\n","fail":"import numpy as np\nfrom numba import njit, i8\n\n\n@njit(i8(i8, i8, i8[:, :]), cache=True)\ndef solve(R, C, items):\n dp = np.zeros((R + 1, C + 1, 4), dtype=np.int64)\n for i in range(R):\n for j in range(C):\n for k in range(2, -1, -1):\n dp[i][j][k + 1] = max(dp[i][j][k + 1], dp[i][j][k] + items[i][j])\n for k in range(4):\n dp[i + 1][j][0] = max(dp[i + 1][j][0], dp[i][j][k])\n dp[i][j + 1][k] = max(dp[i][j + 1][k], dp[i][j][k])\n return dp[R][C - 1][0]\n\n\nR, C, K, *rcv = map(int, open(0).read().split())\nitems = np.zeros((R + 1, C + 1), dtype=np.int64)\nfor r, c, v in zip(*[iter(rcv)] * 3):\n items[r - 1][c - 1] = v\nprint(solve(R, C, items))\n","change":"replace","i1":1,"i2":20,"j1":1,"j2":22,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02586","language":"Python","original_status":"Time Limit Exceeded","pass":"def solve():\n dp = [[[0] * 4 for _ in range(C + 1)] for _ in range(R + 1)]\n for i in range(1, R + 1):\n for j in range(1, C + 1):\n for k in range(4):\n dp[i][j][k] = max(dp[i][j - 1][k], dp[i - 1][j][3])\n if (i, j) not in items:\n continue\n for k in range(3, 0, -1):\n dp[i][j][k] = max(dp[i][j][k], dp[i][j][k - 1] + items[(i, j)])\n return dp[R][C][3]\n\n\nR, C, K, *rcv = map(int, open(0).read().split())\n\nitems = {}\nfor r, c, v in zip(*[iter(rcv)] * 3):\n items[(r, c)] = v\n\nprint(solve())\n","fail":"import numpy as np\nfrom numba import njit\n\n\n@njit\ndef solve():\n dp = np.zeros((R + 1, C + 1, 4), dtype=np.int64)\n for i in range(1, R + 1):\n for j in range(1, C + 1):\n for k in range(4):\n dp[i][j][k] = max(dp[i][j - 1][k], dp[i - 1][j][3])\n if items[i][j] == 0:\n continue\n for k in range(3, 0, -1):\n dp[i][j][k] = max(dp[i][j][k], dp[i][j][k - 1] + items[i][j])\n return dp[R][C][-1]\n\n\nR, C, K, *rcv = map(int, open(0).read().split())\n\nitems = np.zeros((R + 1, C + 1), dtype=np.int32)\nfor r, c, v in zip(*[iter(rcv)] * 3):\n items[r][c] = v\n\nprint(solve())\n","change":"replace","i1":0,"i2":18,"j1":0,"j2":23,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02586","language":"Python","original_status":"Time Limit Exceeded","pass":"import io\nimport os\n\ninput = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline\n\nR, C, K = [int(x) for x in input().split()]\ngrid = [[0 for c in range(C)] for r in range(R)]\nfor r, c, v in ((int(x) for x in input().split()) for i in range(K)):\n grid[r - 1][c - 1] = v\n\n\ndp = [[[0 for i in range(3 + 1 + 1)] for c in range(C + 1)] for r in range(R + 1)]\ndp2 = [[0 for c in range(C + 1)] for r in range(R + 1)]\n\ninf = float(\"inf\")\nfor r in range(R + 1):\n for c in range(C + 1):\n dp[r][c][-1] = -inf\nfor r in range(R):\n for c in range(C):\n for numTakenThisRow in range(3 + 1):\n best = max(\n dp[r][c - 1][numTakenThisRow], # came from left\n dp2[r - 1][c], # came from top, didn't take curr\n dp[r][c - 1][numTakenThisRow - 1]\n + grid[r][c], # came from left, took curr\n dp2[r - 1][c] + grid[r][c]\n if numTakenThisRow == 1\n else 0, # came from top, took curr\n )\n dp[r][c][numTakenThisRow] = best\n dp2[r][c] = max(dp[r][c][i] for i in range(3 + 1))\nprint(dp2[R - 1][C - 1])\n","fail":"import io\nimport os\nfrom collections import defaultdict\n\nDEBUG = False\nif not DEBUG:\n\n input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline\n\n R, C, K = [int(x) for x in input().split()]\n grid = [[0 for c in range(C)] for r in range(R)]\n for r, c, v in ((int(x) for x in input().split()) for i in range(K)):\n grid[r - 1][c - 1] = v\nelse:\n import random\n\n random.seed(0)\n R, C = 3000, 3000\n # 2 * 10**5 \/ 90 * 10**5 full\n grid = [\n [int(random.randint(1, 90) <= 2) * random.randint(0, 10**9) for c in range(C)]\n for r in range(R)\n ]\n print(sum(bool(grid[r][c]) for r in range(R) for c in range(C)))\n print(\"done gen\")\n\n from timeit import default_timer as timer\n\n startTime = timer()\n\n\ncurrRow = [[0 for i in range(3 + 1)] for c in range(C + 1)]\nprevRow = [0 for c in range(C + 1)]\nnextPrevRow = [0 for c in range(C + 1)]\n\ninf = float(\"inf\")\nfor r in range(R):\n for c in range(C):\n for numTakenThisRow in range(3 + 1):\n best = max(\n currRow[c - 1][numTakenThisRow], # came from left\n prevRow[c], # came from top, didn't take curr\n currRow[c - 1][numTakenThisRow - 1] + grid[r][c]\n if numTakenThisRow\n else 0, # came from left, took curr\n prevRow[c] + grid[r][c]\n if numTakenThisRow == 1\n else 0, # came from top, took curr\n )\n currRow[c][numTakenThisRow] = best\n nextPrevRow[c] = max(currRow[c][i] for i in range(3 + 1))\n prevRow, nextPrevRow = nextPrevRow, prevRow\nprint(prevRow[C - 1])\n\nif DEBUG:\n print(timer() - startTime)\n","change":"replace","i1":2,"i2":33,"j1":2,"j2":56,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02588","language":"Python","original_status":"Runtime Error","pass":"import sys\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef div_cnt(n, d):\n res = 0\n while n % d == 0:\n res += 1\n n \/\/= d\n return res\n\n\nN = int(input())\nA = list(int(float(input()) * 1_000_000_000) for _ in range(N))\ndivs = [(div_cnt(a, 2), div_cnt(a, 5)) for a in A]\n\ntable = [[0] * 19 for _ in range(19)]\nfor t, f in divs:\n table[t][f] += 1\n\nans = 0\nfor t, f in divs:\n for i in range(19):\n for j in range(19):\n if t + i >= 18 and f + j >= 18:\n ans += table[i][j]\n if t == i and f == j:\n ans -= 1\n\nprint(ans \/\/ 2)\n","fail":"import sys\n\nimport numpy as np\nfrom numba import njit, i8\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef convert(S):\n i, *d = S.split(\".\")\n i = int(i) * 1_000_000_000\n if d:\n return i + int(d[0].ljust(9, \"0\"))\n else:\n return i\n\n\ndef div_cnt(n, d):\n res = 0\n while n % d == 0:\n res += 1\n n \/\/= d\n return res\n\n\n@njit(i8(i8[:, :]), cache=True)\ndef solve(table):\n ans = 0\n for i in range(19):\n for j in range(19):\n cur = table[i][j]\n if cur == 0:\n continue\n for k in range(18 - i, 19):\n for l in range(18 - j, 19):\n if k == i and j == l:\n ans += cur * (cur - 1)\n else:\n ans += cur * table[k][l]\n return ans\n\n\nN = int(input())\nA = list(convert(input()) for _ in range(N))\ndivs = [(div_cnt(a, 2), div_cnt(a, 5)) for a in A]\n\ntable = np.zeros((19, 19), np.int64)\nfor t, f in divs:\n table[min(t, 18)][min(f, 18)] += 1\nprint(solve(table) \/\/ 2)\n","change":"replace","i1":1,"i2":33,"j1":1,"j2":52,"error":"0","stderr":null,"stdout":"3\n"} {"problem_id":"p02594","language":"Python","original_status":"Runtime Error","pass":"x = input()\nif x >= 30:\n print(\"Yes\")\nelse:\n print(\"No\")\n","fail":"x = int(input())\nif x >= 30:\n print(\"Yes\")\nelse:\n print(\"No\")\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"TypeError: '>=' not supported between instances of 'str' and 'int'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02594\/Python\/s624570905.py\", line 2, in \n if x >= 30:\nTypeError: '>=' not supported between instances of 'str' and 'int'\n","stdout":null} {"problem_id":"p02594","language":"Python","original_status":"Runtime Error","pass":"x = input()\nif x >= 30:\n print(\"Yes\")\nelse:\n print(\"No\")\n","fail":"x = input()\nif int(x) >= 30:\n print(\"Yes\")\nelse:\n print(\"No\")\n","change":"replace","i1":1,"i2":2,"j1":1,"j2":2,"error":"TypeError: '>=' not supported between instances of 'str' and 'int'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02594\/Python\/s511585247.py\", line 2, in \n if x >= 30:\nTypeError: '>=' not supported between instances of 'str' and 'int'\n","stdout":null} {"problem_id":"p02594","language":"Python","original_status":"Runtime Error","pass":"X = int(input().split())\n\nif X >= 30:\n print(\"Yes\")\nelse:\n print(\"No\")\n","fail":"X = int(input())\n\nif X >= 30:\n print(\"Yes\")\nelse:\n print(\"No\")\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"TypeError: int() argument must be a string, a bytes-like object or a real number, not 'list'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02594\/Python\/s217813658.py\", line 1, in \n X = int(input().split())\nTypeError: int() argument must be a string, a bytes-like object or a real number, not 'list'\n","stdout":null} {"problem_id":"p02594","language":"Python","original_status":"Runtime Error","pass":"x = input()\n\nif x >= 30:\n print(\"Yes\")\nelse:\n print(\"No\")\n","fail":"x = int(input())\n\nif x >= 30:\n print(\"Yes\")\nelse:\n print(\"No\")\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"TypeError: '>=' not supported between instances of 'str' and 'int'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02594\/Python\/s522477833.py\", line 3, in \n if x >= 30:\nTypeError: '>=' not supported between instances of 'str' and 'int'\n","stdout":null} {"problem_id":"p02596","language":"Python","original_status":"Runtime Error","pass":"k = int(input())\na = 7\ni = 1\nF = [0] * k\nwhile F[a % k] == 0:\n F[a] = 1\n a = ((10 * a) + 7) % k\n i += 1\n if a == 0:\n print(i)\n exit()\nprint(-1)\n","fail":"k = int(input())\na = 7\nfor i in range(1, k + 1):\n if a % k == 0:\n print(i)\n exit()\n a = (10 * a + 7) % k\nprint(-1)\n","change":"replace","i1":2,"i2":11,"j1":2,"j2":7,"error":"0","stderr":null,"stdout":"4\n"} {"problem_id":"p02596","language":"Python","original_status":"Time Limit Exceeded","pass":"K = int(input())\n\nans = 1\na = 7\ni = K\nwhile K > 0:\n m = a % K\n if m == 0:\n print(ans)\n break\n else:\n ans += 1\n a = m * 10 + 7\n i -= 1\nif m != 0:\n print(-1)\n","fail":"K = int(input())\n\nans = 1\na = 7\ni = K\nwhile i > 0:\n m = a % K\n if m == 0:\n print(ans)\n break\n else:\n ans += 1\n a = m * 10 + 7\n i -= 1\nif m != 0:\n print(-1)\n","change":"replace","i1":5,"i2":6,"j1":5,"j2":6,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02596","language":"Python","original_status":"Time Limit Exceeded","pass":"k = int(input())\nn = 1\nlist = []\nr = 7\nwhile True:\n r = r % k\n if r == 0:\n print(n)\n break\n elif r in list:\n print(-1)\n break\n else:\n list.append(r)\n r = r * 10 + 7\n n += 1\n","fail":"K = int(input())\na = 7\nfor i in range(K):\n if a % K == 0:\n print(i + 1)\n break\n else:\n a = 10 * (a % K) + 7\nelse:\n print(-1)\n","change":"replace","i1":0,"i2":16,"j1":0,"j2":10,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02596","language":"Python","original_status":"Time Limit Exceeded","pass":"k = int(input())\n\nif k % 2 == 0 or k % 5 == 0:\n print(-1)\nelse:\n ans = 1\n num = 7\n while True:\n if int(num) % k == 0:\n print(ans)\n break\n else:\n ans += 1\n num += 7 * pow(10, ans - 1, k)\n num %= k\n","fail":"k = int(input())\n\nif k % 2 == 0 or k % 5 == 0:\n print(-1)\nelse:\n ans = 1\n num = 7\n while True:\n if num % k == 0:\n print(ans)\n break\n else:\n ans += 1\n num += 7 * pow(10, ans - 1, k)\n num %= k\n","change":"replace","i1":8,"i2":9,"j1":8,"j2":9,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02596","language":"Python","original_status":"Time Limit Exceeded","pass":"k = int(input())\n\nif k % 2 == 0:\n print(-1)\nelse:\n ans = 1\n num = 7 % k\n temp = 7 % k\n while True:\n if num % k == 0:\n print(ans)\n break\n else:\n ans += 1\n temp = temp * 10 % k\n num += temp % k\n num %= k\n","fail":"k = int(input())\n\nif k % 2 == 0 or k % 5 == 0:\n print(-1)\nelse:\n ans = 1\n num = 7 % k\n temp = 7 % k\n while True:\n if num % k == 0:\n print(ans)\n break\n else:\n ans += 1\n temp = temp * 10 % k\n num += temp % k\n num %= k\n","change":"replace","i1":2,"i2":3,"j1":2,"j2":3,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02596","language":"Python","original_status":"Time Limit Exceeded","pass":"k = int(input())\nif k % 2 == 0:\n print(-1)\nelse:\n mod = 7 % k\n counter = 1\n memo = 1\n while mod != 0:\n memo = ((memo % k) * (10 % k)) % k\n mod = (mod + 7 * memo) % k\n counter += 1\n if mod == 0:\n break\n print(counter)\n","fail":"k = int(input())\nif k % 2 == 0:\n print(-1)\nelse:\n mod = 7 % k\n counter = 1\n memo = 1\n mod_map = set()\n mod_map.add(mod)\n while mod != 0:\n memo = ((memo % k) * (10 % k)) % k\n mod = (mod + 7 * memo) % k\n if mod not in mod_map:\n mod_map.add(mod)\n else:\n counter = -1\n break\n counter += 1\n if mod == 0:\n break\n print(counter)\n","change":"replace","i1":7,"i2":10,"j1":7,"j2":17,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02596","language":"Python","original_status":"Time Limit Exceeded","pass":"K = int(input())\nif K % 2 == 0:\n print(-1)\n exit()\n\nx = 7 % K\ni = 1\nwhile True:\n if x == 0:\n print(i)\n exit()\n y = (x * 10 + 7) % K\n if x == y:\n print(-1)\n exit()\n x = y\n i += 1\n","fail":"K = int(input())\nif K % 2 == 0:\n print(-1)\n exit()\n\nx = 7 % K\ni = 1\nwhile True:\n if x == 0:\n print(i)\n exit()\n x = (x * 10 + 7) % K\n i += 1\n if i > 10**6:\n print(-1)\n exit()\n","change":"replace","i1":11,"i2":17,"j1":11,"j2":16,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02596","language":"Python","original_status":"Time Limit Exceeded","pass":"k = int(input())\ns = 7\nnum = 1\nif k == 2:\n print(-1)\nelse:\n while 1:\n s %= k\n if s == 0:\n print(num)\n break\n num += 1\n s *= 10\n s += 7\n","fail":"k = int(input())\ns = 7\nnum = 1\nres = True\nif k == 2:\n print(-1)\nelse:\n for i in range(k):\n s %= k\n if s == 0:\n res = False\n print(num)\n break\n num += 1\n s *= 10\n s += 7\n if res:\n print(-1)\n","change":"replace","i1":3,"i2":14,"j1":3,"j2":18,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02596","language":"Python","original_status":"Time Limit Exceeded","pass":"k = int(input())\nseven = 7\nans = 1\n\nif k % 2 == 0:\n ans = -1\nelif k == 1 or k == 7:\n ans = 1\nelse:\n while seven % k != 0:\n seven = seven * 10 + 7\n ans += 1\n\nprint(ans)\n","fail":"k = int(input())\nseven = 7\nans = -1\n\nfor i in range(1, k + 1):\n seven %= k\n if seven == 0:\n ans = i\n break\n else:\n seven = seven * 10 + 7\n\nprint(ans)\n","change":"replace","i1":2,"i2":12,"j1":2,"j2":11,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02596","language":"Python","original_status":"Time Limit Exceeded","pass":"K = int(input())\n\nif K % 2 == 0:\n print(-1)\n exit()\nif K % 5 == 0:\n print(-1)\n exit()\n\nseven = 0\nfor i in range(10**6):\n seven = seven * 10 + 7\n if seven % K == 0:\n print(i + 1)\n exit()\n\nprint(-1)\n","fail":"K = int(input())\n\nif K % 2 == 0 or K % 5 == 0:\n print(-1)\n exit()\n\nans = 0\nai = 0\nwhile True:\n ai = (ai * 10 + 7) % K\n ans += 1\n if ai % K == 0:\n print(ans)\n exit()\n","change":"replace","i1":2,"i2":17,"j1":2,"j2":14,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02596","language":"Python","original_status":"Time Limit Exceeded","pass":"# coding: utf-8\nk = int(input())\nkx = k\nif k % 2 == 1:\n while True:\n num = list(str(kx))\n if all(kx == \"7\" for kx in num):\n print(len(str(kx)))\n break\n kx = kx + k\nelse:\n print(\"-1\")\n","fail":"# coding: utf-8\nk = int(input())\nans = -1\nx = 7\n\nfor i in range(k):\n if x % k == 0:\n ans = i + 1\n break\n x = (10 * x + 7) % k\nprint(ans)\n","change":"replace","i1":2,"i2":12,"j1":2,"j2":11,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02596","language":"Python","original_status":"Time Limit Exceeded","pass":"K = int(input())\ncount = 1\ncheck = 7\n\nif K % 2 == 0 or K % 5 == 0:\n print(-1)\nelse:\n while True:\n if check % K == 0:\n print(count)\n break\n else:\n count += 1\n check = check * 10 + 7\n","fail":"K = int(input())\ncount = 1\ncheck = 7\n\nif K % 2 == 0 or K % 5 == 0:\n print(-1)\nelse:\n while True:\n if check % K == 0:\n print(count)\n break\n else:\n count += 1\n check = (check * 10 + 7) % K\n","change":"replace","i1":13,"i2":14,"j1":13,"j2":14,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02596","language":"Python","original_status":"Time Limit Exceeded","pass":"k = int(input())\nk_str = str(k)\n\nif k % 2 == 0 or k % 5 == 0:\n print(-1)\nelse:\n seven = 7\n seven_str = \"7\"\n while int(seven_str) % k != 0:\n seven_str += \"7\"\n print(len(seven_str))\n","fail":"k = int(input())\ncount = 1\nx = 7\nwhile x % k != 0 and count <= k:\n count += 1\n x = (10 * x + 7) % k\n\nif x % k == 0:\n print(count)\nelse:\n print(-1)\n","change":"replace","i1":1,"i2":11,"j1":1,"j2":11,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02596","language":"Python","original_status":"Time Limit Exceeded","pass":"x = int(input())\nif x % 2 == 0:\n print(-1)\n exit()\ns = 7\ncnt = 1\nwhile True:\n if s % x == 0:\n print(cnt)\n break\n s = s * 10 + 7\n cnt += 1\n","fail":"x = int(input())\ncnt = 1\nmod = 7\n\nfor i in range(x):\n if mod % x == 0:\n print(cnt)\n exit()\n mod = (10 * mod + 7) % x\n cnt += 1\nprint(-1)\n","change":"replace","i1":1,"i2":12,"j1":1,"j2":11,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02596","language":"Python","original_status":"Time Limit Exceeded","pass":"k = int(input())\n\nif k % 2 == 0 or k % 5 == 0:\n print(-1)\nelse:\n i = 7\n while True:\n if i % k == 0:\n print(len(str(i)))\n break\n i *= 10\n i += 7\n","fail":"from itertools import count\n\nk = int(input())\nif k % 2 == 0 or k % 5 == 0:\n print(-1)\nelse:\n m = 0\n for i in count(0):\n m += pow(10, i, k) * 7\n m %= k\n if m == 0:\n print(i + 1)\n break\n","change":"replace","i1":0,"i2":12,"j1":0,"j2":13,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02596","language":"Python","original_status":"Time Limit Exceeded","pass":"K = int(input())\n\nif K % 2 == 0 or K % 5 == 0:\n print(-1)\n exit()\nnow = 0\ncount = 0\nwhile True:\n now = now * 10 + 7\n count += 1\n if now % K == 0:\n print(count)\n exit()\n","fail":"K = int(input())\n\nif K % 2 == 0 or K % 5 == 0:\n print(-1)\n exit()\nnow = 0\ncount = 0\nwhile True:\n now = (now * 10 + 7) % K\n count += 1\n if now % K == 0:\n print(count)\n exit()\n","change":"replace","i1":8,"i2":9,"j1":8,"j2":9,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02596","language":"Python","original_status":"Time Limit Exceeded","pass":"K = int(input())\nif K % 2 == 0:\n print(-1)\nelse:\n mod, modt, ans = 7 % K, 7 % K, 1\n while mod != 0:\n modt = (modt * (10 % K)) % K\n mod, ans = (mod + modt) % K, ans + 1\n print(ans)\n","fail":"K = int(input())\nif K % 2 == 0 or K % 5 == 0:\n print(-1)\nelse:\n mod, modt, ans = 7 % K, 7 % K, 1\n while mod != 0:\n modt = (modt * (10 % K)) % K\n mod, ans = (mod + modt) % K, ans + 1\n print(ans)\n","change":"replace","i1":1,"i2":2,"j1":1,"j2":2,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02596","language":"Python","original_status":"Time Limit Exceeded","pass":"K = int(input())\nif K % 2 == 0:\n print(-1)\n exit()\nelse:\n n = 7\n n_before = 7\n count = 1\n while n % K != 0:\n n = n % K\n count += 1\n n_before = 10 * n_before % K\n n = n + n_before\nprint(count)\n","fail":"K = int(input())\nif K % 2 == 0 or K % 5 == 0:\n print(-1)\n exit()\nelse:\n n = 7\n n_before = 7\n count = 0\n while True:\n count += 1\n n = n % K\n if n == 0:\n print(count)\n exit()\n else:\n n_before = 10 * n_before % K\n n = n + n_before\nprint(count)\n","change":"replace","i1":1,"i2":13,"j1":1,"j2":17,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02596","language":"Python","original_status":"Runtime Error","pass":"k = int(input())\nif k % 7 == 0:\n L = 9 * k \/ 7\nelse:\n L = 9 * k\nout = -1\ns = 10\nfor i in range(L):\n if s % L == 1:\n out = i + 1\n break\n else:\n s = (s % L) * 10\nprint(out)\n","fail":"k = int(input())\nif k % 7 == 0:\n L = 9 * k \/\/ 7\nelse:\n L = 9 * k\nout = -1\ns = 10\nfor i in range(L):\n if s % L == 1:\n out = i + 1\n break\n else:\n s = (s % L) * 10\nprint(out)\n","change":"replace","i1":2,"i2":3,"j1":2,"j2":3,"error":"0","stderr":null,"stdout":"4\n"} {"problem_id":"p02597","language":"Python","original_status":"Runtime Error","pass":"import sys\n\nN = int(sys.stdin.readline().rstrip())\nTMP_C = [x for x in input()]\nC = []\nfor i in range(N - 1, -1, -1):\n C.append(TMP_C[i])\n# print(C)\n\ncnt = 0\nfor i in range(N - 1, -1, -1):\n if C[i] == \"W\":\n j = C.index(\"R\")\n if j < i:\n C[i], C[j] = C[j], C[i]\n cnt += 1\n\nprint(cnt)\n","fail":"import sys\nfrom collections import Counter\n\nN = int(sys.stdin.readline().rstrip())\nS = [x for x in input()]\n\nC = Counter(S)\n\nW = C[\"W\"]\nR = C[\"R\"]\n\nSS = S[:R]\nCC = Counter(SS)\nRR = CC[\"W\"]\n\nprint(RR)\n","change":"replace","i1":1,"i2":18,"j1":1,"j2":16,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p02597","language":"Python","original_status":"Runtime Error","pass":"n = int(input())\nc = input()\nlists = list(c)\ncnt = 0\nwhile 1:\n if lists[cnt] == \"W\":\n cnt += 1\n else:\n break\nnumber = 0\nfor i in range(len(lists) - cnt):\n if lists[i + cnt] == \"W\":\n number += 1\nprint(number)\n","fail":"n = int(input())\nc = input()\nlists = list(c)\ncnt = 0\n\nfor i in range(len(lists)):\n if lists[i] == \"R\":\n cnt += 1\nchange = 0\nfor i in range(cnt):\n if lists[i] == \"W\":\n change += 1\nprint(change)\n","change":"replace","i1":4,"i2":14,"j1":4,"j2":13,"error":"WA","stderr":null,"stdout":0.0} {"problem_id":"p02598","language":"Python","original_status":"Runtime Error","pass":"def is_good(mid, key):\n res = 0\n for a in A:\n res += (a + mid - 1) \/\/ mid - 1\n return res <= key\n\n\ndef binary_search(bad, good, key):\n while good - bad > 1:\n mid = (bad + good) \/\/ 2\n if is_good(mid, key):\n good = mid\n else:\n bad = mid\n return good\n\n\nN, K, *A = map(int, open(0).read().split())\nprint(binary_search(-1, 1_000_000_000, K))\n","fail":"def is_good(mid, key):\n res = 0\n for a in A:\n res += (a + mid - 1) \/\/ mid\n return res - N <= key\n\n\ndef binary_search(bad, good, key):\n while good - bad > 1:\n mid = (bad + good) \/\/ 2\n if is_good(mid, key):\n good = mid\n else:\n bad = mid\n return good\n\n\nN, K, *A = map(int, open(0).read().split())\nprint(binary_search(0, 1_000_000_000, K))\n","change":"replace","i1":3,"i2":19,"j1":3,"j2":19,"error":"0","stderr":null,"stdout":"4\n"} {"problem_id":"p02598","language":"Python","original_status":"Runtime Error","pass":"from math import ceil\nfrom heapq import heapify, heappop, heappush\n\nN, K, *A = map(int, open(0).read().split())\n\nt = sum(A) \/ K\na = [None] * len(A)\nfor i in A:\n k = max(ceil(i \/ t), 1)\n a.append((-i \/ k, i, k))\n\nheapify(a)\nfor _ in range(K):\n i, j, k = heappop(a)\n k += 1\n i = -(j \/ k)\n heappush(a, (i, j, k))\nprint(ceil(heappop(a)[0] * -1))\n","fail":"from math import ceil\n\nN, K, *A = map(int, open(0).read().split())\n\n\ndef is_ok(n):\n t = 0\n for a in A:\n if a <= n:\n continue\n t += ceil(a \/ n) - 1\n return t <= K\n\n\nok = 1000000000\nng = 0.0000000001\nwhile abs(ng - ok) > 1:\n m = (ok + ng) \/\/ 2\n if is_ok(m):\n ok = m\n else:\n ng = m\n\nprint(ceil(ok))\n","change":"replace","i1":1,"i2":18,"j1":1,"j2":24,"error":"TypeError: '<' not supported between instances of 'NoneType' and 'tuple'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02598\/Python\/s856589706.py\", line 12, in \n heapify(a)\nTypeError: '<' not supported between instances of 'NoneType' and 'tuple'\n","stdout":null} {"problem_id":"p02598","language":"Python","original_status":"Runtime Error","pass":"n, k = map(int, input().split())\nA = list(map(int, input().strip().split()))\n\nb = 0\ne = max(A)\nL = e \/\/ 2\nwhile e - b >= 1:\n m = sum(list(map(lambda x: x \/\/ L, A)))\n if m <= k:\n e = L\n L = (e + b) \/\/ 2\n else:\n b = L\n L = (e + b) \/\/ 2\nprint(e)\n","fail":"n, k = map(int, input().split())\nA = list(map(int, input().strip().split()))\n\nb = 0\ne = max(A)\nL = e \/\/ 2\nwhile e - b > 1:\n L = (e + b) \/\/ 2\n m = sum(list(map(lambda x: (x - 1) \/\/ L, A)))\n if m <= k:\n e = L\n else:\n b = L\nprint(e)\n","change":"replace","i1":6,"i2":14,"j1":6,"j2":13,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02598","language":"Python","original_status":"Runtime Error","pass":"# ABC174 E\n\nn, k = map(int, input().split())\na_l = [int(x) for x in input().split()]\n\nleft = 0\nright = max(a_l)\n\n\ndef cut(len):\n ret = 0\n for i in range(n):\n if a_l[i] % len == 0:\n ret += a_l[i] \/\/ len - 1\n else:\n ret += a_l[i] \/\/ len\n return ret\n\n\nwhile (right - left) > 1:\n _q = max((left + right) \/\/ 2, 1)\n _ret = cut(_q)\n if k >= _ret:\n right = _q\n else:\n left = _q\n\n_l = cut(left)\n_r = cut(right)\n\nif _l <= k:\n print(left)\nelse:\n print(right)\n","fail":"# ABC174 E\n\nn, k = map(int, input().split())\na_l = [int(x) for x in input().split()]\n\nleft = 0\nright = max(a_l)\n\n\ndef cut(len):\n ret = 0\n for i in range(n):\n if a_l[i] % len == 0:\n ret += a_l[i] \/\/ len - 1\n else:\n ret += a_l[i] \/\/ len\n return ret\n\n\nwhile (right - left) > 1:\n _q = (left + right) \/\/ 2\n _ret = cut(_q)\n if k >= _ret:\n right = _q\n else:\n left = _q\n\nprint(right)\n","change":"replace","i1":20,"i2":34,"j1":20,"j2":28,"error":"0","stderr":null,"stdout":"4\n"} {"problem_id":"p02599","language":"Python","original_status":"Time Limit Exceeded","pass":"class BIT:\n # 1-indexed\n def __init__(self, n):\n self.size = n + 1\n self.bit = [0] * self.size\n\n def add(self, i, x):\n \"\"\"Add x to a[i].\"\"\"\n while i < self.size:\n self.bit[i] += x\n i += i & -i\n\n def sumup(self, i):\n \"\"\"Sum a[1]~a[i].\"\"\"\n res = 0\n while i > 0:\n res += self.bit[i]\n i -= i & -i\n return res\n\n def query(self, i, j):\n \"\"\"Sum a[i]~a[j].\"\"\"\n return self.sumup(j) - self.sumup(i - 1)\n\n\nN, Q = map(int, input().split())\nC = list(map(int, input().split()))\nX = [list(map(int, input().split())) for _ in range(Q)]\n\nans = [0] * Q\nlast_appeared = [0] * (N + 1)\nbit = BIT(N + 1)\nrm = 0\nfor i, (l, r) in sorted(enumerate(X), key=lambda x: x[1][1]):\n for j in range(rm + 1, r + 1):\n if last_appeared[C[j - 1]] > 0:\n bit.add(last_appeared[C[j - 1]], -1)\n last_appeared[C[j - 1]] = j\n bit.add(j, 1)\n\n rm = r\n ans[i] = bit.query(l, r)\n\nprint(*ans, sep=\"\\\\n\")\n","fail":"class BIT:\n # 1-indexed\n def __init__(self, n):\n self.size = n + 1\n self.bit = [0] * self.size\n\n def add(self, i, x):\n # Add x to a[i]\n while i < self.size:\n self.bit[i] += x\n i += i & -i\n\n def sumup(self, i):\n # Sum a[1]~a[i]\n res = 0\n while i > 0:\n res += self.bit[i]\n i -= i & -i\n return res\n\n def query(self, i, j):\n # Sum a[i]~a[j]\n return self.sumup(j) - self.sumup(i - 1)\n\n\nN, Q = map(int, input().split())\nC = list(map(int, input().split()))\n\nX = []\nfor i in range(Q):\n l, r = map(int, input().split())\n X.append((i, l, r))\nX.sort(key=lambda x: x[2])\n\nans = [0] * Q\nbit = BIT(N + 1)\nlast = [0] * (N + 1)\nk = 0\nfor i, l, r in X:\n for j in range(k + 1, r + 1):\n if last[C[j - 1]] > 0:\n bit.add(last[C[j - 1]], -1)\n\n bit.add(j, 1)\n last[C[j - 1]] = j\n\n k = r\n ans[i] = bit.query(l, r)\n\nprint(*ans, sep=\"\\\\n\")\n","change":"replace","i1":7,"i2":41,"j1":7,"j2":47,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02599","language":"Python","original_status":"Time Limit Exceeded","pass":"# from sys import stdin\n# input = stdin.readline\n\n\nclass Bit:\n def __init__(self, n):\n self.size = n\n self.tree = [0] * (n + 1)\n\n def sum(self, i):\n s = 0\n while i > 0:\n s += self.tree[i]\n i -= i & -i\n return s\n\n def add(self, i, x):\n while i <= self.size:\n self.tree[i] += x\n i += i & -i\n\n\nN, Q = map(int, input().split())\nc = list(map(int, input().split()))\n\nlr = []\nfor i in range(Q):\n l, r = map(int, input().split())\n lr.append([l, r, i])\n\nlr.sort(key=lambda x: x[1])\n# print(\"lr\", lr)\nrightest = [-1] * (N + 1)\ncurrent_q = 0\nbit = Bit(N)\nans = [0] * Q\n\nfor i in range(N):\n if rightest[c[i]] != -1:\n bit.add(rightest[c[i]] + 1, -1)\n rightest[c[i]] = i\n bit.add(i + 1, 1)\n # print(bit.tree)\n\n while current_q < Q and lr[current_q][1] == i + 1:\n ans[lr[current_q][2]] = bit.sum(lr[current_q][1]) - bit.sum(lr[current_q][0] - 1)\n current_q += 1\n\nfor i in range(Q):\n print(ans[i])\n","fail":"from sys import stdin\n\ninput = stdin.readline\n\n\nclass Bit:\n def __init__(self, n):\n self.size = n\n self.tree = [0] * (n + 1)\n\n def sum(self, i):\n s = 0\n while i > 0:\n s += self.tree[i]\n i -= i & -i\n return s\n\n def add(self, i, x):\n while i <= self.size:\n self.tree[i] += x\n i += i & -i\n\n\nN, Q = map(int, input().split())\nc = list(map(int, input().split()))\n\nlr = []\nfor i in range(Q):\n l, r = map(int, input().split())\n lr.append([l, r, i])\n\nlr.sort(key=lambda x: x[1])\n# print(\"lr\", lr)\nrightest = [-1] * (N + 1)\ncurrent_q = 0\nbit = Bit(N)\nans = [0] * Q\n\nfor i in range(N):\n if rightest[c[i]] != -1:\n bit.add(rightest[c[i]] + 1, -1)\n rightest[c[i]] = i\n bit.add(i + 1, 1)\n # print(bit.tree)\n\n while current_q < Q and lr[current_q][1] == i + 1:\n ans[lr[current_q][2]] = bit.sum(lr[current_q][1]) - bit.sum(lr[current_q][0] - 1)\n current_q += 1\n\nfor i in range(Q):\n print(ans[i])\n","change":"replace","i1":0,"i2":2,"j1":0,"j2":3,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02599","language":"Python","original_status":"Time Limit Exceeded","pass":"import sys\n\ninput = sys.stdin.buffer.readline\nn, q = map(int, input().split())\nC = list(map(int, input().split()))\n\n\ndef popcnt(n):\n c = (n & 0x5555555555555555) + ((n >> 1) & 0x5555555555555555)\n c = (c & 0x3333333333333333) + ((c >> 2) & 0x3333333333333333)\n c = (c & 0x0F0F0F0F0F0F0F0F) + ((c >> 4) & 0x0F0F0F0F0F0F0F0F)\n c = (c & 0x00FF00FF00FF00FF) + ((c >> 8) & 0x00FF00FF00FF00FF)\n c = (c & 0x0000FFFF0000FFFF) + ((c >> 16) & 0x0000FFFF0000FFFF)\n c = (c & 0x00000000FFFFFFFF) + ((c >> 32) & 0x00000000FFFFFFFF)\n return c\n\n\nnum = 2 ** ((n - 1).bit_length())\nSEG = [0] * (2 * num)\n\n\ndef func(a, b):\n return a | b\n\n\nfor idx, val in enumerate(C):\n idx += num\n SEG[idx] = 1 << (val - 1)\n while idx > 0:\n idx \/\/= 2\n SEG[idx] = func(SEG[2 * idx], SEG[2 * idx + 1])\n\n\ndef query(left, right):\n resleft = 0\n resright = 0\n left += num\n right += num\n while right - left > 0:\n if left % 2 == 1:\n resleft = func(resleft, SEG[left])\n left += 1\n if right % 2 == 1:\n right -= 1\n resright = func(resright, SEG[right])\n left \/\/= 2\n right \/\/= 2\n return func(resleft, resright)\n\n\nfor _ in range(q):\n l, r = map(int, input().split())\n temp = query(l - 1, r)\n print(popcnt(temp))\n","fail":"import sys\n\ninput = sys.stdin.buffer.readline\nn, q = map(int, input().split())\nC = list(map(int, input().split()))\nLR = []\nfor i in range(q):\n l, r = map(int, input().split())\n LR.append((l, r, i))\nLR.sort(key=lambda x: x[1])\n\n\nBIT = [0] * (n + 1)\n\n\ndef update(idx, val):\n while idx <= n:\n BIT[idx] += val\n idx += idx & (-idx)\n\n\ndef query(idx):\n res = 0\n while idx > 0:\n res += BIT[idx]\n idx -= idx & (-idx)\n return res\n\n\npos = [-1] * (n + 1)\n\n\ndef func(idx):\n temp = C[idx]\n if pos[temp] == -1:\n pos[temp] = idx + 1\n update(idx + 1, 1)\n else:\n pre = pos[temp]\n pos[temp] = idx + 1\n update(pre, -1)\n update(idx + 1, 1)\n\n\nans = [0] * (q)\nidx = 0\nfor i in range(q):\n l, r, ans_num = LR[i]\n # l,r\u306f0-index\u306b\u623b\u3059\n l -= 1\n r -= 1\n while idx < r + 1: # r\u306b\u306a\u308b\u307e\u3067\u5897\u3084\u3059\n if idx < n: # n\u8d85\u3048\u306a\u3044\u3088\u3046\u306b\u6ce8\u610f\n func(idx)\n idx += 1\n else:\n break\n res = 0\n res += query(r + 1)\n if l > 0:\n res -= query(l)\n ans[ans_num] = res\n\nprint(*ans, sep=\"\\\\n\")\n","change":"replace","i1":5,"i2":54,"j1":5,"j2":64,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02599","language":"Python","original_status":"Time Limit Exceeded","pass":"import sys\n\ninput = sys.stdin.buffer.readline\nn, q = map(int, input().split())\nC = list(map(int, input().split()))\n\n\ndef popcnt(n):\n c = (n & 0x5555555555555555) + ((n >> 1) & 0x5555555555555555)\n c = (c & 0x3333333333333333) + ((c >> 2) & 0x3333333333333333)\n c = (c & 0x0F0F0F0F0F0F0F0F) + ((c >> 4) & 0x0F0F0F0F0F0F0F0F)\n c = (c & 0x00FF00FF00FF00FF) + ((c >> 8) & 0x00FF00FF00FF00FF)\n c = (c & 0x0000FFFF0000FFFF) + ((c >> 16) & 0x0000FFFF0000FFFF)\n c = (c & 0x00000000FFFFFFFF) + ((c >> 32) & 0x00000000FFFFFFFF)\n return c\n\n\nnum = 2 ** ((n - 1).bit_length())\nSEG = [0] * (2 * num)\n\n\ndef func(a, b):\n return a | b\n\n\nfor idx, val in enumerate(C):\n idx += num\n SEG[idx] = 1 << (val - 1)\nfor idx in range(num - 1, 0, -1):\n while idx > 0:\n SEG[idx] = func(SEG[2 * idx], SEG[2 * idx + 1])\n idx \/\/= 2\n\n\ndef query(left, right):\n resleft = 0\n resright = 0\n left += num\n right += num\n while right - left > 0:\n if left % 2 == 1:\n resleft = func(resleft, SEG[left])\n left += 1\n if right % 2 == 1:\n right -= 1\n resright = func(resright, SEG[right])\n left \/\/= 2\n right \/\/= 2\n return func(resleft, resright)\n\n\nfor _ in range(q):\n l, r = map(int, input().split())\n temp = query(l - 1, r)\n print(popcnt(temp))\n","fail":"# cattuper's solution\nimport sys\n\ninput = sys.stdin.buffer.readline\nn, q = map(int, input().split())\nc = list(map(int, input().split()))\nl = [0] * q\nr = [0] * q\n\nqueries = [[] for _ in range(n)]\nrights = [[] for _ in range(n)]\nfor i in range(q):\n l[i], r[i] = map(int, input().split())\n l[i] -= 1\n queries[l[i]].append(i)\n\nlast_app = [-1] * (n + 1)\nfor i in range(n):\n if last_app[c[i]] != -1:\n last = last_app[c[i]]\n rights[last].append(i)\n last_app[c[i]] = i\n\n\nans = [0] * q\n\nseg = [0] * (1 << 20)\n\n\ndef add(x):\n x += 1 << 19\n while x:\n seg[x] += 1\n x = x \/\/ 2\n\n\ndef sum_of(l, r):\n l += 1 << 19\n r += 1 << 19\n ans = 0\n while l < r:\n if l % 2 == 1:\n ans += seg[l]\n l += 1\n if r % 2 == 1:\n ans += seg[r - 1]\n r -= 1\n l \/\/= 2\n r \/\/= 2\n return ans\n\n\nfor i in range(n - 1, -1, -1):\n for right in rights[i]:\n add(right)\n for q_ind in queries[i]:\n left = l[q_ind]\n right = r[q_ind]\n ans[q_ind] = (right - left) - sum_of(left, right)\n\nfor i in range(q):\n print(ans[i])\n","change":"replace","i1":0,"i2":55,"j1":0,"j2":62,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02600","language":"Python","original_status":"Runtime Error","pass":"X = int(input())\n\nif 400 <= X < 600:\n result = 8\nelif X < 800:\n result = 7\nelif X < 1000:\n result = 6\nelif X < 1200:\n result = 5\nelif X < 1400:\n result = 4\nelif X < 1600:\n result = 3\nelif X < 1800:\n result = 2\nelif X < 200:\n result = 1\n\nprint(result)\n","fail":"X = int(input())\n\nif 400 <= X < 600:\n result = 8\nelif X < 800:\n result = 7\nelif X < 1000:\n result = 6\nelif X < 1200:\n result = 5\nelif X < 1400:\n result = 4\nelif X < 1600:\n result = 3\nelif X < 1800:\n result = 2\nelif X < 2000:\n result = 1\n\nprint(result)\n","change":"replace","i1":16,"i2":17,"j1":16,"j2":17,"error":"0","stderr":null,"stdout":7.0} {"problem_id":"p02601","language":"Python","original_status":"Time Limit Exceeded","pass":"A, B, C = map(int, input().split())\nK = int(input())\n\ni = 0\nwhile i < K:\n if B <= A:\n B *= 2\n i += 1\n else:\n if C <= B:\n C *= 2\n i += 1\n\nif A < B < C:\n print(\"Yes\")\nelse:\n print(\"No\")\n","fail":"A, B, C = map(int, input().split())\nK = int(input())\n\nfor i in range(K):\n if B <= A:\n B *= 2\n else:\n if C <= B:\n C *= 2\n\nif A < B < C:\n print(\"Yes\")\nelse:\n print(\"No\")\n","change":"replace","i1":3,"i2":12,"j1":3,"j2":9,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02601","language":"Python","original_status":"Time Limit Exceeded","pass":"A, B, C = map(int, input().split())\nK = int(input())\n\nwhile K > 0:\n if A >= B:\n B *= 2\n K -= 1\n elif B >= C:\n C *= 2\n K -= 1\nif C > B and B > A:\n print(\"Yes\")\nelse:\n print(\"No\")\n","fail":"A, B, C = map(int, input().split())\nK = int(input())\n\nwhile K > 0:\n if A >= B:\n B *= 2\n K -= 1\n elif B >= C:\n C *= 2\n K -= 1\n if C > B and B > A:\n break\nif C > B and B > A:\n print(\"Yes\")\nelse:\n print(\"No\")\n","change":"insert","i1":10,"i2":10,"j1":10,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02602","language":"Python","original_status":"Time Limit Exceeded","pass":"import itertools\nimport operator\n\nN, K = [int(x) for x in input().split(\" \")]\nA = [int(x) for x in input().split(\" \")]\n\npro = [1] + list(itertools.accumulate(A, func=operator.mul))\n\nfor i in range(K + 1, N + 1):\n if pro[i] * pro[i - K - 1] > pro[i - K] * (pro[i - 1]):\n print(\"Yes\")\n else:\n print(\"No\")\n","fail":"N, K = [int(x) for x in input().split(\" \")]\nA = [int(x) for x in input().split(\" \")]\n\n\nfor i in range(K, N):\n if A[i - K] < A[i]:\n print(\"Yes\")\n else:\n print(\"No\")\n","change":"replace","i1":0,"i2":10,"j1":0,"j2":6,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02602","language":"Python","original_status":"Time Limit Exceeded","pass":"# -*- coding: utf-8 -*-\n\n\n# \u5165\u529b\u3092\u6574\u6570\u306b\u5909\u63db\u3057\u3066\u53d7\u3051\u53d6\u308b\ndef input_int():\n return int(input())\n\n\n# \u30de\u30a4\u30ca\u30b91\u3057\u305f\u5024\u3092\u8fd4\u5374\ndef int1(x):\n return int(x) - 1\n\n\n# \u534a\u89d2\u30b9\u30da\u30fc\u30b9\u533a\u5207\u308a\u5165\u529b\u3092Int\u306b\u5909\u63db\u3057\u3066Map\u3067\u53d7\u3051\u53d6\u308b\ndef input_to_int_map():\n return map(int, input().split())\n\n\n# \u534a\u89d2\u30b9\u30da\u30fc\u30b9\u533a\u5207\u308a\u5165\u529b\u3092Int\u306b\u5909\u63db\u3057\u3066\u53d7\u3051\u53d6\u308b\ndef input_to_int_tuple():\n return tuple(map(int, input().split()))\n\n\n# \u534a\u89d2\u30b9\u30da\u30fc\u30b9\u533a\u5207\u308a\u5165\u529b\u3092Int\u306b\u5909\u63db\u3057\u3066\u30de\u30a4\u30ca\u30b91\u3057\u305f\u5024\u3092\u53d7\u3051\u53d6\u308b\ndef input_to_int_tuple_minus1():\n return tuple(map(int1, input().split()))\n\n\ndef main():\n n, k = input_to_int_map()\n a_array = input_to_int_tuple()\n\n temp = [1]\n val = 1\n for a in a_array:\n val *= a\n temp.append(val)\n\n pre_k_val = temp[k + 1 - 1]\n ini_pre_k_val = temp[k + 1 - 1 - k]\n pre_k_val \/= ini_pre_k_val\n for i in range(k + 1, n + 1):\n k_val = temp[i]\n ini_k_val = temp[i - k]\n k_val \/= ini_k_val\n\n if pre_k_val < k_val:\n print(\"Yes\")\n else:\n print(\"No\")\n\n pre_k_val = k_val\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"# -*- coding: utf-8 -*-\n\n\n# \u5165\u529b\u3092\u6574\u6570\u306b\u5909\u63db\u3057\u3066\u53d7\u3051\u53d6\u308b\ndef input_int():\n return int(input())\n\n\n# \u30de\u30a4\u30ca\u30b91\u3057\u305f\u5024\u3092\u8fd4\u5374\ndef int1(x):\n return int(x) - 1\n\n\n# \u534a\u89d2\u30b9\u30da\u30fc\u30b9\u533a\u5207\u308a\u5165\u529b\u3092Int\u306b\u5909\u63db\u3057\u3066Map\u3067\u53d7\u3051\u53d6\u308b\ndef input_to_int_map():\n return map(int, input().split())\n\n\n# \u534a\u89d2\u30b9\u30da\u30fc\u30b9\u533a\u5207\u308a\u5165\u529b\u3092Int\u306b\u5909\u63db\u3057\u3066\u53d7\u3051\u53d6\u308b\ndef input_to_int_tuple():\n return tuple(map(int, input().split()))\n\n\n# \u534a\u89d2\u30b9\u30da\u30fc\u30b9\u533a\u5207\u308a\u5165\u529b\u3092Int\u306b\u5909\u63db\u3057\u3066\u30de\u30a4\u30ca\u30b91\u3057\u305f\u5024\u3092\u53d7\u3051\u53d6\u308b\ndef input_to_int_tuple_minus1():\n return tuple(map(int1, input().split()))\n\n\ndef main():\n n, k = input_to_int_map()\n a_array = input_to_int_tuple()\n\n for k_val, pre_k_val in zip(a_array[k:], a_array[k - k :]):\n if k_val > pre_k_val:\n print(\"Yes\")\n else:\n print(\"No\")\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":32,"i2":53,"j1":32,"j2":38,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02602","language":"Python","original_status":"Time Limit Exceeded","pass":"n, k = map(int, input().split(\" \"))\na = list(map(int, input().split(\" \")))\n\nscore: list = []\nfor i in range(k - 1, n):\n tmp_score = 1\n for j in range(k):\n tmp_score *= a[i - j]\n score.append(tmp_score)\n\nfor i in range(len(score) - 1):\n # print(score[i], score[i + 1])\n if score[i + 1] > score[i]:\n print(\"Yes\")\n else:\n print(\"No\")\n","fail":"n, k = map(int, input().split(\" \"))\na = list(map(int, input().split(\" \")))\n\nfor i in range(k, n):\n if a[i - k] < a[i]:\n print(\"Yes\")\n else:\n print(\"No\")\n","change":"replace","i1":3,"i2":13,"j1":3,"j2":5,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02602","language":"Python","original_status":"Time Limit Exceeded","pass":"n, k = map(int, input().split())\na = list(map(int, input().split()))\n\nresult = 1\n\nfor i in range(k):\n result *= a[k - i]\n\nfor i in range(k, n):\n before_result = result\n result \/= a[i - k]\n result *= a[i]\n if before_result < result:\n print(\"Yes\")\n else:\n print(\"No\")\n","fail":"n, k = map(int, input().split())\na = list(map(int, input().split()))\n\nfor i in range(k, n):\n if a[i - k] < a[i]:\n print(\"Yes\")\n else:\n print(\"No\")\n","change":"replace","i1":3,"i2":13,"j1":3,"j2":5,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02602","language":"Python","original_status":"Time Limit Exceeded","pass":"n, k = list(map(int, input().split(\" \")))\n\na_lst = list(map(int, input().split(\" \")))\n\n# previous\u306e\u5024\u3092\u53d6\u3063\u3066\u304a\u3044\u3066\u771f\u306b\u639b\u3051\u7b97\u3057\u305f\u8a55\u5b9a\u304c\u9ad8\u304b\u3063\u305f\u304b\u3092\u5224\u5b9a\nprevious = 1\nfor i in range(k):\n previous *= a_lst[i]\nfor i in range(k, n):\n now = previous \/ a_lst[i - k] * a_lst[i]\n if now > previous:\n print(\"Yes\")\n else:\n print(\"No\")\n previous = now\n","fail":"n, k = list(map(int, input().split(\" \")))\n\na_lst = list(map(int, input().split(\" \")))\n\nfor i in range(k, n):\n if a_lst[i] > a_lst[i - k]:\n print(\"Yes\")\n else:\n print(\"No\")\n","change":"replace","i1":4,"i2":15,"j1":4,"j2":9,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02602","language":"Python","original_status":"Time Limit Exceeded","pass":"def solve():\n n, k = map(int, input().split())\n A = list(map(int, input().split()))\n tmp = 1\n for i in range(k):\n tmp *= A[i]\n\n for j in range(k + 1, n + 1):\n x = tmp * 1\n tmp \/\/= A[j - k - 1]\n tmp *= A[j - 1]\n if tmp > x:\n print(\"Yes\")\n else:\n print(\"No\")\n\n\nsolve()\n","fail":"def solve():\n n, k = map(int, input().split())\n A = list(map(int, input().split()))\n\n for j in range(k + 1, n + 1):\n if A[j - k - 1] < A[j - 1]:\n print(\"Yes\")\n else:\n print(\"No\")\n\n\nsolve()\n","change":"replace","i1":3,"i2":12,"j1":3,"j2":6,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02602","language":"Python","original_status":"Time Limit Exceeded","pass":"n, k = map(int, input().split())\na = list(map(int, input().split()))\nscore = 1\nfor i in range(k):\n score *= a[i]\ntop = 0\nfor i in range(k, n):\n pre_score = score\n score \/= a[top]\n top += 1\n score *= a[i]\n if score > pre_score:\n print(\"Yes\")\n else:\n print(\"No\")\n","fail":"n, k = map(int, input().split())\na = list(map(int, input().split()))\nscore = sum(a[:k])\ntop = 0\nfor i in range(k, n):\n if a[i] > a[top]:\n print(\"Yes\")\n else:\n print(\"No\")\n top += 1\n","change":"replace","i1":2,"i2":15,"j1":2,"j2":10,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02602","language":"Python","original_status":"Time Limit Exceeded","pass":"n, k = map(int, input().split())\na = list(map(int, input().split()))\nma = min(a)\n\na = list(map(lambda x: x - ma + 1, a))\n\nbefscore = 1\nscore = 1\nf = True\nfor i in range(n):\n score = score * a[i]\n\n if i >= k:\n score = int(score \/ a[i - k])\n if befscore >= score:\n print(\"No\")\n else:\n print(\"Yes\")\n\n befscore = score\n","fail":"n, k = map(int, input().split())\na = list(map(int, input().split()))\nma = min(a)\n\na = list(map(lambda x: x - ma, a))\n\nbefscore = 1\nscore = 1\nf = True\nfor i in range(n):\n score = score + a[i]\n\n if i >= k:\n score = int(score - a[i - k])\n if befscore >= score:\n print(\"No\")\n else:\n print(\"Yes\")\n\n befscore = score\n","change":"replace","i1":4,"i2":14,"j1":4,"j2":14,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02602","language":"Python","original_status":"Runtime Error","pass":"import numpy as np\n\nn, k = map(int, input().split())\na = list(map(int, input().split()))\n\nres = list()\n\nres.append(np.prod(a[:k]))\ntmp = res[0]\n\nfor i in range(k, n):\n tmp \/= a[i - k]\n tmp *= a[i]\n res.append(tmp)\n\nfor i in range(1, n - k + 1):\n if res[i - 1] < res[i]:\n print(\"Yes\")\n else:\n print(\"No\")\n","fail":"n, k = map(int, input().split())\na = list(map(int, input().split()))\n\nres = list()\n\nfor i in range(k, n):\n if a[i - k] < a[i]:\n res.append(\"Yes\")\n else:\n res.append(\"No\")\n\nfor r in res:\n print(r)\n","change":"replace","i1":0,"i2":20,"j1":0,"j2":13,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02602","language":"Python","original_status":"Time Limit Exceeded","pass":"n, k = map(int, input().split())\nA = list(map(int, input().split()))\nkeep = 1\n\nfor i in range(k):\n keep *= A[i]\n\n\nfor j in range(n - k):\n if A[k + j] > A[j]:\n print(\"Yes\")\n else:\n print(\"No\")\n keep = keep * A[k + j] \/ A[j]\n","fail":"n, k = map(int, input().split())\nA = list(map(int, input().split()))\n\nfor j in range(n - k):\n if A[k + j] > A[j]:\n print(\"Yes\")\n else:\n print(\"No\")\n","change":"replace","i1":2,"i2":14,"j1":2,"j2":8,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02602","language":"Python","original_status":"Time Limit Exceeded","pass":"N, K = map(int, input().split())\nA = list(map(int, input().split()))\n\nc = 1\nfor i in range(K):\n c *= A[i]\n\nC = c\nfor i in range(0, N - K):\n c \/\/= A[i]\n c *= A[K + i]\n\n if c > C:\n print(\"Yes\")\n else:\n print(\"No\")\n C = c\n","fail":"N, K = map(int, input().split())\nA = list(map(int, input().split()))\n\nfor i in range(N - K):\n if A[K + i] > A[i]:\n print(\"Yes\")\n else:\n print(\"No\")\n","change":"replace","i1":3,"i2":17,"j1":3,"j2":8,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02602","language":"Python","original_status":"Time Limit Exceeded","pass":"n, k = map(int, input().split())\na_list = list(map(int, input().split()))\nprev = 1\n\nfor i in range(n - k + 1):\n score = 1\n for j in range(k):\n score *= a_list[i + j]\n if i != 0:\n if prev < score:\n print(\"Yes\")\n else:\n print(\"No\")\n prev = score\n","fail":"n, k = map(int, input().split())\na_list = list(map(int, input().split()))\n\nfor i in range(n - k):\n if a_list[i] < a_list[i + k]:\n print(\"Yes\")\n else:\n print(\"No\")\n","change":"replace","i1":2,"i2":14,"j1":2,"j2":8,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02602","language":"Python","original_status":"Time Limit Exceeded","pass":"n, k = map(int, input().split())\na = list(map(int, input().split()))\nscore = 1\nfor j in range(k):\n score *= a[j]\n\nfor i in range(n - k):\n score2 = score \/ a[i] * a[k + i]\n if score2 > score:\n print(\"Yes\")\n else:\n print(\"No\")\n score = score2\n","fail":"n, k = map(int, input().split())\na = list(map(int, input().split()))\n\nfor i in range(n - k):\n if a[k + i] > a[i]:\n print(\"Yes\")\n else:\n print(\"No\")\n","change":"replace","i1":2,"i2":13,"j1":2,"j2":8,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02602","language":"Python","original_status":"Time Limit Exceeded","pass":"# vim: fileencoding=utf-8\n\n\ndef main():\n n, k = map(int, input().split())\n aList = list(map(int, input().split()))\n hyoukaList = []\n c = 1\n for i in aList:\n hyoukaList.append(i)\n b = hyoukaList[0]\n\n if c <= k:\n c += 1\n continue\n\n hyoukaList = hyoukaList[1:]\n if b < i:\n print(\"Yes\")\n else:\n print(\"No\")\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"# vim: fileencoding=utf-8\n\n\ndef main():\n n, k = map(int, input().split())\n aList = list(map(int, input().split()))\n hyoukaList = []\n c = 1\n for i in range(n):\n if i < k:\n continue\n b = aList[i - k]\n a = aList[i]\n\n if b < a:\n print(\"Yes\")\n else:\n print(\"No\")\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":8,"i2":18,"j1":8,"j2":15,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02602","language":"Python","original_status":"Runtime Error","pass":"from collections import deque\n\nn, k = map(int, input().split())\na = list(map(int, input().split()))\nqueue = deque()\nfor i in range(n):\n if i < k - 1:\n queue.append(a[i])\n elif i >= k:\n x = queue.popleft()\n if x < a[i]:\n print(\"Yes\")\n else:\n print(\"No\")\n queue.append(a[i])\n","fail":"from collections import deque\n\nn, k = map(int, input().split())\na = list(map(int, input().split()))\nqueue = deque()\nfor i in range(n):\n if i <= k - 1:\n queue.append(a[i])\n elif i >= k:\n x = queue.popleft()\n if x < a[i]:\n print(\"Yes\")\n else:\n print(\"No\")\n queue.append(a[i])\n","change":"replace","i1":6,"i2":7,"j1":6,"j2":7,"error":"0","stderr":null,"stdout":"Yes\nNo\n"} {"problem_id":"p02603","language":"Python","original_status":"Time Limit Exceeded","pass":"import threading\nimport sys\nimport functools\n\n\ndef main():\n N = int(input())\n A = [int(x) for x in input().split(\" \")]\n\n @functools.lru_cache(maxsize=None)\n def solve(stock: int, money: int, day: int, end_day: int) -> int:\n if end_day == day:\n return money\n\n current_price = A[day]\n\n money_buy = money - (money \/\/ current_price) * current_price\n stock_buy = (money \/\/ current_price) + stock\n\n money_sell = money + stock * current_price\n stock_sell = 0\n\n return max(\n solve(stock, money, day + 1, end_day),\n solve(stock_buy, money_buy, day + 1, end_day),\n solve(stock_sell, money_sell, day + 1, end_day),\n )\n\n print(solve(0, 1000, 0, N))\n\n\nif __name__ == \"__main__\":\n\n sys.setrecursionlimit(1024 * 1024 * 2)\n threading.stack_size(128 * 1024 * 1024 * 2)\n threading.Thread(target=main).start()\n","fail":"from typing import List\n\n\ndef solve(A: List[int], N: int) -> int:\n current_money = 1000\n for i in range(N - 1):\n stocks = 0\n\n if A[i] < A[i + 1]:\n stocks = current_money \/\/ A[i]\n current_money += (A[i + 1] - A[i]) * stocks\n return current_money\n\n\ndef main():\n N = int(input())\n A = [int(x) for x in input().split(\" \")]\n\n print(solve(A, N))\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":0,"i2":36,"j1":0,"j2":23,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02603","language":"Python","original_status":"Runtime Error","pass":"N = int(input())\nA = list(map(int, input().split()))\n\nmoney = 1000\nticket = 0\nfor i in range(N):\n # buy\n if A[i] < A[i + 1]:\n money -= (money \/\/ A[i]) * A[i]\n ticket += money \/\/ A[i]\n elif A[i] == A[i + 1]:\n pass\n # sell\n else:\n money += A[i] * ticket\n ticket = 0\n","fail":"N = int(input())\nA = list(map(int, input().split()))\n\nmoney = 1000\nticket = 0\nfor i in range(N - 1):\n # buy\n if A[i] < A[i + 1]:\n ticket += money \/\/ A[i]\n money -= (money \/\/ A[i]) * A[i]\n elif A[i] == A[i + 1]:\n pass\n # sell\n else:\n money += A[i] * ticket\n ticket = 0\n\nmoney += A[-1] * ticket\n\nprint(money)\n","change":"replace","i1":5,"i2":16,"j1":5,"j2":20,"error":"IndexError: list index out of range","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02603\/Python\/s130468405.py\", line 8, in \n if A[i] < A[i + 1]:\nIndexError: list index out of range\n","stdout":null} {"problem_id":"p02603","language":"Python","original_status":"Runtime Error","pass":"n = int(input())\na = list(map(int, input().split()))\n\nmoney = 1000\nstock = 0\nfor i in range(n):\n money += stock * a[i]\n stock = 0\n\n if a[i] < a[i + 1]:\n stock = money \/\/ a[i]\n money %= a[i]\n\nprint(money)\n","fail":"n = int(input())\na = list(map(int, input().split()))\n\nmoney = 1000\nstock = 0\nfor i in range(n):\n # \u58f2\u308b\n money += stock * a[i]\n stock = 0\n\n # \u8cb7\u3046\n if i != n - 1 and a[i] < a[i + 1]:\n stock = money \/\/ a[i]\n money %= a[i]\n\nprint(money)\n","change":"replace","i1":6,"i2":10,"j1":6,"j2":12,"error":"IndexError: list index out of range","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02603\/Python\/s929174190.py\", line 10, in \n if a[i] < a[i + 1]:\nIndexError: list index out of range\n","stdout":null} {"problem_id":"p02607","language":"Python","original_status":"Runtime Error","pass":"n = int(input())\na = list(map(int, input().split()))\nres = 0\nfor i in range(1, n + 1, 2):\n if a[i] % 2 != 0:\n res += 1\n\nprint(res)\n","fail":"n = int(input())\na = list(map(int, input().split()))\nres = 0\nfor i in range(0, n, 2):\n if a[i] % 2 != 0:\n res += 1\n\nprint(res)\n","change":"replace","i1":3,"i2":4,"j1":3,"j2":4,"error":"IndexError: list index out of range","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02607\/Python\/s671759343.py\", line 5, in \n if a[i] % 2 != 0:\nIndexError: list index out of range\n","stdout":null} {"problem_id":"p02608","language":"Python","original_status":"Time Limit Exceeded","pass":"import math\n\nN = int(input())\n\nfor n in range(1, N + 1):\n count = 0\n ub = int(math.sqrt(n))\n for x in range(1, ub + 1):\n for y in range(x, ub + 1):\n for z in range(y, ub + 1):\n if x * x + y * y + z * z + x * y + y * z + z * x == n:\n s = len(set([x, y, z]))\n if s == 1:\n count += 1\n elif s == 2:\n count += 3\n else:\n count += 6\n break\n print(count)\n","fail":"import math\n\nN = int(input())\n\nfor n in range(1, N + 1):\n count = 0\n ub = int(math.sqrt(n))\n for x in range(1, ub + 1):\n for y in range(x, ub + 1):\n r = 4 * n - 3 * x * x - 2 * x * y - 3 * y * y\n if r < 0:\n break\n z = (math.sqrt(r) - x - y) \/ 2\n if z - int(z) < 1e-9:\n z = int(z)\n elif z - int(z + 1) < 1e-9:\n z = int(z + 1)\n else:\n break\n\n if y > z or z > ub:\n break\n if abs(x * x + y * y + z * z + x * y + y * z + z * x - n) < 1e-9:\n # print(x, y, round(z), z)\n s = len(set([x, y, round(z)]))\n if s == 1:\n count += 1\n elif s == 2:\n count += 3\n else:\n count += 6\n\n print(count)\n","change":"replace","i1":9,"i2":19,"j1":9,"j2":32,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02608","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\nans = [0] * n\n\nfor i in range(1, n):\n for j in range(1, n):\n for k in range(1, n):\n fn = i * i + j * j + k * k + i * j + j * k + k * i\n if fn > n:\n break\n ans[fn - 1] += 1\n\nfor i in range(n):\n print(ans[i])\n","fail":"import math\n\nn = int(input())\nans = [0] * n\n\nfor i in range(1, int(math.sqrt(n))):\n for j in range(1, i + 1):\n for k in range(1, j + 1):\n fn = i * i + j * j + k * k + i * j + j * k + k * i\n if fn > n:\n break\n if i != j and j != k and k != i:\n ans[fn - 1] += 6\n elif i == j and j == k:\n ans[fn - 1] += 1\n else:\n ans[fn - 1] += 3\n\nfor i in range(n):\n print(ans[i])\n","change":"replace","i1":0,"i2":10,"j1":0,"j2":17,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02608","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\n\nfor i in range(1, n + 1):\n ans = 0\n for x in range(1, n + 1):\n if x**2 + x >= i:\n continue\n for y in range(1, n + 1):\n if x**2 + y**2 + x * y >= i:\n continue\n for z in range(1, n + 1):\n if z**2 >= i:\n continue\n\n if x**2 + y**2 + z**2 + x * y + y * z + z * x == i:\n ans += 1\n\n print(ans)\n","fail":"n = int(input())\n\nans = [0] * (n + 1)\nfor x in range(1, n + 1):\n if x**2 + x >= n:\n break\n for y in range(1, n + 1):\n if x**2 + y**2 + x * y + x + y >= n:\n break\n for z in range(1, n + 1):\n w = x**2 + y**2 + z**2 + x * y + y * z + z * x\n if w > n:\n break\n else:\n ans[w] += 1\n\nfor i in range(1, n + 1):\n print(ans[i])\n","change":"replace","i1":2,"i2":18,"j1":2,"j2":18,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02608","language":"Python","original_status":"Runtime Error","pass":"n = int(input())\nans = [0 for _ in range(1001)]\nfor i in range(1, 40):\n for j in range(1, 40):\n for k in range(1, 40):\n summ = i**2 + j**2 + k**2 + i * j + j * k + k * i\n if summ < 1001:\n ans[summ] += 1\n\nfor i in range(1, n):\n print(ans[i])\n","fail":"n = int(input())\nans = [0 for _ in range(10001)]\nfor i in range(1, 100):\n for j in range(1, 100):\n for k in range(1, 100):\n summ = i**2 + j**2 + k**2 + i * j + j * k + k * i\n if summ < 10001:\n ans[summ] += 1\n\nfor i in range(1, n + 1):\n print(ans[i])\n# print(ans[20])\n","change":"replace","i1":1,"i2":11,"j1":1,"j2":12,"error":"WA","stderr":null,"stdout":"0\n0\n0\n0\n0\n1\n0\n0\n0\n0\n3\n0\n0\n0\n0\n0\n3\n3\n0\n"} {"problem_id":"p02608","language":"Python","original_status":"Runtime Error","pass":"n = int(input())\n\ntable = [0] * 1001\n\nfor x in range(1, 101):\n for y in range(1, 101):\n for z in range(1, 101):\n k = (x * x) + (y * y) + (z * z) + (x * y) + (y * z) + (z * x)\n if k < 1001:\n table[k] += 1\n\nfor i in range(1, n + 1):\n print(table[i])\n","fail":"n = int(input())\n\ntable = [0] * 10001\n\nfor x in range(1, 101):\n for y in range(1, 101):\n for z in range(1, 101):\n k = (x * x) + (y * y) + (z * z) + (x * y) + (y * z) + (z * x)\n if k < 10001:\n table[k] += 1\n\nfor i in range(1, n + 1):\n print(table[i])\n","change":"replace","i1":2,"i2":9,"j1":2,"j2":9,"error":"0","stderr":null,"stdout":"0\n0\n0\n0\n0\n1\n0\n0\n0\n0\n3\n0\n0\n0\n0\n0\n3\n3\n0\n0\n"} {"problem_id":"p02608","language":"Python","original_status":"Time Limit Exceeded","pass":"import math\n\n\ndef main():\n N = int(input())\n\n for n in range(1, N + 1):\n count = 0\n\n for x in range(1, int(math.sqrt(2 * n)) + 1):\n for y in range(1, int(math.sqrt(2 * n)) + 1):\n for z in range(1, int(math.sqrt(2 * n)) + 1):\n if (x + y) ** 2 + (y + z) ** 2 + (z + x) ** 2 == 2 * n:\n count += 1\n break\n\n print(count)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"def main_v2():\n N = int(input())\n f_list = [0 for _ in range(N)]\n\n for x in range(1, 101):\n for y in range(1, 101):\n for z in range(1, 101):\n ans = x * x + y * y + z * z + x * y + y * z + z * x\n if ans <= N:\n f_list[ans - 1] += 1\n\n for i in range(N):\n print(f_list[i])\n\n\nif __name__ == \"__main__\":\n main_v2()\n","change":"replace","i1":0,"i2":21,"j1":0,"j2":17,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02608","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\n\nfor n in range(1, N + 1):\n max_xyz = 1\n for k in range(1, N + 1):\n if k * k > n:\n break\n max_xyz = k\n c = 0\n for x in range(1, k + 1):\n for y in range(1, k - x + 1):\n for z in range(1, k - x - y + 1):\n p = x * x + y * y + z * z + x * y + y * z + z * x\n if p == n:\n c += 1\n print(c)\n","fail":"from collections import Counter\n\nN = int(input())\n\ncounter = [0] * 10001\nfor x in range(1, N + 1):\n n1 = x * x\n if n1 >= N:\n continue\n for y in range(x, N + 1):\n n2 = n1 + y * y + x * y\n if n2 >= N:\n continue\n for z in range(y, N + 1):\n n = n2 + z * z + y * z + z * x\n if 1 <= n <= 10000:\n s = len(Counter([x, y, z]))\n if s == 1:\n counter[n] += 1\n elif s == 2:\n counter[n] += 3\n elif s == 3:\n counter[n] += 6\nfor i in range(1, N + 1):\n print(counter[i])\n","change":"replace","i1":0,"i2":16,"j1":0,"j2":25,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02608","language":"Python","original_status":"Time Limit Exceeded","pass":"#!\/usr\/bin\/env python\n# -*- coding: utf-8 -*-\n\n\ndef xyz(x, y, z):\n return x**2 + y**2 + z**2 + x * y + y * z + z * x\n\n\ndef main():\n N = int(input())\n # print(N)\n\n for i in range(1, N + 1):\n ans = 0\n for x in range(1, i):\n if x**2 > i:\n break\n for y in range(1, i):\n if y**2 > i:\n break\n for z in range(1, i):\n if z**2 > i:\n break\n if i == xyz(x, y, z):\n ans += 1\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"#!\/usr\/bin\/env python\n# -*- coding: utf-8 -*-\n\n\ndef main():\n N = int(input())\n ans = [0] * (6 * 10**4 + 10)\n\n for x in range(1, 101):\n for y in range(1, 101):\n for z in range(1, 101):\n ans[x**2 + y**2 + z**2 + x * y + y * z + x * z - 1] += 1\n\n for i in range(N):\n print(ans[i])\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":4,"i2":26,"j1":4,"j2":15,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02609","language":"Python","original_status":"Runtime Error","pass":"N = int(input())\nX = input()\n\ncnt = X.count(\"1\")\ndiv = [0] * (cnt + 10)\nfor i in range(1, cnt + 10):\n for n in range(20):\n div[i] += i >> n & 1\n\nmemo = [-1] * (cnt + 10)\nmemo[0] = 0\nfor i in range(1, cnt + 10):\n memo[i] = memo[i % div[i]] + 1\n\nres0 = 0\nres1 = 0\nfor i in range(N):\n if X[i] == \"1\":\n res0 = (res0 + pow(2, N - i - 1, cnt + 1)) % (cnt + 1)\n res1 = (res1 + pow(2, N - i - 1, cnt - 1)) % (cnt - 1)\n\nfor i in range(N):\n if X[i] == \"0\":\n div = cnt + 1\n tmp = (res0 + pow(2, N - i - 1, div)) % div\n else:\n div = cnt - 1\n tmp = (res1 + div - pow(2, N - i - 1, div)) % div\n print(memo[tmp] + 1)\n","fail":"N = int(input())\nX = input()\n\ncnt = X.count(\"1\")\nres0 = 0\nres1 = 0\nfor i in range(N):\n if X[i] == \"1\":\n res0 = (res0 + pow(2, N - i - 1, cnt + 1)) % (cnt + 1)\n\n if cnt - 1 > 0:\n res1 = (res1 + pow(2, N - i - 1, cnt - 1)) % (cnt - 1)\n\nfor i in range(N):\n ans = 0\n if X[i] == \"0\":\n div = cnt + 1\n tmp = (res0 + pow(2, N - i - 1, div)) % div\n ans += 1\n else:\n if cnt - 1 > 0:\n div = cnt - 1\n tmp = (res1 + div - pow(2, N - i - 1, div)) % div\n ans += 1\n else:\n tmp = 0\n\n while tmp > 0:\n ans += 1\n div = bin(tmp).count(\"1\")\n tmp %= div\n\n print(ans)\n","change":"replace","i1":4,"i2":29,"j1":4,"j2":33,"error":"0","stderr":null,"stdout":"2\n1\n1\n"} {"problem_id":"p02609","language":"Python","original_status":"Runtime Error","pass":"#!\/usr\/bin\/env python3\nn = int(input())\nx = input()\nc = x.count(\"1\")\nm = 0\nfor i in range(n):\n if x[i] == \"1\":\n m += pow(2, (n - i - 1), c + 1)\nm %= c + 1\nm2 = 0\nfor i in range(n):\n if x[i] == \"1\":\n m2 += pow(2, (n - i - 1), c - 1)\nm2 %= c - 1\n\nfor i in range(n):\n if x[i] == \"1\":\n t = m2 - pow(2, (n - i - 1), c - 1)\n t %= c - 1\n else:\n t = m + pow(2, (n - i - 1), c + 1)\n t %= c + 1\n count = 1\n while t > 0:\n t %= bin(t).count(\"1\")\n count += 1\n print(count)\n","fail":"#!\/usr\/bin\/env python3\nn = int(input())\nx = input()\nc = x.count(\"1\")\nm = 0\nm2 = 0\nfor i in range(n):\n if x[i] == \"1\":\n m += pow(2, (n - i - 1), c + 1)\n m %= c + 1\nm2 = 0\nif c != 1:\n for i in range(n):\n if x[i] == \"1\":\n m2 += pow(2, (n - i - 1), c - 1)\n m2 %= c - 1\n\nfor i in range(n):\n if x[i] == \"1\":\n if c != 1:\n t = m2 - pow(2, (n - i - 1), c - 1)\n t %= c - 1\n count = 1\n else:\n t = 0\n count = 0\n else:\n t = m + pow(2, (n - i - 1), c + 1)\n t %= c + 1\n count = 1\n while t > 0:\n t %= bin(t).count(\"1\")\n count += 1\n print(count)\n","change":"replace","i1":5,"i2":23,"j1":5,"j2":30,"error":"0","stderr":null,"stdout":"2\n1\n1\n"} {"problem_id":"p02609","language":"Python","original_status":"Runtime Error","pass":"import sys\n\n\ndef popcount(x: int):\n return bin(x).count(\"1\")\n\n\ndef main():\n N = int(sys.stdin.readline().rstrip())\n X = sys.stdin.readline().rstrip()\n\n Xdec = int(X, 2)\n\n # X \u304c\u30bc\u30ed\u306a\u3089\u7d42\u4e86\n if Xdec == 0:\n print(0)\n return\n\n # 1\u56de\u76ee\u306e\u6f14\u7b97\u7528\n md = popcount(Xdec)\n md_p, md_m = md + 1, md - 1\n\n tmp_p = Xdec % md_p\n if md_m == 0:\n tmp_m = Xdec % md_m\n\n for i in range(0, N, 1):\n if X[i] == \"1\": # 1->0\n if md_m == 0:\n print(0)\n x_m = pow(2, (N - 1 - i), md_m)\n tmp = (tmp_m - x_m) % md_m\n\n if X[i] == \"0\": # 0->1\n x_p = pow(2, (N - 1 - i), md_p)\n tmp = (tmp_p + x_p) % md_p\n\n cnt = 1\n while tmp:\n\n tmp = tmp % popcount(tmp)\n cnt += 1\n\n print(cnt)\n\n\nmain()\n","fail":"import sys\n\n\ndef popcount(x: int):\n return bin(x).count(\"1\")\n\n\ndef main():\n N = int(sys.stdin.readline().rstrip())\n X = sys.stdin.readline().rstrip()\n\n Xdec = int(X, 2)\n\n # 1\u56de\u76ee\u306e\u6f14\u7b97\u7528\n md = popcount(Xdec)\n md_p, md_m = md + 1, md - 1\n\n tmp_p = Xdec % md_p\n if md_m > 0:\n tmp_m = Xdec % md_m\n\n for i in range(0, N, 1):\n if X[i] == \"1\": # 1->0\n if md_m == 0:\n print(0)\n continue\n x_m = pow(2, (N - 1 - i), md_m)\n tmp = (tmp_m - x_m) % md_m\n\n if X[i] == \"0\": # 0->1\n x_p = pow(2, (N - 1 - i), md_p)\n tmp = (tmp_p + x_p) % md_p\n\n cnt = 1\n while tmp:\n\n tmp = tmp % popcount(tmp)\n cnt += 1\n\n print(cnt)\n\n\nmain()\n","change":"replace","i1":13,"i2":30,"j1":13,"j2":26,"error":"UnboundLocalError: local variable 'tmp_m' referenced before assignment","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02609\/Python\/s102394639.py\", line 47, in \n main()\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02609\/Python\/s102394639.py\", line 32, in main\n tmp = (tmp_m - x_m) % md_m\nUnboundLocalError: local variable 'tmp_m' referenced before assignment\n","stdout":"2\n"} {"problem_id":"p02609","language":"Python","original_status":"Runtime Error","pass":"def pop_count(n):\n return bin(n).count(\"1\")\n\n\nN = int(input())\nX = list(map(int, input()))\nX_m = 0\nX_p = 0\npop_X = 0\nif 1 in X:\n pop_X += X.count(1)\n for i in range(N):\n if X[N - i - 1]:\n X_m += pow(2, i, pop_X - 1)\n X_m %= pop_X - 1\n X_p += pow(2, i, pop_X + 1)\n X_p %= pop_X + 1\n\nfor i in range(N):\n ans = 1\n n = 0\n if X[i]:\n n += X_m\n n -= pow(2, N - i - 1, pop_X - 1)\n n %= pop_X - 1\n else:\n n += X_p\n n += pow(2, N - i - 1, pop_X + 1)\n n %= pop_X + 1\n while n:\n n %= pop_count(n)\n ans += 1\n print(ans)\n","fail":"def pop_count(n):\n return bin(n).count(\"1\")\n\n\ndef f(n):\n if n == 0:\n return 0\n return f(n % pop_count(n)) + 1\n\n\nN = int(input())\nX = list(map(int, input()))\nX_m = 0\nX_p = 0\npop_X = X.count(1)\nfor i in range(N):\n if X[i] == 0:\n continue\n X_p += pow(2, N - i - 1, pop_X + 1)\n X_p %= pop_X + 1\n if pop_X > 1:\n X_m += pow(2, N - i - 1, pop_X - 1)\n X_m %= pop_X - 1\n\nfor i in range(N):\n ans = 1\n if X[i] == 0:\n ans += f((X_p + pow(2, N - i - 1, pop_X + 1)) % (pop_X + 1))\n elif pop_X > 1:\n ans += f((X_m - pow(2, N - i - 1, pop_X - 1)) % (pop_X - 1))\n else:\n ans = 0\n print(ans)\n","change":"replace","i1":2,"i2":32,"j1":2,"j2":32,"error":"0","stderr":null,"stdout":"2\n1\n1\n"} {"problem_id":"p02612","language":"Python","original_status":"Runtime Error","pass":"n = input()\nn = int(n[1:])\nif 1000 - n == 1000:\n print(0)\nelse:\n print(1000 - n)\n","fail":"n = int(input())\nn = n % 1000\nif 1000 - n == 1000:\n print(0)\nelse:\n print(1000 - n)\n","change":"replace","i1":0,"i2":2,"j1":0,"j2":2,"error":"0","stderr":null,"stdout":100.0} {"problem_id":"p02612","language":"Python","original_status":"Runtime Error","pass":"# input\nN = int(input())\nnoguchi = [1000 * n for n in range(1, 11)]\n\n# check\nprint(min([ngc - N for ngc in noguchi if (ngc - N) > 0]))\n","fail":"# input\nN = int(input())\nnoguchi = [1000 * n for n in range(1, 11)]\n\n# check\nprint(min([ngc - N for ngc in noguchi if (ngc - N) >= 0]))\n","change":"replace","i1":5,"i2":6,"j1":5,"j2":6,"error":"0","stderr":null,"stdout":100.0} {"problem_id":"p02612","language":"Python","original_status":"Runtime Error","pass":"N = int(input())\n\nyen = 1000\n\nif N % 1000 == 0:\n ans = 0\nelse:\n n = str(N)\n a = int(n[1:])\n ans = yen - a\n\nprint(ans)\n","fail":"N = int(input())\nyen = 1000\n\nif N % 1000 == 0:\n ans = 0\nelse:\n while N > 0:\n N = N - yen\n ans = abs(N)\n\nprint(ans)\n","change":"replace","i1":1,"i2":10,"j1":1,"j2":9,"error":"0","stderr":null,"stdout":100.0} {"problem_id":"p02612","language":"Python","original_status":"Runtime Error","pass":"n = list(input())\nif int(\"\".join(n)) % 1000 == 0:\n print(\"0\")\nelse:\n print((10 - int(n[-3])) * 100)\n","fail":"n = int(input())\nif n % 1000 == 0:\n print(\"0\")\nelse:\n print(((n \/\/ 1000) + 1) * 1000 - n)\n","change":"replace","i1":0,"i2":5,"j1":0,"j2":5,"error":"0","stderr":null,"stdout":100.0} {"problem_id":"p02612","language":"Python","original_status":"Runtime Error","pass":"def main():\n N = input()\n return N % 1000\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"def main():\n N = int(input())\n if N % 1000 == 0:\n print(0)\n else:\n print(1000 - (N % 1000))\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":1,"i2":3,"j1":1,"j2":6,"error":"TypeError: not all arguments converted during string formatting","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02612\/Python\/s991643016.py\", line 7, in \n main()\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02612\/Python\/s991643016.py\", line 3, in main\n return N % 1000\nTypeError: not all arguments converted during string formatting\n","stdout":null} {"problem_id":"p02613","language":"Python","original_status":"Runtime Error","pass":"N = int(input())\na = [input() for i in range(N)]\nc0 = a.count(\"AC\")\nc1 = a.count(\"WA\")\nc2 = a.count(\"TLE\")\nc3 = a.count(\"RE\")\nprint(\"AC \u00d7 \" + c0)\nprint(\"WA \u00d7 \" + c1)\nprint(\"TLE \u00d7 \" + c2)\nprint(\"RE \u00d7 \" + c3)\n","fail":"N = int(input())\na = [input() for i in range(N)]\nc0 = a.count(\"AC\")\nc1 = a.count(\"WA\")\nc2 = a.count(\"TLE\")\nc3 = a.count(\"RE\")\nprint(\"AC x\", c0)\nprint(\"WA x\", c1)\nprint(\"TLE x\", c2)\nprint(\"RE x\", c3)\n","change":"replace","i1":6,"i2":10,"j1":6,"j2":10,"error":"TypeError: can only concatenate str (not \"int\") to str","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02613\/Python\/s511049207.py\", line 7, in \n print(\"AC \u00d7 \" + c0)\nTypeError: can only concatenate str (not \"int\") to str\n","stdout":null} {"problem_id":"p02614","language":"Python","original_status":"Runtime Error","pass":"import itertools\n\nimport numpy as np\n\n\ndef _run(H, W, K, C):\n input = np.zeros([H, W], dtype=np.int8)\n for h in range(H):\n for w in range(W):\n if C[h][w] == \"#\":\n input[h, w] = 1\n\n count = 0\n for r in itertools.product(*[[0, 1] for _ in range(H + W)]):\n copy_input = input.copy()\n for h in range(H):\n if r[h] == 1:\n copy_input[h] = 0\n for w in range(W):\n if r[H + w] == 1:\n copy_input[:, w] = 0\n\n if np.sum(copy_input) == K:\n count += 1\n print(count)\n\n\ndef _main():\n H, W, K = map(int, input().split())\n C = []\n for _ in range(H):\n C.append(list(map(str, input().split())))\n _run(H, W, K, C)\n\n\nif __name__ == \"__main__\":\n _main()\n","fail":"import itertools\n\nimport numpy as np\n\n\ndef _run(H, W, K, C):\n input = np.zeros([H, W], dtype=np.int8)\n for h in range(H):\n for w in range(W):\n if C[h][w] == \"#\":\n input[h, w] = 1\n\n count = 0\n for r in itertools.product(*[[0, 1] for _ in range(H + W)]):\n copy_input = input.copy()\n for h in range(H):\n if r[h] == 1:\n copy_input[h] = 0\n for w in range(W):\n if r[H + w] == 1:\n copy_input[:, w] = 0\n\n if np.sum(copy_input) == K:\n count += 1\n print(count)\n\n\ndef _main():\n H, W, K = map(int, input().split())\n C = [str(input()) for _ in range(H)]\n _run(H, W, K, C)\n\n\nif __name__ == \"__main__\":\n _main()\n","change":"replace","i1":29,"i2":32,"j1":29,"j2":30,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02615","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = list(map(int, input().split()))\na.sort(reverse=True)\na_set = sorted(set(a), key=a.index)\n\nmaxval = a[0]\ncc = {maxval: 1}\n\nans = 0\nidx = 0\n\nfor i in range(1, n):\n if a[i] in cc:\n cc[a[i]] += 2\n else:\n cc[a[i]] = 2\n cc[maxval] -= 1\n ans += maxval\n if cc[maxval] == 0:\n idx += 1\n maxval = a_set[idx]\n # print(cc)\n\nprint(ans)\n","fail":"n = int(input())\na = list(map(int, input().split()))\na.sort(reverse=True)\n\nmaxval = a[0]\ncc = {maxval: 1}\n\nans = 0\nidx = 0\n\nfor i in range(1, n):\n if a[i] in cc:\n cc[a[i]] += 2\n else:\n cc[a[i]] = 2\n cc[maxval] -= 1\n ans += maxval\n if cc[maxval] == 0:\n while 1:\n idx += 1\n if maxval > a[idx]:\n maxval = a[idx]\n break\n\nprint(ans)\n","change":"replace","i1":3,"i2":22,"j1":3,"j2":23,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02615","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = [int(i) for i in input().split()]\na.sort()\na = a[::-1]\n\ncur = [a[0], a[1]]\nnow = a[0]\nfor i in a[2:]:\n loc = 0\n maxer = min(cur[0], cur[-1])\n for j in range(1, len(cur)):\n temp = min(cur[j - 1], cur[j])\n if temp > maxer:\n loc = j\n maxer = temp\n now += maxer\n cur = cur[:loc] + [i] + cur[loc:]\n\nprint(now)\n","fail":"n = int(input())\na = [int(i) for i in input().split()]\na.sort()\na = a[::-1]\n\nif n % 3 == 0:\n if n % 2 == 0:\n print(a[0] + sum(a[1 : n \/\/ 2]) * 2)\n else:\n print(a[0] + sum(a[1 : n \/\/ 2]) * 2 + a[n \/\/ 2])\nelif n % 3 == 2:\n if n % 2 == 0:\n print(a[0] + sum(a[1 : n \/\/ 2]) * 2)\n else:\n print(a[0] + sum(a[1 : n \/\/ 2]) * 2 + a[n \/\/ 2])\nelse:\n if n % 2 == 0:\n print(a[0] + sum(a[1 : n \/\/ 2]) * 2)\n else:\n print(a[0] + sum(a[1 : n \/\/ 2]) * 2 + a[n \/\/ 2])\n","change":"replace","i1":5,"i2":19,"j1":5,"j2":20,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02615","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = list(map(int, input().split()))\n\nA.sort()\n\npot = [A.pop()]\ncom = 0\nwhile A:\n com += pot.pop()\n new = A.pop()\n pot.append(new)\n pot.append(new)\n pot.sort()\n\nprint(com)\n","fail":"N = int(input())\nA = list(map(int, input().split()))\n\nA.sort()\nfrom collections import deque\n\npot = deque([A.pop()])\ncom = 0\nwhile A:\n com += pot.pop()\n new = A.pop()\n pot.appendleft(new)\n pot.appendleft(new)\n\nprint(com)\n","change":"replace","i1":4,"i2":13,"j1":4,"j2":13,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02615","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = list(map(int, input().split()))\nA.sort(reverse=True)\nans = A[0]\ncur = 1\ncount = 1\nwhile True:\n if count <= N - 3:\n ans += A[cur] * 2\n count += 2\n cur += 1\n else:\n ans += A[cur]\n count += 1\n if count == N - 1:\n break\nprint(ans)\n","fail":"N = int(input())\nA = list(map(int, input().split()))\nA.sort(reverse=True)\nans = A[0]\ncur = 1\ncount = 1\nwhile True:\n if count <= N - 3:\n ans += A[cur] * 2\n count += 2\n cur += 1\n elif count == N - 2:\n ans += A[cur]\n count += 1\n elif count == N - 1:\n break\nprint(ans)\n","change":"replace","i1":11,"i2":15,"j1":11,"j2":15,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02615","language":"Python","original_status":"Runtime Error","pass":"n = int(input())\na = list(map(int, input().split()))\n\na.sort(reverse=True)\nans = a[0]\ni = 1\nwhile True:\n ans += a[i]\n i += 1\n if i == n - 1:\n break\n ans += a[i]\n i += 1\n if i == n - 1:\n break\nprint(ans)\n","fail":"n = int(input())\na = list(map(int, input().split()))\n\na.sort(reverse=True)\nans = a[0]\ncnt = 1\nfor i in range(1, n):\n if cnt == n - 1:\n break\n ans += a[i]\n cnt += 1\n if cnt == n - 1:\n break\n ans += a[i]\n cnt += 1\nprint(ans)\n","change":"replace","i1":5,"i2":15,"j1":5,"j2":15,"error":"0","stderr":null,"stdout":"7\n"} {"problem_id":"p02615","language":"Python","original_status":"Time Limit Exceeded","pass":"# -*- coding: utf-8 -*-\n\nN = int(input())\nA = list(map(int, input().split()))\n\na_sorted = sorted(A, key=lambda x: -x)\n\ncircle = [a_sorted[0]]\nans = 0\nfor a in a_sorted:\n tmp = 0\n tmp_idx = -1\n for i in range(len(circle) - 1):\n cand = min(circle[i], circle[i + 1])\n if cand > tmp:\n tmp = cand\n tmp_idx = i\n ans += tmp\n circle.insert(tmp_idx + 1, a)\n\nprint(ans)\n","fail":"# -*- coding: utf-8 -*-\n\nN = int(input())\nA = list(map(int, input().split()))\n\na_sorted = sorted(A, key=lambda x: -x)\n\ncircle = [a_sorted[0]]\nans = 0\nfor idx, a in enumerate(a_sorted[1:]):\n ans += circle[idx]\n circle.extend([a, a])\n\nprint(ans)\n","change":"replace","i1":9,"i2":19,"j1":9,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02615","language":"Python","original_status":"Runtime Error","pass":"from collections import deque\n\nN = int(input())\nA = list(map(int, input().split()))\n\nA.sort(reverse=True)\n\ndeq = deque([A[0]])\nans = 0\n\nfor x in A[1:]:\n print(f\"{deq=}, {x=}\")\n ans += deq.popleft()\n deq.append(x)\n deq.append(x)\n\nprint(ans)\n","fail":"import sys\nfrom collections import deque\n\nread = sys.stdin.buffer.read\n\nN, *A = map(int, read().split())\nA.sort(reverse=True)\n\ndeq = deque([A[0]])\nans = 0\n\nfor x in A[1:]:\n ans += deq.popleft()\n deq.append(x)\n deq.append(x)\n\nprint(ans)\n","change":"replace","i1":0,"i2":12,"j1":0,"j2":12,"error":"WA","stderr":null,"stdout":"deq=deque([3]), x=2\ndeq=deque([2, 2]), x=2\ndeq=deque([2, 2, 2]), x=1\n7\n"} {"problem_id":"p02615","language":"Python","original_status":"Runtime Error","pass":"n = int(input())\na = sorted(map(int, input().split()), reverse=True)\n\nans, que = 0, [a[0]]\nfor i in enumerate(a[1:]):\n ans += que[i]\n que += [i, i]\nprint(ans)\n","fail":"n = int(input())\na = sorted(map(int, input().split()))[::-1]\n\nans, que = 0, [a[0]]\nfor i, ai in enumerate(a[1:]):\n ans += que[i]\n que += [ai, ai]\nprint(ans)\n","change":"replace","i1":1,"i2":7,"j1":1,"j2":7,"error":"TypeError: list indices must be integers or slices, not tuple","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02615\/Python\/s177267284.py\", line 6, in \n ans += que[i]\nTypeError: list indices must be integers or slices, not tuple\n","stdout":null} {"problem_id":"p02615","language":"Python","original_status":"Runtime Error","pass":"from collections import deque\n\nn = int(input())\na = sorted(map(int, input().split()), reverse=True)\n\nans, cnt = 0, deque([a[0]])\nfor i in a[1:]:\n ans += cnt.popleft()\n cnt.append(a[i])\n cnt.append(a[i])\nprint(ans)\n","fail":"from collections import deque\n\nn = int(input())\na = sorted(map(int, input().split()), reverse=True)\n\nans, cnt = 0, deque([a[0]])\nfor i in a[1:]:\n ans += cnt.popleft()\n cnt.append(i)\n cnt.append(i)\nprint(ans)\n","change":"replace","i1":8,"i2":10,"j1":8,"j2":10,"error":"0","stderr":null,"stdout":"7\n"} {"problem_id":"p02615","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = sorted(list(map(int, input().split())), reverse=True)\nsum_com = a[0]\ncomfort = [a[1], a[1]]\n\nfor ai in a[2:]:\n sum_com += comfort[0]\n if comfort[0] == ai:\n comfort.append(ai)\n else:\n comfort.pop(0)\n comfort += [ai, ai]\n\nprint(sum_com)\n","fail":"n = int(input())\na = sorted(list(map(int, input().split())), reverse=True)\nsum_com = 0\ndistinct_a = sorted(list(set(a)), reverse=True)\ncomfort = {i: 0 for i in distinct_a}\ncomfort[a[0]] = 1\nmax_com = 0\n\nfor ai in a[1:]:\n sum_com += distinct_a[max_com]\n if distinct_a[max_com] == ai:\n comfort[distinct_a[max_com]] += 1\n else:\n comfort[distinct_a[max_com]] -= 1\n comfort[ai] += 2\n if comfort[distinct_a[max_com]] == 0:\n max_com += 1\n\nprint(sum_com)\n","change":"replace","i1":2,"i2":12,"j1":2,"j2":17,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02615","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = list([int(x) for x in input().split()])\n\nA.sort(reverse=True)\n\n\ncomfort = 0\n\ncomfort_list = []\n\nfor a in A:\n if comfort_list == []:\n comfort_list.append(a)\n else:\n max_comfort = comfort_list.pop(0)\n comfort += max_comfort\n comfort_list.append(min(a, max_comfort))\n comfort_list.append(min(a, max_comfort))\n\nprint(comfort)\n","fail":"from collections import deque\n\nN = int(input())\nA = list([int(x) for x in input().split()])\n\nA.sort(reverse=True)\n\ncomfort = 0\ncomfort_list = deque()\n\nfor a in A:\n if len(comfort_list) == 0:\n comfort_list.append(a)\n else:\n max_comfort = comfort_list.popleft()\n comfort += max_comfort\n comfort_list.append(min(a, max_comfort))\n comfort_list.append(min(a, max_comfort))\n\nprint(comfort)\n","change":"replace","i1":0,"i2":15,"j1":0,"j2":15,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02618","language":"Python","original_status":"Runtime Error","pass":"d = int(input())\nc = list(map(int, input().split()))\ns = [list(map(int, input().split())) for _ in range(d)]\nt = [int(input()) for _ in range(d)]\n\nlast = [0] * 26\nans = 0\nfor di in range(d):\n ans += s[di][t[di] - 1]\n last[t[di] - 1] = di + 1\n ans -= sum(c[i] * (di + 1 - last[i]) for i in range(26))\n print(ans)\n","fail":"d = int(input())\nc = list(map(int, input().split()))\ns = [list(map(int, input().split())) for _ in range(d)]\n\nlast = [0] * 26\nfor di in range(d):\n minus = [c[i] * (di + 1 - last[i]) for i in range(26)]\n cnt = [s[di][i] + minus[i] for i in range(26)]\n ti = cnt.index(max(cnt))\n last[ti] = di + 1\n print(ti + 1)\n","change":"replace","i1":3,"i2":12,"j1":3,"j2":11,"error":"EOFError: EOF when reading a line","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02618\/Python\/s583750787.py\", line 4, in \n t = [int(input()) for _ in range(d)]\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02618\/Python\/s583750787.py\", line 4, in \n t = [int(input()) for _ in range(d)]\nEOFError: EOF when reading a line\n","stdout":null} {"problem_id":"p02618","language":"Python","original_status":"Time Limit Exceeded","pass":"import copy\nimport sys\n\nimport numpy as np\n\nglobal NN\nNN = 26\n\nreadline = sys.stdin.buffer.readline\n\n\nclass Contest:\n \"\"\"\n d: \u3042\u308b\u65e5\u4ed8\n i: \u30c6\u30b9\u30c8\u306e\u7a2e\u985e\n self.day: \u6700\u5f8c\u306b\u30c6\u30b9\u30c8i\u3092\u958b\u50ac\u3057\u305f\u65e5\n \"\"\"\n\n def __init__(self, c, s, D):\n self.last = [-1 for _ in range(NN)]\n self.C = c\n self.S = s\n self.score = 0\n\n def minus_score(self, d, i):\n m = self.C[i] * (d - self.last[i])\n return m\n\n def sum_minus_scores(self, d):\n m = 0\n for i in range(NN):\n m += self.minus_score(d, i)\n\n return m\n\n # \u30c6\u30b9\u30c8i\u3092\u958b\u50ac\u3057\u305f\u3068\u304d\u306e\u30b9\u30b3\u30a2\n def update_score(self, i, d):\n self.last[i] = d\n self.score += S[d][i]\n self.score -= self.sum_minus_scores(d)\n return self.score\n\n # \u65e5\u4ed8\u3092\u66f4\u65b0\u305b\u305a\u306b\u30b9\u30b3\u30a2\u3092\u8a08\u7b97\n def calc_score(self, i, d):\n s = self.score\n last_d = self.last[i]\n self.last = d\n s += S[d][i]\n s -= self.sum_minus_scores(d)\n self.last = last_d\n\n return s\n\n def find_worst(self, tests):\n old_score = 0\n diff = []\n for day, test in enumerate(tests):\n score = self.update_score(test, day)\n diff.append(score - old_score)\n old_score = score\n\n return diff\n\n\nD = int(input())\nC = list(map(int, input().split()))\nS = [list(map(int, input().split())) for _ in range(D)]\n\ntests = []\nfor s in S:\n s = np.array(s)\n tests.append(np.argmax(s))\n\nT = Contest(C, S, D)\nT.find_worst(tests)\n\nk = 2\nfor cnt in range(10**6):\n org_tests = copy.deepcopy(tests)\n org_score = T.score\n\n diff = T.find_worst(tests)\n a = np.argsort(diff)\n\n if cnt % 10 == 0:\n ind = np.random.randint(D)\n tests[ind] = np.random.randint(0, NN)\n\n if T.score < org_score:\n tests = org_tests\n\n # print(T.score, org_score)\n\n else:\n ind = [int(np.arange(D)[a == i]) for i in range(k)]\n\n for i in range(k):\n tests[ind[i]] = np.random.randint(0, NN)\n\n if T.score < org_score:\n tests = org_tests\n\n # print(T.score)\n\nans = [str(i + 1) for i in tests]\nprint(\"\\\\n\".join(ans))\n","fail":"import copy\nimport random\nimport sys\nimport time\nfrom collections import deque\n\nt1 = time.time()\n\nreadline = sys.stdin.buffer.readline\n\n\nglobal NN\nNN = 26\n\n\ndef evaluate(D, C, S, out, k):\n score = 0\n last = [0 for _ in range(NN)]\n\n for d in range(len(out)):\n last[out[d]] = d + 1\n for i in range(NN):\n score -= (d + 1 - last[i]) * C[i]\n\n score += S[d][out[d]]\n\n for d in range(len(out), min(D, len(out) + k)):\n for i in range(NN):\n score -= (d + 1 - last[i]) * C[i]\n\n return score\n\n\ndef compute_score(D, C, S, out):\n score = 0\n last = [0 for _ in range(NN)]\n\n for d in range(len(out)):\n p = out[d]\n last[p] = d + 1\n last[out[d]] = d + 1\n for i in range(NN):\n score -= (d + 1 - last[i]) * C[i]\n\n score += S[d][out[d]]\n\n return score\n\n\ndef solve(D, C, S, k):\n out = deque()\n for _ in range(D):\n max_score = -(10**8)\n best_i = 0\n\n for i in range(NN):\n out.append(i)\n score = evaluate(D, C, S, out, k)\n if max_score < score:\n max_score = score\n best_i = i\n out.pop()\n out.append(best_i)\n\n return out\n\n\n# 1\u7b87\u6240\u30e9\u30f3\u30c0\u30e0\u306b\u5909\u3048\u308b\ndef random_change(D, C, S, out, score):\n new_out = copy.deepcopy(out)\n d = random.randrange(0, D)\n new_out[d] = random.randrange(0, NN)\n new_score = compute_score(D, C, S, new_out)\n\n if new_score > score:\n score = new_score\n out = new_out\n\n return out, score\n\n\n# N\u7b87\u6240\u30e9\u30f3\u30c0\u30e0\u306b\u5909\u3048\u308b\ndef random_changeN(D, C, S, out, score):\n N = 2\n new_out = copy.deepcopy(out)\n for _ in range(N):\n d = random.randrange(0, D)\n new_out[d] = random.randrange(0, NN)\n\n new_score = compute_score(D, C, S, new_out)\n\n if new_score > score:\n score = new_score\n out = new_out\n\n return out, score\n\n\n# 2\u3064swap\ndef random_swap2(D, C, S, out, score):\n d1 = random.randrange(0, D - 1)\n d2 = random.randrange(d1 + 1, min(d1 + 16, D))\n new_out = copy.deepcopy(out)\n new_out[d1], new_out[d2] = out[d2], out[d1]\n new_score = compute_score(D, C, S, out)\n\n if new_score > score:\n score = new_score\n out = new_out\n\n return out, score\n\n\n# \uff13\u3064swap\ndef random_swap3(D, C, S, out, score):\n d1 = random.randrange(0, D - 1)\n d2 = random.randrange(d1 + 1, min(d1 + 8, D))\n d3 = random.randrange(max(d1 - 8, 0), d1 + 1)\n new_out = copy.deepcopy(out)\n new_out[d1], new_out[d2], new_out[d3] = out[d2], out[d3], out[d1]\n new_score = compute_score(D, C, S, out)\n\n if new_score > score:\n score = new_score\n out = new_out\n\n return out, score\n\n\ndef main():\n D = int(readline())\n C = list(map(int, readline().split()))\n S = [list(map(int, readline().split())) for _ in range(D)]\n\n # \u30e9\u30f3\u30c0\u30e0\u306a\u521d\u671f\u5024\n # out = [random.randrange(0, NN) for _ in range(D)]\n\n # \u8caa\u6b32\u6cd5\u3067\u521d\u671f\u5024\u3092\u6c7a\u3081\u308b\n # k = 18 # k\u3092\u5927\u304d\u304f\u3057\u3066\uff0c\u5c40\u6240\u89e3\u304b\u3089\u9060\u3044\u3082\u306e\u3092\u5f97\u308b\n k = 26 # k\u3092\u5927\u304d\u304f\u3057\u3066\uff0c\u5c40\u6240\u89e3\u304b\u3089\u9060\u3044\u3082\u306e\u3092\u5f97\u308b\n out = solve(D, C, S, k)\n\n # \u521d\u671f\u5024\u3092\u6570\u30ab\u6240\u5909\u3048\u308b\n # np = 0.2 # \u5909\u3048\u3059\u304e\uff1f\n # np = 0.1\n np = 0.05\n n = int(D * np)\n queue = [random.randrange(0, D) for _ in range(n)]\n\n for q in queue:\n out[q] = random.randrange(0, NN)\n\n score = compute_score(D, C, S, out)\n\n for cnt in range(10**10):\n bl = [random.randint(0, 1) for _ in range(5)]\n\n for b in bl:\n if b:\n out, score = random_change(D, C, S, out, score)\n # out, score = random_changeN(D, C, S, out, score)\n else:\n # out, score = random_swap2(D, C, S, out, score)\n out, score = random_swap3(D, C, S, out, score)\n\n t2 = time.time()\n if t2 - t1 > 1.85:\n break\n\n ans = [str(i + 1) for i in out]\n print(\"\\\\n\".join(ans))\n\n\nmain()\n","change":"replace","i1":1,"i2":106,"j1":1,"j2":174,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02620","language":"Python","original_status":"Time Limit Exceeded","pass":"import sys\n\n\ndef B(T):\n global S, Z, D\n _last = [0] * Z\n cnt = 0\n for d in range(1, D + 1):\n t = T[d]\n _last[t] = d\n up = S[d][t]\n down = sum(C[i] * (d - _last[i]) for i in range(Z))\n cnt += up - down\n return cnt\n\n\ndef checkScore(r):\n global D\n L = last[r]\n rst = 0\n for d in range(1, D + 1):\n down = C[r] * (d - L[d])\n up = S[d][r] if down == 0 else 0\n rst += up - down\n return rst\n\n\nZ = 26\nD = int(input())\nC = list(map(int, input().split()))\nS = [tuple([0] * Z)]\nS += [tuple(map(int, input().split())) for _ in range(D)]\nT = [None] + [int(input()) - 1 for _ in range(D)]\n\nM = int(input())\nQ = [tuple(map(lambda x: int(x) - 1, s.split())) for s in sys.stdin.readlines()]\n\n\nlast = [[0] * (D + 1) for _ in range(Z)]\nV = [0] * Z\nfor d in range(1, D + 1):\n t = T[d]\n for p in range(Z):\n last[p][d] = last[p][d - 1]\n last[t][d] = d\nfor p in range(Z):\n V[p] = checkScore(p)\n\nscore = sum(V)\n\nfor d, q in Q:\n d += 1\n\n p = T[d]\n T[d] = q\n\n for r, L in ((p, last[p]), (q, last[q])):\n for e in range(1, D + 1):\n L[e] = L[e - 1] if r != T[e] else e\n\n score -= V[p] + V[q]\n V[p] = checkScore(p)\n V[q] = checkScore(q)\n score += V[p] + V[q]\n # print(score == B(T), score, B(T))\n print(B(T))\n","fail":"import sys\n\n\ndef B(T):\n global S, Z, D\n _last = [0] * Z\n cnt = 0\n for d in range(1, D + 1):\n t = T[d]\n _last[t] = d\n up = S[d][t]\n down = sum(C[i] * (d - _last[i]) for i in range(Z))\n cnt += up - down\n return cnt\n\n\ndef checkScore(r):\n global D, last\n L = last[r]\n rst = 0\n for d in range(1, D + 1):\n down = C[r] * (d - L[d])\n up = S[d][r] if L[d] == d else 0\n rst += up - down\n return rst\n\n\nZ = 26\nD = int(input())\nC = list(map(int, input().split()))\nS = [tuple([0] * Z)]\nS += [tuple(map(int, input().split())) for _ in range(D)]\nT = [None] + [int(input()) - 1 for _ in range(D)]\n\nM = int(input())\nQ = [tuple(map(lambda x: int(x) - 1, s.split())) for s in sys.stdin.readlines()]\n\n\nlast = [[0] * (D + 1) for _ in range(Z)]\nV = [0] * Z\nfor d in range(1, D + 1):\n t = T[d]\n for p in range(Z):\n last[p][d] = last[p][d - 1]\n last[t][d] = d\nfor p in range(Z):\n V[p] = checkScore(p)\n\nscore = sum(V)\n\nfor d, q in Q:\n d += 1\n\n p = T[d]\n T[d] = q\n\n for r, L in ((p, last[p]), (q, last[q])):\n for e in range(1, D + 1):\n L[e] = L[e - 1] if r != T[e] else e\n\n score -= V[p] + V[q]\n V[p] = checkScore(p)\n V[q] = checkScore(q)\n score += V[p] + V[q]\n # # if M > 10 ** 4:\n # print(score)\n # else:\n # print(B(T))\n print(score)\n","change":"replace","i1":17,"i2":66,"j1":17,"j2":69,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02621","language":"Python","original_status":"Time Limit Exceeded","pass":"N = 10**7\n\n\ndef f(x):\n return x\n\n\nM = 10**5\narr = list(range(M))\nfor i in range(N):\n t = (i + i * i - i) % M # \u56db\u5247\u6f14\u7b97\n b = arr[t] # \u914d\u5217\u30e9\u30f3\u30c0\u30e0\u30a2\u30af\u30bb\u30b9\n b = f(b) # \u95a2\u6570\u547c\u3073\u51fa\u3057\n\n# \u7b54\u3048\na = int(input())\nprint(a + a**2 + a**3)\n","fail":"N = 10**6\n\n\ndef f(x):\n return x\n\n\nM = 10**5\narr = list(range(M))\nfor i in range(N):\n t = (i + i * i - i) % M # \u56db\u5247\u6f14\u7b97\n b = arr[t] # \u914d\u5217\u30e9\u30f3\u30c0\u30e0\u30a2\u30af\u30bb\u30b9\n b = f(b) # \u95a2\u6570\u547c\u3073\u51fa\u3057\n\n# \u7b54\u3048\na = int(input())\nprint(a + a**2 + a**3)\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02621","language":"Python","original_status":"Time Limit Exceeded","pass":"N = 10**9\n\n\ndef f(x):\n return x\n\n\nM = 10**5\narr = list(range(M))\nfor i in range(N):\n t = (i + i * i - i) % M # \u56db\u5247\u6f14\u7b97\n b = arr[t] # \u914d\u5217\u30e9\u30f3\u30c0\u30e0\u30a2\u30af\u30bb\u30b9\n b = f(b) # \u95a2\u6570\u547c\u3073\u51fa\u3057\n\n# \u7b54\u3048\na = int(input())\nprint(a + a**2 + a**3)\n","fail":"N = 5 * 10**8\n\n\ndef f(x):\n return x\n\n\nM = 10**5\narr = list(range(M))\nfor i in range(N):\n t = (i + i * i - i) % M # \u56db\u5247\u6f14\u7b97\n b = arr[t] # \u914d\u5217\u30e9\u30f3\u30c0\u30e0\u30a2\u30af\u30bb\u30b9\n b = f(b) # \u95a2\u6570\u547c\u3073\u51fa\u3057\n\n# \u7b54\u3048\na = int(input())\nprint(a + a**2 + a**3)\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02621","language":"Python","original_status":"Runtime Error","pass":"a = input()\nprint(a + a**2 + a**3)\n","fail":"a = int(input())\nprint(a + a**2 + a**3)\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"TypeError: unsupported operand type(s) for ** or pow(): 'str' and 'int'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02621\/Python\/s078567518.py\", line 2, in \n print(a + a**2 + a**3)\nTypeError: unsupported operand type(s) for ** or pow(): 'str' and 'int'\n","stdout":null} {"problem_id":"p02622","language":"Python","original_status":"Runtime Error","pass":"S = input()\nT = input()\nN = len(S)\nans = 0\nfor i in range(N):\n if not S[i] == T[i]:\n S[i] = T[i]\n ans += 1\nprint(ans)\n","fail":"S = input()\nT = input()\nN = len(S)\nans = 0\nfor i in range(N):\n if S[i] != T[i]:\n ans += 1\nprint(ans)\n","change":"replace","i1":5,"i2":7,"j1":5,"j2":6,"error":"TypeError: 'str' object does not support item assignment","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02622\/Python\/s028680665.py\", line 7, in \n S[i] = T[i]\nTypeError: 'str' object does not support item assignment\n","stdout":null} {"problem_id":"p02622","language":"Python","original_status":"Time Limit Exceeded","pass":"s = input()\nt = input()\na = 1\nb = 1\nc = 0\nwhile a <= len(s):\n for n in s:\n for m in t:\n if a == b and n == m:\n c += 1\n b += 1\n a += 1\n b = 1\nprint(len(s) - c)\n","fail":"s = input()\nt = input()\na = 0\nfor i in range(0, len(s)):\n if s[i] != t[i]:\n a += 1\nprint(a)\n","change":"replace","i1":2,"i2":14,"j1":2,"j2":7,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02622","language":"Python","original_status":"Runtime Error","pass":"S = input()\nT = input()\nreplaces = 0\nfor ch in range(S):\n if S[ch] == T[ch]:\n replaces += 1\n\nprint(replaces)\n","fail":"S = input()\nT = input()\nreplaces = 0\nfor ch in range(len(S)):\n if S[ch] != T[ch]:\n replaces += 1\n\nprint(replaces)\n","change":"replace","i1":3,"i2":5,"j1":3,"j2":5,"error":"TypeError: 'str' object cannot be interpreted as an integer","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02622\/Python\/s517520692.py\", line 4, in \n for ch in range(S):\nTypeError: 'str' object cannot be interpreted as an integer\n","stdout":null} {"problem_id":"p02623","language":"Python","original_status":"Runtime Error","pass":"N, M, K = map(int, input().split())\nA = list(map(int, input().split()))\nB = list(map(int, input().split()))\nk = 0\nidx1 = 0\nidx2 = 0\nwhile True:\n if idx1 >= N and idx2 >= M:\n break\n if idx1 >= N:\n if B[idx2] <= K:\n K -= B[idx2]\n idx2 += 1\n continue\n else:\n break\n elif idx2 >= N:\n if A[idx1] <= K:\n K -= A[idx1]\n idx1 += 1\n else:\n break\n if A[idx1] <= B[idx2]:\n if A[idx1] <= K:\n K -= A[idx1]\n idx1 += 1\n continue\n else:\n break\n else:\n if B[idx2] <= K:\n K -= B[idx2]\n idx2 += 1\n continue\n else:\n break\nprint(idx1 + idx2)\n","fail":"from itertools import accumulate\nfrom bisect import bisect_left\n\nN, M, K = map(int, input().split())\nA = list(map(int, input().split()))\nB = list(map(int, input().split()))\nacc_A = [0] + list(accumulate(A))\nacc_B = [0] + list(accumulate(B))\nres = 0\nfor i, a in enumerate(acc_A):\n if a > K:\n break\n idx = bisect_left(acc_B, K - a)\n idx = min(idx, M)\n if acc_B[idx] > K - a:\n idx -= 1\n res = max(res, i + idx)\nprint(res)\n","change":"replace","i1":0,"i2":37,"j1":0,"j2":18,"error":"0","stderr":null,"stdout":"3\n"} {"problem_id":"p02623","language":"Python","original_status":"Time Limit Exceeded","pass":"import itertools\n\nN, M, K = map(int, input().split())\nA = list(map(int, input().split())) # (N,)\nB = list(map(int, input().split())) # (M,)\n\nbook_num = 0\n\nA_accum = [0] + list(itertools.accumulate(A))\nB_accum = [0] + list(itertools.accumulate(B))\nfor n in range(N + 1):\n for m in range(M + 1):\n if K < A_accum[n] + B_accum[m]:\n break\n if book_num < n + m:\n book_num = n + m\n\nprint(book_num)\n","fail":"import itertools\n\nN, M, K = map(int, input().split())\nA = list(map(int, input().split())) # (N,)\nB = list(map(int, input().split())) # (M,)\n\n\nA_accum = [0] + list(itertools.accumulate(A))\nB_accum = [0] + list(itertools.accumulate(B))\n\nbook_num = 0\n\nb_best = M\nfor n in range(N + 1):\n for m in range(b_best, -1, -1):\n if A_accum[n] + B_accum[m] <= K:\n b_best = m\n if book_num < n + m:\n book_num = n + m\n break\n\nprint(book_num)\n","change":"replace","i1":6,"i2":16,"j1":6,"j2":20,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02623","language":"Python","original_status":"Runtime Error","pass":"from itertools import accumulate\nfrom bisect import bisect\n\nn, m, k = map(int, input().split())\na = [*accumulate(map(int, input().split()), initial=0)]\nb = [*accumulate(map(int, input().split()), initial=0)]\nans = 0\nfor i, x in enumerate(a):\n if x <= k:\n ans = max(i - 1 + bisect(b, k - x))\nprint(ans)\n","fail":"from itertools import accumulate\nfrom bisect import bisect\n\nn, m, k = map(int, input().split())\na = list(map(int, input().split()))\nb = list(map(int, input().split()))\na = [0] + list(accumulate(a))\nb = [0] + list(accumulate(b))\nans = 0\nj = m\nfor i in range(n + 1):\n if a[i] > k:\n break\n while b[j] > k - a[i]:\n j -= 1\n ans = max(ans, i + j)\nprint(ans)\n","change":"replace","i1":4,"i2":10,"j1":4,"j2":16,"error":"TypeError: 'int' object is not iterable","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02623\/Python\/s760036159.py\", line 10, in \n ans = max(i - 1 + bisect(b, k - x))\nTypeError: 'int' object is not iterable\n","stdout":null} {"problem_id":"p02623","language":"Python","original_status":"Runtime Error","pass":"N, M, K = map(int, input().split())\nA = list(map(int, input().split()))\nB = list(map(int, input().split()))\n\n# \u5168\u90e8A\u304b\u3089\u9078\u3093\u3067\u307f\u308b\nminutes_a = 0\ncount_a = 0\nfor i in range(N):\n if minutes_a + A[i] > K:\n break\n minutes_a += A[i]\n count_a += 1\n\nminutes_b = 0\ncount_b = 0\n\nif minutes_a < K:\n for i in range(M):\n if minutes_a + minutes_b + B[i] > K:\n break\n minutes_b += B[i]\n count_b += 1\n\nfor i in range(count_b, M):\n if minutes_a + minutes_b + B[i] > K:\n if count_a > 0 and minutes_a - A[count_a - 1] + minutes_b + B[i] <= K:\n minutes_a -= A[count_a - 1]\n count_a -= 1\n minutes_b += B[i]\n count_b += 1\n continue\n else:\n break\n minutes_b += B[i]\n count_b += 1\n\na_max = count_a + count_b\n\n# \u5168\u90e8B\u304b\u3089\u9078\u3093\u3067\u307f\u308b\nminutes_b = 0\ncount_b = 0\nfor i in range(M):\n if minutes_b + B[i] > K:\n break\n minutes_b += B[i]\n count_b += 1\n\nminutes_a = 0\ncount_a = 0\n\nif minutes_b < K:\n for i in range(N):\n if minutes_b + minutes_a + A[i] > K:\n break\n minutes_a += A[i]\n count_a += 1\n\nfor i in range(count_a, N):\n if minutes_b + minutes_a + A[i] > K:\n if count_b > 0 and minutes_b - B[count_b - 1] + minutes_a + A[i] <= K:\n minutes_b -= B[count_a - 1]\n count_b -= 1\n minutes_a += A[i]\n count_a += 1\n continue\n else:\n break\n minutes_a += A[i]\n count_a += 1\n\nprint(max(a_max, count_a + count_b))\n","fail":"N, M, K = map(int, input().split())\nA = list(map(int, input().split()))\nB = list(map(int, input().split()))\n\n# \u5168\u90e8A\u304b\u3089\u9078\u3093\u3067\u307f\u308b\nminutes_a = 0\ncount_a = 0\nfor i in range(N):\n if minutes_a + A[i] > K:\n break\n minutes_a += A[i]\n count_a += 1\n\nans = count_a\nminutes_b = 0\ncount_b = 0\n\nfor i in range(M):\n if minutes_a + minutes_b + B[i] > K:\n found = False\n while count_a > 0:\n minutes_a -= A[count_a - 1]\n count_a -= 1\n if minutes_a + minutes_b + B[i] <= K:\n minutes_b += B[i]\n count_b += 1\n found = True\n break\n if not found:\n break\n else:\n minutes_b += B[i]\n count_b += 1\n ans = max(ans, count_a + count_b)\n\nprint(ans)\n","change":"replace","i1":13,"i2":71,"j1":13,"j2":36,"error":"0","stderr":null,"stdout":"3\n"} {"problem_id":"p02623","language":"Python","original_status":"Runtime Error","pass":"N, M, K = map(int, input().split())\n\ntime_A = list(map(int, input().split()))\ntime_B = list(map(int, input().split()))\nmax_books = 0\nnum_books = 0\nallot_to_A = 0\nallot_to_B = K\ntime_bankB = allot_to_B\nread_in_B = []\nbaf_timeB = 0\n\nfor i in range(len(time_B)):\n if time_B[i] <= time_bankB:\n time_bankB -= time_B[i]\n num_books += 1\n read_in_B.append(time_B[i])\n else:\n baf_timeB = time_bankB\nif baf_timeB == 0:\n baf_timeB = K - sum(time_B)\n\nmax_books = num_books\ntmp = max_books\n\n\nfor i in range(len(time_A)):\n tmp = max_books\n dif = 1\n allot_to_A += time_A[i]\n allot_to_B -= time_A[i]\n if allot_to_B < 0:\n break\n time_to_reduce = time_A[i]\n while time_to_reduce > 0:\n if time_to_reduce <= baf_timeB:\n baf_timeB -= time_to_reduce\n break\n else:\n baf_timeB += read_in_B[-1]\n dif -= 1\n del read_in_B[-1]\n tmp += dif\n max_books = max(tmp, max_books)\n\nprint(max_books)\n","fail":"N, M, K = map(int, input().split())\n\nA = list(map(int, input().split()))\nB = list(map(int, input().split()))\n\na, b = [0], [0]\nfor i in range(N):\n a.append(a[i] + A[i])\nfor i in range(M):\n b.append(b[i] + B[i])\n\nans, j = 0, M\nfor i in range(N + 1):\n if a[i] > K:\n break\n while b[j] > K - a[i]:\n j -= 1\n ans = max(ans, i + j)\n\nprint(ans)\n","change":"replace","i1":2,"i2":46,"j1":2,"j2":20,"error":"0","stderr":null,"stdout":"3\n"} {"problem_id":"p02623","language":"Python","original_status":"Time Limit Exceeded","pass":"import numpy as np\nfrom functools import reduce\n\nN, M, K = list(map(int, input().split()))\nAs = list(map(int, input().split()))\nBs = list(map(int, input().split()))\n\ncumA = reduce(lambda x, y: x + [y + x[-1]], As, [0])\ncumB = reduce(lambda x, y: x + [y + x[-1]], Bs, [0])\ncumA.append(np.inf)\ncumB.append(np.inf)\ncumA = np.array(cumA)\ncumB = np.array(cumB)\n\nmax_count = 0\na_thresh = np.where(cumA > K)[0][0]\na_count = a_thresh\nb_count = 0\nb_thresh = np.where(cumB > K)[0][0]\nwhile a_count >= 0 and b_count <= b_thresh:\n while b_count <= b_thresh and cumA[a_count] + cumB[b_count] <= K:\n b_count += 1\n b_count = max(0, b_count - 1)\n if cumA[a_count] + cumB[b_count] <= K:\n max_count = max(max_count, a_count + b_count)\n a_count -= 1\n\nprint(max_count)\n","fail":"import numpy as np\nfrom functools import reduce\n\nN, M, K = list(map(int, input().split()))\nAs = list(map(int, input().split()))\nBs = list(map(int, input().split()))\n\n\ndef get_cum(arr):\n cum_arr = [0]\n for e in arr:\n tot = cum_arr[-1] + e\n if tot > K:\n return cum_arr\n cum_arr.append(tot)\n return cum_arr\n\n\ncumA = get_cum(As)\ncumB = get_cum(Bs)\n\nmax_count = 0\na_thresh = len(cumA) - 1\na_count = a_thresh\nb_count = 0\nb_thresh = len(cumB) - 1\nwhile a_count >= 0 and b_count <= b_thresh:\n while b_count <= b_thresh and cumA[a_count] + cumB[b_count] <= K:\n b_count += 1\n b_count = max(0, b_count - 1)\n if cumA[a_count] + cumB[b_count] <= K:\n max_count = max(max_count, a_count + b_count)\n a_count -= 1\n\nprint(max_count)\n","change":"replace","i1":7,"i2":19,"j1":7,"j2":26,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02623","language":"Python","original_status":"Runtime Error","pass":"def resolve():\n N, M, K = [int(i) for i in input().split()]\n A = [int(i) for i in input().split()]\n B = [int(i) for i in input().split()]\n sumA = 0\n ai, bi = 0, 0\n while sumA <= K:\n if ai < N and A[ai] < B[bi] and sumA + A[ai] <= K:\n sumA += A[ai]\n ai += 1\n elif bi < M and sumA + B[bi] <= K:\n sumA += B[bi]\n bi += 1\n else:\n break\n print(ai + bi)\n\n\nresolve()\n","fail":"def check(A, mid, K):\n return A[mid] <= K\n\n\ndef binMax(A, K):\n ok = -1 # maxVal when minimize\n ng = len(A) # maxVal when maximize\n while abs(ok - ng) > 1:\n mid = (ok + ng) \/\/ 2\n if check(A, mid, K):\n ok = mid\n else:\n ng = mid\n return ok\n\n\ndef resolve():\n N, M, K = [int(i) for i in input().split()]\n A = [int(i) for i in input().split()]\n B = [int(i) for i in input().split()]\n presumA = [0 for _ in range(N + 1)]\n for i in range(N):\n presumA[i + 1] = presumA[i] + A[i]\n presumB = [0 for _ in range(M + 1)]\n for i in range(M):\n presumB[i + 1] = presumB[i] + B[i]\n startA = binMax(presumA, K)\n maxA = 0\n for ai in range(startA, -1, -1):\n maxA = max(maxA, ai + binMax(presumB, K - presumA[ai]))\n print(maxA)\n\n\nresolve()\n","change":"replace","i1":0,"i2":16,"j1":0,"j2":31,"error":"0","stderr":null,"stdout":"3\n"} {"problem_id":"p02623","language":"Python","original_status":"Runtime Error","pass":"import numpy as np\n\nN, M, K = map(int, input().split())\nA = np.array(input().split(), dtype=np.int64)\nB = np.array(input().split(), dtype=np.int64)\n\n# \u7d2f\u7a4d\u548c\nA = np.cumsum(A)\nB = np.cumsum(B)\n\n# K\u4ee5\u4e0b\u3092\u62bd\u51fa\nA = A[A <= K]\nB = B[B <= K]\n\n# A\u3092\u9006\u9806\u306b\u3059\u308b\nA = A[::-1]\n\nc = 0\nc_max = 0\nfor i, a in enumerate(A):\n c += len(A) - i\n\n for j, b in enumerate(B):\n if a + b <= K:\n cb = j + 1\n\n c += cb\n if c > c_max:\n c_max = c\n c = 0\n\nprint(c_max)\n","fail":"import numpy as np\n\nfrom numba import njit\n\n\n@njit(\"i8[:](i8, i8[:], i8[:])\", cache=True)\ndef cumsum(K, A, cA):\n for i, a in enumerate(A):\n cA[i] += cA[i - 1] + A[i]\n if cA[i] > K:\n break\n\n cA = cA[cA != 0]\n cA = np.append(0, cA)\n return cA\n\n\n@njit(\"i8(i8, i8[:], i8[:])\", cache=True)\ndef solve(K, cA, cB):\n ans = np.searchsorted(cA, K - cB, side=\"right\") - 1\n ans += np.arange(len(cB))\n return ans.max()\n\n\nN, M, K = map(int, input().split())\nA = np.array(input().split(), dtype=np.int64)\nB = np.array(input().split(), dtype=np.int64)\n\ncA = np.zeros(N, dtype=np.int64)\ncB = np.zeros(M, dtype=np.int64)\n\n# np.cumsum\u3060\u3068overflow\u3059\u308b\ncA = cumsum(K, A, cA)\ncB = cumsum(K, B, cB)\n\nans = solve(K, cA, cB)\nprint(ans)\n","change":"replace","i1":1,"i2":32,"j1":1,"j2":37,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02623","language":"Python","original_status":"Runtime Error","pass":"# -*- coding: utf-8 -*-\nfrom sys import stdin\n\n# import numpy as np\nfrom itertools import accumulate\nfrom bisect import bisect_right\n\n# import sys\n# sys.setrecursionlimit(10**4)\n\n\ndef _li():\n return list(map(int, stdin.readline().split()))\n\n\ndef _li_():\n return list(map(lambda x: int(x) - 1, stdin.readline().split()))\n\n\ndef _lf():\n return list(map(float, stdin.readline().split()))\n\n\ndef _ls():\n return stdin.readline().split()\n\n\ndef _i():\n return int(stdin.readline())\n\n\ndef _f():\n return float(stdin.readline())\n\n\ndef _s():\n return stdin.readline()[:-1]\n\n\ndef search(cum1, cum2, iter_max, limit):\n ans = 0\n for i in range(iter_max):\n if cum1[i] > limit:\n break\n cand = bisect_right(cum2, limit - cum1[i])\n ans = max(i + 1 + cand, ans)\n return ans\n\n\nN, M, K = _li()\nA_list = _li()\nB_list = _li()\n\ncum_a = list(accumulate(A_list))\ncum_b = list(accumulate(B_list))\n\nif cum_a[0] < cum_b[0]:\n print(search(cum_a, cum_b, N))\nelse:\n print(search(cum_b, cum_a, M))\n","fail":"# -*- coding: utf-8 -*-\nfrom sys import stdin\n\n# import numpy as np\nfrom itertools import accumulate\nfrom bisect import bisect_right\n\n# import sys\n# sys.setrecursionlimit(10**4)\n\n\ndef _li():\n return list(map(int, stdin.readline().split()))\n\n\ndef _li_():\n return list(map(lambda x: int(x) - 1, stdin.readline().split()))\n\n\ndef _lf():\n return list(map(float, stdin.readline().split()))\n\n\ndef _ls():\n return stdin.readline().split()\n\n\ndef _i():\n return int(stdin.readline())\n\n\ndef _f():\n return float(stdin.readline())\n\n\ndef _s():\n return stdin.readline()[:-1]\n\n\ndef search(cum1, cum2, iter_max, limit):\n ans = 0\n for (i,) in range(iter_max):\n if cum1[i] > limit:\n cur = 0\n else:\n cur = i\n cand = bisect_right(cum2, limit - cum1[i])\n ans = max(cur + cand, ans)\n return ans\n\n\nN, M, K = _li()\nA_list = _li()\nB_list = _li()\n\ncum_a = [0] + list(accumulate(A_list))\ncum_b = list(accumulate(B_list))\n\nans = 0\nfor i, a in enumerate(cum_a):\n if a > K:\n cur = 0\n else:\n cur = i\n cand = bisect_right(cum_b, K - a)\n ans = max(cur + cand, ans)\n\nprint(ans)\n","change":"replace","i1":41,"i2":60,"j1":41,"j2":68,"error":"TypeError: search() missing 1 required positional argument: 'limit'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02623\/Python\/s364683935.py\", line 58, in \n print(search(cum_a, cum_b, N))\nTypeError: search() missing 1 required positional argument: 'limit'\n","stdout":null} {"problem_id":"p02623","language":"Python","original_status":"Runtime Error","pass":"from collections import deque\n\nn, m, k = map(int, input().split())\na = deque(map(int, input().split()))\nb = deque(map(int, input().split()))\n\nt = 0\nres = 0\nwhile a or b:\n if not a:\n if t + b[0] > k:\n break\n else:\n t += b.popleft()\n elif not b:\n if t + a[0] > k:\n break\n else:\n t += a.popleft()\n else:\n if t + a[0] > k and t + b[0] > k:\n break\n if a[0] < b[0]:\n t += a.popleft()\n elif a[0] > b[0]:\n t += b.popleft()\n else:\n if a[1] < b[1]:\n t += a.popleft()\n else:\n t += b.popleft()\n res += 1\nprint(res)\n","fail":"from itertools import accumulate\n\nn, m, k = map(int, input().split())\na = list(map(int, input().split()))\nb = list(map(int, input().split()))\n\na_cumsum = [0] + list(accumulate(a))\nb_cumsum = [0] + list(accumulate(b))\nj = m\nres = 0\nfor i in range(n + 1):\n if a_cumsum[i] > k:\n break\n while a_cumsum[i] + b_cumsum[j] > k:\n j -= 1\n if (v := i + j) > res:\n res = v\nprint(res)\n","change":"replace","i1":0,"i2":32,"j1":0,"j2":17,"error":"0","stderr":null,"stdout":"3\n"} {"problem_id":"p02623","language":"Python","original_status":"Runtime Error","pass":"from collections import deque\n\nN, M, K = map(int, input().split())\nA = deque([int(x) for x in input().split()])\nB = deque([int(x) for x in input().split()])\ntsundoku = 0\n\nwhile K > 0:\n if not A:\n K -= B.popleft()\n elif not B:\n K -= A.popleft()\n elif A[0] < B[0]:\n K -= A.popleft()\n elif A[0] > B[0]:\n K -= B.popleft()\n elif A[0] == A[0]:\n if A[1] < B[1]:\n K -= A.popleft()\n elif A[1] > B[1]:\n K -= B.popleft()\n\n if K >= 0:\n tsundoku += 1\n\nprint(tsundoku)\n","fail":"N, M, K = map(int, input().split())\nA = [int(x) for x in input().split()]\nB = [int(x) for x in input().split()]\n\n\ndef cusum(array):\n for i in range(len(array) - 1):\n array[i + 1] += array[i]\n\n\ncusum(A)\ncusum(B)\nA = [0] + A\nB = [0] + B\ntsundoku = 0\nia = 0\nib = M\n\nfor ia in range(N + 1):\n if A[ia] > K:\n break\n while A[ia] + B[ib] > K and ib >= 0:\n ib -= 1\n tsundoku = max(ia + ib, tsundoku)\n\nprint(tsundoku)\n","change":"replace","i1":0,"i2":24,"j1":0,"j2":24,"error":"0","stderr":null,"stdout":"3\n"} {"problem_id":"p02623","language":"Python","original_status":"Time Limit Exceeded","pass":"N, M, K = map(int, input().split())\nA = list(map(int, input().split()))\nB = list(map(int, input().split()))\nans = 0\n\nfor i in range(1, N):\n A[i] = A[i - 1] + A[i]\n if A[i] > K:\n A = A[:i]\n break\nA = [0] + A\n\nfor i in range(1, M):\n B[i] = B[i - 1] + B[i]\n if B[i] > K:\n B = B[:i]\n break\nB = [0] + B\n\nA_length = len(A)\nB_length = len(B)\n\nfor i in range(A_length):\n j = 0\n while j < B_length:\n if A[i] + B[j] <= K:\n j += 1\n else:\n break\n ans = max(ans, i + (j - 1))\nprint(ans)\n","fail":"N, M, K = map(int, input().split())\nA = list(map(int, input().split()))\nB = list(map(int, input().split()))\nans = 0\n\nfor i in range(1, N):\n A[i] = A[i - 1] + A[i]\n if A[i] > K:\n A = A[:i]\n break\nA = [0] + A\nA = A[::-1]\n\nfor i in range(1, M):\n B[i] = B[i - 1] + B[i]\n if B[i] > K:\n B = B[:i]\n break\nB = [0] + B\n\nA_length = len(A)\nB_length = len(B)\n\nj = 0\nfor i in range(A_length):\n\n while j < B_length:\n if A[i] + B[j] <= K:\n j += 1\n else:\n break\n j -= 1\n\n ans = max(ans, A_length - (i + 1) + j)\nprint(ans)\n","change":"replace","i1":11,"i2":30,"j1":11,"j2":34,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02623","language":"Python","original_status":"Runtime Error","pass":"def main():\n N, M, K = map(int, input().split())\n A = list(map(int, input().split()))\n B = list(map(int, input().split()))\n\n a, b = [0], [0]\n for i in range(N):\n a.append(a[i] + A[i])\n for i in range(M):\n a.append(b[i] + B[i])\n\n ans, j = 0, M\n for i in range(N + 1):\n if a[i] > K:\n break\n\n while a[i] + b[j] > K:\n j -= 1\n\n ans = max(ans, i + j)\n\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"def main():\n N, M, K = map(int, input().split())\n A = list(map(int, input().split()))\n B = list(map(int, input().split()))\n\n a, b = [0], [0]\n for i in range(N):\n a.append(a[i] + A[i])\n for i in range(M):\n b.append(b[i] + B[i])\n\n ans, j = 0, M\n for i in range(N + 1):\n if a[i] > K:\n break\n\n while a[i] + b[j] > K:\n j -= 1\n\n ans = max(ans, i + j)\n\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":9,"i2":10,"j1":9,"j2":10,"error":"IndexError: list index out of range","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02623\/Python\/s656972231.py\", line 26, in \n main()\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02623\/Python\/s656972231.py\", line 10, in main\n a.append(b[i] + B[i])\nIndexError: list index out of range\n","stdout":null} {"problem_id":"p02623","language":"Python","original_status":"Time Limit Exceeded","pass":"from collections import deque\n\nN, M, K = map(int, input().split())\nA = deque(list(map(int, input().split())))\nB = deque(list(map(int, input().split())))\n\nif sum(A) + sum(B) < K:\n print(N + M)\n exit()\n\nans = 0\n\nwhile K > 0:\n if len(A) != 0:\n # if len(B) == 0 or A[0] <= B[0]:\n if len(B) == 0 or sum(A) <= sum(B):\n if A[0] <= K:\n K -= A.popleft()\n ans += 1\n continue\n if len(B) != 0:\n # if len(A) == 0 or A[0] >= B[0]:\n if len(A) == 0 or sum(A) >= sum(B):\n if B[0] <= K:\n K -= B.popleft()\n ans += 1\n continue\n\nprint(ans)\n","fail":"N, M, K = map(int, input().split())\nA = list(map(int, input().split()))\nB = list(map(int, input().split()))\n\n# \u7d2f\u7a4d\u548c\u306e\u7b97\u51fa\nA_sum, B_sum = [0], [0]\nfor i, a in enumerate(A):\n A_sum.append(A_sum[i] + a)\nfor i, b in enumerate(B):\n B_sum.append(B_sum[i] + b)\n\nans = 0\nj = M\n\n# \u673aA\u306e\u672c\u3092\u8aad\u3080\u6240\u8981\u6642\u9593:A_sum[i] \u2026 i\u306e\u5024\u30920\u304b\u3089\u5897\u3084\u3057\u3066\u3044\u304f\n# \u673aB\u306e\u672c\u3092\u8aad\u3080\u6240\u8981\u6642\u9593:B_sum[j] \u2026 i\u306e\u5024\u3092\u56fa\u5b9a\u3057\u3001M\u304b\u3089\u6e1b\u3089\u3057\u3066\u3044\u304f\n# A_sum[i]+B_sum[j]\u304cK\u306b\u53ce\u307e\u308bi\u3068j\u306e\u5024\u3092\u898b\u3064\u3051\u51fa\u3057\u3001i+j\u306e\u5024\u3092\u51fa\u3059\n# i\u306e\u5024\u3092\u5897\u3084\u3057\u306a\u304c\u3089\u4e0a\u8a18\u3092\u7e70\u308a\u8fd4\u3057\u3001i+j\u306e\u6700\u5927\u5024\u304c\u89e3\u3068\u306a\u308b\nfor i in range(N + 1):\n if A_sum[i] > K:\n break\n while B_sum[j] > K - A_sum[i]:\n j -= 1\n ans = max(ans, i + j)\n\nprint(ans)\n","change":"replace","i1":0,"i2":27,"j1":0,"j2":24,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02623","language":"Python","original_status":"Runtime Error","pass":"from itertools import accumulate\nfrom bisect import bisect_left\n\nN, M, K = map(int, input().split())\nA = list(map(int, input().split()))\nB = list(map(int, input().split()))\n\na = [0] + list(accumulate(A))\nb = [0] + list(accumulate(B))\n\nresult = 0\nfor i in range(N):\n t = K - a[i]\n if t < 0:\n break\n j = bisect_left(b, t)\n if b[j] == t:\n result = max(result, i + j + 1)\n else:\n result = max(result, i + j)\nprint(result)\n","fail":"from itertools import accumulate\nfrom bisect import bisect_left\n\nN, M, K = map(int, input().split())\nA = list(map(int, input().split()))\nB = list(map(int, input().split()))\n\na = [0] + list(accumulate(A))\nb = [0] + list(accumulate(B))\n\nresult = 0\nfor i in range(N + 1):\n t = K - a[i]\n if t < 0:\n break\n j = bisect_left(b, t)\n if j == M + 1:\n result = max(result, i + M)\n elif b[j] == t:\n result = max(result, i + j)\n else:\n result = max(result, i + j - 1)\nprint(result)\n","change":"replace","i1":11,"i2":20,"j1":11,"j2":22,"error":"WA","stderr":null,"stdout":"4\n"} {"problem_id":"p02623","language":"Python","original_status":"Runtime Error","pass":"# D - Sum of Divisors\nfrom numba import njit\n\n\n@njit\ndef solve(N):\n res = 0\n for a in range(1, N + 1):\n for b in range(1, N \/\/ a + 1):\n res += a * b\n return res\n\n\ndef main():\n N = int(input())\n print(solve(N))\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"# C - Tsundoku\nfrom bisect import bisect\nfrom itertools import accumulate\n\n\ndef main():\n N, M, K, *AB = map(int, open(0).read().split())\n cum_A, cum_B = accumulate(AB[:N], initial=0), tuple(accumulate(AB[N:]))\n candidates = [0]\n for i, a in enumerate(cum_A):\n if a > K:\n break\n candidates.append(i + bisect(cum_B, K - a))\n print(max(candidates))\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":0,"i2":16,"j1":0,"j2":14,"error":"ModuleNotFoundError: No module named 'numba'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02623\/Python\/s856584170.py\", line 2, in \n from numba import njit\nModuleNotFoundError: No module named 'numba'\n","stdout":null} {"problem_id":"p02623","language":"Python","original_status":"Runtime Error","pass":"#!\/usr\/bin\/env python3\nn, m, k = map(int, input().split())\na = [0] + list(map(int, input().split()))\nb = [0] + list(map(int, input().split()))\nfor i in range(1, n + 1):\n a[i] = a[i - 1] + a[i]\n\nfor i in range(1, m + 1):\n b[i] = b[i - 1] + b[i]\nans = 0\nt = 0\nj = 0\nfor i in range(n + 1):\n while j < m + 1 and k - a[i] >= b[j]:\n j += 1\n j -= 1\n ans = max(ans, i + j)\n\nprint(ans)\n","fail":"#!\/usr\/bin\/env python3\nn, m, k = map(int, input().split())\na = list(map(int, input().split()))\nb = list(map(int, input().split()))\nA = [0]\nB = [0]\nfor i in range(n):\n A.append(A[i] + a[i])\nfor i in range(m):\n B.append(B[i] + b[i])\nans = 0\nj = m\nfor i in range(n + 1):\n if A[i] > k:\n break\n while j > 0 and k - A[i] < B[j]:\n j -= 1\n ans = max(ans, i + j)\n\nprint(ans)\n","change":"replace","i1":2,"i2":16,"j1":2,"j2":17,"error":"0","stderr":null,"stdout":"3\n"} {"problem_id":"p02623","language":"Python","original_status":"Time Limit Exceeded","pass":"def _integral(A):\n result = []\n sum_value = 0\n result.append(sum_value)\n for i in range(len(A)):\n sum_value += A[i]\n result.append(sum_value)\n return result\n\n\ndef _main(N, M, K, A, B):\n integral_a = _integral(A)\n integral_b = _integral(B)\n top_count = 0\n for a_index in range(len(A) + 1)[::-1]:\n a_value = integral_a[a_index]\n if K < a_value:\n continue\n for b_index in range(len(B) + 1)[::-1]:\n if a_value + integral_b[b_index] <= K:\n if top_count < a_index + b_index:\n top_count = a_index + b_index\n break\n print(top_count)\n #\n #\n # sum_k = 0.0\n # a_index = 0\n # a_len = len(A)\n # b_index = 0\n # b_len = len(B)\n # while sum_k < K:\n # current_a = A[a_index] if a_index < a_len else None\n # current_b = B[b_index] if b_index < b_len else None\n # if current_a is None and current_b is None:\n # break\n #\n # if current_a is not None and current_b is None:\n # if K < sum_k + current_a:\n # break\n # sum_k += current_a\n # a_index += 1\n # elif current_a is None and current_b is not None:\n # if K < sum_k + current_b:\n # break\n # sum_k += current_b\n # b_index += 1\n # elif current_a < current_b:\n # if K < sum_k + current_a:\n # break\n # sum_k += current_a\n # a_index += 1\n # else:\n # if K < sum_k + current_b:\n # break\n # sum_k += current_b\n # b_index += 1\n #\n # print(a_index + b_index)\n\n\nif __name__ == \"__main__\":\n Na, Ma, Ka = map(int, input().split())\n Aa = list(map(float, input().split()))\n Ba = list(map(float, input().split()))\n _main(Na, Ma, Ka, Aa, Ba)\n","fail":"def _integral(A):\n result = []\n sum_value = 0\n result.append(sum_value)\n for i in range(len(A)):\n sum_value += A[i]\n result.append(sum_value)\n return result\n\n\ndef _main(N, M, K, A, B):\n integral_a = _integral(A)\n integral_b = _integral(B)\n top_count = 0\n b_max = len(B)\n for a_index in range(len(A) + 1):\n a_value = integral_a[a_index]\n if K < a_value:\n break\n for b_index in range(0, min(len(B) + 1, b_max + 1))[::-1]:\n if a_value + integral_b[b_index] <= K:\n if top_count < a_index + b_index:\n top_count = a_index + b_index\n b_max = b_index\n break\n print(top_count)\n\n\nif __name__ == \"__main__\":\n Na, Ma, Ka = map(int, input().split())\n Aa = list(map(float, input().split()))\n Ba = list(map(float, input().split()))\n _main(Na, Ma, Ka, Aa, Ba)\n","change":"replace","i1":14,"i2":59,"j1":14,"j2":26,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02623","language":"Python","original_status":"Runtime Error","pass":"N, M, K = map(int, input().split())\nA = list(map(int, input().split()))\nB = list(map(int, input().split()))\nacc = sum(B)\nj = M - 1\nif acc + sum(A) <= K:\n print(M + N)\n exit()\nans = 0\nfor i in range(N):\n acc += A[i]\n if acc <= K:\n ans = max(ans, i + j + 2)\n continue\n else:\n while acc > K:\n acc -= B[j]\n j -= 1\n if (j == -1) & (acc > K):\n print(ans)\n exit()\n ans = max(ans, i + j + 2)\nprint(ans)\n","fail":"N, M, K = map(int, input().split())\nA = list(map(int, input().split()))\nB = list(map(int, input().split()))\nif K >= sum(A) + sum(B):\n print(M + N)\n exit()\nacc = 0\nans = 0\nfor j, b in enumerate(B):\n acc += b\n if K >= acc:\n ans = j + 1\nfor i in range(N):\n acc += A[i]\n if K >= acc:\n ans = max(ans, i + j + 2)\n continue\n else:\n while (K < acc) & (j > -1):\n acc -= B[j]\n j -= 1\n if K >= acc:\n ans = max(ans, i + j + 2)\nprint(ans)\n","change":"replace","i1":3,"i2":22,"j1":3,"j2":23,"error":"0","stderr":null,"stdout":"3\n"} {"problem_id":"p02623","language":"Python","original_status":"Time Limit Exceeded","pass":"n, m, k = map(int, input().split())\na = list(map(int, input().split()))\nb = list(map(int, input().split()))\n\nA = [0] * (n + 1)\nfor i in range(1, n + 1):\n A[i] = A[i - 1] + a[i - 1]\n\nB = [0] * (m + 1)\nfor i in range(1, m + 1):\n B[i] = B[i - 1] + b[i - 1]\n\nans = 0\nfor i in range(n + 1):\n for j in range(m + 1):\n t = A[i] + B[j]\n if t > k:\n break\n else:\n ans = max(ans, i + j)\n\nprint(ans)\n","fail":"n, m, k = map(int, input().split())\na = list(map(int, input().split()))\nb = list(map(int, input().split()))\n\nA = [0] * (n + 1)\nfor i in range(1, n + 1):\n A[i] = A[i - 1] + a[i - 1]\n\nB = [0] * (m + 1)\nfor i in range(1, m + 1):\n B[i] = B[i - 1] + b[i - 1]\n\nans = 0\nbest = m\nfor i in range(n + 1):\n for j in range(best, -1, -1):\n t = A[i] + B[j]\n if t <= k:\n ans = max(ans, i + j)\n best = j\n break\nprint(ans)\n","change":"replace","i1":13,"i2":21,"j1":13,"j2":21,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02623","language":"Python","original_status":"Runtime Error","pass":"n, m, k = map(int, input().split())\na = list(map(int, input().split()))\nb = list(map(int, input().split()))\nif k >= sum(a) + sum(b):\n print(n + m)\n exit()\nans = -1\ntotal_time = 0\na_cnt = 0\nb_cnt = 0\nwhile total_time <= k:\n read_time = min(a[a_cnt], b[b_cnt])\n if read_time == a[a_cnt]:\n if a_cnt < len(a) - 1:\n a_cnt += 1\n else:\n b_cnt += 1\n else:\n if b_cnt < len(b) - 1:\n b_cnt += 1\n else:\n a_cnt += 1\n total_time += read_time\n ans += 1\n\nprint(ans)\n","fail":"import numpy as np\nfrom bisect import bisect_right\n\nn, m, k = map(int, input().split())\na = [0] + list(map(int, input().split()))\nb = [0] + list(map(int, input().split()))\na = np.cumsum(a)\nb = np.cumsum(b)\n\nans = 0\nfor a_num, time in enumerate(a):\n if time > k:\n continue\n b_num = bisect_right(b, k - time)\n num = a_num + b_num - 1\n if num > ans:\n ans = num\nprint(ans)\n","change":"replace","i1":0,"i2":25,"j1":0,"j2":17,"error":"0","stderr":null,"stdout":"3\n"} {"problem_id":"p02623","language":"Python","original_status":"Runtime Error","pass":"import itertools\nimport sys\n\ninput = sys.stdin.readline\n\nn, m, k = map(int, input().split())\na = list(map(int, input().split()))\nb = list(map(int, input().split()))\n\nans = 0\na_cum = [0] + list(itertools.accumulate(a))\nb_cum = [0] + list(itertools.accumulate(b))\n\ny = m\nfor x in range(len(a_cum)):\n if a_cum[x] > k:\n break\n while b[y] > k - a[x]:\n y -= 1\n ans = max(ans, x + y)\n\nprint(ans)\n","fail":"import itertools\nimport sys\n\ninput = sys.stdin.readline\n\nn, m, k = map(int, input().split())\na = list(map(int, input().split()))\nb = list(map(int, input().split()))\n\nans = 0\na_cum = [0] + list(itertools.accumulate(a))\nb_cum = [0] + list(itertools.accumulate(b))\n\ny = m # len(b_cum) - 1\nfor x in range(len(a_cum)):\n if a_cum[x] > k:\n break\n while b_cum[y] > k - a_cum[x]:\n y -= 1\n ans = max(ans, x + y)\n\nprint(ans)\n","change":"replace","i1":13,"i2":18,"j1":13,"j2":18,"error":"IndexError: list index out of range","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02623\/Python\/s326887515.py\", line 18, in \n while b[y] > k - a[x]:\nIndexError: list index out of range\n","stdout":null} {"problem_id":"p02623","language":"Python","original_status":"Time Limit Exceeded","pass":"import sys\nimport itertools\n\nN, M, K = map(int, input().split())\nA = list(map(int, sys.stdin.readline().rsplit()))\nB = list(map(int, sys.stdin.readline().rsplit()))\n\nsA = [0] + list(itertools.accumulate(A))\nsB = [0] + list(itertools.accumulate(B))\n\nres = 0\nfor i in range(N + 1):\n for j in range(M + 1):\n if sA[i] + sB[j] <= K:\n res = max(res, i + j)\n else:\n break\n\nprint(res)\n","fail":"import sys\nimport itertools\nimport bisect\n\nN, M, K = map(int, input().split())\nA = list(map(int, sys.stdin.readline().rsplit()))\nB = list(map(int, sys.stdin.readline().rsplit()))\n\nsA = [0] + list(itertools.accumulate(A))\nsB = [0] + list(itertools.accumulate(B))\n\nres = 0\nfor i, a in enumerate(sA):\n if K < a:\n break\n j = bisect.bisect_right(sB, K - a) - 1\n res = max(res, i + j)\n\nprint(res)\n","change":"replace","i1":2,"i2":17,"j1":2,"j2":17,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02623","language":"Python","original_status":"Runtime Error","pass":"n, m, k = map(int, input().split())\nA = list(map(int, input().split()))\nB = list(map(int, input().split()))\na = [0]\nb = [0]\nfor i in range(n):\n a.append(a[i] + A[i])\nfor i in range(m):\n b.append(b[i] + B[i])\nans = 0\nj = m\nfor i in range(n + 1):\n if a[0] > k:\n break\n while b[j] > k - a[i]:\n j -= 1\n ans = max(ans, i + j)\nprint(ans)\n","fail":"n, m, k = map(int, input().split())\nA = list(map(int, input().split()))\nB = list(map(int, input().split()))\na = [0]\nb = [0]\nfor i in range(n):\n a.append(a[i] + A[i])\nfor i in range(m):\n b.append(b[i] + B[i])\nans = 0\nj = m\nfor i in range(n + 1):\n if a[i] > k:\n break\n while b[j] > k - a[i]:\n j -= 1\n ans = max(ans, i + j)\nprint(ans)\n","change":"replace","i1":12,"i2":13,"j1":12,"j2":13,"error":"IndexError: list index out of range","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02623\/Python\/s808740023.py\", line 15, in \n while b[j] > k - a[i]:\nIndexError: list index out of range\n","stdout":null} {"problem_id":"p02623","language":"Python","original_status":"Runtime Error","pass":"N, M, K = map(int, input().split())\nA = list(map(int, input().split()))\nB = list(map(int, input().split()))\n\nA_sum = [0]\nfor i in range(N):\n A_sum.append(A_sum[i] + A[i])\nB_sum = [0]\nfor i in range(N):\n B_sum.append(B_sum[i] + B[i])\nB_sum.append(10**10)\n\nres = 0\nfor i in range(len(A_sum)):\n low = 0\n high = len(B_sum)\n while high - low > 1:\n mid = (low + high) \/\/ 2\n if A_sum[i] + B_sum[mid] <= K:\n low = mid\n else:\n high = mid\n if A_sum[i] + B_sum[low] <= K:\n res = max(res, i + low)\n\nprint(res)\n","fail":"N, M, K = map(int, input().split())\nA = list(map(int, input().split()))\nB = list(map(int, input().split()))\n\nA_sum = [0]\nfor i in range(N):\n A_sum.append(A_sum[i] + A[i])\nB_sum = [0]\nfor i in range(M):\n B_sum.append(B_sum[i] + B[i])\nB_sum.append(10**10)\n\nres = 0\nfor i in range(len(A_sum)):\n low = 0\n high = len(B_sum)\n while high - low > 1:\n mid = (low + high) \/\/ 2\n if A_sum[i] + B_sum[mid] <= K:\n low = mid\n else:\n high = mid\n if A_sum[i] + B_sum[low] <= K:\n res = max(res, i + low)\n\nprint(res)\n","change":"replace","i1":8,"i2":9,"j1":8,"j2":9,"error":"0","stderr":null,"stdout":"3\n"} {"problem_id":"p02623","language":"Python","original_status":"Runtime Error","pass":"N, M, K = map(int, input().split())\nA = list(map(int, input().split()))\nB = list(map(int, input().split()))\n\nb_sum = 0\nfor i in range(M):\n b_sum += B[i]\n if b_sum > K:\n b_sum -= B[i]\n j = i - 1\n break\nresult = j + 1\n\na_sum = 0\nfor i in range(N):\n a_sum += A[i]\n if a_sum > K:\n break\n while a_sum + b_sum > K:\n b_sum -= B[j]\n j -= 1\n result = max(result, (i + 1) + (j + 1))\nprint(result)\n","fail":"N, M, K = map(int, input().split())\nA = list(map(int, input().split()))\nB = list(map(int, input().split()))\n\nb_sum = 0\nfor i in range(M):\n b_sum += B[i]\n if b_sum > K:\n b_sum -= B[i]\n j = i - 1\n break\nelse:\n j = M - 1\nresult = j + 1\n\na_sum = 0\nfor i in range(N):\n a_sum += A[i]\n if a_sum > K:\n break\n while a_sum + b_sum > K:\n b_sum -= B[j]\n j -= 1\n result = max(result, (i + 1) + (j + 1))\nprint(result)\n","change":"insert","i1":11,"i2":11,"j1":11,"j2":13,"error":"0","stderr":null,"stdout":"3\n"} {"problem_id":"p02624","language":"Python","original_status":"Time Limit Exceeded","pass":"import numpy as np\nfrom numba import njit\n\nn = int(input())\n\n\n@njit\ndef f(n):\n cnt = np.zeros(n + 1, np.int32)\n for i in range(1, n + 1):\n cnt[i::i] += 1\n\n return (cnt * np.arange(n + 1)).sum()\n\n\nans = f(n)\nprint(ans)\n","fail":"import numpy as np\nfrom numba import njit\n\nn = int(input())\n\n\n@njit\ndef f(n):\n cnt = np.zeros(n + 1, np.int16)\n for i in range(1, n + 1):\n cnt[i::i] += 1\n\n return (cnt * np.arange(n + 1)).sum()\n\n\nans = f(n)\nprint(ans)\n","change":"replace","i1":8,"i2":9,"j1":8,"j2":9,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02624","language":"Python","original_status":"Time Limit Exceeded","pass":"from numba import njit\nimport numpy as np\n\n\n@njit(\"i8(i8)\")\ndef solve(n):\n ans = 1\n res = np.ones(n + 1, dtype=np.int64)\n for i in range(2, n + 1):\n res[i::i] += 1\n res[i] *= i\n ans += res[i]\n return ans\n\n\nN = int(input())\nprint(solve(N))\n","fail":"from numba import njit\nimport numpy as np\n\n\n@njit(\"i8(i8)\")\ndef solve(n):\n ans = 1\n res = np.ones(n + 1, dtype=np.int64)\n for i in range(2, n + 1):\n for j in range(i, n + 1, i):\n res[j] += 1\n ans += i * res[i]\n return ans\n\n\nN = int(input())\nprint(solve(N))\n","change":"replace","i1":9,"i2":12,"j1":9,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02624","language":"Python","original_status":"Time Limit Exceeded","pass":"import sys\nimport math\n\n\ndef yakusu(K):\n Y = set()\n for i in range(1, int(math.sqrt(K)) + 1):\n if K % i == 0:\n Y.add(i)\n Y.add(K \/\/ i)\n return len(Y)\n\n\ndef main():\n N = int(sys.stdin.readline().rstrip())\n\n sum_ = 0\n for k in range(1, N + 1):\n sum_ += k * yakusu(k)\n\n print(sum_)\n\n\nmain()\n","fail":"import sys\nimport math\n\n\ndef main():\n N = int(sys.stdin.readline().rstrip())\n\n sum_ = 0\n\n for i in range(1, int(math.sqrt(N)) + 1):\n\n sum_ += i**2\n\n k1 = N \/\/ i\n # k2 = i\n\n k1_sum = k1 * (k1 + 1) \/\/ 2\n k2_sum = i * (i + 1) \/\/ 2\n sum_ += 2 * i * (k1_sum - k2_sum)\n\n print(sum_)\n\n\nmain()\n","change":"replace","i1":2,"i2":19,"j1":2,"j2":19,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02624","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\n\ndp = [0] * (N + 1)\nfor i in range(1, N + 1):\n cursor = i\n while cursor <= N:\n dp[cursor] += 1\n cursor += i\n\nans = 0\nfor i in range(1, N + 1):\n ans += i * dp[i]\n\nprint(ans)\n","fail":"N = int(input())\n\nans = 0\nfor i in range(1, N + 1):\n start = i\n n = N \/\/ i\n end = i * n\n ans += n * (start + end) \/\/ 2\n\n\nprint(ans)\n","change":"replace","i1":1,"i2":12,"j1":1,"j2":9,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02624","language":"Python","original_status":"Time Limit Exceeded","pass":"import sys\nfrom io import StringIO\nimport unittest\nimport os\n\n# \u518d\u5e30\u51e6\u7406\u4e0a\u9650(dfs\u4f5c\u6210\u6642\u306b\u8a2d\u5b9a\u3059\u308b\u306e\u304c\u9762\u5012\u306a\u306e\u3067\u9650\u5ea6\u8fd1\u3044\u5024\u3092\u7d44\u307f\u8fbc\u3080)\nsys.setrecursionlimit(999999999)\n\n\n# \u5b9f\u88c5\u3092\u884c\u3046\u95a2\u6570\ndef resolve(test_def_name=\"\"):\n n = int(input())\n\n ans = 0\n\n for j in range(1, n + 1):\n for i in range(1, n + 1):\n if i % j == 0:\n ans += i\n\n print(ans)\n\n\n# \u30c6\u30b9\u30c8\u30af\u30e9\u30b9\nclass TestClass(unittest.TestCase):\n def assertIO(self, assert_input, output):\n stdout, sat_in = sys.stdout, sys.stdin\n sys.stdout, sys.stdin = StringIO(), StringIO(assert_input)\n resolve(sys._getframe().f_back.f_code.co_name)\n sys.stdout.seek(0)\n out = sys.stdout.read()[:-1]\n sys.stdout, sys.stdin = stdout, sat_in\n self.assertEqual(out, output)\n\n def test_input_1(self):\n test_input = \"\"\"4\"\"\"\n output = \"\"\"23\"\"\"\n self.assertIO(test_input, output)\n\n def test_input_2(self):\n test_input = \"\"\"100\"\"\"\n output = \"\"\"26879\"\"\"\n self.assertIO(test_input, output)\n\n # def test_input_3(self):\n # test_input = \"\"\"10000000\"\"\"\n # output = \"\"\"838627288460105\"\"\"\n # self.assertIO(test_input, output)\n\n # \u81ea\u4f5c\u30c6\u30b9\u30c8\u30d1\u30bf\u30fc\u30f3\u306e\u3072\u306a\u5f62(\u5229\u7528\u6642\u306f\u300ctes_t\u300d\u306e\u30a2\u30f3\u30c0\u30fc\u30d0\u30fc\u3092\u524a\u9664\u3059\u308b\u3053\u3068\n def tes_t_1original_1(self):\n test_input = \"\"\"\u30c7\u30fc\u30bf\"\"\"\n output = \"\"\"\u30c7\u30fc\u30bf\"\"\"\n self.assertIO(test_input, output)\n\n\n# \u5b9f\u88c5or\u30c6\u30b9\u30c8\u306e\u547c\u3073\u51fa\u3057\nif __name__ == \"__main__\":\n if os.environ.get(\"USERNAME\") is None:\n # AtCoder\u63d0\u51fa\u6642\u306e\u5834\u5408\n resolve()\n\n else:\n # \u81eaPC\u306e\u5834\u5408\n unittest.main()\n","fail":"import sys\nfrom io import StringIO\nimport unittest\nimport os\n\nsys.setrecursionlimit(999999999)\n\n\ndef get_arithmetic_progression(a, d, n):\n return n * (2 * a + (n - 1) * d) \/\/ 2\n\n\n# \u5b9f\u88c5\u3092\u884c\u3046\u95a2\u6570\ndef resolve(test_def_name=\"\"):\n n = int(input())\n\n ans = 0\n for i in range(1, n + 1):\n ans += get_arithmetic_progression(i, i, n \/\/ i)\n\n print(ans)\n\n\n# \u30c6\u30b9\u30c8\u30af\u30e9\u30b9\nclass TestClass(unittest.TestCase):\n def assertIO(self, assert_input, output):\n stdout, sat_in = sys.stdout, sys.stdin\n sys.stdout, sys.stdin = StringIO(), StringIO(assert_input)\n resolve(sys._getframe().f_back.f_code.co_name)\n sys.stdout.seek(0)\n out = sys.stdout.read()[:-1]\n sys.stdout, sys.stdin = stdout, sat_in\n self.assertEqual(out, output)\n\n def test_input_1(self):\n test_input = \"\"\"4\"\"\"\n output = \"\"\"23\"\"\"\n self.assertIO(test_input, output)\n\n def test_input_2(self):\n test_input = \"\"\"100\"\"\"\n output = \"\"\"26879\"\"\"\n self.assertIO(test_input, output)\n\n # def test_input_3(self):\n # test_input = \"\"\"10000000\"\"\"\n # output = \"\"\"838627288460105\"\"\"\n # self.assertIO(test_input, output)\n\n # \u81ea\u4f5c\u30c6\u30b9\u30c8\u30d1\u30bf\u30fc\u30f3\u306e\u3072\u306a\u5f62(\u5229\u7528\u6642\u306f\u300ctes_t\u300d\u306e\u30a2\u30f3\u30c0\u30fc\u30d0\u30fc\u3092\u524a\u9664\u3059\u308b\u3053\u3068\n def tes_t_1original_1(self):\n test_input = \"\"\"\u30c7\u30fc\u30bf\"\"\"\n output = \"\"\"\u30c7\u30fc\u30bf\"\"\"\n self.assertIO(test_input, output)\n\n\n# \u5b9f\u88c5or\u30c6\u30b9\u30c8\u306e\u547c\u3073\u51fa\u3057\nif __name__ == \"__main__\":\n if os.environ.get(\"USERNAME\") is None:\n # AtCoder\u63d0\u51fa\u6642\u306e\u5834\u5408\n resolve()\n\n else:\n # \u81eaPC\u306e\u5834\u5408\n unittest.main()\n","change":"replace","i1":5,"i2":19,"j1":5,"j2":19,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02624","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\n\nans = 0\n\nfor i in range(1, n + 1):\n for j in range(i, n + 1, i):\n ans += j\n\nprint(ans)\n","fail":"n = int(input())\n\nans = n * (n + 1) \/\/ 2\n\nfor i in range(2, n + 1):\n for j in range(i, n + 1, i):\n ans += j\n\nprint(ans)\n","change":"replace","i1":2,"i2":5,"j1":2,"j2":5,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02624","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\nans = 0\nfor i in range(1, n + 1):\n for j in range(i, n + 1, i):\n ans += j\nprint(ans)\n","fail":"n = int(input())\nans = 0\nfor i in range(1, int(n**0.5) + 1):\n k = n \/\/ i\n ans += i * k * (k + 1) \/\/ 2\n if i != k:\n l = n \/\/ (i + 1)\n ans += i * (i + 1) * (k + l + 1) * (k - l) \/\/ 4\nprint(ans)\n","change":"replace","i1":2,"i2":5,"j1":2,"j2":8,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02624","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\nout = 0\nfor i in range(n):\n j = 1\n while (i + 1) * j <= n:\n out += (i + 1) * j\n j += 1\n\nprint(out)\n","fail":"n = int(input())\nout = 0\nfor i in range(n):\n k = n \/\/ (i + 1)\n out += (i + 1) * k * (k + 1) \/ 2\n\nprint(int(out))\n","change":"replace","i1":3,"i2":9,"j1":3,"j2":7,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02624","language":"Python","original_status":"Runtime Error","pass":"# D - Sum of Divisors\nfrom numba import njit\n\n\n@njit\ndef main():\n N = int(input())\n res = 0\n for a in range(1, N + 1):\n for b in range(1, N \/\/ a + 1):\n res += a * b\n print(res)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"# D - Sum of Divisors\nfrom numba import njit\n\n\n@njit\ndef solve(N):\n res = 0\n for a in range(1, N + 1):\n for b in range(1, N \/\/ a + 1):\n res += a * b\n return res\n\n\ndef main():\n N = int(input())\n print(solve(N))\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":5,"i2":12,"j1":5,"j2":16,"error":"ModuleNotFoundError: No module named 'numba'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02624\/Python\/s317956629.py\", line 2, in \n from numba import njit\nModuleNotFoundError: No module named 'numba'\n","stdout":null} {"problem_id":"p02624","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nnum = [1 for _ in range(N + 1)]\nfor i in range(2, N + 1):\n cnt = 1\n while cnt * i <= N:\n num[cnt * i] += 1\n cnt += 1\nans = 0\nfor i in range(1, N + 1):\n ans += num[i] * i\nprint(ans)\n","fail":"N = int(input())\nans = 0\nfor i in range(1, N + 1):\n largest = N \/\/ i * i\n ans += ((largest + i) * (N \/\/ i)) \/\/ 2\nprint(ans)\n","change":"replace","i1":1,"i2":10,"j1":1,"j2":5,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02624","language":"Python","original_status":"Time Limit Exceeded","pass":"#!\/usr\/bin\/env python3\nimport numpy as np\n\n\ndef solve(N):\n fx = np.zeros(N + 1, dtype=np.uint32)\n for i in range(1, N + 1):\n fx[i::i] += 1\n return np.sum(np.arange(0, N + 1, dtype=np.uint64) * fx)\n\n\ndef main():\n N = int(input()) # type: int\n answer = solve(N)\n print(answer)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"#!\/usr\/bin\/env python3\n\n# N N'\n# | 1 2 3 4 5\n# 1 | 1 2 3 4 5 : N \/\/ 1 1 * N' (N'+1) \/\/ 2\n# 2 | 2 4 : N \/\/ 2 2 * N' (N'+1) \/\/ 2\n# 3 | 3 : N \/\/ 3 3 * N' (N'+1) \/\/ 2\n# 4 | 4 : N \/\/ 4 4 * N' (N'+1) \/\/ 2\n# 5 | 5 : N \/\/ 5 5 * N' (N'+1) \/\/ 2\n\n\ndef solve(N):\n answer = 0\n for i in range(1, N + 1):\n mprime = N \/\/ i\n answer += i * (mprime * (mprime + 1)) \/\/ 2\n return answer\n\n\ndef main():\n N = int(input()) # type: int\n answer = solve(N)\n print(answer)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":1,"i2":9,"j1":1,"j2":17,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02626","language":"Python","original_status":"Runtime Error","pass":"import sys\n\n\ndef solve(n, aaa):\n if n == 2:\n h, m = divmod(sum(aaa), 2)\n if m == 1 or h > aaa[0]:\n return -1\n return aaa[0] - h\n\n x = 0\n for a in aaa[2:]:\n x ^= a\n a0, a1 = aaa[:2]\n s = a0 + a1\n\n if s & 1 != x & 1:\n return -1\n\n p, q = 0, 0\n\n b = 1 << 40\n while b:\n bx = x & b\n if bx == 0:\n # print('bx', s)\n # print(f'{b:040b}')\n # print(f'{p:040b}')\n # print(f'{q:040b}')\n # print(f'{a0:040b}')\n # print(f'{a1:040b}')\n # print()\n if s >= 2 * b:\n if p + b <= a0:\n p |= b\n q |= b\n s -= 2 * b\n # else:\n # return -1\n else:\n if s < b:\n return -1\n if p + b <= a0 and q + b > a1:\n p |= b\n else:\n q |= b\n s -= b\n\n # print(f'{b:040b}')\n # print(f'{p:040b}')\n # print(f'{q:040b}')\n # print(f'{a0:040b}')\n # print(f'{a1:040b}')\n # print()\n\n b >>= 1\n\n if p == 0:\n return -1\n assert s == 0\n assert p ^ q == x\n assert a0 - p == q - a1\n return a0 - p\n\n\nn, *aaa = map(int, sys.stdin.buffer.read().split())\nprint(solve(n, aaa))\n","fail":"import sys\n\n\ndef solve(n, aaa):\n if n == 2:\n h, m = divmod(sum(aaa), 2)\n if m == 1 or h > aaa[0]:\n return -1\n return aaa[0] - h\n\n x = 0\n for a in aaa[2:]:\n x ^= a\n a0, a1 = aaa[:2]\n s = a0 + a1\n\n if s & 1 != x & 1:\n return -1\n\n p, q = 0, 0\n\n b = 1 << 40\n swappable = []\n while b:\n bx = x & b\n if bx == 0:\n # print('bx=0', s)\n # print(f'{b:040b}')\n # print(f'{p:040b}')\n # print(f'{q:040b}')\n # print(f'{a0:040b}')\n # print(f'{a1:040b}')\n # print()\n if s >= 2 * b:\n if p | b <= a0:\n p |= b\n q |= b\n s -= 2 * b\n elif swappable:\n bs = swappable.pop()\n p ^= bs\n q ^= bs\n p |= b\n q |= b\n s -= 2 * b\n else:\n return -1\n else:\n if s < b:\n return -1\n if p | b <= a0 and q | b > a1:\n p |= b\n swappable.append(b)\n else:\n q |= b\n s -= b\n\n # print('bx=1', s)\n # print(f'{b:040b}')\n # print(f'{p:040b}')\n # print(f'{q:040b}')\n # print(f'{a0:040b}')\n # print(f'{a1:040b}')\n # print()\n\n b >>= 1\n\n if p == 0:\n return -1\n assert s == 0\n assert p ^ q == x\n assert a0 - p == q - a1\n return a0 - p\n\n\nn, *aaa = map(int, sys.stdin.buffer.read().split())\nprint(solve(n, aaa))\n","change":"replace","i1":22,"i2":54,"j1":22,"j2":64,"error":"0","stderr":null,"stdout":1.0} {"problem_id":"p02627","language":"Python","original_status":"Runtime Error","pass":"s = input()\nif s.isuper():\n print(\"A\")\nelse:\n print(\"a\")\n","fail":"s = input()\nif s.isupper():\n print(\"A\")\nelse:\n print(\"a\")\n","change":"replace","i1":1,"i2":2,"j1":1,"j2":2,"error":"AttributeError: 'str' object has no attribute 'isuper'. Did you mean: 'isupper'?","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02627\/Python\/s327847448.py\", line 2, in \n if s.isuper():\nAttributeError: 'str' object has no attribute 'isuper'. Did you mean: 'isupper'?\n","stdout":null} {"problem_id":"p02628","language":"Python","original_status":"Runtime Error","pass":"N, K = (int(i) for i in input().split())\np = [input().split()]\n\nsp = sorted(p)\nprint(sum(sp[:K]))\n","fail":"N, K = (int(i) for i in input().split())\np = [int(i) for i in input().split()]\n\nsp = sorted(p)\nprint(sum(sp[:K]))\n","change":"replace","i1":1,"i2":2,"j1":1,"j2":2,"error":"TypeError: unsupported operand type(s) for +: 'int' and 'list'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02628\/Python\/s927789922.py\", line 5, in \n print(sum(sp[:K]))\nTypeError: unsupported operand type(s) for +: 'int' and 'list'\n","stdout":null} {"problem_id":"p02628","language":"Python","original_status":"Time Limit Exceeded","pass":"import itertools\n\nN, K = map(int, input().split())\nP = list(map(int, input().split()))\n\n# tmp = itertools.combinations_with_replacement(P, K)\ntmp = itertools.combinations(P, K)\n\nhoge = []\nfor i in tmp:\n hoge.append(sum(i))\n\nprint(min(hoge))\n","fail":"# import itertools\n\nN, K = map(int, input().split())\nP = list(map(int, input().split()))\n\n# tmp = itertools.combinations_with_replacement(P, K)\n# tmp = itertools.combinations(P, K)\n\nP.sort()\nprint(sum(P[0:K]))\n\n# hoge = []\n# for i in tmp:\n# hoge.append(sum(i))\n\n# print(min(hoge))\n","change":"replace","i1":0,"i2":13,"j1":0,"j2":16,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02628","language":"Python","original_status":"Time Limit Exceeded","pass":"N, K = map(int, input().split())\nP = list(map(int, input().split()))\n\nans = float(\"inf\")\nfor i in range(1 << len(P)):\n sum = 0\n cnt = 0\n for j in range(len(P)):\n if (i >> j) & 1 == 1:\n sum += P[j]\n cnt += 1\n if cnt == K:\n ans = min(ans, sum)\nprint(ans)\n","fail":"N, K = map(int, input().split())\nP = list(map(int, input().split()))\n\nP = sorted(P)\n\nprint(sum(P[:K]))\n","change":"replace","i1":3,"i2":14,"j1":3,"j2":6,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02628","language":"Python","original_status":"Time Limit Exceeded","pass":"import itertools\n\nN, K = map(int, input().split())\np = list(map(int, input().split()))\nans = 10e6\n\nfor i in itertools.combinations(p, K):\n tmp = sum(list(i))\n if tmp < ans:\n ans = tmp\n\nprint(ans)\n","fail":"N, K = map(int, input().split())\np = list(map(int, input().split()))\n\nans = sum(sorted(p)[:K])\nprint(ans)\n","change":"replace","i1":0,"i2":11,"j1":0,"j2":4,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02628","language":"Python","original_status":"Runtime Error","pass":"N, K = map(int, input().split())\nP = list(map(int, input().split())).sort()\nprint(sum(P[:K]))\n","fail":"N, K = map(int, input().split())\nP = sorted(list(map(int, input().split())))\nprint(sum(P[:K]))\n","change":"replace","i1":1,"i2":2,"j1":1,"j2":2,"error":"TypeError: 'NoneType' object is not subscriptable","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02628\/Python\/s595641778.py\", line 3, in \n print(sum(P[:K]))\nTypeError: 'NoneType' object is not subscriptable\n","stdout":null} {"problem_id":"p02628","language":"Python","original_status":"Time Limit Exceeded","pass":"import itertools\n\nN, K = map(int, input().split())\np = list(map(int, input().split()))\n\nans = sum(p)\nfor v in itertools.permutations(p, K):\n ans = min(ans, sum(v))\n\nprint(ans)\n","fail":"import itertools\n\nN, K = map(int, input().split())\np = list(map(int, input().split()))\n\nans = 0\nfor _ in range(K):\n min_index = p.index(min(p))\n minv = p.pop(min_index)\n ans += minv\n\nprint(ans)\n","change":"replace","i1":5,"i2":8,"j1":5,"j2":10,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02629","language":"Python","original_status":"Runtime Error","pass":"# -*- coding: utf-8 -*-\nfrom numba import njit, void, i8\n\n\ndef get_input() -> int:\n \"\"\"\n \u6a19\u6e96\u5165\u529b\u3092\u53d6\u5f97\u3059\u308b.\n\n Returns:\\\\n\n int: \u6a19\u6e96\u5165\u529b\n \"\"\"\n N = int(input())\n\n return N\n\n\n@njit(void(i8))\ndef main(N: int) -> None:\n \"\"\"\n \u6c42\u89e3\u51e6\u7406.\n\n Args:\\\\n\n N (int): \u6574\u6570\n \"\"\"\n # \u6c42\u89e3\u51e6\u7406\n ans = \"\"\n while N > 0:\n N -= 1\n ans += chr(ord(\"a\") + N % 26)\n N \/\/= 26\n ans = ans[::-1]\n\n # \u7d50\u679c\u51fa\u529b\n print(ans)\n\n\nif __name__ == \"__main__\":\n N = get_input()\n main(N)\n","fail":"# -*- coding: utf-8 -*-\n\n\ndef get_input() -> int:\n \"\"\"\n \u6a19\u6e96\u5165\u529b\u3092\u53d6\u5f97\u3059\u308b.\n\n Returns:\\\\n\n int: \u6a19\u6e96\u5165\u529b\n \"\"\"\n N = int(input())\n\n return N\n\n\ndef main(N: int) -> None:\n \"\"\"\n \u6c42\u89e3\u51e6\u7406.\n\n Args:\\\\n\n N (int): \u6574\u6570\n \"\"\"\n # \u6c42\u89e3\u51e6\u7406\n ans = \"\"\n while N > 0:\n N -= 1\n ans += chr(ord(\"a\") + N % 26)\n N \/\/= 26\n ans = ans[::-1]\n\n # \u7d50\u679c\u51fa\u529b\n print(ans)\n\n\nif __name__ == \"__main__\":\n N = get_input()\n main(N)\n","change":"replace","i1":1,"i2":17,"j1":1,"j2":15,"error":"ModuleNotFoundError: No module named 'numba'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02629\/Python\/s063087830.py\", line 2, in \n from numba import njit, void, i8\nModuleNotFoundError: No module named 'numba'\n","stdout":null} {"problem_id":"p02629","language":"Python","original_status":"Runtime Error","pass":"alphabet = \"abcdefghijklmnopqrstrvwxyz\"\n\n\nn = int(input()) - 1\n\nA = []\nwhile n > 0:\n A.append(n % 26)\n n \/\/= 26\n\nm = len(A)\n\nif m == 1:\n print(alphabet[A[0]])\n exit()\n\nANS = []\nANS.append(alphabet[A[0]])\nfor i in range(1, m - 1):\n if A[i] == 0:\n ANS.append(\"z\")\n A[i + 1] -= 1\n else:\n ANS.append(alphabet[A[i] - 1])\nif A[-1]:\n ANS.append(alphabet[A[-1] - 1])\n\nprint(\"\".join(ANS[::-1]))\n","fail":"alphabets = \"abcdefghijklmnopqrstuvwxyz\"\n\n\nn = int(input())\n\nA = []\nwhile True:\n A.append(n % 26)\n n \/\/= 26\n if n == 0:\n break\n\nfor i in range(len(A) - 1):\n if A[i] <= 0:\n A[i] += 26\n A[i + 1] -= 1\n\nANS = []\nfor a in A[::-1]:\n if a == 0:\n continue\n ANS.append(alphabets[a - 1])\n\nprint(\"\".join(ANS))\n","change":"replace","i1":0,"i2":28,"j1":0,"j2":24,"error":"0","stderr":null,"stdout":"b\n"} {"problem_id":"p02630","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = list(map(int, input().split()))\nQ = int(input())\nBC = [list(map(int, input().split())) for i in range(Q)]\n# print(N)\n# print(A)\n# print(Q)\n# print(B)\n\ntotal = sum(A)\n\nfor i in range(Q):\n Bi = BC[i][0]\n Ci = BC[i][1]\n\n diff = 0\n for j in range(len(A)):\n if A[j] == Bi:\n diff += Ci - A[j]\n A[j] = Ci\n\n total += diff\n print(total)\n","fail":"import itertools\n\nN = int(input())\nA = list(map(int, input().split()))\nQ = int(input())\nBC = [list(map(int, input().split())) for i in range(Q)]\n# print(N)\n# print(A)\n# print(Q)\n# print(B)\n\ndistribution = {}\nmax_A = max(A)\nmax_BC = max(list(itertools.chain.from_iterable(BC)))\nmaximum = max([max_A, max_BC])\n# print(max_A, max_BC, maximum)\nfor i in range(maximum + 1):\n distribution[i] = 0\n\nfor Ai in A:\n distribution[Ai] += 1\n# print(distribution)\n\ntotal = sum(A)\nfor i in range(Q):\n Bi = BC[i][0]\n Ci = BC[i][1]\n num_Bi = distribution.get(Bi)\n diff = (Ci - Bi) * num_Bi\n\n distribution[Bi] = 0\n # print(num_Bi, distribution.get(Bi), Ci)\n distribution[Ci] += num_Bi\n\n total += diff\n print(total)\n","change":"replace","i1":0,"i2":20,"j1":0,"j2":33,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02630","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = list(map(int, input().split()))\nq = int(input())\nB = [list(map(int, input().split())) for _ in range(q)]\n\n# print(n,a,q,B)\n\n# from collections import Counter\n\n# _a = Counter()\n\nfor (b, c) in B:\n a = [c if x == b else x for x in a]\n print(sum(a))\n","fail":"n = int(input())\na = list(map(int, input().split()))\nq = int(input())\nB = [list(map(int, input().split())) for _ in range(q)]\n\nfrom collections import Counter\n\nans = sum(a.copy())\na = Counter(a)\n\nfor (b, c) in B:\n ans += a[b] * (c - b)\n print(ans)\n a[c] += a[b]\n a[b] = 0\n","change":"replace","i1":5,"i2":14,"j1":5,"j2":15,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02630","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = [int(s) for s in input().split()]\nQ = int(input())\nB = []\nC = []\nfor _ in range(Q):\n b, c = [int(s) for s in input().split()]\n B.append(b)\n C.append(c)\n\nA_dict = {}\nfor a in A:\n A_dict[a] = A.count(a)\n\nA_sum = sum(A)\nfor b, c in zip(B, C):\n if b in A_dict.keys():\n n = A_dict[b]\n else:\n n = 0\n A_dict[b] = 0\n if c in A_dict.keys():\n A_dict[c] += n\n else:\n A_dict[c] = n\n A_sum += (c - b) * n\n print(A_sum)\n","fail":"from collections import defaultdict\n\nN = int(input())\nA = [int(s) for s in input().split()]\nQ = int(input())\nB = []\nC = []\nfor _ in range(Q):\n b, c = [int(s) for s in input().split()]\n B.append(b)\n C.append(c)\n\nA_dict = defaultdict(int)\nfor a in A:\n A_dict[a] += 1\n\nA_sum = sum(A)\nfor b, c in zip(B, C):\n n = A_dict[b]\n A_dict[b] = 0\n A_dict[c] += n\n A_sum += (c - b) * n\n print(A_sum)\n","change":"replace","i1":0,"i2":25,"j1":0,"j2":21,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02630","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\narr = list(map(int, input().split()))\nQ = int(input())\nque = [list(map(int, input().split())) for _ in range(Q)]\n\nfor i in que:\n for j in range(N):\n if arr[j] == i[0]:\n arr[j] = i[1]\n print(sum(arr))\n","fail":"N = int(input())\narr = list(map(int, input().split()))\nQ = int(input())\nque = [list(map(int, input().split())) for _ in range(Q)]\n\ncount_list = [0] * (10**5 + 1)\n\nfor i in range(N):\n count_list[arr[i]] += 1\n\nans = sum(arr)\n\nfor i in que:\n keep = count_list[i[0]]\n c_ans = ans + keep * (i[1] - i[0])\n print(c_ans)\n ans = c_ans\n if count_list[i[0]] == 0:\n continue\n if count_list[i[0]] != 0:\n count_list[i[1]] += count_list[i[0]]\n count_list[i[0]] = 0\n","change":"replace","i1":5,"i2":10,"j1":5,"j2":22,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02630","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = list(map(int, input().split()))\nq = int(input())\nxy = [map(int, input().split()) for _ in range(q)]\nb, c = [list(i) for i in zip(*xy)]\n\nstuck_b = []\nstuck_c = []\nstuck_sum = []\n\nsum = 0\n\nfor cnt_q in range(q):\n sum = 0\n if len(stuck_b) > 0:\n if stuck_b[cnt_q] == b[cnt_q] and stuck_c[cnt_q] == c[cnt_q]:\n print(stuck_sum[cnt_q])\n else:\n for cnt_n in range(n):\n if a[cnt_n] == b[cnt_q]:\n a[cnt_n] = c[cnt_q]\n for num in range(n):\n sum += a[num]\n print(sum)\n else:\n for cnt_n in range(n):\n if a[cnt_n] == b[cnt_q]:\n a[cnt_n] = c[cnt_q]\n for num in range(n):\n sum += a[num]\n print(sum)\n","fail":"n = int(input())\na = list(map(int, input().split()))\nq = int(input())\nxy = [map(int, input().split()) for _ in range(q)]\nb, c = [list(i) for i in zip(*xy)]\n\nans = 0\n\nsum_all = 0\nfor cnt in range(n):\n sum_all += a[cnt]\n\na = sorted(a)\nlist_a_num = [0] * (10**5 + 1)\nfor cnt in range(n):\n list_a_num[a[cnt]] += 1\n\nfor cnt in range(q):\n sum_all += (c[cnt] - b[cnt]) * list_a_num[b[cnt]]\n list_a_num[c[cnt]] += list_a_num[b[cnt]]\n list_a_num[b[cnt]] = 0\n print(sum_all)\n","change":"replace","i1":6,"i2":31,"j1":6,"j2":22,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02630","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = list(map(int, input().split()))\nQ = int(input())\nB = [list(map(int, input().split())) for _ in range(Q)]\n\n\nfor nums in B:\n A = [nums[1] if i == nums[0] else i for i in A]\n print(sum(A))\n","fail":"N = int(input())\nA = list(map(int, input().split()))\nQ = int(input())\nsum_res = sum(A)\ncounter = [0 for _ in range(10**5 + 1)]\n\nfor a in A:\n counter[a] += 1\n\nfor _ in range(Q):\n B, C = map(int, input().split())\n sum_res = sum_res - (counter[B] * B)\n sum_res = sum_res + (counter[B] * C)\n counter[C] += counter[B]\n counter[B] = 0\n print(sum_res)\n","change":"replace","i1":3,"i2":9,"j1":3,"j2":16,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02630","language":"Python","original_status":"Runtime Error","pass":"from collections import Counter\n\nN = int(input())\nA = list(map(int, input().split()))\nQ = int(input())\nB = []\nC = []\nfor _ in range(Q):\n b, c = map(int, input().split())\n B.append(b)\n C.append(c)\n\ncounter = Counter(A)\nans = 0\nfor num, count in counter.items():\n ans += num * count\n\nfor i in range(Q):\n if B[i] in counter:\n ans += counter[B[i]] * C[i] - counter[B[i]] * B[i]\n counter[C[i]] = counter[C[i]] + counter.pop([B[i]])\n print(ans)\n","fail":"from collections import Counter\n\nN = int(input())\nA = list(map(int, input().split()))\nQ = int(input())\nB = []\nC = []\nfor _ in range(Q):\n b, c = map(int, input().split())\n B.append(b)\n C.append(c)\n\ncounter = Counter(A)\nans = 0\nfor num, count in counter.items():\n ans += num * count\n\nfor i in range(Q):\n if B[i] in counter:\n ans += counter[B[i]] * C[i] - counter[B[i]] * B[i]\n counter[C[i]] = counter[C[i]] + counter.pop(B[i])\n print(ans)\n","change":"replace","i1":20,"i2":21,"j1":20,"j2":21,"error":"TypeError: unhashable type: 'list'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02630\/Python\/s734232725.py\", line 21, in \n counter[C[i]] = counter[C[i]] + counter.pop([B[i]])\nTypeError: unhashable type: 'list'\n","stdout":null} {"problem_id":"p02630","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\nls = input()\nq = int(input())\nfor _ in range(q):\n b, q = map(str, input().split())\n ls = ls.replace(b, q)\n print(sum(map(int, ls.split())))\n","fail":"from collections import Counter\n\nn = int(input())\nls = list(map(int, input().split()))\nq = int(input())\ncount = Counter(ls)\nsm = sum(ls)\n\nfor _ in range(q):\n b, q = map(int, input().split())\n if b in count:\n sm -= count[b] * b\n sm += count[b] * q\n print(sm)\n else:\n print(sm)\n if q in count:\n count[q] += count[b]\n\n count[b] = 0\n else:\n count[q] = count[b]\n\n count[b] = 0\n","change":"replace","i1":0,"i2":7,"j1":0,"j2":24,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02630","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = list(map(int, input().split()))\nq = int(input())\nb_c = [list(map(int, input().split())) for i in range(q)]\n\nans = 0\n\nfor i in range(q):\n before = b_c[i][0]\n after = b_c[i][1]\n while before in a:\n a[a.index(before)] = after\n ans = sum(a)\n print(ans)\n","fail":"import collections\n\nn = int(input())\na = list(map(int, input().split()))\nq = int(input())\nbc = [list(map(int, input().split())) for i in range(q)]\n\nans = sum(a)\nnum = collections.Counter(a)\n\nfor i in range(q):\n before = bc[i][0]\n after = bc[i][1]\n ans += num[before] * (after - before)\n num[after] += num[before]\n num[before] = 0\n # print(a.count(before))\n # print(num(before))\n print(ans)\n","change":"replace","i1":0,"i2":13,"j1":0,"j2":18,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02630","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = list(map(int, input().split()))\nQ = int(input())\n\ndictA = {}\n\nfor z in A:\n dictA.setdefault(z, 0)\n dictA[z] += 1\n\n\nBC = [list(map(int, input().split())) for i in range(Q)]\nfor x in BC:\n if x[0] in dictA.keys():\n dictA.setdefault(x[1], 0)\n dictA[x[1]] += dictA[x[0]]\n dictA.pop(x[0])\n # print(dictA)\n\n sumA = 0\n for k, v in dictA.items():\n sumA += k * v\n print(sumA)\n","fail":"N = int(input())\nA = list(map(int, input().split()))\nQ = int(input())\n\ndictA = {}\n\nfor z in A:\n dictA.setdefault(z, 0)\n dictA[z] += 1\n\nsumA = sum(A)\n\nBC = [list(map(int, input().split())) for i in range(Q)]\nfor x in BC:\n if x[0] in dictA.keys():\n sumA += (x[1] - x[0]) * dictA[x[0]]\n dictA.setdefault(x[1], 0)\n dictA[x[1]] += dictA[x[0]]\n dictA.pop(x[0])\n print(sumA)\n","change":"replace","i1":10,"i2":22,"j1":10,"j2":19,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02630","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = list(input().split())\nq = int(input())\nfor i in range(q):\n b, c = input().split()\n replace_a = [i.replace(b, c) if i == b else i for i in a]\n print(sum(map(int, replace_a)))\n a = replace_a\n","fail":"from collections import Counter\n\nn = int(input())\na = list(map(int, input().split()))\nsum_a = sum(a)\ncount_a = Counter(a)\nq = int(input())\nfor i in range(q):\n b, c = map(int, input().split())\n tmp = count_a[b]\n new = {c: tmp}\n count_a.update(new)\n del count_a[b]\n sum_a = sum_a - b * tmp + c * tmp\n print(sum_a)\n","change":"replace","i1":0,"i2":8,"j1":0,"j2":15,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02630","language":"Python","original_status":"Runtime Error","pass":"from collections import defaultdict\n\nN = int(input())\n_A = [*map(int, input().split())]\nQ = int(input())\nval = [[*map(int, line.split())] for line in open(0)]\n\nA = defaultdict(int)\nfor _a in _A:\n A[_a] += 1\n\nans = sum(_A)\nfor v in val:\n if v[0] in A.keys():\n num = A[v[0]]\n A[v[0]] = 0\n A[v[1]] += num\n ans += (v[1] - v[0]) * num\n print(ans)\n","fail":"from collections import defaultdict\n\nN, _A, Q, *val = [[*map(int, line.split())] for line in open(0)]\nN = N[0]\nQ = Q[0]\n\nA = defaultdict(int)\nfor _a in _A:\n A[_a] += 1\n\nans = sum(_A)\nfor v in val:\n if v[0] in A.keys():\n num = A[v[0]]\n A[v[0]] = 0\n A[v[1]] += num\n ans += (v[1] - v[0]) * num\n print(ans)\n","change":"replace","i1":2,"i2":6,"j1":2,"j2":5,"error":"WA","stderr":null,"stdout":null} {"problem_id":"p02630","language":"Python","original_status":"Runtime Error","pass":"import collections\n\nN = int(input())\nA = list(map(int, input().split())) # (N,)\nQ = int(input())\nB, C = zip(*[list(map(int, input().split())) for _ in range(Q)]) # (Q,), (Q,)\n\nvalue_count_map = collections.defaultdict(int)\nvalue_sum_map = collections.defaultdict(int)\nfor a in A:\n value_count_map[a] += 1\n value_sum_map[a] += a\n\nfor b, c in zip(B, C):\n b_cnt = value_count_map[b]\n value_count_map[c] += b_cnt\n value_sum_map[c] += c * b_cnt\n if b in value_count_map:\n del value_count_map[b]\n del value_sum_map[b]\n print(sum(v for v in value_sum_map.values()))\n","fail":"import collections\n\nN = int(input())\nA = list(map(int, input().split())) # (N,)\nQ = int(input())\nB, C = zip(*[list(map(int, input().split())) for _ in range(Q)]) # (Q,), (Q,)\n\ncur_sum = 0\nvalue_count_map = collections.defaultdict(int)\nfor a in A:\n cur_sum += a\n value_count_map[a] += 1\n\nfor b, c in zip(B, C):\n b_cnt = value_count_map.get(b, 0)\n value_count_map[b] = 0\n value_count_map[c] += b_cnt\n cur_sum += b_cnt * (c - b)\n print(cur_sum)\n","change":"replace","i1":7,"i2":21,"j1":7,"j2":19,"error":"0","stderr":null,"stdout":"11\n12\n16\n"} {"problem_id":"p02630","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = list(map(str, input().split()))\nQ = int(input())\nL = [list(map(str, input().split())) for i in range(Q)]\n\nfor j in range(Q):\n A = [k.replace(L[j][0], L[j][1]) for k in A]\n B = sum(map(int, A))\n print(B)\n","fail":"N = int(input())\nA = list(map(int, input().split()))\nQ = int(input())\n\na = [0] * (10**5 + 1)\nans = sum(A)\n\nfor i in range(N):\n a[A[i]] += 1\n\nfor i in range(Q):\n B, C = map(int, input().split())\n ans += a[B] * (C - B)\n a[C] += a[B]\n a[B] = 0\n print(ans)\n","change":"replace","i1":1,"i2":9,"j1":1,"j2":16,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02630","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = list(map(int, input().split()))\nQ = int(input())\nfor i in range(Q):\n B, C = map(int, input().split())\n for i in range(N):\n if A[i] == B:\n A[i] = C\n print(sum(A))\n","fail":"from collections import Counter\n\nn = int(input())\na = list(map(int, input().split()))\nq = int(input())\n\ncnt = Counter(a)\n\ns = sum(a)\n\nfor i in range(q):\n b, c = map(int, input().split())\n s = s - b * cnt[b]\n s = s + c * cnt[b]\n cnt[c] += cnt[b]\n cnt[b] = 0\n print(s)\n","change":"replace","i1":0,"i2":9,"j1":0,"j2":17,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02630","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = list(map(int, input().split()))\nQ = int(input())\n\ndic = {}\nfor num in A:\n if num in dic:\n dic[num] += 1\n else:\n dic[num] = 1\n\nfor _ in range(Q):\n total = 0\n B, C = map(int, input().split())\n if B in dic and C in dic:\n dic[C] += dic[B]\n del dic[B]\n elif B in dic and C not in dic:\n dic[C] = dic[B]\n del dic[B]\n for mykey, myvalue in dic.items():\n total += mykey * myvalue\n print(total)\n","fail":"N = int(input())\nA = list(map(int, input().split()))\nQ = int(input())\n\ndic = {}\nfor num in A:\n if num in dic:\n dic[num] += 1\n else:\n dic[num] = 1\n\nprev_sum = 0\n\nfor key, value in dic.items():\n prev_sum += key * value\n\nfor _ in range(Q):\n B, C = map(int, input().split())\n if B in dic and C in dic:\n dic[C] += dic[B]\n dif = (C - B) * dic[B]\n prev_sum += dif\n del dic[B]\n elif B in dic and C not in dic:\n dic[C] = dic[B]\n dif = (C - B) * dic[B]\n prev_sum += dif\n del dic[B]\n print(prev_sum)\n","change":"replace","i1":11,"i2":23,"j1":11,"j2":29,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02630","language":"Python","original_status":"Time Limit Exceeded","pass":"import sys\nimport numpy as np\n\n# \u5b9f\u884c\u74b0\u5883(0:vscode, 1:atcoder)\nMODE = 1\n\n# \u5165\u529b\u306e\u6b21\u5143\nDIMENSION = 2\n\n# int\u578b\u306b\u5909\u63db\nINT_TYPE = 1\n\nif not (MODE):\n with open(\"input.txt\", \"r\") as f:\n s = f.read()\nelse:\n s = sys.stdin.read()\n\nif DIMENSION == 0:\n if INT_TYPE == 1:\n s = int(s)\nelif DIMENSION == 1:\n if INT_TYPE == 0:\n s = s.split()\n elif INT_TYPE == 1:\n s = [int(x) for x in s.split()]\nelif DIMENSION == 2:\n if INT_TYPE == 0:\n s = [x.split() for x in s.splitlines()]\n elif INT_TYPE == 1:\n s = [[int(y) for y in x.split()] for x in s.splitlines()]\n\nN = s[0][0]\nA = np.array(s[1])\nQ = s[2][0]\nBC = np.array(s[3:])\nB = BC[:, 0]\nC = BC[:, 1]\n\nA_sum = np.sum(A)\n\nD = np.array([np.count_nonzero(A == i) for i in range(100001)])\nfor i in range(Q):\n b = B[i]\n c = C[i]\n A_sum += D[b] * (c - b)\n print(A_sum)\n D[c] += D[b]\n D[b] = 0\n","fail":"import sys\nimport numpy as np\nfrom collections import Counter\n\n# \u5b9f\u884c\u74b0\u5883(0:vscode, 1:atcoder)\nMODE = 1\n\n# \u5165\u529b\u306e\u6b21\u5143\nDIMENSION = 2\n\n# int\u578b\u306b\u5909\u63db\nINT_TYPE = 1\n\nif not (MODE):\n with open(\"input.txt\", \"r\") as f:\n s = f.read()\nelse:\n s = sys.stdin.read()\n\nif DIMENSION == 0:\n if INT_TYPE == 1:\n s = int(s)\nelif DIMENSION == 1:\n if INT_TYPE == 0:\n s = s.split()\n elif INT_TYPE == 1:\n s = [int(x) for x in s.split()]\nelif DIMENSION == 2:\n if INT_TYPE == 0:\n s = [x.split() for x in s.splitlines()]\n elif INT_TYPE == 1:\n s = [[int(y) for y in x.split()] for x in s.splitlines()]\n\nN = s[0][0]\nA = np.array(s[1])\nQ = s[2][0]\nBC = np.array(s[3:])\nB = BC[:, 0]\nC = BC[:, 1]\n\nA_sum = np.sum(A)\n\nD = Counter(A)\n\nfor i in range(Q):\n b = B[i]\n c = C[i]\n A_sum += D[b] * (c - b)\n print(A_sum)\n D[c] += D[b]\n D[b] = 0\n","change":"replace","i1":2,"i2":42,"j1":2,"j2":44,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02630","language":"Python","original_status":"Time Limit Exceeded","pass":"import bisect\n\nN = int(input())\nA = list(map(int, input().split()))\nQ = int(input())\nB = [0] * Q\nC = [0] * Q\nfor i in range(Q):\n B[i], C[i] = map(int, input().split())\n\nA.sort()\nSum = sum(A)\n\nfor i in range(Q):\n L = bisect.bisect_left(A, B[i])\n R = bisect.bisect_right(A, B[i])\n num = R - L\n Sum += num * (C[i] - B[i])\n\n for j in range(L, R):\n A[j] = C[i]\n\n A.sort()\n print(Sum)\n","fail":"import bisect\n\nN = int(input())\nA = list(map(int, input().split()))\nQ = int(input())\nB = [0] * Q\nC = [0] * Q\nfor i in range(Q):\n B[i], C[i] = map(int, input().split())\n\nDP = [0] * (10**5 + 1)\n\nfor i in range(len(A)):\n DP[A[i]] += 1\n\nSum = sum(A)\n\nfor i in range(Q):\n Sum += (C[i] - B[i]) * DP[B[i]]\n DP[C[i]] += DP[B[i]]\n DP[B[i]] = 0\n print(Sum)\n","change":"replace","i1":10,"i2":23,"j1":10,"j2":21,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02630","language":"Python","original_status":"Runtime Error","pass":"N = int(input())\nA = list(map(int, input().split()))\nQ = int(input())\n\nB = []\nC = []\nfor _ in range(Q):\n b, c = map(int, input().split())\n B.append(b)\n C.append(c)\n\nd = [0] * 10\nfor a in A:\n d[a] += 1\nsum_a = sum(A)\nfor j in range(Q):\n d[C[j]] += d[B[j]]\n sum_a -= d[B[j]] * B[j]\n\n sum_a += (d[C[j]] - d[B[j]]) * C[j]\n d[B[j]] = 0\n print(sum_a)\n","fail":"N = int(input())\nA = list(map(int, input().split()))\nQ = int(input())\n\nB = []\nC = []\nfor _ in range(Q):\n b, c = map(int, input().split())\n B.append(b)\n C.append(c)\n\nd = [0] * (10**5 + 7)\nfor a in A:\n d[a] += 1\nsum_a = sum(A)\nfor j in range(Q):\n before = d[C[j]]\n d[C[j]] += d[B[j]]\n sum_a -= d[B[j]] * B[j]\n\n sum_a += (d[C[j]] - before) * C[j]\n d[B[j]] = 0\n print(sum_a)\n","change":"replace","i1":11,"i2":20,"j1":11,"j2":21,"error":"0","stderr":null,"stdout":"11\n12\n16\n"} {"problem_id":"p02630","language":"Python","original_status":"Time Limit Exceeded","pass":"import sys\nimport numpy as np\n\nN = int(sys.stdin.readline())\nA = list(map(int, sys.stdin.readline().split()))\nQ = int(sys.stdin.readline())\nreplace_map = [list(map(int, sys.stdin.readline().split())) for _ in range(Q)]\n\nnums = {}\nfor a in A:\n nums[a] = nums[a] + 1 if a in nums else 1\n\nfor search, replace in replace_map:\n if search in nums:\n nums[replace] = nums[replace] + nums[search] if replace in nums else nums[search]\n del nums[search]\n print(np.dot(list(nums.keys()), list(nums.values())))\n","fail":"import sys\nimport numpy as np\n\n_ = sys.stdin.readline()\nA = list(map(int, sys.stdin.readline().split()))\nQ = int(sys.stdin.readline())\nreplace_map = [list(map(int, sys.stdin.readline().split())) for _ in range(Q)]\n\nnums = {}\nfor a in A:\n nums[a] = nums[a] + 1 if a in nums else 1\n\nprevious_sum = 0\nfor search, replace in replace_map:\n replaced_count = 0\n if search in nums:\n replaced_count = nums[search]\n nums[replace] = (\n nums[replace] + replaced_count if replace in nums else replaced_count\n )\n del nums[search]\n if previous_sum == 0:\n previous_sum = np.dot(list(nums.keys()), list(nums.values()))\n else:\n previous_sum += replaced_count * (replace - search)\n print(previous_sum)\n","change":"replace","i1":3,"i2":17,"j1":3,"j2":26,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02630","language":"Python","original_status":"Time Limit Exceeded","pass":"from collections import Counter\n\nn = int(input())\na = list(map(int, input().split()))\nq = int(input())\nbc = [list(map(int, input().split())) for _ in range(q)]\n\nx = Counter(a)\nfor b, c in bc:\n x[c] += x[b]\n x[b] = 0\n\n ans = 0\n for key, value in x.most_common():\n ans += key * value\n print(ans)\n","fail":"from collections import Counter\n\nn = int(input())\na = list(map(int, input().split()))\nq = int(input())\nbc = [list(map(int, input().split())) for _ in range(q)]\n\nx = Counter(a)\nans = sum(a)\nfor b, c in bc:\n ans += (c - b) * x[b]\n print(ans)\n x[c] += x[b]\n x[b] = 0\n","change":"replace","i1":8,"i2":16,"j1":8,"j2":14,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02630","language":"Python","original_status":"Time Limit Exceeded","pass":"from collections import Counter\n\nN = int(input())\nA = list(map(int, input().split()))\n\nQ = int(input())\nBC = [list(map(int, input().split())) for _ in range(Q)]\n\nd = Counter(A)\n\nfor b, c in BC:\n d[c] += d[b]\n d[b] = 0\n\n li = [k * v for k, v in d.items()]\n print(sum(li))\n","fail":"from collections import Counter\n\nN = int(input())\nA = list(map(int, input().split()))\n\nQ = int(input())\nBC = [list(map(int, input().split())) for _ in range(Q)]\n\nd = Counter(A)\n\nsub_s = sum(A)\n\nfor b, c in BC:\n sub_s += d[b] * (c - b)\n d[c] += d[b]\n d[b] = 0\n\n print(sub_s)\n","change":"replace","i1":10,"i2":16,"j1":10,"j2":18,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02630","language":"Python","original_status":"Time Limit Exceeded","pass":"from collections import Counter\nimport copy\n\nN = int(input())\n\ntarget_list = list(map(int, input().split()))\ncheck = [Counter(target_list)]\nresult_list = [sum(target_list)]\n\n\nfor index in range(int(input())):\n B, C = map(int, input().split())\n if B in check[index]:\n result = copy.deepcopy(check[index])\n change = result.pop(B)\n diff = change * (C - B)\n if C in result:\n result[C] = result[C] + change\n else:\n result[C] = change\n\n else:\n result = copy.deepcopy(check[index])\n diff = 0\n check.append(result)\n print(result_list[index] + diff)\n result_list.append(result_list[index] + diff)\n","fail":"from collections import Counter\n\nN = int(input())\n\ntarget_list = list(map(int, input().split()))\ncheck = Counter(target_list)\nresult = sum(target_list)\n\n\nfor index in range(int(input())):\n B, C = map(int, input().split())\n if B in check:\n result = result + (check[B]) * (C - B)\n if C in check:\n check[C] = check[C] + check[B]\n else:\n check[C] = check[B]\n check[B] = 0\n print(result)\n","change":"replace","i1":1,"i2":27,"j1":1,"j2":19,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02630","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = list(map(int, input().split()))\nQ = int(input())\nBC = [map(int, input().split()) for _ in range(Q)]\nB, C = [list(i) for i in zip(*BC)]\n\nfor i in range(Q):\n A_replace = [C[i] if a == B[i] else a for a in A]\n A = A_replace\n print(sum(A))\n","fail":"N = int(input())\nA = list(map(int, input().split()))\nQ = int(input())\nBC = [map(int, input().split()) for _ in range(Q)]\nB, C = [list(i) for i in zip(*BC)]\n\nsum = 0\nsize = 10**5 + 1\nlist = [0] * size\nfor a in A:\n list[a] += 1\n sum += a\n\nfor i in range(Q):\n sum = sum + C[i] * list[B[i]] - B[i] * list[B[i]]\n list[C[i]] += list[B[i]]\n list[B[i]] = 0\n print(sum)\n","change":"replace","i1":6,"i2":10,"j1":6,"j2":18,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02631","language":"Python","original_status":"Time Limit Exceeded","pass":"# import sys\n# readline = sys.stdin.readline\n# generator = (readline().strip() for _ in range(N))\n\n# N, M = map(int, input().split())\n# As = list(map(int, input().split()))\n# queries = (input() for _ in range(N))\n\n\ndef solve():\n N = int(input())\n As = list(map(int, input().split()))\n\n digits = dict()\n for d in range(30):\n digits[d] = 0\n for a in As:\n digits[d] += a >> d & 1\n\n oore = dict()\n for k, v in digits.items():\n oore[k] = v % 2\n\n nums = [0] * N\n\n for i, a in enumerate(As):\n for d in range(30):\n nums[i] += ((a >> d & 1) ^ (oore[d])) << d\n\n return nums\n\n\ndef main():\n print(*solve())\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"# import sys\n# readline = sys.stdin.readline\n# generator = (readline().strip() for _ in range(N))\n\n# N, M = map(int, input().split())\n# As = list(map(int, input().split()))\n# queries = (input() for _ in range(N))\n\n\ndef solve():\n N = int(input())\n As = list(map(int, input().split()))\n\n digits = dict()\n for d in range(30):\n digits[d] = 0\n for a in As:\n digits[d] += a >> d & 1\n\n oore = 0\n for k, v in digits.items():\n oore += (v % 2) << k\n\n nums = [0] * N\n\n for i, a in enumerate(As):\n nums[i] = a ^ oore\n\n return nums\n\n\ndef main():\n print(*solve())\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":19,"i2":28,"j1":19,"j2":27,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02631","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = [int(i) for i in input().split()]\n\n\nans = []\nfor i in range(n):\n temp = 0\n for j, aa in enumerate(a):\n if j == i:\n continue\n temp = temp ^ aa\n ans.append(temp)\n\nans = [str(i) for i in ans]\nprint(\" \".join(ans))\n","fail":"n = int(input())\na = [int(i) for i in input().split()]\n\n\nans = []\nalld = 0\n\nfor aa in a:\n alld = alld ^ aa\n\nfor aa in a:\n ans.append(alld ^ aa)\n\nans = [str(i) for i in ans]\nprint(\" \".join(ans))\n","change":"replace","i1":5,"i2":12,"j1":5,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02631","language":"Python","original_status":"Time Limit Exceeded","pass":"# -*- coding: utf-8 -*-\n\n# \u5165\u529b\u3092\u6574\u6570\u306b\u5909\u63db\u3057\u3066\u53d7\u3051\u53d6\u308b\ndef input_int():\n return int(input())\n\n\n# \u30de\u30a4\u30ca\u30b91\u3057\u305f\u5024\u3092\u8fd4\u5374\ndef int1(x):\n return int(x) - 1\n\n\n# \u534a\u89d2\u30b9\u30da\u30fc\u30b9\u533a\u5207\u308a\u5165\u529b\u3092Int\u306b\u5909\u63db\u3057\u3066Map\u3067\u53d7\u3051\u53d6\u308b\ndef input_to_int_map():\n return map(int, input().split())\n\n\n# \u534a\u89d2\u30b9\u30da\u30fc\u30b9\u533a\u5207\u308a\u5165\u529b\u3092Int\u306b\u5909\u63db\u3057\u3066\u53d7\u3051\u53d6\u308b\ndef input_to_int_tuple():\n return tuple(map(int, input().split()))\n\n\n# \u534a\u89d2\u30b9\u30da\u30fc\u30b9\u533a\u5207\u308a\u5165\u529b\u3092Int\u306b\u5909\u63db\u3057\u3066\u30de\u30a4\u30ca\u30b91\u3057\u305f\u5024\u3092\u53d7\u3051\u53d6\u308b\ndef input_to_int_tuple_minus1():\n return tuple(map(int1, input().split()))\n\n\ndef main():\n n = int(input())\n a_list = input_to_int_tuple()\n\n ret = \"\"\n for i in range(n):\n my = 0\n for j, v in enumerate(a_list):\n if i == j:\n continue\n\n my ^= v\n\n ret += str(my) + \" \"\n\n print(ret.rstrip())\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"# -*- coding: utf-8 -*-\n\n# \u5165\u529b\u3092\u6574\u6570\u306b\u5909\u63db\u3057\u3066\u53d7\u3051\u53d6\u308b\ndef input_int():\n return int(input())\n\n\n# \u30de\u30a4\u30ca\u30b91\u3057\u305f\u5024\u3092\u8fd4\u5374\ndef int1(x):\n return int(x) - 1\n\n\n# \u534a\u89d2\u30b9\u30da\u30fc\u30b9\u533a\u5207\u308a\u5165\u529b\u3092Int\u306b\u5909\u63db\u3057\u3066Map\u3067\u53d7\u3051\u53d6\u308b\ndef input_to_int_map():\n return map(int, input().split())\n\n\n# \u534a\u89d2\u30b9\u30da\u30fc\u30b9\u533a\u5207\u308a\u5165\u529b\u3092Int\u306b\u5909\u63db\u3057\u3066\u53d7\u3051\u53d6\u308b\ndef input_to_int_tuple():\n return tuple(map(int, input().split()))\n\n\n# \u534a\u89d2\u30b9\u30da\u30fc\u30b9\u533a\u5207\u308a\u5165\u529b\u3092Int\u306b\u5909\u63db\u3057\u3066\u30de\u30a4\u30ca\u30b91\u3057\u305f\u5024\u3092\u53d7\u3051\u53d6\u308b\ndef input_to_int_tuple_minus1():\n return tuple(map(int1, input().split()))\n\n\ndef main():\n n = int(input())\n a_list = input_to_int_tuple()\n\n all = 0\n for v in a_list:\n all ^= v\n\n ret = \"\"\n for v in a_list:\n ret += str(all ^ v) + \" \"\n\n print(ret.rstrip())\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":31,"i2":41,"j1":31,"j2":38,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02631","language":"Python","original_status":"Time Limit Exceeded","pass":"import numpy as np\n\nN = int(input())\na = np.fromstring(input(), sep=\" \", dtype=np.int64)\n# b = np.bitwise_xor.reduce(a)\n# c = np.bitwise_xor(a, b)\n# print(*c, sep=\" \")\nfor n in range(N):\n print(np.bitwise_xor.reduce(a) ^ a[n])\n","fail":"import numpy as np\n\nN = int(input())\na = np.fromstring(input(), sep=\" \", dtype=np.int64)\nb = np.bitwise_xor.reduce(a)\nc = np.bitwise_xor(a, b)\nprint(*c, sep=\" \")\n","change":"replace","i1":4,"i2":9,"j1":4,"j2":7,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02632","language":"Python","original_status":"Time Limit Exceeded","pass":"import numpy as np\nfrom numba import njit\n\n\ndef comb(n, r, p):\n r = min(r, n - r)\n ret = fac[n]\n ret = ret * facinv[r] % p\n return ret * facinv[n - r] % p\n\n\n@njit\ndef comb_init(N_UNTIL, p):\n N_UNTIL += 1\n inv = np.empty(N_UNTIL, np.int64)\n fac = np.empty(N_UNTIL, np.int64)\n facinv = np.empty(N_UNTIL, np.int64)\n inv[0] = 0\n inv[1] = 1\n fac[0] = 1\n facinv[0] = 1\n for i in range(2, N_UNTIL):\n inv[i] = -inv[p % i] * (p \/\/ i) % p\n for i in range(1, N_UNTIL):\n fac[i] = fac[i - 1] * i % p\n for i in range(1, N_UNTIL):\n facinv[i] = facinv[i - 1] * inv[i] % p\n return inv, fac, facinv\n\n\nK = int(input())\nS = input()\nN = len(S)\nMOD = 1_000_000_007\ninv, fac, facinv = comb_init(N + K - 1, MOD)\nans = 0\nfor i in range(K + 1):\n tmp = pow(25, K - i, MOD)\n tmp *= comb(N + K - i - 1, K - i, MOD)\n tmp %= MOD\n tmp *= pow(26, i, MOD)\n tmp %= MOD\n ans += tmp\n ans %= MOD\nprint(ans)\n","fail":"def comb(n, r, p):\n return fac[n] * facinv[r] * facinv[n - r] % p\n\n\ndef comb_pre(N_UNTIL, p):\n for i in range(2, N_UNTIL + 1):\n fac.append(fac[i - 1] * i % p)\n inv.append(-inv[p % i] * (p \/\/ i) % p)\n facinv.append(facinv[-1] * inv[-1] % p)\n\n\nfac = [1, 1]\nfacinv = [1, 1]\ninv = [0, 1]\n\nK = int(input())\nS = input()\nN = len(S)\nMOD = 1_000_000_007\ncomb_pre(N + K - 1, MOD)\nans = 0\nfor i in range(K + 1):\n tmp = pow(25, K - i, MOD)\n tmp *= comb(N + K - i - 1, K - i, MOD)\n tmp %= MOD\n tmp *= pow(26, i, MOD)\n tmp %= MOD\n ans += tmp\n ans %= MOD\nprint(ans)\n","change":"replace","i1":0,"i2":35,"j1":0,"j2":20,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02632","language":"Python","original_status":"Time Limit Exceeded","pass":"k = int(input())\nn = len(input())\np = 10**9 + 7\nfct, inv = [1], [1]\na, b = 1, 1\nfor i in range(1, n + k + 1):\n a = (a * i) % p\n b = (b * pow(i, p - 2, p)) % p\n fct.append(a)\n inv.append(b)\nans = 0\nfor i in range(k + 1):\n c = fct[i + n - 1] * inv[i] * inv[n - 1]\n ans += pow(25, i, p) * pow(26, k - i, p) * c\n ans %= p\nprint(ans)\n","fail":"k = int(input())\nn = len(input())\np = 10**9 + 7\na = 1\nfct = [a]\nfor i in range(1, n + k + 1):\n a = (a * i) % p\n fct.append(a)\nb = pow(fct[-1], p - 2, p)\ninv = [b]\nfor i in range(1, n + k + 1)[::-1]:\n b = (b * i) % p\n inv.append(b)\ninv.reverse()\nans = 0\npow25, pow26 = [1], [1]\nfor i in range(1, k + 1):\n pow25.append((pow25[-1] * 25) % p)\n pow26.append((pow26[-1] * 26) % p)\nfor i in range(k + 1):\n c = fct[i + n - 1] * inv[i] * inv[n - 1]\n ans += pow25[i] * pow26[k - i] * c\n ans %= p\nprint(ans)\n","change":"replace","i1":3,"i2":14,"j1":3,"j2":22,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02637","language":"Python","original_status":"Runtime Error","pass":"import sys\n\n\ndef solve(k, aaa):\n min_a = min(aaa)\n max_a = max(aaa)\n if min_a * 2 < max_a:\n return [-1]\n\n ans = []\n while True:\n min_a = min(aaa)\n max_a1 = max(aaa[1:])\n max_a = max(aaa[0], max_a1)\n\n if min_a == 0:\n assert max_a == 0\n break\n\n if min_a * 2 == max_a:\n must_use = [i for i, a in enumerate(aaa) if a == max_a]\n next_max = max_a - 2\n elif (aaa[0] - 2) * 2 >= max_a1 - 1:\n must_use = []\n next_max = max(aaa[0] - 2, max_a1 - 1)\n else:\n ans.extend(range(1, k + 1))\n for i in range(k):\n aaa[i] -= 1\n continue\n\n can_use = []\n cant_use = []\n\n for i in range(k):\n if min_a * 2 == aaa[i]:\n pass\n elif (aaa[i] - 2) * 2 >= next_max:\n can_use.append(i)\n else:\n cant_use.append(i)\n\n double = []\n if len(must_use) == 0:\n double.append(can_use[0] + 1)\n else:\n max_use = must_use[-1]\n use = must_use + can_use\n use.sort()\n double = [i + 1 for i in use if i <= max_use]\n single = [i for i in range(1, k + 1) if i not in double]\n\n for i in double:\n aaa[i - 1] -= 2\n for i in single:\n aaa[i - 1] -= 1\n\n ans.extend(double)\n ans.extend(single)\n ans.extend(double)\n\n return ans\n\n\nk, *aaa = map(int, sys.stdin.buffer.read().split())\nprint(*solve(k, aaa))\n","fail":"import sys\n\n\ndef find_permutation(aaa, use):\n \"\"\"\n i\u306e\u6b8b\u308a\u4f7f\u7528\u6570\u304caaa[i-1]\u306e\u72b6\u614b\u3067\n \u96c6\u5408use\u306b\u3042\u308b\u6587\u5b57\u7fa4(1\uff5ek)\u3092\u5f8c\u308d\u306b\u7e4b\u3052\u308b\u65b9\u6cd5\u3067\n \u305d\u308c\u3088\u308a\u3055\u3089\u306b\u5f8c\u304c\u7834\u7dbb\u3057\u306a\u3044\u3088\u3046\u306a\u7e4b\u3052\u65b9\u306e\u3046\u3061\n \u8f9e\u66f8\u9806\u6700\u5c0f\u306e\u3082\u306e\u3092\u6c42\u3081\u308b\u3002\n\n \u305f\u3060\u3057\uff08\u3053\u306e\u95a2\u6570\u304b\u3089\u306f\u898b\u3048\u306a\u3044\u304c\uff09\u73fe\u5728\u78ba\u5b9a\u6e08\u307f\u914d\u5217\u306e\n \u672b\u5c3e (k - |use|) \u500b\u306f\u3001use\u306b\u542b\u307e\u308c\u306a\u3044\u8981\u7d20\u304c1\u56de\u305a\u3064\u767b\u5834\u3059\u308b\u3053\u3068\u3092\u524d\u63d0\u3068\u3059\u308b\u3002\n \uff08\u3064\u307e\u308a\u3001\u3053\u306e\u95a2\u6570\u306e\u7d50\u679c\u3092\u7e4b\u3052\u308b\u3068\u3001\u672b\u5c3e k \u500b\u304c\u9806\u5217\u306b\u306a\u308b\uff09\n\n \u3069\u3046\u3084\u3063\u3066\u3082\u7834\u7dbb\u3059\u308b\u5834\u5408\u306fNone\u3092\u8fd4\u3059\u3002\n\n :param aaa:\n :param use:\n :return:\n \"\"\"\n\n max_a = -1\n min_a = 1005\n max_fixed = -1\n\n for i in range(k):\n a = aaa[i]\n if i + 1 in use:\n min_a = min(min_a, a)\n max_a = max(max_a, a)\n else:\n max_fixed = max(max_fixed, a)\n\n if max(max_a, max_fixed + 1) > 2 * min_a:\n return None\n\n if max_a < 2 * min_a:\n return sorted(use)\n\n front = []\n rear = []\n either = []\n for i in use:\n if aaa[i - 1] == max_a:\n front.append(i)\n elif aaa[i - 1] == min_a:\n rear.append(i)\n else:\n either.append(i)\n\n max_front = front[-1]\n for i in either:\n if i < max_front:\n front.append(i)\n else:\n rear.append(i)\n front.sort()\n rear.sort()\n front.extend(rear)\n\n return front\n\n\ndef solve(k, aaa):\n if k == 1:\n return [1] * aaa[0]\n\n min_a = min(aaa)\n max_a = max(aaa)\n if min_a * 2 < max_a:\n return [-1]\n\n ans = []\n ans.extend(find_permutation(aaa, set(range(1, k + 1))))\n for i in range(k):\n aaa[i] -= 1\n\n remaining = sum(aaa)\n while remaining:\n use = set(range(1, k + 1))\n candidates = []\n for r in range(k):\n result = find_permutation(aaa, use)\n if result is not None:\n candidates.append(result)\n\n use.remove(ans[-r - 1])\n adopted = min(candidates)\n ans.extend(adopted)\n for i in adopted:\n aaa[i - 1] -= 1\n remaining -= len(adopted)\n\n return ans\n\n\nk, *aaa = map(int, sys.stdin.buffer.read().split())\nprint(*solve(k, aaa))\n","change":"replace","i1":3,"i2":60,"j1":3,"j2":92,"error":"0","stderr":null,"stdout":"2 1 3 2 2 3 1 2 3\n"} {"problem_id":"p02639","language":"Python","original_status":"Runtime Error","pass":"# -*- coding: utf-8 -*-\na, b, c, d, e = map(int, input().split())\n\nsuuji_list = [\"\", a, b, c, d, e]\n\nprint(list.index(0))\n","fail":"# -*- coding: utf-8 -*-\na, b, c, d, e = map(int, input().split())\n\nsuuji_list = [\"\", a, b, c, d, e]\n\nprint(suuji_list.index(0))\n","change":"replace","i1":5,"i2":6,"j1":5,"j2":6,"error":"TypeError: descriptor 'index' for 'list' objects doesn't apply to a 'int' object","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02639\/Python\/s072466363.py\", line 6, in \n print(list.index(0))\nTypeError: descriptor 'index' for 'list' objects doesn't apply to a 'int' object\n","stdout":null} {"problem_id":"p02639","language":"Python","original_status":"Runtime Error","pass":"nums = [int(x) for x in input()]\n\nfor i in range(5):\n if nums[i] == 0:\n print(i + 1)\n exit(0)\n","fail":"nums = [int(x) for x in input().split(\" \")]\n\nfor i in range(5):\n if nums[i] == 0:\n print(i + 1)\n exit(0)\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"ValueError: invalid literal for int() with base 10: ' '","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02639\/Python\/s316600506.py\", line 1, in \n nums = [int(x) for x in input()]\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02639\/Python\/s316600506.py\", line 1, in \n nums = [int(x) for x in input()]\nValueError: invalid literal for int() with base 10: ' '\n","stdout":null} {"problem_id":"p02640","language":"Python","original_status":"Time Limit Exceeded","pass":"X, Y = map(int, input().split())\n\n\ndef checkY(N, count, X):\n if count == X and N == 0:\n print(\"Yes\")\n exit(0)\n elif count == X and N != 0:\n return False\n\n if checkY(N - 2, count + 1, X):\n return True\n\n if checkY(N - 4, count + 1, X):\n return True\n\n return False\n\n\nif 2 * X <= Y and Y <= 4 * X:\n if checkY(Y, 0, X):\n print(\"Yes\")\n else:\n print(\"No\")\nelse:\n print(\"No\")\n","fail":"X, Y = map(int, input().split())\n\ncrane = (4 * X - Y) \/ 2\nturtle = (Y - 2 * X) \/ 2\n\n\ndef is_integer_num(n):\n if isinstance(n, int):\n return True\n if isinstance(n, float):\n return n.is_integer()\n return False\n\n\nif is_integer_num(crane) and crane >= 0 and is_integer_num(turtle) and turtle >= 0:\n print(\"Yes\")\n\nelse:\n print(\"No\")\n","change":"replace","i1":2,"i2":24,"j1":2,"j2":17,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02640","language":"Python","original_status":"Runtime Error","pass":"X, Y = [int(), input().split()]\n\nif X % 2 == 0 and 2 * X < Y < 4 * X:\n print(\"Yes\")\nelse:\n print(\"No\")\n","fail":"X, Y = map(int, input().split())\n\nif Y % 2 == 0 and 2 * X <= Y <= 4 * X:\n print(\"Yes\")\nelse:\n print(\"No\")\n","change":"replace","i1":0,"i2":3,"j1":0,"j2":3,"error":"TypeError: '<' not supported between instances of 'int' and 'list'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02640\/Python\/s666717578.py\", line 3, in \n if X % 2 == 0 and 2 * X < Y < 4 * X:\nTypeError: '<' not supported between instances of 'int' and 'list'\n","stdout":null} {"problem_id":"p02640","language":"Python","original_status":"Time Limit Exceeded","pass":"from numba import jit\n\n\n@jit\ndef solve(X, Y, Z):\n while X >= 0:\n if 2 * X + 4 * Z == Y:\n return True\n elif 2 * X + 4 * Z < Y:\n X -= 1\n Z += 1\n return False\n\n\ndef main():\n X, Y = map(int, input().split())\n Z = 0\n\n if solve(X, Y, Z):\n print(\"Yes\")\n else:\n print(\"No\")\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"from numba import jit\n\n\n@jit\ndef solve(X, Y, Z):\n while X >= 0:\n if 2 * X + 4 * Z == Y:\n return True\n elif 2 * X + 4 * Z < Y:\n X -= 1\n Z += 1\n else:\n return False\n return False\n\n\ndef main():\n X, Y = map(int, input().split())\n Z = 0\n\n if solve(X, Y, Z):\n print(\"Yes\")\n else:\n print(\"No\")\n\n\nif __name__ == \"__main__\":\n main()\n","change":"insert","i1":11,"i2":11,"j1":11,"j2":13,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02641","language":"Python","original_status":"Runtime Error","pass":"def actual(X, N, P):\n for i in range(X, -1, -1):\n if i not in P:\n left = i\n break\n\n for i in range(X, 101):\n if i not in P:\n right = i\n break\n\n if abs(left - X) <= abs(right - X):\n return left\n else:\n return right\n\n\nX, N = map(int, input().split())\n\nif N == 0:\n print(X)\nelse:\n P = list(map(int, input().split()))\n print(actual(X, N, P))\n","fail":"def actual(X, N, P):\n for i in range(X, -1 - 1, -1):\n if i not in P:\n left = i\n break\n\n for i in range(X, 101 + 1):\n if i not in P:\n right = i\n break\n\n if abs(left - X) <= abs(right - X):\n answer = left\n else:\n answer = right\n\n return answer\n\n\nX, N = map(int, input().split())\n\nif N == 0:\n P = []\n print(actual(X, N, P))\nelse:\n P = list(map(int, input().split()))\n print(actual(X, N, P))\n","change":"replace","i1":1,"i2":21,"j1":1,"j2":24,"error":"0","stderr":null,"stdout":8.0} {"problem_id":"p02641","language":"Python","original_status":"Runtime Error","pass":"X, N = map(int, input().split())\np = list(map(int, input().split()))\n\nif p:\n x = [i for i in range(1, max(p)) if i not in p]\n\n c = x.pop()\n a = abs(c - X)\n for i in x:\n if abs(i - X) < a:\n c = i\n print(c)\nelse:\n print(X)\n","fail":"X, N = map(int, input().split())\np = list(map(int, input().split()))\n\ni = 0\nwhile True:\n if X - i not in p:\n print(X - i)\n break\n elif X + i not in p:\n print(X + i)\n break\n i += 1\n","change":"replace","i1":3,"i2":14,"j1":3,"j2":12,"error":"0","stderr":null,"stdout":8.0} {"problem_id":"p02641","language":"Python","original_status":"Runtime Error","pass":"import sys\n\nX, N = map(int, input().split())\nlist_p = list(map(int, input().split()))\n\nif N == 0:\n print(X)\n sys.exit()\n\nall_list = [int(x) for x in range(min(list_p), max(list_p) + 1)]\ntarget_list = sorted(list(set(list_p) ^ set(all_list)))\n\nans = [abs(num - X) for num in target_list]\n# print(ans)\n# print(min(ans))\n# print(ans.index(min(ans)))\nprint(target_list[ans.index(min(ans))])\n","fail":"import sys\n\nX, N = map(int, input().split())\nlist_p = list(map(int, input().split()))\n\nif N == 0:\n print(X)\n sys.exit()\n\nall_list = [int(x) for x in range(0, 102)]\ntarget_list = sorted(list(set(list_p) ^ set(all_list)))\n\nans = [abs(num - X) for num in target_list]\n# print(all_list)\n# print(target_list)\n# print(min(ans))\n# print(ans.index(min(ans)))\nprint(target_list[ans.index(min(ans))])\n","change":"replace","i1":9,"i2":14,"j1":9,"j2":15,"error":"0","stderr":null,"stdout":8.0} {"problem_id":"p02641","language":"Python","original_status":"Runtime Error","pass":"X, N = input().split()\np = list(map(int, input().split()))\n\nans = 0\nfor i in range(1, 102):\n if abs(X - i) < abs(ans - i) and i not in p and i != X:\n ans = i\n\nprint(ans)\n","fail":"X, N = map(int, input().split())\np = list(map(int, input().split()))\n\nans = 0\nfor i in range(1, 102):\n if abs(X - i) < abs(X - ans) and i not in p:\n ans = i\nprint(ans)\n","change":"replace","i1":0,"i2":8,"j1":0,"j2":7,"error":"TypeError: unsupported operand type(s) for -: 'str' and 'int'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02641\/Python\/s033864949.py\", line 6, in \n if abs(X - i) < abs(ans - i) and i not in p and i != X:\nTypeError: unsupported operand type(s) for -: 'str' and 'int'\n","stdout":null} {"problem_id":"p02641","language":"Python","original_status":"Runtime Error","pass":"import sys\n\nx, n = map(int, input().split())\nif n == 0:\n print(x)\n sys.exit()\nelse:\n p = list(map(int, input().split()))\nif x == 1:\n print(0)\n sys.exit()\n\na = []\nb = []\n\nfor i in range(1, 100):\n if i not in p:\n a.append(abs(x - i))\n b.append(i)\nans = min(a)\nbb = a.index(ans)\nprint(b[bb])\n","fail":"import sys\n\nx, n = map(int, input().split())\nif n == 0:\n print(x)\n sys.exit()\nelse:\n p = list(map(int, input().split()))\n\na = []\nb = []\n\nfor i in range(0, 102):\n if i not in p:\n a.append((x - i) ** 2)\n b.append(i)\nans = min(a)\nbb = a.index(ans)\nprint(b[bb])\n","change":"replace","i1":8,"i2":18,"j1":8,"j2":15,"error":"0","stderr":null,"stdout":8.0} {"problem_id":"p02641","language":"Python","original_status":"Runtime Error","pass":"x, n = map(int, input().split())\n\nif n == 0:\n p = set([])\nelse:\n p = list(map(int, input().split()))\np = list(map(int, str.split()))\na = list(set(range(201)) - set(p))\nabs_diff = [abs(i - x) for i in a]\nmin_abs_diff = min(abs_diff)\nfor i, j in zip(a, abs_diff):\n if j == min_abs_diff:\n print(i)\n break\n","fail":"# ABC170C\n\nx, n = map(int, input().split())\n\nif n == 0:\n p = set([])\nelse:\n p = list(map(int, input().split()))\na = list(set(range(201)) - set(p))\nabs_diff = [abs(i - x) for i in a]\nmin_abs_diff = min(abs_diff)\nfor i, j in zip(a, abs_diff):\n if j == min_abs_diff:\n print(i)\n break\n","change":"replace","i1":0,"i2":7,"j1":0,"j2":8,"error":"TypeError: unbound method str.split() needs an argument","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02641\/Python\/s627877653.py\", line 7, in \n p = list(map(int, str.split()))\nTypeError: unbound method str.split() needs an argument\n","stdout":null} {"problem_id":"p02641","language":"Python","original_status":"Runtime Error","pass":"def main():\n x, n = map(int, input().split())\n p = list(map(int, input().split()))\n\n min = 1000\n\n for i in range(1, 101):\n\n if i in p:\n continue\n\n elif min > abs(x - i):\n result = i\n min = abs(x - i)\n\n print(result)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"def main():\n x, n = map(int, input().split())\n p = list(map(int, input().split()))\n\n min = 1000\n\n for i in range(-50, 150):\n\n if i in p:\n continue\n\n elif min > abs(x - i):\n result = i\n min = abs(x - i)\n\n print(result)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":6,"i2":7,"j1":6,"j2":7,"error":"0","stderr":null,"stdout":8.0} {"problem_id":"p02641","language":"Python","original_status":"Runtime Error","pass":"x, n = map(int, input().split())\np = list(map(int, input().split()))\nans = 0\np.sort()\nfor i in range(p[0], p[n - 1] + 1):\n if (i not in p) and abs(x - i) < abs(ans - x):\n ans = i\n\nprint(ans)\n","fail":"x, n = map(int, input().split())\np = list(map(int, input().split()))\nans = 0\n\nif n == 0:\n print(x)\n exit()\n\np.sort()\n\nfor i in range(p[0] - x, p[n - 1] + x):\n if (i not in p) and abs(x - i) < abs(ans - x):\n ans = i\n\nprint(ans)\n","change":"replace","i1":3,"i2":5,"j1":3,"j2":11,"error":"0","stderr":null,"stdout":8.0} {"problem_id":"p02641","language":"Python","original_status":"Runtime Error","pass":"X, N = map(int, input().split())\nif N == 0 and N == 100:\n print(X)\n\n\nelse:\n p = list(map(int, input().split()))\n abs_list = []\n re_list = []\n min = 1000\n min_index = 0\n\n for i in range(100):\n abs_list.append(i + 1)\n for j in p:\n abs_list.remove(j)\n for i in range(len(abs_list)):\n\n re_list.append(abs(abs_list[i] - X))\n for i in range(len(re_list)):\n if min > re_list[i]:\n min = re_list[i]\n min_index = i\n print(abs_list[min_index])\n","fail":"X, N = map(int, input().split())\nif N == 0:\n print(X)\nelif N == 100:\n if X <= 50:\n print(0)\n else:\n print(101)\n\nelse:\n p = list(map(int, input().split()))\n abs_list = []\n re_list = []\n min = 1000\n min_index = 0\n\n for i in range(250):\n abs_list.append(-100 + i)\n for j in p:\n abs_list.remove(j)\n for i in range(len(abs_list)):\n\n re_list.append(abs(abs_list[i] - X))\n for i in range(len(re_list)):\n if min > re_list[i]:\n min = re_list[i]\n min_index = i\n if re_list[min_index] > X:\n print(0)\n else:\n print(abs_list[min_index])\n","change":"replace","i1":1,"i2":24,"j1":1,"j2":31,"error":"0","stderr":null,"stdout":8.0} {"problem_id":"p02641","language":"Python","original_status":"Runtime Error","pass":"x, n = list(map(int, input().split()))\nif n == 0:\n print(x)\n exit()\np_list = list(map(int, input().split()))\n\nidx = p_list.index(x)\n\ni = 0\nwhile True:\n x_i = x - i\n x_j = x + i\n\n if x_i not in p_list:\n print(x_i)\n exit()\n if x_j not in p_list:\n print(x_j)\n exit()\n\n i += 1\n","fail":"x, n = list(map(int, input().split()))\np_list = list(map(int, input().split()))\nif n == 0:\n print(x)\n exit()\n\ni = 0\nwhile True:\n x_i = x - i\n x_j = x + i\n\n if x_i not in p_list:\n print(x_i)\n exit()\n if x_j not in p_list:\n print(x_j)\n exit()\n\n i += 1\n","change":"replace","i1":1,"i2":7,"j1":1,"j2":5,"error":"0","stderr":null,"stdout":8.0} {"problem_id":"p02641","language":"Python","original_status":"Runtime Error","pass":"import numpy as np\n\nX, N = map(int, input().split())\nP = np.array(list(map(int, input().split())))\n\nP = P - X\n\nfor i in range(0, X):\n if i not in P or -i not in P:\n if -i not in P:\n ans = X - i\n else:\n ans = X + i\n break\n\nprint(ans)\n","fail":"import numpy as np\n\nX, N = map(int, input().split())\nP = np.array(list(map(int, input().split())))\n\nP = P - X\n\nfor i in range(0, X + 1):\n if i not in P or -i not in P:\n if -i not in P:\n ans = X - i\n else:\n ans = X + i\n break\n\nprint(ans)\n","change":"replace","i1":7,"i2":8,"j1":7,"j2":8,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02641","language":"Python","original_status":"Runtime Error","pass":"def Qc():\n x, n = map(int, input().split())\n if 0 < n:\n p = map(int, input().split())\n\n targets = list(range(1, 101))\n outer = set(targets) - set(p)\n res = [abs(x - v) for v in outer]\n i = res.index(min(res))\n res = list(outer)[i]\n else:\n # \u6574\u6570\u5217\u304c\u306a\u306b\u3082\u306a\u3044\u5834\u5408\u306f\u81ea\u5206\u81ea\u8eab\u304c\u542b\u307e\u308c\u3066\u3044\u306a\u3044\u6700\u8fd1\u5024\u306b\u306a\u308b\n res = x\n print(res)\n\n\nif __name__ == \"__main__\":\n Qc()\n","fail":"def Qc():\n x, n = map(int, input().split())\n if 0 < n:\n p = list(map(int, input().split()))\n for i in range(101):\n if x - i not in p:\n print(x - i)\n exit()\n if x + i not in p:\n res = x + 1\n print(x + i)\n exit()\n else:\n # \u6574\u6570\u5217\u304c\u306a\u306b\u3082\u306a\u3044\u5834\u5408\u306f\u81ea\u5206\u81ea\u8eab\u304c\u542b\u307e\u308c\u3066\u3044\u306a\u3044\u6700\u8fd1\u5024\u306b\u306a\u308b\n print(x)\n exit()\n\n\nif __name__ == \"__main__\":\n Qc()\n","change":"replace","i1":3,"i2":14,"j1":3,"j2":16,"error":"0","stderr":null,"stdout":8.0} {"problem_id":"p02641","language":"Python","original_status":"Runtime Error","pass":"a = input()\n\nt, c = int(a.split(\" \")[0]), int(a.split(\" \")[1])\n\nif not c:\n print(t)\n\nb = input()\nlst = [int(x) for x in b.split(\" \")]\n\nfor i in range(c):\n if t - i not in lst:\n print(t - i)\n break\n if t + i not in lst:\n print(t + i)\n break\n","fail":"a = input()\n\nt, c = int(a.split(\" \")[0]), int(a.split(\" \")[1])\n\nif not c:\n print(t)\nelse:\n b = input()\n lst = [int(x) for x in b.split(\" \")]\n\n for i in range(c + 2):\n if t - i not in lst:\n print(t - i)\n break\n if t + i not in lst:\n print(t + i)\n break\n","change":"replace","i1":6,"i2":17,"j1":6,"j2":17,"error":"0","stderr":null,"stdout":8.0} {"problem_id":"p02641","language":"Python","original_status":"Runtime Error","pass":"X, N = map(int, input().split())\n\nif N == 0:\n print(X)\n\nelse:\n p = list(map(int, input().split()))\n q = [i for i in range(-1, 102)]\n\n for r in p:\n idx = q.index(r)\n del q[idx]\n\n if X in q:\n print(X)\n\n else:\n q.sort()\n mindif = 100\n\n for num in q:\n dif = abs(X - num)\n if mindif <= dif:\n break\n else:\n mindif = dif\n ans = num\n print(ans)\n","fail":"X, N = map(int, input().split())\n\nif N == 0:\n print(X)\n\nelse:\n p = list(map(int, input().split()))\n q = [i for i in range(-1, 102)]\n\n for r in p:\n idx = q.index(r)\n del q[idx]\n\n if X in q:\n print(X)\n\n else:\n q.sort()\n mindif = 1000\n\n for num in q:\n dif = abs(X - num)\n if mindif <= dif:\n break\n else:\n mindif = dif\n ans = num\n print(ans)\n","change":"replace","i1":18,"i2":19,"j1":18,"j2":19,"error":"0","stderr":null,"stdout":8.0} {"problem_id":"p02641","language":"Python","original_status":"Runtime Error","pass":"X, N = map(int, input().split())\nA = list(map(int, input().split()))\n\ntmp = 1000\nresult = []\nresult2 = []\nfor i in range(1, 101):\n if i in A:\n continue\n\n hoge = abs(X - i)\n if hoge <= tmp:\n tmp = hoge\n result2.append(tmp)\n result.append(i)\n\nresult3 = []\nfor i, v in enumerate(result2):\n if v == min(result2):\n result3.append(result[i])\n\nprint(min(result3))\n","fail":"X, N = map(int, input().split())\nA = list(map(int, input().split()))\n\ntmp = 1000\nresult = []\nresult2 = []\nfor i in range(0, 102):\n if i in A:\n continue\n\n hoge = abs(X - i)\n if hoge <= tmp:\n tmp = hoge\n result2.append(tmp)\n result.append(i)\n\nresult3 = []\nfor i, v in enumerate(result2):\n if v == min(result2):\n result3.append(result[i])\n\nprint(min(result3))\n","change":"replace","i1":6,"i2":7,"j1":6,"j2":7,"error":"0","stderr":null,"stdout":8.0} {"problem_id":"p02641","language":"Python","original_status":"Runtime Error","pass":"X, N = map(int, input().split())\nP = set(list(map(int, input().split())))\n\ntargets = set(range(1, 101)) - P\nprint(min([(target, abs(X - target)) for target in targets], key=lambda x: x[1])[0])\n","fail":"X, N = map(int, input().split())\nP = set(list(map(int, input().split())))\n\ntargets = set(range(-101, 102)) - P\nif targets:\n print(min([(target, abs(X - target)) for target in targets], key=lambda x: x[1])[0])\nelse:\n print(X)\n","change":"replace","i1":3,"i2":5,"j1":3,"j2":8,"error":"0","stderr":null,"stdout":8.0} {"problem_id":"p02641","language":"Python","original_status":"Runtime Error","pass":"import numpy as np\n\n\ndef getNearestValue(li, num):\n idx = np.abs(np.array(li) - num).argmin()\n return li[idx]\n\n\nx, n = map(int, input().split())\np = list(map(int, input().split()))\n\n\nans = 0\nprint(p)\ni = 0\nwhile True:\n mi = getNearestValue(p, x - i)\n ma = getNearestValue(p, x + i)\n if mi or ma:\n break\n i += 1\n\nprint(mi if mi < ma else ma)\n","fail":"x, n = map(int, input().split())\np = set(map(int, input().split()))\n\n\nans = 0\ni = 0\nwhile True:\n if (x - i) not in p:\n ans = x - i\n break\n elif (x + i) not in p:\n ans = x + i\n break\n i += 1\n\nprint(ans)\n","change":"replace","i1":0,"i2":23,"j1":0,"j2":16,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02641","language":"Python","original_status":"Runtime Error","pass":"x, n = map(int, input().split())\np = [int(_) for _ in input().split()]\n\nnot_in_p = [i for i in range(0, 102) if i not in p]\nnip_temp = list(map(lambda s: abs(x - s), not_in_p))\n\naddress = nip_temp.index(min(nip_temp))\nprint(p[address])\n","fail":"x, n = map(int, input().split())\np = [int(_) for _ in input().split()]\n\nnot_in_p = [i for i in range(0, 102) if i not in p]\nnip_temp = list(map(lambda s: abs(x - s), not_in_p))\n\naddress = nip_temp.index(min(nip_temp))\nprint(not_in_p[address])\n","change":"replace","i1":7,"i2":8,"j1":7,"j2":8,"error":"WA","stderr":null,"stdout":5.0} {"problem_id":"p02641","language":"Python","original_status":"Time Limit Exceeded","pass":"X, N = map(int, input().split())\n\nP = list(map(int, input().split()))\n\nif N == 0:\n print(X)\n exit()\n\n# high\nhigh = 0\ntmp = 0\nwhile not high:\n if (X + tmp) in P:\n tmp += 1\n continue\n high = X + tmp\n\nlow = 0\ntmp = 0\nwhile not low:\n if (X - tmp) in P:\n tmp += 1\n continue\n low = X - tmp\n\nif abs(X - low) == abs(X - high):\n print(low)\nelif abs(X - low) < abs(X - high):\n print(low)\nelse:\n print(high)\n","fail":"X, N = map(int, input().split())\n\nP = list(map(int, input().split()))\n\nif N == 0:\n print(X)\n exit()\n\ndiff = 0\nhigh = low = None\nwhile True:\n if X + diff not in P:\n high = X + diff\n if X - diff not in P:\n low = X - diff\n if high is None and low is None:\n diff += 1\n continue\n\n if high == low:\n print(low)\n elif low is None:\n print(high)\n else:\n print(low)\n break\n","change":"replace","i1":8,"i2":31,"j1":8,"j2":26,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02641","language":"Python","original_status":"Runtime Error","pass":"X, N = map(int, input().split())\np_int_list = []\n\nif N == 0:\n print(X)\n exit()\nelse:\n p_int_list = list(map(int, input().split()))\n p_int_list = sorted(p_int_list)\n\n\nans_range = []\nfor i, j in zip(p_int_list[:-1], p_int_list[1:]):\n if j < 0:\n if abs(j) <= X <= abs(i):\n ans_range = [abs(j), abs(i)]\n else:\n if i <= X <= j:\n ans_range = [i, j]\n if i < 0:\n print(0)\n exit()\n\nans = 0\np_int_set = set(p_int_list)\n\nif ans_range[1] - ans_range[0] != 1:\n if ans_range[1] == X:\n print(ans_range[1] - 1)\n exit()\n elif ans_range[0] == X:\n if X - 1 in p_int_set:\n print(X + 1)\n exit()\n else:\n print(X + 1)\n exit()\nelif ans_range[1] - ans_range[0] == 1:\n for i in range(1, N):\n if ans_range[0] - i not in p_int_set:\n print(ans_range[0] - i)\n exit()\n elif ans_range[1] + i not in p_int_set:\n print(ans_range[1] + i)\n exit()\n","fail":"X, N = map(int, input().split())\np_int_list = []\n\nif N == 0:\n print(X)\n exit()\nelse:\n p_int_list = list(map(int, input().split()))\n\np_int_set = set(p_int_list)\n\nif X not in p_int_set:\n print(X)\n exit()\n\nfor i in range(1, 10000):\n if X - i not in p_int_set:\n print(X - i)\n exit()\n elif X + i not in p_int_set:\n print(X + i)\n exit()\n","change":"replace","i1":8,"i2":45,"j1":8,"j2":22,"error":"0","stderr":null,"stdout":8.0} {"problem_id":"p02641","language":"Python","original_status":"Runtime Error","pass":"x, n = map(int, input().split())\n\nif n != 0:\n p = list(map(int, input().split()))\nelse:\n print(x)\n exit(1)\n\ndif = 100\nans = 0\n\nfor i in range(min(p) - 1, max(p) + 2):\n if not (i in p):\n if dif > abs(x - i):\n dif = abs(x - i)\n ans = i\n\nprint(ans)\n","fail":"x, n = map(int, input().split())\n\nif n != 0:\n p = list(map(int, input().split()))\nelse:\n print(x)\n exit()\n\ndif = 100\nans = 0\n\nfor i in range(min(p) - 1, max(p) + 2):\n if not (i in p):\n if dif > abs(x - i):\n dif = abs(x - i)\n ans = i\n\nprint(ans)\n","change":"replace","i1":6,"i2":7,"j1":6,"j2":7,"error":"0","stderr":null,"stdout":8.0} {"problem_id":"p02641","language":"Python","original_status":"Runtime Error","pass":"X, N = map(int, input().split())\nif N == 0:\n print(X)\n exit()\n\nP = list(map(int, input().split()))\nminmin = []\nminn = 101\nfor i in range(1, 101):\n if i in P:\n continue\n abs1 = abs(i - X)\n if minn >= abs1:\n minn = abs1\n minmin.append(i)\n\nif len(minmin) > 2 and abs(X - minmin[-1]) == abs(X - minmin[-2]):\n print(minmin[-2])\n exit()\nprint(minmin[-1])\n","fail":"X, N = map(int, input().split())\nif N == 0:\n print(X)\n exit()\n\nP = list(map(int, input().split()))\n\nfor i in range(101):\n p = X - i not in P\n p1 = X + i not in P\n if p1 or p:\n if p:\n print(X - i)\n exit()\n print(X + i)\n exit()\n","change":"replace","i1":6,"i2":20,"j1":6,"j2":16,"error":"0","stderr":null,"stdout":8.0} {"problem_id":"p02641","language":"Python","original_status":"Runtime Error","pass":"# coding:utf-8\nx, n = map(int, input().split())\np = list(map(int, input().split()))\n\n\nif n == 0:\n print(x)\nelse:\n ps = sorted(p)\n tmp = [_ for _ in range(ps[0], ps[-1] + 1)]\n ans_list = list(set(tmp) ^ set(ps))\n # print(tmp, ans_list)\n diff = []\n\n for i in ans_list:\n diff.append(abs(i - x))\n print(ans_list[diff.index(min(diff))])\n","fail":"# coding:utf-8\nx, n = map(int, input().split())\np = list(map(int, input().split()))\n\n\nif n == 0:\n print(x)\nelse:\n ps = sorted(p)\n tmp = list(range(-201, 200))\n ans_list = list(set(tmp) ^ set(ps))\n ans_list = sorted(ans_list)\n # print(tmp, ans_list)\n diff = []\n\n for i in ans_list:\n diff.append(abs(i - x))\n\n print(ans_list[diff.index(min(diff))])\n","change":"replace","i1":9,"i2":16,"j1":9,"j2":18,"error":"0","stderr":null,"stdout":8.0} {"problem_id":"p02641","language":"Python","original_status":"Runtime Error","pass":"x, n = map(int, input().split())\nif n != 0:\n p = list(map(int, input().split()))\n if x in p:\n for i in range(-1000, 1001):\n print(i)\n if i == -100:\n mini = i\n if i in p:\n pass\n else:\n if abs(x - mini) > abs(x - i):\n mini = i\n elif abs(x - mini) == abs(x - i):\n mini = min(mini, i)\n else:\n print(mini)\n else:\n print(x)\nelse:\n print(x)\n","fail":"x, n = map(int, input().split())\nif n != 0:\n p = list(map(int, input().split()))\n if x in p:\n for i in range(-1000, 1001):\n if i == -1000:\n mini = i\n if i in p:\n pass\n else:\n if abs(x - mini) > abs(x - i):\n mini = i\n elif abs(x - mini) == abs(x - i):\n mini = min(mini, i)\n else:\n print(mini)\n else:\n print(x)\nelse:\n print(x)\n","change":"replace","i1":5,"i2":7,"j1":5,"j2":6,"error":"NameError: name 'mini' is not defined. Did you mean: 'min'?","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02641\/Python\/s131160105.py\", line 12, in \n if abs(x - mini) > abs(x - i):\nNameError: name 'mini' is not defined. Did you mean: 'min'?\n","stdout":-1000.0} {"problem_id":"p02642","language":"Python","original_status":"Runtime Error","pass":"N = int(input())\nA = list(map(int, input().split()))\n\nsetA = set(A)\nresult = 0\n\nif N == 1:\n print(0)\nelse:\n for i in range(N):\n tmp = A[i]\n A[i] = 0\n setA = set(A)\n A[i] = tmp\n if 1 in setA:\n continue\n\n for a in setA:\n if A[i] % a == 0:\n break\n else:\n result += 1\n\n print(result)\n","fail":"from collections import Counter\n\nN = int(input())\nA = list(map(int, input().split()))\n\nsorted_A = sorted(A)\nresult = 0\nc = Counter(sorted_A)\n# \u500d\u6570\u3092\u7ba1\u7406\u3059\u308b\u30c6\u30fc\u30d6\u30eb\nlendp = sorted_A[-1] + 1\ndp = [0] * lendp\n\nfor a in sorted_A:\n dp[a] += 1\n if dp[a] == 1:\n b = a * 2\n while b < lendp:\n dp[b] += 2\n b += a\n\nprint(dp.count(1))\n","change":"replace","i1":0,"i2":24,"j1":0,"j2":21,"error":"ZeroDivisionError: integer division or modulo by zero","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02642\/Python\/s509349915.py\", line 19, in \n if A[i] % a == 0:\nZeroDivisionError: integer division or modulo by zero\n","stdout":null} {"problem_id":"p02642","language":"Python","original_status":"Runtime Error","pass":"# Not Divisible\n\nN = int(input())\nA = [int(n) for n in input().split()]\n\ncheck = [0] * 1000000\nA.sort()\n\nok = [-1]\np = 0\nfor a in A:\n if a == p:\n if ok[-1] == p:\n ok = ok[:-1]\n continue\n p = a\n if check[a] == 1:\n continue\n for i in range(a, 1000000, a):\n check[i] = 1\n ok.append(a)\n\nprint(len(ok) - 1)\n","fail":"# Not Divisible\n\nN = int(input())\nA = [int(n) for n in input().split()]\n\ncheck = [0] * 1000001\nA.sort()\n\nok = [-1]\np = 0\nfor a in A:\n if a == p:\n if ok[-1] == p:\n ok = ok[:-1]\n continue\n p = a\n if check[a] == 1:\n continue\n for i in range(a, 1000001, a):\n check[i] = 1\n ok.append(a)\n\nprint(len(ok) - 1)\n","change":"replace","i1":5,"i2":19,"j1":5,"j2":19,"error":"0","stderr":null,"stdout":3.0} {"problem_id":"p02642","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = sorted(map(int, input().split()))\n\ncnt = [0] * (max(a) + 1)\nfor i in a:\n cnt[i] += 1\nfor i in set(a):\n if cnt[i] >= 1:\n for j in range(i * 2, max(a) + 1, i):\n cnt[j] = 0\nprint(cnt.count(1))\n","fail":"n = int(input())\na = sorted(map(int, input().split()))\n\ncnt = [0] * (a[-1] + 1)\nfor i in a:\n cnt[i] += 1\nfor i in set(a):\n if cnt[i] >= 1:\n for j in range(i * 2, a[-1] + 1, i):\n cnt[j] = 0\nprint(cnt.count(1))\n","change":"replace","i1":3,"i2":9,"j1":3,"j2":9,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02642","language":"Python","original_status":"Time Limit Exceeded","pass":"from collections import Counter\n\n\nn = int(input())\na = list(map(int, input().split()))\nc = Counter(a)\na = set(a)\n\ncnt = 0\nwhile a:\n min_val = min(a)\n a.remove(min_val)\n\n if c[min_val] == 1:\n cnt += 1\n\n if not a:\n break\n\n max_val = max(a)\n\n del_a = set()\n mul = 2\n while True:\n mul_val = min_val * mul\n\n if mul_val > max_val:\n break\n\n if mul_val in a:\n del_a.add(min_val * mul)\n\n mul += 1\n\n a -= del_a\n\nprint(cnt)\n","fail":"from collections import Counter\n\n\nn = int(input())\na = list(map(int, input().split()))\na.sort()\nc = Counter(a)\n\nflags = [True] * (a[-1] + 1)\n\nfor e in a:\n for mul in range(2, a[-1] \/\/ e + 1):\n flags[e * mul] = False\n\nprint(sum([flags[a[i]] and c[a[i]] == 1 for i in range(n)]))\n","change":"replace","i1":5,"i2":37,"j1":5,"j2":15,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02642","language":"Python","original_status":"Time Limit Exceeded","pass":"# coding:utf-8\nn = int(input())\na = list(map(int, input().split()))\ncount = [0 for _ in range(max(a) + 1)]\nans = 0\n\nfor i in a:\n if count[i] != 0:\n count[i] = 1\n continue\n for j in range(2 * i, max(a) + 1, i):\n count[j] = 1\n count[i] = 2\n\nfor i in a:\n if count[i] != 1:\n ans += 1\n\nprint(ans)\n","fail":"# coding:utf-8\nn = int(input())\na = list(map(int, input().split()))\nm = max(a)\ncount = [0 for _ in range(m + 1)]\nans = 0\n\nfor i in a:\n if count[i] != 0:\n count[i] = 1\n continue\n for j in range(2 * i, m + 1, i):\n count[j] = 1\n count[i] = 2\n\nfor i in a:\n if count[i] != 1:\n ans += 1\n\nprint(ans)\n","change":"replace","i1":3,"i2":11,"j1":3,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02642","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = list(map(int, input().split()))\nremain = [0 for i in range(max(a) + 1)]\nfor ai in a:\n remain[ai] += 1\nres = 0\nfor i in range(1, max(a) + 1):\n if remain[i] == 1:\n res += 1\n if remain[i]:\n for j in range(i * 2, max(a) + 1, i):\n remain[j] = 0\nprint(res)\n","fail":"n = int(input())\na = list(map(int, input().split()))\nremain = [0 for i in range(max(a) + 1)]\nfor ai in a:\n remain[ai] += 1\nres = 0\nmax_a = max(a)\nfor i in range(1, max_a + 1):\n if remain[i] == 1:\n res += 1\n if remain[i]:\n for j in range(i * 2, max_a + 1, i):\n remain[j] = 0\nprint(res)\n","change":"replace","i1":6,"i2":11,"j1":6,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02642","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = list(map(int, input().split()))\na.sort()\nflag = False\nb = [False] * 1000010\nfor i in range(n - 1):\n if a[i] == a[i + 1]:\n for j in range(a[i], 1000010, a[i]):\n b[j] = True\n\nans = 0\nfor i in range(n):\n if not b[a[i]]:\n ans += 1\n for j in range(a[i], 1000010, a[i]):\n b[j] = True\n\nprint(ans)\n","fail":"n = int(input())\na = list(map(int, input().split()))\na.sort()\nflag = False\nb = [False] * 1000010\nfor i in range(n - 1):\n if a[i] == a[i + 1]:\n if b[a[i]]:\n continue\n for j in range(a[i], 1000010, a[i]):\n b[j] = True\n\nans = 0\nfor i in range(n):\n if not b[a[i]]:\n ans += 1\n for j in range(a[i], 1000010, a[i]):\n b[j] = True\n\nprint(ans)\n","change":"insert","i1":7,"i2":7,"j1":7,"j2":9,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02642","language":"Python","original_status":"Runtime Error","pass":"from collections import Counter\nimport sympy\n\n\nlen_arr = int(input())\narr = list(map(int, input().split()))\ncounter = Counter(arr)\nst = set(arr)\n\nans = 0\nfor value, count in counter.items():\n if count > 1:\n continue\n divs = set(sympy.divisors(value))\n if len(divs & st) == 1:\n ans += 1\n\nprint(ans)\n","fail":"import numpy as np\nfrom collections import Counter\n\n\nlen_arr = int(input())\narr = list(map(int, input().split(\" \")))\ncounter = Counter(arr)\nx_max = max(counter.keys())\n\ndp = np.empty(x_max + 1, dtype=np.bool_)\ndp[:] = True\n\nans = 0\n\nfor x, count in sorted(counter.items()):\n multi = [x * y for y in range(1, x_max \/\/ x + 1)]\n if count == 1 and dp[x]:\n ans += 1\n dp[multi] = False\n\nprint(ans)\n","change":"replace","i1":0,"i2":16,"j1":0,"j2":19,"error":"0","stderr":null,"stdout":3.0} {"problem_id":"p02642","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\nA = sorted(map(int, input().split()))\n\nB = [1] * n\nfor i in range(n):\n if B[i] == 0:\n continue\n a = A[i]\n for j in range(i + 1, n):\n if A[j] % a == 0:\n B[j] = 0\n\nfor i in range(n - 1):\n if B[i] == 1:\n if A[i] == A[i + 1]:\n B[i] = 0\n\nprint(sum(B))\n","fail":"from collections import Counter\n\n\nn = int(input())\nA = list(map(int, input().split()))\n\nok = [False] * (10**6 + 1)\nfor a in A:\n ok[a] = True\n\nfor i in range(10**6 + 1):\n if ok[i]:\n j = 2\n while i * j <= 10**6:\n ok[i * j] = False\n j += 1\n\nfor a, cnt in Counter(A).items():\n if cnt >= 2:\n ok[a] = False\n\nprint(sum(ok))\n","change":"replace","i1":0,"i2":18,"j1":0,"j2":22,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02642","language":"Python","original_status":"Time Limit Exceeded","pass":"from collections import Counter\n\nN = int(input())\nA = list(map(int, input().split()))\n\nA_sort = sorted(set(A))\nA_counter = Counter(A)\n# print(A_sort)\n\nres = 0\n# res_list = []\nfor i in range(len(A_sort)):\n # print(A_sort[i], A_sort_tmp)\n if A_counter[A_sort[i]] >= 2:\n continue\n\n A_sort_tmp = A_sort[:i]\n for j in range(len(A_sort_tmp)):\n if A_sort[i] % A_sort_tmp[j] == 0:\n break\n else:\n res += 1\n # res_list.append(i + 1)\n\nprint(res)\n# print(res_list)\n","fail":"from collections import defaultdict\n\nN = int(input())\nA = list(map(int, input().split()))\nA_sort = sorted(set(A))\n\nbool_list = [True] * (10**6 + 1)\n\nduplicate_dic = defaultdict(int)\nfor a in A:\n duplicate_dic[a] += 1\n if duplicate_dic[a] > 1:\n bool_list[a] = False\n\nfor a in A_sort:\n for i in range(2 * a, 10**6 + 1, a):\n bool_list[i] = False\n\nprint(sum([1 for a in A_sort if bool_list[a]]))\n","change":"replace","i1":0,"i2":26,"j1":0,"j2":19,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02642","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nAS = [int(x) for x in input().split()]\n\nok = []\nfor i in range(N):\n for j in range(N):\n if i == j:\n continue\n if AS[i] % AS[j] == 0:\n break\n else:\n ok.append(i)\n\nprint(len(ok))\n","fail":"N = int(input())\nAS = [int(x) for x in input().split()]\n\nAS.sort(reverse=True)\nMAX_AS = AS[0]\ntable = [0] * (MAX_AS + 1) # 1..max(AS)\n\nalreadyVisited = {}\nfor i in range(N):\n x = dx = AS[i]\n if alreadyVisited.get(x, False):\n table[x] = 0\n continue\n alreadyVisited[x] = True\n\n table[x] = 1\n while True:\n x += dx\n if x > MAX_AS:\n break\n table[x] = 0\n\nprint(sum(table))\n","change":"replace","i1":3,"i2":14,"j1":3,"j2":23,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02642","language":"Python","original_status":"Runtime Error","pass":"from collections import Counter\n\nn = int(input())\na = list(map(int, input().split()))\n\nnew = [key for key, val in Counter(a).most_common() if val == 1]\ndp = [0] * 100010\n\nfor i in new:\n for j in range(0, 100000, i):\n dp[j] += 1\n\nans = 0\nfor i in new:\n if dp[i] == 1:\n ans += 1\nprint(ans)\n","fail":"from collections import Counter\n\nn = int(input())\na = list(map(int, input().split()))\n\n# new = [key for key, val in Counter(a).most_common() if val == 1]\nprime = [1] * 1000010\n\nfor i in set(a):\n # if prime[i]:\n for j in range(i + i, 1000001, i):\n prime[j] = 0\n\nc = Counter(a)\nans = 0\nfor i in a:\n if prime[i] and c[i] == 1:\n ans += 1\nprint(ans)\n","change":"replace","i1":5,"i2":15,"j1":5,"j2":17,"error":"0","stderr":null,"stdout":3.0} {"problem_id":"p02642","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = list(map(int, input().split()))\n\n\ncount = 0\nfor i in range(N):\n is_ans = True\n for j in range(N):\n if i != j:\n if A[i] % A[j] == 0:\n is_ans = False\n break\n\n if is_ans:\n count += 1\n\nprint(count)\n","fail":"N = int(input())\nA = list(map(int, input().split()))\n\n\ndef solve2(N, A):\n A.sort()\n amax = A[-1]\n dp = [True] * (amax + 1)\n cnt = [0] * (amax + 1)\n\n for a in A:\n cnt[a] += 1\n\n for i in range(amax):\n x = i + 1\n if cnt[x] > 1:\n dp[x] = False\n\n if cnt[x] > 0:\n y = x * 2\n while y <= amax:\n dp[y] = False\n y += x\n\n ansval = [x for x in A if dp[x]]\n\n # print(ansval)\n ans = len(ansval)\n\n return ans\n\n\ndef solve1(N, A):\n ans = 0\n for i in range(N):\n is_ans = True\n for j in range(N):\n if i != j:\n if A[i] % A[j] == 0:\n is_ans = False\n break\n\n if is_ans:\n ans += 1\n\n return ans\n\n\nprint(solve2(N, A))\n","change":"replace","i1":4,"i2":17,"j1":4,"j2":49,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02642","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = [int(Ai) for Ai in input().split()]\n\ncount = 0\nfor i, Ai in enumerate(A):\n found = False\n for j, Aj in enumerate(A):\n if i != j and Ai % Aj == 0:\n found = True\n break\n if not found:\n count += 1\n\nprint(count)\n","fail":"from collections import Counter\n\nN = int(input())\nA = [int(Ai) for Ai in input().split()]\n\ncounter = Counter(A)\n\ndp = [1] * (max(A) + 1)\nfor Ai in A:\n for j in range(Ai * 2, len(dp), Ai):\n dp[j] = 0\n\nprint(sum([dp[Ai] == 1 and counter[Ai] == 1 for Ai in A]))\n","change":"replace","i1":0,"i2":14,"j1":0,"j2":13,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02642","language":"Python","original_status":"Runtime Error","pass":"n = int(input())\na = list(map(int, input().split()))\na = list(set(a))\na.sort()\nans = 0\nif len(a) == 1:\n print(0)\nelse:\n for _ in range(n):\n m = a.pop()\n ind = True\n for i in a:\n if m % i == 0:\n ind = False\n break\n if ind:\n ans += 1\n print(ans)\n","fail":"n = int(input())\na = list(map(int, input().split()))\nm = max(a)\ny = [0] * (m + 1)\nfor i in a:\n x = i\n while x <= m:\n y[x] += 1\n x += i\nans = 0\nfor j in a:\n if y[j] == 1:\n ans += 1\n\nprint(ans)\n","change":"replace","i1":2,"i2":18,"j1":2,"j2":15,"error":"0","stderr":null,"stdout":3.0} {"problem_id":"p02642","language":"Python","original_status":"Runtime Error","pass":"from numba import njit\n\n\n@njit(cache=True)\ndef fact(x):\n i = 1\n while i * i <= x:\n if x % i == 0:\n yield i\n yield x \/\/ i\n i += 1\n\n\ndef main():\n n = int(input())\n a = tuple(map(int, input().split()))\n\n c = [0] * (max(a) + 1)\n\n for e in a:\n c[e] += 1\n\n ans = n\n for e in a:\n c[e] -= 1\n for fct in fact(e):\n if c[fct]:\n ans -= 1\n break\n\n c[e] += 1\n\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"from numba import njit\n\n\n@njit(fastmath=True)\ndef fact(x):\n i = 1\n while i * i <= x:\n if x % i == 0:\n yield i\n yield x \/\/ i\n i += 1\n\n\ndef main():\n n = int(input())\n a = tuple(map(int, input().split()))\n\n c = [0] * (max(a) + 1)\n\n for e in a:\n c[e] += 1\n\n ans = n\n for e in a:\n c[e] -= 1\n for fct in fact(e):\n if c[fct]:\n ans -= 1\n break\n\n c[e] += 1\n\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":3,"i2":4,"j1":3,"j2":4,"error":"ModuleNotFoundError: No module named 'numba'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02642\/Python\/s936960783.py\", line 1, in \n from numba import njit\nModuleNotFoundError: No module named 'numba'\n","stdout":null} {"problem_id":"p02642","language":"Python","original_status":"Time Limit Exceeded","pass":"# -*- coding: utf-8 -*-\nn = int(input())\na = list(map(int, input().split()))\n\ncount = 0\nfor i in range(n):\n is_divisible = False\n for j in range(n):\n divisible_num = []\n if a[i] % a[j] == 0 and i != j:\n divisible_num.append(a[j])\n is_divisible = True\n if len(divisible_num) >= 1:\n continue\n if is_divisible:\n continue\n else:\n count += 1\n\nprint(count)\n","fail":"# -*- coding: utf-8 -*-\nn = int(input())\na = sorted(list(map(int, input().split())))\n\n# \u63a2\u7d22\u7bc4\u56f2\u306f\u6570\u5217a\u306e\u6700\u5927\u5024\u307e\u3067\nmax_a = a[-1]\nb = [0] * (max_a + 1)\nans = set()\nfor i in a:\n if b[i] == 1:\n if i in ans:\n ans.remove(i)\n continue\n # \u63a2\u7d22\u7bc4\u56f2\u5185\u306ei\u306e\u500d\u6570\u3092\u30c1\u30a7\u30c3\u30af\n for j in range(i, max_a + 1, i):\n b[j] = 1\n ans.add(i)\n\nprint(len(ans))\n","change":"replace","i1":2,"i2":20,"j1":2,"j2":19,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02642","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\nA = [int(x) for x in input().split()]\nA.sort()\nans = 0\nfor i, a in enumerate(A):\n if i != n - 1 and A[i + 1] == a:\n continue\n do_count = True\n for j in range(i):\n b = A[j]\n if a % b == 0:\n do_count = False\n break\n if do_count:\n ans += 1\nprint(ans)\n","fail":"n = int(input())\nA = [int(x) for x in input().split()]\nA.sort()\nlim = A[-1]\nse = [True for i in range(lim + 1)]\nans = 0\nfor i, a in enumerate(A):\n if se[a]:\n if not ((i != n - 1 and A[i + 1] == a) or (i != 0 and A[i - 1] == a)):\n ans += 1\n tmp = a\n while not tmp > lim:\n se[tmp] = False\n tmp += a\nprint(ans)\n","change":"replace","i1":3,"i2":15,"j1":3,"j2":14,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02642","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = list(map(int, input().split()))\n\nleft = 0\nright = n - 1\nans = 0\n\nfor i in range(n):\n left = 0\n right = n - 1\n while left <= right:\n if i == left == right:\n left, right = left + 1, right - 1\n continue\n\n elif i == left:\n if a[i] % a[right] == 0:\n break\n\n elif i == right:\n if a[i] % a[left] == 0:\n break\n\n else:\n if a[i] % a[left] == 0 or a[i] % a[right] == 0:\n break\n\n left, right = left + 1, right - 1\n\n if left > right:\n ans += 1\n\nprint(ans)\n","fail":"n = int(input())\na = sorted(list(map(int, input().split())))\n\nans = 0\ndp = [0] * (a[-1] + 1)\n\nfor i in range(n):\n tmp = a[i]\n while tmp <= a[-1]:\n dp[tmp] += 1\n tmp += a[i]\n\nfor i in a:\n if dp[i] == 1:\n ans += 1\n\nprint(ans)\n","change":"replace","i1":1,"i2":30,"j1":1,"j2":14,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02642","language":"Python","original_status":"Runtime Error","pass":"from collections import Counter\n\nn = int(input())\nalist = [int(v) for v in input().split()]\ndup_set = {k for k, v in Counter(alist).items() if v >= 2}\nalist = sorted(set(alist))\nadict = {a: False for a in alist}\na_max = alist[-1]\nmax_ind = -1\n\ncount = 0\nif 1 in adict:\n count = 0 if 1 in dup_set else 1\nelse:\n for a, f in adict.items():\n if f:\n continue\n if a not in dup_set:\n count += 1\n for k in range(a, a_max + 1, a):\n if k in adict:\n adict[k] = True\n if k == a_max:\n max_ind -= 1\n a_max = alist[max_ind]\n\nprint(count)\n","fail":"from collections import Counter\n\nn = int(input())\nalist = [int(v) for v in input().split()]\ndup_set = {k for k, v in Counter(alist).items() if v >= 2}\nalist = sorted(set(alist))\nadict = {a: False for a in alist}\na_max = alist[-1]\nmax_ind = -1\n\ncount = 0\nif 1 in adict:\n count = 0 if 1 in dup_set else 1\nelse:\n for a, f in adict.items():\n if f:\n continue\n if a not in dup_set:\n count += 1\n for k in range(a, a_max + 1, a):\n if k in adict:\n adict[k] = True\n if k == a_max:\n max_ind -= 1\n if abs(max_ind) <= len(alist):\n a_max = alist[max_ind]\n\nprint(count)\n","change":"replace","i1":24,"i2":25,"j1":24,"j2":26,"error":"0","stderr":null,"stdout":3.0} {"problem_id":"p02642","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = list(map(int, input().split()))\nA.sort()\nres = 0\nwhile A:\n if len(A) == 1:\n res += 1\n else:\n if A[0] != A[1]:\n res += 1\n t = A[0]\n NA = []\n for a in A:\n if a % t != 0:\n NA.append(a)\n A = NA[:]\nprint(res)\n","fail":"N = int(input())\nA = list(map(int, input().split()))\nA.sort()\nMA = max(A)\ndp = [True for _ in range(MA + 1)]\nflag = [False for _ in range(MA + 1)]\n\nfor i in range(N):\n a = A[i]\n if not flag[a]:\n flag[a] = True\n t = a * 2\n while t <= MA:\n dp[t] = False\n t += a\n elif flag[a] == 1:\n dp[a] = False\nres = 0\nfor a in A:\n if dp[a]:\n res += 1\nprint(res)\n","change":"replace","i1":3,"i2":16,"j1":3,"j2":21,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02642","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\naL = sorted(list(map(int, input().split(\" \"))))\n# aL = sorted(list(set(aLP)))\n\ndp = [False for _ in range(1000001)]\n\nans = 0\nfor a in aL:\n if dp[a] or aL.count(a) > 1:\n continue\n ans += 1\n\n c = 1\n while a * c <= 1000000:\n dp[a * c] = True\n c += 1\n\nprint(ans)\n","fail":"n = int(input())\naL = sorted(list(map(int, input().split(\" \"))))\n# aL = sorted(list(set(aLP)))\n\ndp = [False for _ in range(1000001)]\n\nd = {}\nfor a in aL:\n if a in d:\n d[a] += 1\n else:\n d[a] = 1\n\nans = 0\nfor a in aL:\n if dp[a]:\n continue\n if d[a] > 1:\n c = 1\n while a * c <= 1000000:\n dp[a * c] = True\n c += 1\n continue\n ans += 1\n\n c = 1\n while a * c <= 1000000:\n dp[a * c] = True\n c += 1\n\nprint(ans)\n","change":"replace","i1":6,"i2":9,"j1":6,"j2":22,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02642","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\ndata = list(map(int, input().split()))\n\nans_list = []\nfor i in range(n):\n f = True\n for j in range(n):\n if i == j:\n continue\n\n if data[i] % data[j] == 0:\n f = False\n break\n\n if f:\n ans_list.append(data[i])\n\nprint(len(ans_list))\n","fail":"from collections import Counter\n\nn = int(input())\ndata = list(map(int, input().split()))\n\nmax_ = 10**6 + 1\nb = [True] * (max_ + 1)\ndata.sort()\nc = Counter(data)\n\nans = 0\nfor d in data:\n if b[d]:\n for j in range(d, max_, d):\n b[j] = False\n # \u8907\u6570\u5b58\u5728\n if c[d] > 1:\n continue\n else:\n ans += 1\n\nprint(ans)\n","change":"replace","i1":0,"i2":18,"j1":0,"j2":22,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02642","language":"Python","original_status":"Runtime Error","pass":"n = int(input())\na = list(map(int, input().split()))\na.sort()\n\nans = 0\nfor i in range(n):\n cnt = 0\n if i > 0 and a[i] == a[i - 1]:\n continue\n for j in range(i):\n if a[j] > a[i] \/\/ 2:\n break\n if a[i] % a[j] == 0:\n cnt += 1\n break\n if cnt == 0:\n if i != 0:\n # print(i, a[i])\n ans += 1\n elif a[0] != a[1]:\n # i == 0\n ans += 1\n\nprint(ans)\n","fail":"n = int(input())\na = list(map(int, input().split()))\na.sort()\n\ncnt = [0] * (a[-1] + 1)\nfor i in range(n):\n cnt[a[i]] += 1\n\nans = 0\nfor i in range(1, a[-1] + 1):\n if cnt[i] > 0:\n if cnt[i] == 1:\n ans += 1\n for j in range(2, a[-1] + 1):\n na = i * j\n if na <= a[-1]:\n cnt[na] = 0\n else:\n break\n\nprint(ans)\n","change":"replace","i1":4,"i2":22,"j1":4,"j2":19,"error":"0","stderr":null,"stdout":3.0} {"problem_id":"p02642","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\nA = list(map(int, input().split()))\n\nA.sort()\ncount = 0\nfor i in range(n - 1):\n if A[i] % A[i + 1] == 0:\n count += 1\n continue\n for j in range(i):\n if A[i] % A[j] == 0:\n count += 1\n break\ni = n - 1\nfor j in range(i):\n if A[i] % A[j] == 0:\n count += 1\n break\nprint(n - count)\n","fail":"n = int(input())\nA = list(map(int, input().split()))\nA.sort()\n\ndp = [False] * (A[-1] + 1)\nfor a in A:\n dp[a] = True\n\nfor idx, a in enumerate(A):\n if A[idx] == A[idx - 1]:\n if idx == 0:\n None\n else:\n dp[a] = False\n for j in range(2, A[-1] \/\/ a + 1):\n dp[a * j] = False\n\ncount = 0\nfor d in dp:\n if d:\n count += 1\nprint(count)\n","change":"replace","i1":2,"i2":19,"j1":2,"j2":22,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02642","language":"Python","original_status":"Time Limit Exceeded","pass":"#!\/usr\/bin\/env python3\n\nN = int(input())\nA = list(map(int, input().split()))\nA.sort()\n\ncount = 0\n\nfor i in range(N):\n for j in range(N):\n if i == j:\n continue\n\n if A[i] % A[j] == 0:\n break\n\n else:\n count += 1\n\nprint(count)\n","fail":"#!\/usr\/bin\/env python3\n\nN = int(input())\nA = list(map(int, input().split()))\n\nA.sort()\nA_max = A[-1]\ntable = [0] * (A_max + 1)\n\nfor x in A:\n table[x] += 1\n for y in range(x * 2, A_max + 1, x):\n table[y] += 1\n\nresult = sum([1 for x in A if table[x] == 1])\nprint(result)\n","change":"replace","i1":4,"i2":20,"j1":4,"j2":16,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02642","language":"Python","original_status":"Runtime Error","pass":"from collections import Counter\n\nN = int(input())\na = sorted(list(map(int, input().split())))\n\nM = 10**6 + 1\n\ntable = [1] * M\n\nB = Counter(a)\nKey = list(B.keys())\n\ncount = 0\nfor x in Key:\n if B[x] == 1 and table[x] == 1:\n count += 1\n\n for i in range(M):\n if i * x > M:\n break\n else:\n table[i * x] = 0\n\nprint(count)\n","fail":"from collections import Counter\n\nN = int(input())\na = sorted(list(map(int, input().split())))\n\nM = 10**6\n\ntable = [1] * (M + 1)\n\nB = Counter(a)\nKey = list(B.keys())\n\ncount = 0\nfor x in Key:\n if B[x] == 1 and table[x] == 1:\n count += 1\n\n for i in range(M):\n if i * x > M:\n break\n else:\n table[i * x] = 0\n\nprint(count)\n","change":"replace","i1":5,"i2":8,"j1":5,"j2":8,"error":"0","stderr":null,"stdout":3.0} {"problem_id":"p02642","language":"Python","original_status":"Runtime Error","pass":"n = int(input())\nA = list(map(int, input().split()))\n\nA.sort()\nA.append(-1)\n\nx = A[0]\nflag = True\nfor a in A:\n if a % x != 0:\n flag = False\nif flag:\n print(0)\n exit()\n\nused = [False] * A[-2]\nans = 0\nfor idx, a in enumerate(A):\n if used[a - 1]:\n continue\n if a != A[idx + 1]:\n ans += 1\n for j in range(a, len(used) + 1, a):\n used[j - 1] = True\nprint(ans)\n","fail":"n = int(input())\nA = list(map(int, input().split()))\n\nA.sort()\nA.append(-1)\n\nx = A[0]\nif x != 1:\n flag = True\n for a in A:\n if a % x != 0:\n flag = False\n if flag:\n print(0)\n exit()\n\nused = [False] * A[-2]\nans = 0\nfor idx, a in enumerate(A[:-1]):\n if used[a - 1]:\n continue\n if a != A[idx + 1]:\n ans += 1\n for j in range(a, len(used) + 1, a):\n used[j - 1] = True\nprint(ans)\n","change":"replace","i1":7,"i2":18,"j1":7,"j2":19,"error":"IndexError: list index out of range","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02642\/Python\/s321495509.py\", line 21, in \n if a != A[idx + 1]:\nIndexError: list index out of range\n","stdout":null} {"problem_id":"p02644","language":"Python","original_status":"Time Limit Exceeded","pass":"import sys\nfrom collections import deque\n\n\ninput = iter(sys.stdin.readlines()).__next__\n\nR, C, K = [int(x) for x in input().split()]\nX1, Y1, X2, Y2 = [int(x) - 1 for x in input().split()] # 0 indexed\n\ngrid = [input().rstrip() for r in range(R)]\n\nsource = (X1, Y1)\nq = deque([source])\ndist = {source: 0}\n\n\ndef getNbr(node):\n r, c = node\n ret = []\n for dr, dc in [(0, 0), (-1, 0), (0, -1), (0, 1), (1, 0)]:\n for k in range(1, K + 1):\n nr = r + dr * k\n nc = c + dc * k\n if not (0 <= nr < R and 0 <= nc < C):\n break\n if grid[nr][nc] == \"@\":\n break\n ret.append((nr, nc))\n return ret\n\n\nwhile q:\n node = q.popleft()\n d = dist[node]\n for nbr in getNbr(node):\n if nbr not in dist:\n q.append(nbr)\n dist[nbr] = d + 1\n\n\nif False:\n for row in grid:\n print(row)\n print()\n for r in range(R):\n for c in range(C):\n print(dist.get((r, c), \"?\"), end=\" \")\n print()\n\n\nif (X2, Y2) in dist:\n print(dist[(X2, Y2)])\nelse:\n print(-1)\n","fail":"import sys\nfrom collections import deque\n\n\ninput = iter(sys.stdin.readlines()).__next__\n\nR, C, K = [int(x) for x in input().split()]\nX1, Y1, X2, Y2 = [int(x) - 1 for x in input().split()] # 0 indexed\n\ngrid = [input().rstrip() for r in range(R)]\n\nsource = (X1, Y1)\nq = deque([source])\ndist = {source: 0}\n\n\ndef getNbr(node, currDist):\n r, c = node\n ret = []\n for dr, dc in [(0, 0), (-1, 0), (0, -1), (0, 1), (1, 0)]:\n for k in range(1, K + 1):\n nr = r + dr * k\n nc = c + dc * k\n if not (0 <= nr < R and 0 <= nc < C):\n break\n if grid[nr][nc] == \"@\" or ((nr, nc) in dist and dist[(nr, nc)] <= d):\n break\n ret.append((nr, nc))\n return ret\n\n\nwhile q:\n node = q.popleft()\n d = dist[node]\n for nbr in getNbr(node, d):\n if nbr not in dist:\n q.append(nbr)\n dist[nbr] = d + 1\n\n\nif False:\n for row in grid:\n print(row)\n print()\n for r in range(R):\n for c in range(C):\n print(dist.get((r, c), \"?\"), end=\" \")\n print()\n\n\nif (X2, Y2) in dist:\n print(dist[(X2, Y2)])\nelse:\n print(-1)\n","change":"replace","i1":16,"i2":35,"j1":16,"j2":35,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02645","language":"Python","original_status":"Runtime Error","pass":"s = input()\nprint(s[3])\n","fail":"s = input()\nprint(s[:3])\n","change":"replace","i1":1,"i2":2,"j1":1,"j2":2,"error":"WA","stderr":null,"stdout":"a\n"} {"problem_id":"p02645","language":"Python","original_status":"Runtime Error","pass":"print(input().split().index(\"0\") + 1)\n","fail":"print(input()[:3])\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"ValueError: '0' is not in list","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02645\/Python\/s112750711.py\", line 1, in \n print(input().split().index(\"0\") + 1)\nValueError: '0' is not in list\n","stdout":null} {"problem_id":"p02647","language":"Python","original_status":"Time Limit Exceeded","pass":"import sys\nfrom itertools import accumulate\n\ninput = sys.stdin.readline\n\n\ndef main():\n N, K = map(int, input().split())\n A = list(map(int, input().split()))\n\n for _ in range(min(41, K)):\n A_cumsum = [0] * N\n for i in range(N):\n a = i - A[i]\n b = i + A[i] + 1\n if a < 0:\n A_cumsum[0] += 1\n else:\n A_cumsum[a] += 1\n if N - 1 < b:\n pass\n else:\n A_cumsum[b] -= 1\n A = list(accumulate(A_cumsum))\n\n print(\" \".join(map(str, A)))\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"import sys\n\nimport numba as nb\nimport numpy as np\n\ninput = sys.stdin.readline\n\n\n@nb.njit(\"i8[:](i8,i8,i8[:])\", cache=True)\ndef solve(N, K, A):\n for _ in range(min(41, K)):\n A_cumsum = np.zeros(shape=N, dtype=np.int64)\n for i in range(N):\n A_cumsum[max(0, i - A[i])] += 1\n b = i + A[i] + 1\n if N - 1 < b:\n pass\n else:\n A_cumsum[b] -= 1\n A = np.cumsum(A_cumsum)\n return A\n\n\ndef main():\n N, K = map(int, input().split())\n A = np.array(input().split(), dtype=np.int64)\n\n ans = solve(N, K, A)\n\n print(\" \".join(map(str, ans)))\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":1,"i2":26,"j1":1,"j2":30,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02647","language":"Python","original_status":"Time Limit Exceeded","pass":"from copy import deepcopy\n\nn, k = map(int, input().split())\nAs = list(map(int, input().split()))\n\nfor _ in range(k):\n if sum(As) == n * n:\n break\n As_next = [0] * n\n for i in range(n):\n for j in range(max(0, i - As[i]), min(n, i + As[i] + 1)):\n As_next[j] += 1\n As = deepcopy(As_next)\n\nprint(\" \".join(map(str, As)))\n","fail":"from copy import deepcopy\n\nn, k = map(int, input().split())\nAs = list(map(int, input().split()))\n\nfor _ in range(k):\n if sum(As) == n * n:\n break\n Bs = [0] * n\n for i in range(n):\n l = max(0, i - As[i])\n r = min(n - 1, i + As[i])\n Bs[l] += 1\n if r + 1 < n:\n Bs[r + 1] -= 1\n for i in range(1, n):\n Bs[i] += Bs[i - 1]\n As = Bs\n\nprint(\" \".join(map(str, As)))\n","change":"replace","i1":8,"i2":13,"j1":8,"j2":18,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02647","language":"Python","original_status":"Time Limit Exceeded","pass":"n, k = map(int, input().split())\na = list(map(int, input().split()))\n\nfor _ in range(k):\n b = [0] * (n + 2)\n for i in range(n):\n b[max(0, i - a[i])] += 1\n b[min(n + 1, i + a[i] + 1)] -= 1\n a[0] = b[0]\n cnt = 1 if a[0] == n else 0\n for i in range(1, n):\n a[i] = a[i - 1] + b[i]\n if a[i] == n:\n cnt += 1\n\n if cnt == n:\n break\n\nprint(*a)\n","fail":"n, k = map(int, input().split())\na = list(map(int, input().split()))\n\nfor _ in range(k):\n b = [0] * (n + 2)\n for i in range(n):\n b[max(0, i - a[i])] += 1\n b[min(n + 1, i + a[i] + 1)] -= 1\n a[0] = b[0]\n cnt = a[0]\n for i in range(1, n):\n a[i] = a[i - 1] + b[i]\n cnt += a[i]\n\n # print(*a)\n if cnt == n**2:\n break\n\nprint(*a)\n","change":"replace","i1":9,"i2":16,"j1":9,"j2":16,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02647","language":"Python","original_status":"Time Limit Exceeded","pass":"# \u554f\u984c\u6587\u306e\u610f\u5473\u304c\u308f\u304b\u3089\u3093\u30b3\u30f3\u30c6\u30b9\u30c8\n# 0\u306e\u5834\u5408\u3082\u81ea\u5206\u81ea\u8eab\u3092\u7167\u3089\u3059\u3001\u3063\u3066\u306e\u6c17\u3065\u304f\u3068\u3053\u308d\u304b\u3089\u3084\u3063\u3068\u8aad\u89e3\n# K\u30925000\u5146\u56de\u3084\u3063\u305f\u3042\u3068\u306f\u3059\u3079\u3066\u306e\u8981\u7d20\u304cN\u306b\u306a\u3063\u3068\u308b \u3053\u306e\u53ce\u675f\u306f\u308f\u308a\u3068\u65e9\u3044\u3089\u3057\u3044\nn, k = map(int, input().split())\na = list(map(int, input().split()))\n\nfor _ in range(k):\n b = [0] * (n + 1)\n for i in range(n):\n b[max(0, i - a[i])] += 1\n b[min(n, i + a[i] + 1)] -= 1\n for i in range(n):\n b[i + 1] += b[i]\n a = b[:n]\n if b[-1] == n:\n break\nprint(\" \".join(list(map(str, a))))\n","fail":"# \u554f\u984c\u6587\u306e\u610f\u5473\u304c\u308f\u304b\u3089\u3093\u30b3\u30f3\u30c6\u30b9\u30c8\n# 0\u306e\u5834\u5408\u3082\u81ea\u5206\u81ea\u8eab\u3092\u7167\u3089\u3059\u3001\u3063\u3066\u306e\u6c17\u3065\u304f\u3068\u3053\u308d\u304b\u3089\u3084\u3063\u3068\u8aad\u89e3\n# K\b\u30925000\u5146\u56de\u3084\u3063\u305f\u3042\u3068\u306f\u3059\u3079\u3066\u306e\u8981\u7d20\u304cN\u306b\u306a\u3063\u3068\u308b \u3053\u306e\u53ce\u675f\u306f\u308f\u308a\u3068\u65e9\u3044\u3089\u3057\u3044\nn, k = map(int, input().split())\na = list(map(int, input().split()))\n\nfor _ in range(min(k, 100)):\n b = [0] * (n + 1)\n for i in range(n):\n b[max(0, i - a[i])] += 1\n b[min(n, i + a[i] + 1)] -= 1\n for i in range(n):\n b[i + 1] += b[i]\n a = b[:n]\nprint(\" \".join(list(map(str, a))))\n","change":"replace","i1":2,"i2":16,"j1":2,"j2":14,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02647","language":"Python","original_status":"Time Limit Exceeded","pass":"n, k = map(int, input().split())\nA = list(map(int, input().split()))\n\n\ndef query(lamps):\n start_list = []\n end_list = []\n for idx, power in enumerate(lamps):\n start, end = idx - power, idx + power\n start_list.append(start)\n end_list.append(end)\n\n counts = [0] * n\n start_list.sort(reverse=True)\n end_list.sort(reverse=True)\n\n now = 0\n for idx in range(n):\n while start_list and start_list[-1] <= idx:\n start_list.pop()\n now += 1\n\n while end_list and end_list[-1] < idx:\n end_list.pop()\n now -= 1\n\n counts[idx] = now\n\n return counts\n\n\ndef full_check(counts, full):\n for count in counts:\n if count == full:\n continue\n else:\n return False\n\n return True\n\n\nfor _ in range(k):\n A = query(A)\n if full_check(A, n):\n break\n\nprint(*A)\n","fail":"n, k = map(int, input().split())\nA = list(map(int, input().split()))\n\n\ndef query(lamps):\n start_list = []\n end_list = []\n for idx, power in enumerate(lamps):\n start, end = idx - power, idx + power\n start_list.append(start)\n end_list.append(end)\n\n start_list.sort(reverse=True)\n end_list.sort(reverse=True)\n\n now = 0\n for idx in range(n):\n while start_list and start_list[-1] <= idx:\n start_list.pop()\n now += 1\n\n while end_list and end_list[-1] < idx:\n end_list.pop()\n now -= 1\n\n lamps[idx] = now\n\n\ndef full_check(counts, full):\n for count in counts:\n if count == full:\n continue\n else:\n return False\n\n return True\n\n\nfor _ in range(k):\n query(A)\n if full_check(A, n):\n break\n\nprint(*A)\n","change":"replace","i1":12,"i2":43,"j1":12,"j2":40,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02651","language":"Python","original_status":"Runtime Error","pass":"def solve(n, a_list, s):\n\n for i in range(n - 1, -1, -1):\n if s[i] == \"0\":\n r = 2 ** (a_list[i].bit_length() - 1)\n for j in range(i):\n if a_list[j] & r > 0:\n a_list[j] = a_list[i] ^ a_list[j]\n else:\n if a_list[i] > 0:\n return 1\n return 0\n\n\ndef main():\n t = int(input())\n res_list = []\n for _ in range(t):\n n = int(input())\n a_list = list(map(int, input().split()))\n s = input()\n res = solve(n, a_list, s)\n res_list.append(res)\n for res in res_list:\n print(res)\n\n\ndef test():\n assert solve(2, [1, 2], \"10\") == 1\n assert solve(2, [1, 1], \"10\") == 0\n assert solve(6, [2, 3, 4, 5, 6, 7], \"111000\") == 0\n\n\nif __name__ == \"__main__\":\n test()\n main()\n","fail":"def solve(n, a_list, s):\n\n for i in range(n - 1, -1, -1):\n if s[i] == \"0\":\n if a_list[i] == 0:\n continue\n r = 2 ** (a_list[i].bit_length() - 1)\n for j in range(i):\n if a_list[j] & r > 0:\n a_list[j] = a_list[i] ^ a_list[j]\n else:\n if a_list[i] > 0:\n return 1\n return 0\n\n\ndef main():\n t = int(input())\n res_list = []\n for _ in range(t):\n n = int(input())\n a_list = list(map(int, input().split()))\n s = input()\n res = solve(n, a_list, s)\n res_list.append(res)\n for res in res_list:\n print(res)\n\n\ndef test():\n assert solve(2, [1, 2], \"10\") == 1\n assert solve(2, [1, 1], \"10\") == 0\n assert solve(6, [2, 3, 4, 5, 6, 7], \"111000\") == 0\n\n\nif __name__ == \"__main__\":\n test()\n main()\n","change":"insert","i1":4,"i2":4,"j1":4,"j2":6,"error":"0","stderr":null,"stdout":"1\n0\n0\n"} {"problem_id":"p02657","language":"Python","original_status":"Runtime Error","pass":"a, b = int(input().split())\nprint(a * b)\n","fail":"a, b = map(int, input().split())\nprint(a * b)\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"TypeError: int() argument must be a string, a bytes-like object or a real number, not 'list'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02657\/Python\/s298903403.py\", line 1, in \n a, b = int(input().split())\nTypeError: int() argument must be a string, a bytes-like object or a real number, not 'list'\n","stdout":null} {"problem_id":"p02657","language":"Python","original_status":"Runtime Error","pass":"a, b = [*map(input().split(\" \"), int)]\nprint(a * b)\n","fail":"a, b = [*map(int, input().split(\" \"))]\nprint(a * b)\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"TypeError: 'type' object is not iterable","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02657\/Python\/s795495503.py\", line 1, in \n a, b = [*map(input().split(\" \"), int)]\nTypeError: 'type' object is not iterable\n","stdout":null} {"problem_id":"p02657","language":"Python","original_status":"Runtime Error","pass":"val1 = input()\nval2 = input()\n\nprint(int(val1) * int(val2))\n","fail":"val1, val2 = (int(x) for x in input().split())\n\nprint(int(val1) * int(val2))\n","change":"replace","i1":0,"i2":2,"j1":0,"j2":1,"error":"EOFError: EOF when reading a line","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02657\/Python\/s139420322.py\", line 2, in \n val2 = input()\nEOFError: EOF when reading a line\n","stdout":null} {"problem_id":"p02657","language":"Python","original_status":"Runtime Error","pass":"x, y = input().split()\nprint(x * y)\n","fail":"x, y = map(int, input().split())\nprint(x * y)\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"TypeError: can't multiply sequence by non-int of type 'str'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02657\/Python\/s474601082.py\", line 2, in \n print(x * y)\nTypeError: can't multiply sequence by non-int of type 'str'\n","stdout":null} {"problem_id":"p02657","language":"Python","original_status":"Runtime Error","pass":"a = input()\nb = input()\n\nA = int(a)\nB = int(b)\n\nval = A * B\n\nprint(val)\n","fail":"nums = input().split()\n\nA = int(nums[0])\nB = int(nums[1])\n\nval = A * B\n\nprint(val)\n","change":"replace","i1":0,"i2":5,"j1":0,"j2":4,"error":"EOFError: EOF when reading a line","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02657\/Python\/s123530671.py\", line 2, in \n b = input()\nEOFError: EOF when reading a line\n","stdout":null} {"problem_id":"p02657","language":"Python","original_status":"Runtime Error","pass":"a, t = map(int, input().split())\nprint(a * t)\na, t = map(int, input().split())\nprint(a * t)\n","fail":"a, t = map(int, input().split())\nprint(a * t)\n","change":"delete","i1":2,"i2":4,"j1":2,"j2":2,"error":"EOFError: EOF when reading a line","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02657\/Python\/s987059931.py\", line 3, in \n a, t = map(int, input().split())\nEOFError: EOF when reading a line\n","stdout":10.0} {"problem_id":"p02657","language":"Python","original_status":"Runtime Error","pass":"a, b = map(int, input().ssplit())\nprint(a * b)\n","fail":"a, b = map(int, input().split())\nprint(a * b)\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"AttributeError: 'str' object has no attribute 'ssplit'. Did you mean: 'rsplit'?","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02657\/Python\/s218726646.py\", line 1, in \n a, b = map(int, input().ssplit())\nAttributeError: 'str' object has no attribute 'ssplit'. Did you mean: 'rsplit'?\n","stdout":null} {"problem_id":"p02657","language":"Python","original_status":"Runtime Error","pass":"A = int(input())\nB = int(input())\n\nprint(A * B)\n","fail":"a, b = map(int, input().split())\n\nprint(a * b)\n","change":"replace","i1":0,"i2":4,"j1":0,"j2":3,"error":"ValueError: invalid literal for int() with base 10: '2 5'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02657\/Python\/s768625073.py\", line 1, in \n A = int(input())\nValueError: invalid literal for int() with base 10: '2 5'\n","stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = list(map(int, input().split()))\nm = 1\nif 0 in a:\n m = 0\nelse:\n for i in a:\n m *= i\n if m > 10**18:\n m = -1\nprint(m)\n","fail":"n = int(input())\na = list(map(int, input().split()))\nm = 1\nif 0 in a:\n m = 0\nelse:\n for i in a:\n m *= i\n if m > 10**18:\n m = -1\n break\nprint(m)\n","change":"insert","i1":10,"i2":10,"j1":10,"j2":11,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\nA = list(map(int, input().split()))\nans = 1\n\nfor i in A:\n ans *= i\nif ans > 10**18:\n print(-1)\nelse:\n print(ans)\n","fail":"n = int(input())\nA = list(map(int, input().split()))\nans = 1\n\nif 0 in A:\n ans = 0\nelse:\n for i in A:\n ans *= i\n if ans > 10**18:\n ans = -1\n break\n\nprint(ans)\n","change":"replace","i1":4,"i2":10,"j1":4,"j2":14,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = list(map(int, input().split()))\n\nans = 1\n\nfor a in A:\n ans *= a\n if a == 0:\n print(0)\n break\n\nelse:\n if ans > 1000000000000000000:\n print(-1)\n else:\n print(ans)\n","fail":"N = int(input())\nA = list(map(int, input().split()))\n\nans = 1\n\nif 0 in A:\n print(0)\nelse:\n for a in A:\n ans *= a\n if ans > 1000000000000000000:\n print(-1)\n break\n else:\n print(ans)\n","change":"replace","i1":5,"i2":14,"j1":5,"j2":13,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Runtime Error","pass":"import sys\n\nN = int(input().rstrip())\n\nlimit = pow(10, 18)\n\nnums = []\n\nnums = input().rsplit()\n\n# for i in range(0, N - 1):\n# a = input()\n# if a == 0:\n# print(0)\n# sys.exit(1)\n# nums.append(a)\n\naccum = 1\nfor num in nums:\n num = int(num)\n try:\n accum *= num\n except OverflowError:\n print(-1)\n sys.exit(1)\n\n if accum > limit:\n print(-1)\n sys.exit(1)\n\nprint(accum)\n","fail":"import sys\n\nN = int(input().rstrip())\n\nlimit = pow(10, 18)\n\nnums = list(input().split())\n\nfor num in nums:\n num = int(num)\n if num == 0:\n print(0)\n sys.exit(0)\n\naccum = 1\nfor num in nums:\n num = int(num)\n try:\n accum *= num\n except Exception:\n accum = -1\n break\n\n if accum > limit:\n accum = -1\n break\n\nprint(accum)\n","change":"replace","i1":6,"i2":29,"j1":6,"j2":26,"error":"0","stderr":null,"stdout":"1000000000000000000\n"} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"import operator\nfrom functools import reduce\n\n\nn = int(input())\na = list(map(int, input().split()))\nans = reduce(operator.mul, a)\nprint(-1 if ans > 10**18 else ans)\n","fail":"def main():\n N = int(input())\n A = list(map(int, input().split()))\n if 0 in A:\n print(0)\n return\n prod = 1\n for a in A:\n prod *= a\n if prod > 1000000000000000000:\n print(-1)\n return\n print(prod)\n\n\nmain()\n","change":"replace","i1":0,"i2":8,"j1":0,"j2":16,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = list(map(int, input().split()))\n\nres = 1\nfor a in A:\n res *= a\n\nif 1e18 < res:\n print(-1)\nelse:\n print(res)\n","fail":"import sys\n\nN = int(input())\nA = list(map(int, input().split()))\n\nif 0 in A:\n print(0)\n sys.exit()\n\nres = 1\nfor a in A:\n res *= a\n if 1e18 < res:\n print(-1)\n sys.exit()\n\nprint(res)\n","change":"replace","i1":0,"i2":11,"j1":0,"j2":17,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nanser = 1\nfor a in input().split(\" \"):\n anser = anser * int(a)\n\nif anser > 1000000000000000000:\n print(-1)\nelse:\n print(anser)\n","fail":"def main():\n N = int(input())\n A = list(map(int, input().split()))\n\n if 0 in A:\n print(0)\n return\n\n anser = 1\n for a in A:\n anser *= a\n if anser > 1000000000000000000:\n print(-1)\n return\n\n print(anser)\n\n\nmain()\n","change":"replace","i1":0,"i2":9,"j1":0,"j2":19,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = list(map(int, input().split()))\nans = 1\nfor i in a:\n ans *= i\nprint(ans if not ans > 10**18 else -1)\n","fail":"n = int(input())\na = list(map(int, input().split()))\nif 0 in a:\n print(0)\nelse:\n ans = 1\n for i in a:\n ans *= i\n if ans > 10**18:\n ans = -1\n break\n print(ans)\n","change":"replace","i1":2,"i2":6,"j1":2,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = map(int, input().split())\nans = 1\nfor x in a:\n ans *= x\n\nif ans > 10**18:\n print(-1)\nelse:\n print(ans)\n","fail":"import sys\n\ninput = sys.stdin.readline\n\n\ndef main():\n n = int(input())\n a = sorted(map(int, input().split()))\n ans = 1\n for x in a:\n ans *= x\n if ans > 10**18:\n print(-1)\n exit()\n print(ans)\n\n\nmain()\n","change":"replace","i1":0,"i2":10,"j1":0,"j2":18,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = list(map(int, input().split()))\nt = A[0]\ni = 1\nwhile i < N:\n t *= A[i]\n i += 1\nif t <= 1e18:\n print(t)\nelse:\n print(-1)\n","fail":"# import numpy as np\nN = int(input())\nA = list(map(int, input().split()))\n# A = np.array(A)\nt = A[0]\nfor i in range(1, N):\n t *= A[i]\n if int(t) > 1e18:\n for j in range(i, N):\n if A[j] == 0:\n t = 0\n break\nif int(t) <= 1e18:\n print(int(t))\nelse:\n print(-1)\n","change":"replace","i1":0,"i2":9,"j1":0,"j2":14,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"# -*- coding: utf-8 -*-\n# \u6574\u6570\u306e\u5165\u529b\n# a = int(input())\n# \u30b9\u30da\u30fc\u30b9\u533a\u5207\u308a\u306e\u6574\u6570\u306e\u5165\u529b\n# b, c = map(int, input().split())\n# \u6587\u5b57\u5217\u306e\u5165\u529b\n# s = input()\n# \u51fa\u529b\n# print(\"{} {}\".format(a+b+c, s))\n\nN = int(input())\nA = list(map(int, input().split()))\nanswer = 1\nfor i in range(N):\n answer *= A[i]\n\nif answer > 1000000000000000000:\n print(-1)\nelse:\n print(answer)\n","fail":"# -*- coding: utf-8 -*-\n# \u6574\u6570\u306e\u5165\u529b\n# a = int(input())\n# \u30b9\u30da\u30fc\u30b9\u533a\u5207\u308a\u306e\u6574\u6570\u306e\u5165\u529b\n# b, c = map(int, input().split())\n# \u6587\u5b57\u5217\u306e\u5165\u529b\n# s = input()\n# \u51fa\u529b\n# print(\"{} {}\".format(a+b+c, s))\nimport sys\n\nN = int(input())\nA = list(map(int, input().split()))\nfor i in range(N):\n if A[i] == 0:\n print(0)\n sys.exit(0)\nanswer = 1\nfor i in range(N):\n answer *= A[i]\n if answer > 1000000000000000000:\n print(-1)\n sys.exit(0)\n\nprint(answer)\n","change":"replace","i1":9,"i2":20,"j1":9,"j2":25,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = list(map(int, input().split()))\n\nans = 1\nfor a in A:\n ans *= a\nif ans > 10**18:\n ans = -1\nprint(ans)\n","fail":"N = int(input())\nA = list(map(int, input().split()))\n\nif A.count(0):\n print(0)\n import sys\n\n sys.exit()\n\nans = 1\nfor a in A:\n ans *= a\n if ans > 10**18:\n print(-1)\n import sys\n\n sys.exit()\n\nprint(ans)\n","change":"replace","i1":2,"i2":8,"j1":2,"j2":18,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = list(map(int, input().split()))\n\nans = 1\n\nfor i in range(n):\n ans *= a[i]\n\nif ans > 10**18:\n print(-1)\nelse:\n print(ans)\n","fail":"import sys\n\n\nn = int(input())\na = list(map(int, input().split()))\n\nans = 1\n\nfor i in a:\n if i == 0:\n print(0)\n sys.exit(0)\n\nfor i in range(n):\n ans *= a[i]\n if ans > 10**18:\n print(-1)\n sys.exit(0)\n\nif ans > 10**18:\n print(-1)\nelse:\n print(ans)\n","change":"replace","i1":0,"i2":7,"j1":0,"j2":18,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\nli = list(map(int, input().split()))\nx = 1\nif 0 in li:\n print(0)\nelse:\n for i in li:\n x = x * i\n if x > 10**18:\n print(-1)\n else:\n print(x)\n","fail":"n = int(input())\nli = list(map(int, input().split()))\nx = 1\nif 0 in li:\n print(0)\nelse:\n for i in li:\n x = x * i\n if x > 10**18:\n print(-1)\n exit()\n print(x)\n","change":"replace","i1":8,"i2":12,"j1":8,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\nre = 1\n\nli = list(map(int, input().split()))\n\nfor i in range(n):\n re = re * li[i]\nif re > 1000000000000000000:\n print(-1)\nelse:\n print(re)\n","fail":"n = int(input())\nre = 1\n\nli = list(map(int, input().split()))\n\nfor i in range(n):\n if re > 1000000000000000000:\n break\n re = re * li[i]\nif 0 in li:\n print(0)\nelif re > 1000000000000000000:\n print(-1)\nelse:\n print(re)\n","change":"replace","i1":6,"i2":8,"j1":6,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\naa = list(map(int, input().split()))\n\nif 0 in aa:\n print(\"0\")\nelse:\n result = 1\n for a in aa:\n result *= a\n\n if result > pow(10, 18):\n result = -1\n\n print(result)\n","fail":"n = int(input())\naa = list(map(int, input().split()))\n\nif 0 in aa:\n print(\"0\")\n exit(0)\n\nresult = 1\nfor a in aa:\n result *= a\n if result > pow(10, 18):\n print(\"-1\")\n exit(0)\n\nprint(result)\n","change":"replace","i1":5,"i2":14,"j1":5,"j2":15,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = [int(a) for a in input().split()]\nans = A[0]\n\nif 0 in A:\n print(0)\n exit()\n\nfor i in range(1, len(A)):\n ans *= A[i]\n if A[i] > 10**18:\n print(-1)\n exit()\n\nif ans > 10**18:\n print(-1)\nelse:\n print(ans)\n","fail":"import numpy as np\n\nN = int(input())\nA = [int(a) for a in input().split()]\nans = A[0]\n\nif 0 in A:\n print(0)\n exit()\n\nfor i in range(1, len(A)):\n if A[i] != 1:\n ans *= A[i]\n if ans > 10**18:\n print(-1)\n exit()\n\nprint(ans)\n","change":"replace","i1":0,"i2":18,"j1":0,"j2":18,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\n# = map(int, input().split())\nA = list(map(int, input().split()))\n# = [int(input()) for i in range(N)]\n# = [list(map(int, input().split())) for i in range(N)]\nanswer = A[0]\n\nfor i in range(1, N):\n answer *= A[i]\n\nif answer > 10**18:\n print(-1)\nelse:\n print(answer)\n","fail":"N = int(input())\n# = map(int, input().split())\nA = list(map(int, input().split()))\n# = [int(input()) for i in range(N)]\n# = [list(map(int, input().split())) for i in range(N)]\nanswer = A[0]\n\nif A.count(0) > 0:\n print(0)\n exit()\n\nfor i in range(1, N):\n answer = answer * A[i]\n if answer > 10**18:\n print(-1)\n exit()\nelse:\n print(answer)\n","change":"replace","i1":7,"i2":12,"j1":7,"j2":16,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = list(map(int, input().split()))\nans = 1\nfor i in a:\n ans *= i\n\nif ans > 1000000000000000000:\n print(-1)\nelse:\n print(ans)\n","fail":"import sys\n\nn = int(input())\na = list(map(int, input().split()))\nans = 1\nflag = True\nif 0 in a:\n print(0)\n sys.exit()\n\nfor i in a:\n ans *= i\n if ans > 1000000000000000000:\n flag = False\n break\n\nif flag == False:\n print(-1)\nelse:\n print(ans)\n","change":"replace","i1":0,"i2":7,"j1":0,"j2":17,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"num = int(input())\n\nk = input().split()\n\nmul = 1\n\nfor i in range(num):\n mul *= int(k[i])\n\nif mul > 10**18:\n print(-1)\n\nelse:\n print(mul)\n","fail":"num = int(input())\n\nk = input().split()\n\nfor i in range(len(k)):\n k[i] = int(k[i])\n\nk.sort()\n\nmul = 1\n\nfor i in range(num):\n mul *= int(k[i])\n if mul > 10**18:\n break\n\nif mul > 10**18:\n print(-1)\n\nelse:\n print(mul)\n","change":"replace","i1":3,"i2":8,"j1":3,"j2":15,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Runtime Error","pass":"n = int(input())\nmod = 10**18\nli = list(map(int, input().split())).sort()\nans = 1\nfor i in range(n):\n ans = ans * li[i]\n if ans > mod:\n ans = -1\n break\nprint(ans)\n","fail":"n = int(input())\nmod = 10**18\nli = list(map(int, input().split()))\nli.sort()\nans = 1\nfor i in range(n):\n ans *= li[i]\n if ans > mod:\n ans = -1\n break\nprint(ans)\n","change":"replace","i1":2,"i2":6,"j1":2,"j2":7,"error":"TypeError: 'NoneType' object is not subscriptable","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02658\/Python\/s150876238.py\", line 6, in \n ans = ans * li[i]\nTypeError: 'NoneType' object is not subscriptable\n","stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Runtime Error","pass":"N = int(input())\nA = list(map(int, input().split()))\nresult = 1\nflag = 0\nfor a in A:\n if a == 0:\n zero_flag = 1\n result = 0\n break\n else:\n result = result * a\n if result > pow(10, 18):\n flag = 1\n result = 0\nif flag == 1 and zero_flag != 1:\n print(-1)\nelse:\n print(result)\n","fail":"N = int(input())\nA = list(map(int, input().split()))\nresult = 1\nflag = 0\nzero_flag = 0\nfor a in A:\n if a == 0:\n zero_flag = 1\n result = 0\n break\n else:\n result = result * a\n if result > pow(10, 18):\n flag = 1\n result = 0\nif flag == 1 and zero_flag != 1:\n print(-1)\nelse:\n print(result)\n","change":"insert","i1":4,"i2":4,"j1":4,"j2":5,"error":"0","stderr":null,"stdout":"1000000000000000000\n"} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"def main():\n ans = 1\n for a in A:\n ans *= a\n if ans > L:\n print(-1)\n else:\n print(ans)\n\n\nif __name__ == \"__main__\":\n N = int(input())\n A = [int(a) for a in input().split()]\n L = 10**18\n main()\n","fail":"def main():\n if A.count(0) >= 1:\n print(0)\n return\n ans = 1\n for a in A:\n ans *= a\n if ans > L:\n print(-1)\n return\n print(ans)\n\n\nif __name__ == \"__main__\":\n N = int(input())\n A = [int(a) for a in input().split()]\n L = 10**18\n main()\n","change":"replace","i1":1,"i2":8,"j1":1,"j2":11,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nan = list(map(int, input().split()))\nans = 1\nfor a in an:\n if 0 in an:\n ans = 0\n break\n ans *= a\n if ans > 10**18:\n ans = -1\n break\nprint(ans)\n","fail":"N = int(input())\nan = list(map(int, input().split()))\nans = 1\nif 0 in an:\n ans = 0\nelse:\n for a in an:\n ans *= a\n if ans > 10**18:\n ans = -1\n break\nprint(ans)\n","change":"replace","i1":3,"i2":11,"j1":3,"j2":11,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = map(int, input().split())\n\nans = 1\n\nfor a in A:\n ans *= a\nif ans > pow(10, 18):\n ans = -1\nprint(ans)\n","fail":"N = int(input())\nA = list(map(int, input().split()))\n\nans = 1\n\nif 0 in A:\n ans = 0\nelse:\n for a in A:\n ans *= a\n if ans > pow(10, 18):\n ans = -1\n break\nprint(ans)\n","change":"replace","i1":1,"i2":9,"j1":1,"j2":13,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\nret = 1\na = list(map(int, input().split()))\nfor ai in a:\n ret *= ai\nif ret > 1000000000000000000:\n print(-1)\nelse:\n print(ret)\n","fail":"n = int(input())\nret = 1\na = sorted(list(map(int, input().split())))\nfor ai in a:\n ret *= ai\n if ret > 1000000000000000000:\n print(-1)\n exit(0)\nprint(ret)\n","change":"replace","i1":2,"i2":9,"j1":2,"j2":9,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"from functools import reduce\nfrom operator import mul\n\nn = int(input())\na_li = list(map(int, input().split()))\n\nif 0 in a_li:\n print(0)\n exit()\n\na_li = [a for a in a_li if a != 1 and a != 0]\na_li.append(1)\nans = reduce(mul, a_li)\n\nif ans > 1000000000000000000:\n print(-1)\n exit()\nelse:\n print(ans)\n","fail":"n = int(input())\na_li = list(map(int, input().split()))\n\nif 0 in a_li:\n print(0)\n exit()\n\nans = 1\na_li = [a for a in a_li if a != 1 and a != 0]\na_li.append(1)\nfor a in a_li:\n ans *= a\n if ans > 1000000000000000000:\n print(-1)\n exit()\nprint(ans)\n","change":"replace","i1":0,"i2":19,"j1":0,"j2":16,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = list(map(int, input().split()))\n\nsum = 1\nfor i in A:\n sum *= i\n\nans = -1\n\nif sum <= 10**18:\n ans = sum\n\nprint(ans)\n","fail":"N = int(input())\nA = list(map(int, input().split()))\n\nA.sort()\n\nsum = 1\nfor i in A:\n sum *= i\n if sum > 10**18:\n sum = -1\n break\n\nans = sum\n\nprint(ans)\n","change":"replace","i1":2,"i2":11,"j1":2,"j2":13,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = list(map(int, input().split()))\n\nmul = 1\nfor i in range(N):\n mul *= A[i]\n\nif mul > 10**18:\n print(\"-1\")\n\nelse:\n print(mul)\n","fail":"N = int(input())\nA = list(map(int, input().split()))\n\n# print(A)\n\nA.sort()\n# print(A)\n\nmul = 1\nfor i in range(N):\n if mul == 0:\n break\n elif mul > 10**18:\n mul = -1\n break\n else:\n mul *= A[i]\n\nif mul > 10**18:\n print(\"-1\")\nelse:\n print(mul)\n","change":"replace","i1":3,"i2":10,"j1":3,"j2":20,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\nA = list(map(int, input().split()))\nans = 1\nflag = 0\nzeroflag = 0\nfor a in A:\n ans *= a\n if ans > pow(10, 18):\n flag = 1\n if a == 0:\n zeroflag = 1\nif flag:\n ans = -1\nif zeroflag:\n ans = 0\nprint(ans if ans <= pow(10, 18) else -1)\n","fail":"n = int(input())\nA = list(map(int, input().split()))\nans = 1\nflag = 0\nzeroflag = 0\nfor a in A:\n if a == 0:\n print(0)\n exit()\nfor a in A:\n ans *= a\n if ans > pow(10, 18):\n print(-1)\n exit()\nprint(ans)\n","change":"replace","i1":6,"i2":16,"j1":6,"j2":15,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"# -*- coding: utf-8 -*-\nn = int(input())\na = [int(i) for i in input().split()]\n\nans = 1\nfor i in range(n):\n ans *= a[i]\nif ans > pow(10, 18):\n print(-1)\nelse:\n print(ans)\n","fail":"# -*- coding: utf-8 -*-\nn = int(input())\na = [int(i) for i in input().split()]\n\nans = 1\na.sort()\nfor i in range(n):\n ans *= a[i]\n # print(ans)\n if ans > pow(10, 18):\n print(-1)\n exit()\nprint(ans)\n","change":"replace","i1":5,"i2":11,"j1":5,"j2":13,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = list(map(int, input().split()))\n\nif 0 in a:\n print(0)\n exit()\n\nans = 1\nfor num in a:\n ans = ans * num\n\nif ans > 10**18:\n print(-1)\nelse:\n print(ans)\n","fail":"import collections\nimport sys\n\n\ndef pow2(x, n):\n ret = 1\n while n > 0:\n if n & 1:\n ret *= x\n x *= x\n n = n >> 1\n return ret\n\n\nn = int(input())\na = list(map(int, input().split()))\n\nif 0 in a:\n print(0)\n sys.exit(0)\n\nc = collections.Counter(a)\n\nl = sorted(list(c.keys()))\n\nans = 1\nfor num in l:\n ans *= pow2(num, c[num])\n if ans > 1000000000000000000:\n print(-1)\n sys.exit(0)\nprint(ans)\n","change":"replace","i1":0,"i2":15,"j1":0,"j2":32,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"t = int(input())\narr = [int(x) for x in input().split()]\nn = 1\nflag = True\nfor i in range(t):\n n *= arr[i]\n if n > 10**18:\n flag = False\n else:\n flag = True\nif flag:\n print(n)\nelse:\n print(-1)\n","fail":"t = int(input())\narr = [int(x) for x in input().split()]\nn = 1\nflag = True\nif 0 in arr:\n print(0)\nelse:\n for i in range(t):\n n *= arr[i]\n if n > 10**18:\n flag = False\n break\n if flag:\n print(n)\n else:\n print(-1)\n","change":"replace","i1":4,"i2":14,"j1":4,"j2":16,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\n\nans = 1\n\nfor e in map(int, input().split()):\n ans *= e\n\nif ans > 10**18:\n print(-1)\nelse:\n print(ans)\n","fail":"n = int(input())\n\na = [*map(int, input().split())]\nfor e in a:\n if e == 0:\n print(0)\n exit(0)\n\nans = 1\nfor e in a:\n ans *= e\n if ans > 10**18:\n print(-1)\n exit(0)\n\nprint(ans)\n","change":"replace","i1":2,"i2":11,"j1":2,"j2":16,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"import sys\n\nN = int(input())\nA = map(int, input().split())\n\nans = 1\n\n\nfor a in A:\n if a == 0:\n print(0)\n sys.exit()\n ans *= a\n\nif 10**18 < ans:\n print(-1)\nelse:\n print(ans)\n","fail":"import sys\n\nN = int(input())\nA = list(map(int, input().split()))\n\nans = 1\n\nfor a in A:\n if a == 0:\n print(0)\n sys.exit()\n\nfor a in sorted(A, reverse=True):\n ans *= a\n if 10**18 < ans:\n print(-1)\n sys.exit()\n\n\nprint(ans)\n","change":"replace","i1":3,"i2":18,"j1":3,"j2":20,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = input().split()\ni = 0\nS = 1\nfor i in range(N):\n S *= int(A[i])\nif S > 10**18:\n print(-1)\nelse:\n print(S)\n","fail":"N = int(input())\nA = input().split()\nS = 1\nif \"0\" in A:\n print(0)\nelse:\n for i in range(N):\n S *= int(A[i])\n if S > 10**18:\n break\n if S > 10**18:\n print(-1)\n else:\n print(S)\n","change":"replace","i1":2,"i2":10,"j1":2,"j2":14,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = list(map(int, input().split()))\n\nans = 1\nflag = 0\nfor i in range(n):\n ans *= a[i]\n if ans > 10**18:\n flag = 1\n\nif flag == 1 and ans != 0:\n ans = -1\n\nprint(ans)\n","fail":"n = int(input())\na = list(map(int, input().split()))\n\nans = 1\nflag = 0\nfor i in range(n):\n ans *= a[i]\n if ans > 10**18:\n flag = 1\n break\n\nif flag == 1 and (0 not in a):\n ans = -1\nif 0 in a:\n ans = 0\n\nprint(ans)\n","change":"replace","i1":9,"i2":12,"j1":9,"j2":15,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = list(map(int, input().split()))\n\nans = 1\nfor i in a:\n ans *= i\n\nif ans > 10**18:\n print(-1)\nelse:\n print(ans)\n","fail":"n = int(input())\na = list(map(int, input().split()))\n\nif 0 in a:\n print(0)\n exit(0)\n\nans = 1\nfor i in a:\n ans *= i\n if ans > 10**18:\n print(-1)\n exit(0)\n\nprint(ans)\n","change":"replace","i1":2,"i2":11,"j1":2,"j2":15,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = list(map(int, input().split()))\nans = 1\nfor i in range(N):\n ans *= A[i]\nif ans > 10**18:\n ans = -1\nprint(ans)\n","fail":"N = int(input())\nA = list(map(int, input().split()))\nans = 1\nA.sort()\nif A[0] == 0:\n print(0)\nelse:\n for i in range(N):\n ans *= A[i]\n if ans > 10**18:\n print(-1)\n exit(0)\n print(ans)\n","change":"replace","i1":3,"i2":8,"j1":3,"j2":13,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = list(map(int, input().split()))\nans = 1\nfor i in range(n):\n ans *= a[i]\nif ans > 10**18:\n print(-1)\nelse:\n print(ans)\n","fail":"n = int(input())\na = list(map(int, input().split()))\nans = 1\nif 0 in a:\n print(0)\n exit()\nfor i in range(n):\n ans *= a[i]\n if ans > 10**18:\n print(-1)\n exit()\nprint(ans)\n","change":"replace","i1":3,"i2":9,"j1":3,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = list(map(int, input().split()))\n\nans = 1\n\nfor x in range(n):\n if 0 in a:\n ans = 0\n break\n\n ans *= a[x]\n\n if ans > 10**18:\n ans = -1\n break\n\n\nprint(ans)\n","fail":"n = int(input())\na = list(map(int, input().split()))\n\nans = 1\n\na.sort(reverse=True)\n\nif 0 not in a:\n for x in range(n):\n ans *= a[x]\n\n if ans > 10**18:\n ans = -1\n break\nelse:\n ans = 0\n\nprint(ans)\n","change":"replace","i1":5,"i2":16,"j1":5,"j2":16,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Runtime Error","pass":"N = int(input())\nA = list(map(int, input().split()))\n\nif 0 in A:\n print(0)\nelse:\n ans = 1\n for i in range(A):\n ans += A[i]\n if ans > 10**18:\n print(-1)\n exit()\n print(ans)\n","fail":"N = int(input())\nA = list(map(int, input().split()))\n\nif 0 in A:\n print(0)\nelse:\n ans = 1\n for i in range(N):\n ans *= A[i]\n if ans > 10**18:\n print(-1)\n exit()\n print(ans)\n","change":"replace","i1":7,"i2":9,"j1":7,"j2":9,"error":"TypeError: 'list' object cannot be interpreted as an integer","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02658\/Python\/s912887919.py\", line 8, in \n for i in range(A):\nTypeError: 'list' object cannot be interpreted as an integer\n","stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = list(map(int, input().split()))\n\nans = A[0]\nfor i in range(1, N):\n ans *= A[i]\nif ans > 10**18:\n print(-1)\n exit()\nprint(ans)\n","fail":"N = int(input())\nA = list(map(int, input().split()))\n\nif 0 in A:\n print(0)\n exit()\n\nans = A[0]\nfor i in range(1, N):\n ans *= A[i]\n if ans > 10**18:\n print(-1)\n exit()\nprint(ans)\n","change":"replace","i1":2,"i2":9,"j1":2,"j2":13,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = list(map(int, input().split()))\n\nans = 1\nfor a in A:\n ans *= a\n\nif ans > 10**18:\n print(-1)\nelse:\n print(ans)\n","fail":"import sys\nimport numpy as np\n\nN = int(input())\nA = list(map(int, input().split()))\n\nif len(np.where(np.array(A) == 0)[0]) != 0:\n print(0)\n sys.exit(0)\n\nans = 1\nfor a in A:\n ans *= a\n if ans > 10**18:\n print(-1)\n sys.exit(0)\n\nprint(ans)\n","change":"replace","i1":0,"i2":11,"j1":0,"j2":18,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\n\nans = 1\nflag = True\na = list(map(int, input().split()))\nfor i in a:\n ans *= i\n if ans > 1000000000000000000:\n flag = False\n\nif ans == 0:\n flag = True\n\nif flag:\n print(ans)\nelse:\n print(-1)\n","fail":"n = int(input())\n\nans = 1\nflag = True\na = list(map(int, input().split()))\n\na.sort()\n\nif a[0] == 0:\n print(0)\n exit(0)\n\nfor i in a:\n ans *= i\n if ans > 10**18:\n print(-1)\n exit(0)\n\nprint(ans)\n","change":"replace","i1":5,"i2":17,"j1":5,"j2":19,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = [int(x) for x in input().split()]\nans = 1\nfor x in A:\n ans *= x\nif ans > 10**18:\n print(-1)\nelse:\n print(ans)\n","fail":"N = int(input())\nA = [int(x) for x in input().split()]\nif 0 in A:\n print(0)\n exit()\nans = 1\nfor x in A:\n ans *= x\n if ans > 10**18:\n print(-1)\n exit()\nprint(ans)\n","change":"replace","i1":2,"i2":9,"j1":2,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"import sys\n\nread = sys.stdin.buffer.read\nreadline = sys.stdin.buffer.readline\n\nn = int(readline())\na = list(map(int, readline().split()))\n\nt = 1\n\nfor i in range(n):\n t = t * a[i]\n\nif t > 10**18:\n print(\"-1\")\nelse:\n print(t)\n","fail":"import sys\n\nread = sys.stdin.buffer.read\nreadline = sys.stdin.buffer.readline\n\nn = int(readline())\na = list(map(int, readline().split()))\n\nt = 1\n\nfor i in range(n):\n if a[i] == 0:\n print(\"0\")\n exit()\n\nfor i in range(n):\n t = t * a[i]\n if t > 10**18:\n print(\"-1\")\n exit()\n\nprint(t)\n","change":"replace","i1":11,"i2":17,"j1":11,"j2":22,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = list(map(int, input().split()))\n\nx = 1\nfor i in a:\n x *= i\n\nans = x\nif ans > 10**18:\n ans = -1\nprint(ans)\n","fail":"n = int(input())\na = list(map(int, input().split()))\na.sort()\n\nx = 1\nfor i in a:\n x *= i\n if x > 10**18:\n break\n\nans = x\nif ans > 10**18:\n ans = -1\nprint(ans)\n","change":"replace","i1":2,"i2":6,"j1":2,"j2":9,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = list(map(int, input().split()))\nans = 1\nfor i in range(n):\n ans *= a[i]\nif ans > 10**18:\n print(-1)\nelse:\n print(ans)\n","fail":"n = int(input())\na = list(map(int, input().split()))\nans = 1\nif a.count(0) > 0:\n print(0)\n exit()\nfor i in range(n):\n ans *= a[i]\n if ans > 10**18:\n print(-1)\n exit()\nprint(ans)\n","change":"replace","i1":3,"i2":9,"j1":3,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = list(map(int, input().split()))\n\nproduct = 1\n\nfor i in range(N):\n product *= A[i]\n\nif product > 1000000000000000000:\n print(-1)\nelse:\n print(product)\n","fail":"N = int(input())\nA = list(map(int, input().split()))\n\nproduct = 1\nflag = 0\n\nif 0 in A:\n print(0)\nelse:\n for i in range(N):\n product *= A[i]\n if product > 1000000000000000000:\n flag += 1\n break\n if flag == 0:\n print(product)\n else:\n print(-1)\n","change":"replace","i1":4,"i2":12,"j1":4,"j2":18,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"from functools import reduce\n\nA = int(input())\nlst = [int(x) for x in input().split()]\nres = reduce(lambda a, b: a * b, lst)\nprint(res if res <= pow(10, 18) else -1)\n","fail":"res = 1\n\nA = int(input())\nN = sorted([int(x) for x in input().split()])\n\nfor x in N:\n res *= x\n if res > pow(10, 18):\n res = -1\n break\n\nprint(res)\n","change":"replace","i1":0,"i2":6,"j1":0,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = list(map(int, input().split()))\n\nans = 1\nfor i in range(N):\n ans *= A[i]\n\nif ans <= 10**18:\n print(ans)\nelse:\n print(-1)\n","fail":"N = int(input())\nA = list(map(int, input().split()))\n\nans = 1\n\nif 0 in A:\n print(0)\n exit()\n\nfor i in range(N):\n ans *= A[i]\n if ans > 10**18:\n print(-1)\n exit()\n\nprint(ans)\n","change":"replace","i1":4,"i2":11,"j1":4,"j2":16,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = map(int, input().split())\n\nans = 1\nfor a in A:\n ans *= a\n\nif ans > 10**18:\n ans = -1\n\nprint(ans)\n","fail":"N = int(input())\nA = list(map(int, input().split()))\n\nans = 1\nif 0 in A:\n ans = 0\nelse:\n for a in A:\n ans *= a\n if ans > 10**18:\n ans = -1\n break\n\nprint(ans)\n","change":"replace","i1":1,"i2":9,"j1":1,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = [int(v) for v in input().split()]\nans = 1\nnum = 1\nlimit = 1000000000000000000\nfor i in a:\n if i == 0:\n num = 0\n break\n if i >= limit:\n num = -1\n break\n else:\n num *= i\nif num > limit:\n num = -1\nans = num\nprint(ans)\n","fail":"n = int(input())\na = [int(v) for v in input().split()]\nlimit = 1000000000000000000\nif 0 in a:\n print(0)\nelse:\n ans = 1\n num = 1\n for i in a:\n num *= i\n if num > limit:\n num = -1\n break\n ans = num\n print(ans)\n","change":"replace","i1":2,"i2":18,"j1":2,"j2":15,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = list(map(int, input().split()))\nanswer = 1\nfor i in range(len(A)):\n answer *= A[i]\n\nif answer <= 1000000000000000000:\n print(answer)\nelse:\n print(-1)\n","fail":"N = int(input())\nA = list(map(int, input().split()))\nanswer = 1\nif 0 in A:\n print(0)\n exit()\n\nfor i in range(len(A)):\n if len(str(answer)) + len(str(A[i])) <= 20:\n answer *= A[i]\n else:\n print(-1)\n exit()\n\nif answer <= 1000000000000000000:\n print(answer)\nelse:\n print(-1)\n","change":"replace","i1":3,"i2":5,"j1":3,"j2":13,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = list(map(int, input().split()))\nans = 1\nfor i in a:\n ans *= i\n\nif ans > 10**18:\n ans = -1\n\nprint(ans)\n","fail":"n = int(input())\na = list(map(int, input().split()))\n\nfor i in a:\n if i == 0:\n print(0)\n exit()\n\nans = 1\nfor i in a:\n ans *= i\n if ans > 10**18:\n ans = -1\n break\n\nprint(ans)\n","change":"replace","i1":2,"i2":8,"j1":2,"j2":14,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\nnum_list = list(map(int, input().split()))\n\nans = 1\n\nfor e in num_list:\n ans *= e\n\nif ans > 1000000000000000000:\n print(\"-1\")\nelse:\n print(ans)\n","fail":"n = int(input())\nnum_list = list(map(int, input().split()))\n\nans = 1\n\nfor e in num_list:\n if e == 0:\n ans = 0\n\nfor e in num_list:\n ans *= e\n if ans > 1000000000000000000:\n ans = -1\n break\n if ans == 0:\n break\n\nprint(ans)\n","change":"replace","i1":6,"i2":12,"j1":6,"j2":18,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = list(map(int, input().split()))\nans = 1\nfor i in range(n):\n ans *= a[i]\nif ans > 1000000000000000000:\n print(-1)\nelse:\n print(ans)\n","fail":"n = int(input())\na = list(map(int, input().split()))\na = sorted(a)\nans = 1\nfor i in range(n):\n ans *= a[i]\n if ans > 1000000000000000000:\n print(-1)\n exit(0)\nprint(ans)\n","change":"replace","i1":2,"i2":9,"j1":2,"j2":10,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"import sys\n\nn = int(input())\n\na = list(map(int, input().split()))\n\nans = 1\n\nfor i in range(n):\n ans *= a[i]\n\n\nif ans > 10**18:\n print(-1)\n sys.exit()\n\nprint(ans)\n","fail":"import sys\n\nn = int(input())\n\na = list(map(int, input().split()))\n\nans = 1\n\nif 0 in a:\n print(0)\n sys.exit()\n\nfor i in a:\n ans *= i\n\n if ans > 10**18:\n print(-1)\n sys.exit()\n\nprint(ans)\n","change":"replace","i1":8,"i2":16,"j1":8,"j2":19,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = list(map(int, input().split()))\nans = 1\nfor i in range(n):\n ans *= a[i]\nif ans > pow(10, 18):\n print(\"-1\")\nelse:\n print(ans)\n","fail":"n = int(input())\na = list(map(int, input().split()))\nans = 1\na.sort()\nif a[0] == 0:\n print(0)\n exit()\n\nfor i in range(n):\n ans *= a[i]\n if ans > pow(10, 18):\n print(-1)\n exit()\nelse:\n print(ans)\n","change":"replace","i1":3,"i2":7,"j1":3,"j2":13,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\nlis = list(map(int, input().split()))\nres = 1\nfor i in lis:\n res *= i\nprint(res if res <= 10**18 else -1)\n","fail":"n = int(input())\nlis = list(map(int, input().split()))\n\nif 0 in lis:\n print(0)\n exit()\n\nres = 1\nfor i in lis:\n if res > 10**18:\n print(-1)\n exit()\n else:\n res *= i\nprint(res if res <= 10**18 else -1)\n","change":"replace","i1":2,"i2":5,"j1":2,"j2":14,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = list(map(int, input().split()))\n\nsum = A[0]\nfor i in range(1, N):\n sum = sum * A[i]\nif sum <= 10**18:\n print(sum)\nelse:\n print(-1)\n","fail":"N = int(input())\nA = list(map(int, input().split()))\n\nt = 10**18\nif 0 in A:\n print(0)\nelse:\n sum = A[0]\n flag = True\n for i in range(1, N):\n sum = sum * A[i]\n if sum > t:\n flag = False\n break\n if flag:\n print(sum)\n else:\n print(-1)\n","change":"replace","i1":3,"i2":10,"j1":3,"j2":18,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = list(map(int, input().split()))\n\nif 0 in A:\n print(0)\n\nelse:\n total = 1\n for i in range(N):\n total *= A[i]\n\n if total > 10**18:\n print(-1)\n else:\n print(total)\n","fail":"N = int(input())\nA = list(map(int, input().split()))\n\nif 0 in A:\n print(0)\n\nelse:\n total = 1\n for i in range(N):\n total *= A[i]\n if total > 10**18:\n total = -1\n break\n print(total)\n","change":"replace","i1":10,"i2":15,"j1":10,"j2":14,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"# coding:utf-8\nn = int(input())\na = list(map(int, input().split()))\nans = 1\n\nfor i in range(n):\n ans = ans * a[i]\n\nif ans > 10**18:\n print(-1)\nelse:\n print(ans)\n","fail":"# coding:utf-8\nn = int(input())\na = list(map(int, input().split()))\nans = 1\n\nif 0 in a:\n print(0)\n exit()\n\nfor i in range(n):\n ans = ans * a[i]\n if ans > 10**18:\n print(-1)\n exit()\n\nprint(ans)\n","change":"replace","i1":5,"i2":12,"j1":5,"j2":16,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\na = [int(x) for x in input().split()]\n\nX = 1\nfor i in range(N):\n X = X * a[i]\n\nif X > 1000000000000000000:\n print(\"-1\")\nelse:\n print(X)\n","fail":"N = int(input())\na = [int(x) for x in input().split()]\n\nX = 1\n\nfor i in range(N):\n if a[i] == 0:\n X = 0\n\nif X == 1:\n for i in range(N):\n X = X * a[i]\n if X > 1000000000000000000:\n X = -1\n break\n\nprint(X)\n","change":"replace","i1":4,"i2":11,"j1":4,"j2":17,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"# import numpy as np\n\nn = int(input())\na = list(map(int, input().split()))\n\nresult = 1\n\nfor i in range(0, n):\n result = result * a[i]\n\n# result = np.prod(a)\n\nif result > pow(10, 18):\n result = -1\n\nprint(result)\n","fail":"n = int(input())\na = list(map(int, input().split()))\na.sort()\nresult = 1\n\nfor i in a:\n result = result * i\n\n # result = np.prod(a)\n\n if result > pow(10, 18):\n result = -1\n break\n\nprint(result)\n","change":"replace","i1":0,"i2":14,"j1":0,"j2":13,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"#!\/usr\/bin\/env python\n# -*- coding: utf-8 -*-\n\n\ndef main():\n N = int(input())\n A = list(map(int, input().split()))\n\n ans = A[0]\n for i in range(1, N):\n ans *= A[i]\n\n print(-1 if ans > 10**18 else ans)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"#!\/usr\/bin\/env python\n# -*- coding: utf-8 -*-\n\n\ndef main():\n N = int(input())\n A = list(map(int, input().split()))\n\n A.sort(reverse=True)\n\n if 0 in A:\n print(0)\n exit()\n\n ans = A[0]\n for i in range(1, N):\n ans *= A[i]\n if ans > 10**18:\n print(-1)\n exit()\n\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":8,"i2":13,"j1":8,"j2":22,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = [int(i) for i in input().split()]\n\nans = 1\nfor i in range(N):\n ans *= A[i]\nif ans > 10**18:\n print(-1)\nelse:\n print(ans)\n","fail":"N = int(input())\nA = sorted([int(i) for i in input().split()])\n\nif A[0] == 0:\n print(0)\n exit()\nelse:\n ans = 1\n for i in range(N):\n ans *= A[i]\n if ans > 10**18:\n print(-1)\n exit()\n print(ans)\n","change":"replace","i1":1,"i2":9,"j1":1,"j2":13,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = list(map(int, input().split()))\n\nr = 1\nfor a in A:\n r *= a\n\nif r > pow(10, 18):\n print(-1)\nelse:\n print(r)\n","fail":"N = int(input())\nA = list(map(int, input().split()))\n\nA.sort(reverse=True)\n\nfor i in range(N - 1, -1, -1):\n if A[i] == 0:\n print(0)\n exit()\n\nr = 1\nupper = pow(10, 18)\nfor i in range(N):\n r *= A[i]\n\n if r > upper:\n print(-1)\n exit()\n\nprint(r)\n","change":"replace","i1":3,"i2":11,"j1":3,"j2":20,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\n\na = list(map(int, input().split()))\n\nres = 1\n\nfor i in range(n):\n res *= a[i]\n\n if a[i] == 0:\n break\n\n\nif res > 10**18:\n print(-1)\nelse:\n print(res)\n","fail":"n = int(input())\n\na = list(map(int, input().split()))\n\nres = 1\n\nif 0 in a:\n print(0)\nelse:\n for i in range(n):\n res *= a[i]\n\n if a[i] == 0:\n break\n if res > 10**18:\n print(-1)\n break\n\n if res > 10**18:\n pass\n else:\n print(res)\n","change":"replace","i1":6,"i2":17,"j1":6,"j2":22,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = list(map(int, input().split()))\n\nans = 1\nfor a in A:\n ans *= a\n\nif ans > 1000000000000000000:\n print(-1)\nelse:\n print(ans)\n","fail":"N = int(input())\nA = list(map(int, input().split()))\n\nans = 1\nfor a in A:\n ans *= a\n if ans > 1000000000000000000:\n break\n\nif 0 in A:\n print(0)\nelif ans > 1000000000000000000:\n print(-1)\nelse:\n print(ans)\n","change":"replace","i1":6,"i2":8,"j1":6,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"n = map(int, input().split())\na = map(int, input().split())\nans = 1\nfor i in a:\n ans *= i\n\nprint(ans if ans <= 10**18 else -1)\n","fail":"n = map(int, input().split())\na = list(map(int, input().split()))\nans = 1\nflag = True if 0 in a else False\n\nif flag:\n print(0)\n exit()\n\nfor i in a:\n ans *= i\n if ans > 10**18:\n print(-1)\n exit()\n\nprint(ans)\n","change":"replace","i1":1,"i2":7,"j1":1,"j2":16,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = list(map(int, input().split()))\n\nans = 1\nfor i in range(n):\n ans *= a[i]\n\nprint(ans if ans <= 1000000000000000000 else -1)\n","fail":"n = int(input())\na = list(map(int, input().split()))\n\nans = 1\n\nif 0 in a:\n print(0)\n exit()\nfor i in range(n):\n ans *= a[i]\n if ans > 1000000000000000000:\n print(-1)\n exit()\n\nprint(ans)\n","change":"replace","i1":4,"i2":8,"j1":4,"j2":15,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"def main():\n n = int(input())\n As = list(map(int, input().split()))\n\n ans = 1\n for i in range(n):\n ans *= As[i]\n if ans == 0:\n break\n\n if ans > 10**18:\n ans = -1\n\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"def main():\n n = int(input())\n As = list(map(int, input().split()))\n\n ans = 1\n if 0 in As:\n print(0)\n exit()\n\n for i in range(n):\n ans *= As[i]\n if ans > 10**18:\n ans = -1\n break\n\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":5,"i2":12,"j1":5,"j2":14,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"_ = input()\ninp = map(int, input().split())\n\nof = False\nre = 1\n\nfor a in inp:\n re *= a\n\n\nif (re - 1) \/\/ (10**18) > 0:\n re = -1\n\nprint(re)\n","fail":"_ = input()\ninp = list(map(int, input().split()))\n\nre = 1\n\n\nfor a in inp:\n re = re * a\n if re > (10**18):\n of = True\n re = -1\n break\n\n\nfor a in inp:\n if a == 0:\n re = 0\n\n\nprint(re)\n","change":"replace","i1":1,"i2":12,"j1":1,"j2":18,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = list(map(int, input().split()))\nn = 1\nfor i in a:\n n *= i\nif n > 10**18:\n n = -1\nprint(n)\n","fail":"def main():\n\n N = int(input())\n A = list(map(int, input().split()))\n if 0 in A:\n print(0)\n return\n ans = 1\n for i in A:\n ans *= i\n if ans > 1000000000000000000:\n print(-1)\n return\n print(ans)\n\n\nmain()\n","change":"replace","i1":0,"i2":8,"j1":0,"j2":17,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"import sys\n\nn = int(input())\nlist_input = list(map(int, sys.stdin.readline().strip().split()))\n\nif 0 in list_input:\n print(0)\n exit()\n\na = 1\nfor i in list_input:\n a *= i\n\n\nif a > pow(10, 18):\n print(-1)\nelse:\n print(a)\n","fail":"import sys\n\nn = int(input())\nlist_input = list(map(int, sys.stdin.readline().strip().split()))\n\nif 0 in list_input:\n print(0)\n exit()\n\na = 1\nfor i in list_input:\n a *= i\n if a > pow(10, 18):\n break\n\n\nif a > pow(10, 18):\n print(-1)\nelse:\n print(a)\n","change":"insert","i1":12,"i2":12,"j1":12,"j2":14,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nsum = 1\nfor num in input().split():\n sum *= int(num)\n if sum == 0:\n print(0)\n exit()\nif len(str(sum)) > 19:\n print(-1)\n exit()\nelif len(str(sum)) == 19:\n if str(sum).count(\"1\") == 1 and str(sum).count(\"0\") == 18:\n pass\n else:\n print(-1)\n exit()\nprint(sum)\n","fail":"N = int(input())\nsum = 1\nketa = 0\n\nnumbers = input().split()\nif not (\"0\" in numbers):\n for num in numbers:\n keta += len(num) - 1\n if keta > 19:\n print(-1)\n exit()\n sum *= int(num)\n if len(str(sum)) > 19:\n print(-1)\n exit()\n\n if len(str(sum)) == 19:\n if str(sum).count(\"1\") == 1 and str(sum).count(\"0\") == 18:\n pass\n else:\n print(-1)\n exit()\nelse:\n print(0)\n exit()\nprint(sum)\n","change":"replace","i1":2,"i2":16,"j1":2,"j2":25,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"import sys\n\nN = int(input())\nA = list(map(int, input().split()))\nans = 1\nfor a in A:\n if a == 0:\n print(0)\n sys.exit()\n ans *= a\n\nif ans > 10**18:\n print(-1)\nelse:\n print(ans)\n","fail":"import sys\n\nN = int(input())\nA = list(map(int, input().split()))\n\nif 0 in A:\n print(0)\n sys.exit()\n\nans = 1\nfor a in sorted(A, reverse=True):\n ans *= a\n if ans > 10**18:\n print(-1)\n break\nelse:\n print(ans)\n","change":"replace","i1":4,"i2":13,"j1":4,"j2":15,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = list(map(int, input().split()))\nans = 1\nfor i in A:\n ans *= i\nif ans > 10**18:\n print(-1)\nelse:\n print(ans)\n","fail":"N = int(input())\nA = list(map(int, input().split()))\n\nif 0 in A:\n print(0)\n exit()\n\nans = 1\nfor i in A:\n ans *= i\n if ans > 10**18:\n print(-1)\n break\nelse:\n print(ans)\n","change":"replace","i1":2,"i2":7,"j1":2,"j2":13,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = list(map(int, input().split()))\nresult = 1\nfor i in a:\n result *= i\n if i == 0:\n break\nif result > 10**18:\n print(-1)\nelse:\n print(result)\n","fail":"n = int(input())\na = list(map(int, input().split()))\nresult = 1\noverflow = False\nfor i in a:\n result *= i\n if result > 1e18:\n result = 1\n overflow = True\nif result != 0 and overflow:\n print(-1)\nelse:\n print(result)\n","change":"replace","i1":3,"i2":8,"j1":3,"j2":10,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = list(map(int, input().split()))\n\nans = 1\nfor i in a:\n ans *= i\nif ans > 1000000000000000000:\n print(-1)\nelse:\n print(ans)\n","fail":"n = int(input())\na = list(map(int, input().split()))\n\nif 0 in a:\n print(0)\nelse:\n ans = 1\n for i in a:\n ans *= i\n if ans > 1000000000000000000:\n print(-1)\n exit()\n if ans > 1000000000000000000:\n print(-1)\n else:\n print(ans)\n","change":"replace","i1":3,"i2":10,"j1":3,"j2":16,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\nli = [int(x) for x in input().split()]\nans = 1\nfor i in range(n):\n ans = ans * li[i]\nif ans > 1000000000000000000:\n print(\"-1\")\nelse:\n print(ans)\n","fail":"n = int(input())\nli = [int(x) for x in input().split()]\nans = 1\nif 0 in li:\n print(\"0\")\nelse:\n for i in range(n):\n ans = ans * li[i]\n if ans > 1000000000000000000:\n print(\"-1\")\n exit()\n print(ans)\n","change":"replace","i1":3,"i2":8,"j1":3,"j2":11,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = map(int, input().split())\n\nmaxn = 10**18\nans = 1\nfor k in a:\n ans *= k\n\nif ans > maxn:\n ans = -1\n\nprint(ans)\n","fail":"n = int(input())\na = map(int, input().split())\na = list(a)\n\nfor k in a:\n if k == 0:\n print(0)\n exit()\n\nmaxn = 10**18\nans = 1\nfor k in a:\n ans *= k\n if ans > maxn:\n ans = -1\n break\n\n\nprint(ans)\n","change":"replace","i1":2,"i2":10,"j1":2,"j2":17,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = list(map(int, input().split()))\n\ninf = 10**18\nans = 1\n\nsorted(a, reverse=True)\nif 0 in a:\n ans = 0\nelse:\n for i in a:\n ans *= i\n\nprint(ans if ans <= inf else -1)\n","fail":"n = int(input())\na = list(map(int, input().split()))\n\ninf = 10**18\nans = 1\n\nsorted(a, reverse=True)\nif 0 in a:\n print(0)\n exit()\nelse:\n for i in a:\n ans *= i\n if ans > inf:\n print(-1)\n exit()\n\nprint(ans)\n","change":"replace","i1":8,"i2":14,"j1":8,"j2":18,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"_ = input()\na = list(map(int, input().split()))\n\nresult = 1\nfor a_i in a:\n result *= a_i\n\nif 10**18 < result:\n print(-1)\nelse:\n print(result)\n","fail":"def main():\n _ = input()\n a = list(map(int, input().split()))\n\n result = 1\n for a_i in a:\n if a_i == 0:\n return 0\n\n for a_i in a:\n result *= a_i\n\n if 10**18 < result:\n return -1\n\n return result\n\n\nif __name__ == \"__main__\":\n result = main()\n print(result)\n","change":"replace","i1":0,"i2":10,"j1":0,"j2":20,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = [int(a) for a in input().split()]\nans = 1\nfor i in A:\n ans *= i\nif ans <= 10**18:\n print(ans)\nelse:\n print(-1)\n","fail":"N = int(input())\nA = [int(a) for a in input().split()]\nif min(A) == 0:\n print(0)\nelse:\n ans = 1\n M = 10**18\n for i in A:\n ans *= i\n if ans > M:\n print(-1)\n break\n else:\n print(ans)\n","change":"replace","i1":2,"i2":9,"j1":2,"j2":14,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\narr = input(\"\")\na = [int(n) for n in arr.split()]\nans = 1\nfor i in range(n):\n ans = ans * int(a[i])\nif ans > int(1e18):\n print(\"-1\")\nelse:\n print(ans)\n","fail":"n = int(input())\na = list(map(int, input().split()))\na.sort()\nans = 1\nfor i in range(n):\n ans *= a[i]\n if ans > 10**18:\n print(-1)\n exit()\n\nprint(ans)\n","change":"replace","i1":1,"i2":10,"j1":1,"j2":11,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\n\nAs = [int(a) for a in input().split()]\n\n\nprod = 1\n\nfor a in As:\n prod *= a\n\nif prod > 10**18:\n print(\"-1\")\nelse:\n print(prod)\n","fail":"N = int(input())\n\nAs = [int(a) for a in input().split()]\n\n\nprod = 1\noverflow_flag = False\n\nif 0 in As:\n print(0)\nelse:\n for a in As:\n prod *= a\n\n if prod > 10**18:\n overflow_flag = True\n break\n\n if overflow_flag:\n print(\"-1\")\n else:\n print(prod)\n","change":"replace","i1":6,"i2":14,"j1":6,"j2":22,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\nres = 1\na = map(int, input().split())\nfor x in a:\n res *= x\nif res > 1e18:\n res = -1\nprint(res)\n","fail":"def solve():\n _ = int(input())\n a = list(map(int, input().split()))\n res = 1\n for x in a:\n if x == 0:\n print(0)\n return\n for x in a:\n res *= x\n if res > int(1e18):\n print(-1)\n return\n print(res)\n\n\nsolve()\n","change":"replace","i1":0,"i2":8,"j1":0,"j2":17,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = list(map(int, input().split()))\n\nans = 1\nfor i in a:\n ans *= i\n\nif ans > 1000000000000000000:\n print(\"-1\")\nelse:\n print(ans)\n","fail":"n = int(input())\na = list(map(int, input().split()))\n\nif 0 in a:\n print(0)\nelse:\n a.sort(reverse=True)\n ans = 1\n for i in a:\n ans *= i\n if ans > 1000000000000000000:\n print(\"-1\")\n break\n else:\n print(ans)\n","change":"replace","i1":3,"i2":11,"j1":3,"j2":15,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = list(map(int, input().split()))\n\nans = 0\nfor i in A:\n if ans != 0:\n ans = ans * i\n else:\n ans = i\n\nif ans > 1000000000000000000:\n print(\"-1\")\nelse:\n print(ans)\n","fail":"N = int(input())\nA = list(map(int, input().split()))\n\nA.sort()\nans = 0\n\nif A[0] == 0:\n print(ans)\n exit()\n\nfor i in A:\n if ans != 0:\n ans = ans * i\n else:\n ans = i\n if ans > 1000000000000000000:\n print(\"-1\")\n exit()\n\nprint(ans)\n","change":"replace","i1":3,"i2":14,"j1":3,"j2":20,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = [int(x) for x in input().split()]\n\nans = 1\nfor i in range(n):\n ans = ans * a[i]\n\nif ans > 10**18:\n print(-1)\nelse:\n print(ans)\n","fail":"n = int(input())\na = [int(x) for x in input().split()]\n\nif a.count(0) > 0:\n print(0)\n exit()\n\nans = 1\n\nfor i in range(n):\n ans *= a[i]\n if ans > 10**18:\n print(-1)\n exit()\n\n\nif ans > 10**18:\n print(-1)\nelse:\n print(ans)\n","change":"replace","i1":3,"i2":6,"j1":3,"j2":15,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = list(map(int, input().rstrip().rsplit()))\nA_dict = {}\n\nfor val in A:\n A_dict[val] = A_dict.get(val, 0) + 1\n\nlimit = 10**18\nans = 1\nfor val in A_dict:\n ans *= val ** A_dict[val]\n\nif ans > limit:\n ans = -1\n\nprint(ans)\n","fail":"N = int(input())\nA = list(map(int, input().rstrip().rsplit()))\nA_dict = {}\n\nfor val in A:\n A_dict[val] = A_dict.get(val, 0) + 1\n\nlimit = 10**18\nans = 1\n\nif A_dict.get(0, 0) > 0:\n ans = 0\nelse:\n for val in A_dict:\n ans *= val ** A_dict[val]\n\n if ans > limit:\n ans = -1\n break\n\nprint(ans)\n","change":"replace","i1":9,"i2":14,"j1":9,"j2":19,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"#!\/usr\/bin\/env python3\nn = int(input())\n\narg = list(map(int, input().split()))\nans = 1\n\nif 0 in arg:\n ans = 0\nelse:\n for m in arg:\n ans *= m\n\n if ans > 1000000000000000000:\n ans = -1\n\nprint(ans)\n","fail":"#!\/usr\/bin\/env python3\nn = int(input())\n\narg = list(map(int, input().split()))\nans = 1\n\nif 0 in arg:\n ans = 0\nelse:\n for m in arg:\n ans *= m\n\n if ans > 1000000000000000000:\n ans = -1\n break\n\nprint(ans)\n","change":"insert","i1":14,"i2":14,"j1":14,"j2":15,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\nA = list(map(int, input().split()))\nans = 1\nfor a in A:\n ans *= a\n\nif ans > 10**18:\n print(-1)\nelse:\n print(ans)\n","fail":"n = int(input())\nA = list(map(int, input().split()))\nif 0 in A:\n print(0)\n exit()\nans = 1\nfor a in A:\n ans *= a\n if ans > 10**18:\n print(-1)\n break\nelse:\n print(ans)\n","change":"replace","i1":2,"i2":8,"j1":2,"j2":11,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Runtime Error","pass":"import numpy as np\n\nn = int(input())\na = list(map(int, input().split()))\na = np.array(a, dtype=np.float64)\nans = np.prod(a)\nprint(int(ans))\n","fail":"n = int(input())\nA = list(map(int, input().split()))\nif 0 in A:\n print(0)\n exit()\nans = 1\nfor a in A:\n ans *= a\n if ans > 10**18:\n print(-1)\n exit()\nprint(ans)\n","change":"replace","i1":0,"i2":7,"j1":0,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nans = 1\nfor a in [int(hoge) for hoge in input().split()]:\n ans *= a\nif ans > 10**18:\n print(-1)\nelse:\n print(ans)\n","fail":"N = int(input())\nA = [int(hoge) for hoge in input().split()]\nif 0 in A:\n print(0)\nelse:\n ans = 1\n for a in A:\n ans *= a\n if ans > 10**18:\n ans = -1\n break\n print(ans)\n","change":"replace","i1":1,"i2":7,"j1":1,"j2":11,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = list(map(int, input().split()))\n\nx = 1\nfor i in range(n):\n x *= a[i]\n\nif x > 1e18:\n print(-1)\nelse:\n print(x)\n","fail":"n = int(input())\na = list(map(int, input().split()))\n\nx = 1\nif 0 in a:\n print(0)\nelse:\n for i in range(n):\n x *= a[i]\n if x > 1e18:\n print(-1)\n exit()\n print(x)\n","change":"replace","i1":4,"i2":10,"j1":4,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"temp1 = input()\nn = int(temp1)\n\ntemp2 = input().split(\" \")\n\nnums = [int(a) for a in temp2]\n\n\ntemp = nums[0]\n\nlimit = pow(10, 18)\n\nfor i in range(1, n):\n temp = temp * nums[i]\n\nif temp <= limit:\n print(temp)\nelse:\n print(-1)\n","fail":"temp1 = input()\nn = int(temp1)\n\ntemp2 = input().split(\" \")\n\nnums = [int(a) for a in temp2]\n\n\ntemp = nums[0]\n\nlimit = pow(10, 18)\n\nfor i in range(1, n):\n temp = temp * nums[i]\n if temp > limit:\n break\n\nif temp <= limit:\n print(temp)\nelse:\n if 0 in nums:\n print(0)\n else:\n print(-1)\n","change":"replace","i1":14,"i2":19,"j1":14,"j2":24,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nK = [int(i) for i in input().split()]\n\nans = 1\nburst = False\nzero = False\nfor k in K:\n if k == zero:\n zero = True\n break\n ans *= k\n if ans > 10**18:\n burst = True\nif zero:\n print(0)\nelif burst:\n print(-1)\nelse:\n print(ans)\n","fail":"N = int(input())\nK = [int(i) for i in input().split()]\n\nif K.count(0) > 0:\n print(0)\nelse:\n ans = 1\n burst = False\n for k in K:\n ans *= k\n if ans > 10**18:\n burst = True\n break\n if burst:\n print(-1)\n else:\n print(ans)\n","change":"replace","i1":3,"i2":19,"j1":3,"j2":17,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02658","language":"Python","original_status":"Time Limit Exceeded","pass":"# -*- coding: utf-8 -*-\nn = int(input())\na = list(map(int, input().split()))\nMAX_RSESULT = 1000000000000000000\n\nresult = 1\nfor ai in a:\n result *= ai\nif result <= MAX_RSESULT:\n print(result)\nelse:\n print(-1)\n","fail":"# -*- coding: utf-8 -*-\nn = int(input())\na = list(map(int, input().split()))\nMAX_RSESULT = 1000000000000000000\n\nresult = 1\na.sort(reverse=True)\n\nif a[-1] == 0:\n result = 0\nelse:\n for ai in a:\n result *= ai\n if result > MAX_RSESULT:\n result = -1\n break\nprint(result)\n","change":"replace","i1":6,"i2":12,"j1":6,"j2":17,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02659","language":"Python","original_status":"Runtime Error","pass":"from decimal import Decimal\n\nnumbers = input().split()\na = float(numbers[0])\nb = Decimal(numbers[1])\n\nc = a * b\n\nprint(int(c))\n","fail":"from decimal import Decimal\n\nnumbers = input().split()\na = Decimal(numbers[0])\nb = Decimal(numbers[1])\n\nc = a * b\n\nprint(int(c))\n","change":"replace","i1":3,"i2":4,"j1":3,"j2":4,"error":"TypeError: unsupported operand type(s) for *: 'float' and 'decimal.Decimal'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02659\/Python\/s952258773.py\", line 7, in \n c = a * b\nTypeError: unsupported operand type(s) for *: 'float' and 'decimal.Decimal'\n","stdout":null} {"problem_id":"p02659","language":"Python","original_status":"Runtime Error","pass":"import math\n\nA, B = input().split()\nA = int(A)\nB = math.floor(B)\nres = A * B\nprint(res)\n","fail":"from decimal import Decimal, ROUND_FLOOR\n\nA, B = input().split()\nA = Decimal(A)\nB = Decimal(B)\nres = A * B\nprint(res.quantize(Decimal(\"1\"), rounding=ROUND_FLOOR))\n","change":"replace","i1":0,"i2":7,"j1":0,"j2":7,"error":"TypeError: must be real number, not str","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02659\/Python\/s322394811.py\", line 5, in \n B = math.floor(B)\nTypeError: must be real number, not str\n","stdout":null} {"problem_id":"p02659","language":"Python","original_status":"Runtime Error","pass":"A, B = input().split()\nA = int(A \/\/ 100)\nB = int(float(B) * 100)\nAB = A * B\nprint(AB)\n","fail":"A, B = input().split()\nA = int(A)\nB = int(B.replace(\".\", \"\"))\n\nprint(A * B \/\/ 100)\n","change":"replace","i1":1,"i2":5,"j1":1,"j2":5,"error":"TypeError: unsupported operand type(s) for \/\/: 'str' and 'int'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02659\/Python\/s674589932.py\", line 2, in \n A = int(A \/\/ 100)\nTypeError: unsupported operand type(s) for \/\/: 'str' and 'int'\n","stdout":null} {"problem_id":"p02659","language":"Python","original_status":"Runtime Error","pass":"a = [float(i) for i in input().split()]\nprint(int(a))\n","fail":"tmp = [i for i in input().split()]\n\na = int(tmp[0])\nb = int(float(tmp[1]) * 1000)\n\nresult = a * b \/\/ 1000\nprint(result)\n","change":"replace","i1":0,"i2":2,"j1":0,"j2":7,"error":"TypeError: int() argument must be a string, a bytes-like object or a real number, not 'list'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02659\/Python\/s589239347.py\", line 2, in \n print(int(a))\nTypeError: int() argument must be a string, a bytes-like object or a real number, not 'list'\n","stdout":null} {"problem_id":"p02659","language":"Python","original_status":"Runtime Error","pass":"A, B = int(input()), float(input())\nprint(int(A * B))\n","fail":"from decimal import Decimal\n\nA, B = input().split()\nA = Decimal(A)\nB = Decimal(B)\nprint(int(A * B))\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":5,"error":"ValueError: invalid literal for int() with base 10: '198 1.10'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02659\/Python\/s961926097.py\", line 1, in \n A, B = int(input()), float(input())\nValueError: invalid literal for int() with base 10: '198 1.10'\n","stdout":null} {"problem_id":"p02659","language":"Python","original_status":"Runtime Error","pass":"a, b = map(int, input.split())\nprint(int(a * b))\n","fail":"sa, sb = input().split()\na = int(sa)\nb = int(sb.replace(\".\", \"\"))\nprint(a * b \/\/ 100)\n","change":"replace","i1":0,"i2":2,"j1":0,"j2":4,"error":"AttributeError: 'builtin_function_or_method' object has no attribute 'split'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02659\/Python\/s524373464.py\", line 1, in \n a, b = map(int, input.split())\nAttributeError: 'builtin_function_or_method' object has no attribute 'split'\n","stdout":null} {"problem_id":"p02659","language":"Python","original_status":"Runtime Error","pass":"A, B = input().split()\nA = int(A)\nB = float(B)\nans = int(A * B)\nprint(ans)\nA, B = input().split()\nA = int(A)\nB = float(B)\nans = int(A * B)\nprint(ans)\n","fail":"A, B = input().split()\nA = int(A)\nB = int(B.replace(\".\", \"\"))\nans = A * B \/\/ 100\nprint(ans)\n","change":"replace","i1":2,"i2":10,"j1":2,"j2":5,"error":"EOFError: EOF when reading a line","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02659\/Python\/s906622337.py\", line 6, in \n A, B = input().split()\nEOFError: EOF when reading a line\n","stdout":217.0} {"problem_id":"p02659","language":"Python","original_status":"Runtime Error","pass":"def main():\n ab = [int(_x) for _x in input().split()]\n print(int(ab[0] * ab[1]))\n\n\nmain()\n","fail":"def main():\n ab = [_x for _x in input().split()]\n n = ab[1]\n bb = int(n[0]) * 100 + int(n[2]) * 10 + int(n[3])\n aa = int(ab[0])\n if aa == 0:\n print(0)\n return\n if bb == 0:\n print(0)\n return\n result = str(aa * bb)\n\n if len(result) <= 2:\n print(0)\n else:\n print(str(result)[:-2])\n\n\nmain()\n","change":"replace","i1":1,"i2":3,"j1":1,"j2":17,"error":"ValueError: invalid literal for int() with base 10: '1.10'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02659\/Python\/s887896518.py\", line 6, in \n main()\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02659\/Python\/s887896518.py\", line 2, in main\n ab = [int(_x) for _x in input().split()]\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02659\/Python\/s887896518.py\", line 2, in \n ab = [int(_x) for _x in input().split()]\nValueError: invalid literal for int() with base 10: '1.10'\n","stdout":null} {"problem_id":"p02659","language":"Python","original_status":"Runtime Error","pass":"A, B = input.split()\na = int(A)\nb = round(float(B) * 100)\nc = a * b \/\/ 100\nprint(c)\n","fail":"A, B = input().split()\na = int(A)\nb = round(float(B) * 100)\nc = a * b \/\/ 100\nprint(c)\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"AttributeError: 'builtin_function_or_method' object has no attribute 'split'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02659\/Python\/s767690614.py\", line 1, in \n A, B = input.split()\nAttributeError: 'builtin_function_or_method' object has no attribute 'split'\n","stdout":null} {"problem_id":"p02659","language":"Python","original_status":"Runtime Error","pass":"a, b = map(int, input().split())\n\nprint(int(a * b))\n","fail":"import decimal\nimport math\n\n\na, b = map(str, input().split())\nprint(math.floor(int(a) * decimal.Decimal(b)))\n","change":"replace","i1":0,"i2":3,"j1":0,"j2":6,"error":"ValueError: invalid literal for int() with base 10: '1.10'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02659\/Python\/s364857155.py\", line 1, in \n a, b = map(int, input().split())\nValueError: invalid literal for int() with base 10: '1.10'\n","stdout":null} {"problem_id":"p02659","language":"Python","original_status":"Runtime Error","pass":"A, B = [int(n) for n in input().split()]\n\nans = int(A * B)\nprint(ans)\n","fail":"from decimal import Decimal\n\nA, B = [n for n in input().split()]\nA = int(A)\nB = Decimal(B)\n\nans = A * B\nprint(int(ans))\n","change":"replace","i1":0,"i2":4,"j1":0,"j2":8,"error":"ValueError: invalid literal for int() with base 10: '1.10'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02659\/Python\/s206342974.py\", line 1, in \n A, B = [int(n) for n in input().split()]\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02659\/Python\/s206342974.py\", line 1, in \n A, B = [int(n) for n in input().split()]\nValueError: invalid literal for int() with base 10: '1.10'\n","stdout":null} {"problem_id":"p02659","language":"Python","original_status":"Runtime Error","pass":"A, B = input().split()\nA = int(A)\nB100 = \"\"\n\nfor s in range(len(B)):\n if B[s] != \".\":\n B100 += B[s]\n\nB100 = int(B100)\n\nans = A * B100 \/\/ 100\n\nprint(ans[0])\n","fail":"A, B = input().split()\nA = int(A)\nB100 = \"\"\n\nfor s in range(len(B)):\n if B[s] != \".\":\n B100 += B[s]\n\nB100 = int(B100)\n\nans = A * B100 \/\/ 100\n\nprint(ans)\n","change":"replace","i1":12,"i2":13,"j1":12,"j2":13,"error":"TypeError: 'int' object is not subscriptable","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02659\/Python\/s087018848.py\", line 13, in \n print(ans[0])\nTypeError: 'int' object is not subscriptable\n","stdout":null} {"problem_id":"p02659","language":"Python","original_status":"Runtime Error","pass":"num_strs = input().split()\n\na = int(num_strs[0])\nb = int(num_strs[1] * 100)\n\nprint((a * b) \/\/ 100)\n","fail":"import decimal\n\na, b = list(map(decimal.Decimal, input().split()))\n\nprint(int(a * b))\n","change":"replace","i1":0,"i2":6,"j1":0,"j2":5,"error":"ValueError: invalid literal for int() with base 10: '1.101.101.101.101.101.101.101.101.101.101.101.101.101.101.101.101.101.101.101.101.101.101.101.101.101.101.101.101.101.101.101.101.101.101.101.101.101.101.101.101.101.101.101.101.101.101.101.101.101.1","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02659\/Python\/s328577183.py\", line 4, in \n b = int(num_strs[1] * 100)\nValueError: invalid literal for int() with base 10: '1.101.101.101.101.101.101.101.101.101.101.101.101.101.101.101.101.101.101.101.101.101.101.101.101.101.101.101.101.101.101.101.101.101.101.101.101.101.101.101.101.101.101.101.101.101.101.101.101.101.1\n","stdout":null} {"problem_id":"p02661","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\n\nA = [None] * N\nB = [None] * N\n\nfor i in range(N):\n a, b = map(int, input().split())\n A[i] = a\n B[i] = b\n\nmedians = []\n\nif N % 2 == 0:\n a_median = (A[N \/\/ 2 - 1] + A[N \/\/ 2]) \/\/ 2\n b_median = (B[N \/\/ 2 - 1] + B[N \/\/ 2]) \/\/ 2\n i = a_median\n while i <= b_median:\n medians.append(i)\n i += 0.5\nelse:\n a_median = A[(N + 1) \/\/ 2 - 1]\n b_median = B[(N + 1) \/\/ 2 - 1]\n for i in range(a_median, b_median + 1):\n medians.append(i)\n\nprint(len(medians))\n","fail":"from statistics import median\n\nn = int(input())\na = [None] * n\nb = [None] * n\nfor i in range(n):\n a[i], b[i] = map(int, input().split())\n\nif n % 2 == 1:\n print(abs(median(b) - median(a)) + 1)\nelse:\n print(int(abs(median(b) - median(a)) * 2) + 1)\n","change":"replace","i1":0,"i2":26,"j1":0,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02661","language":"Python","original_status":"Runtime Error","pass":"from sys import stdin, setrecursionlimit\n\n\ndef main():\n input = stdin.buffer.readline\n n = int(input())\n ab = [list(map(int, input().split())) for _ in range(n)]\n if n % 2 != 0:\n a, b = ab[n \/\/ 2]\n print(b - a + 1)\n else:\n a1, b1 = ab[(n - 1) \/\/ 2]\n a2, b2 = ab[(n + 1) \/\/ 2]\n print(len(list(range(a1 + a2, b1 + b2 + 1))))\n\n\nif __name__ == \"__main__\":\n setrecursionlimit(10000)\n main()\n","fail":"from sys import stdin, setrecursionlimit\n\n\ndef main():\n input = stdin.buffer.readline\n n = int(input())\n ab = [list(map(int, input().split())) for _ in range(n)]\n min_arr = sorted(ab, key=lambda x: x[0])\n max_arr = sorted(ab, key=lambda x: x[1])\n if n % 2 != 0:\n a = min_arr[n \/\/ 2][0]\n b = max_arr[n \/\/ 2][1]\n print(b - a + 1)\n else:\n a1 = min_arr[(n - 1) \/\/ 2][0]\n b1 = max_arr[(n - 1) \/\/ 2][1]\n a2 = min_arr[(n + 1) \/\/ 2][0]\n b2 = max_arr[(n + 1) \/\/ 2][1]\n print(b1 + b2 - a1 - a2 + 1)\n\n\nif __name__ == \"__main__\":\n setrecursionlimit(10000)\n main()\n","change":"replace","i1":7,"i2":14,"j1":7,"j2":19,"error":"0","stderr":null,"stdout":3.0} {"problem_id":"p02662","language":"Python","original_status":"Time Limit Exceeded","pass":"import sys\n\ninput = sys.stdin.buffer.readline\n\nn, s = map(int, input().split())\nA = list(map(int, input().split()))\nmod = 998244353\ndp = [[{} for _ in range(s + 1)] for _ in range(n + 1)]\ndp[0][0][0] = 1\nkiroku = [0] * (n)\n\nfor i in range(n):\n ni = i + 1\n for j in range(s + 1):\n nj = j\n if dp[i][j] == {}:\n continue\n for key, val in dp[i][j].items():\n if key in dp[ni][nj]:\n dp[ni][nj][key] += val\n else:\n dp[ni][nj][key] = val\n nj = j + A[i]\n if nj <= s:\n for key, val in dp[i][j].items():\n if key + 1 in dp[ni][nj]:\n dp[ni][nj][key + 1] += val\n else:\n dp[ni][nj][key + 1] = val\nans = 0\nfor key, val in dp[n][s].items():\n if key == 0:\n continue\n ans += pow(2, n - key) * val\n ans %= mod\nprint(ans)\n","fail":"import sys\n\ninput = sys.stdin.buffer.readline\n\nn, s = map(int, input().split())\nA = list(map(int, input().split()))\nmod = 998244353\ndp = [[0] * (s + 1) for _ in range(n + 1)]\ndp[0][0] = 1\n\nfor i in range(n):\n ni = i + 1\n for j in range(s + 1):\n nj = j\n dp[ni][nj] += 2 * dp[i][j]\n dp[ni][nj] %= mod\n nj = j + A[i]\n if nj <= s:\n dp[ni][nj] += dp[i][j]\n dp[ni][nj] %= mod\nprint(dp[n][s] % mod)\n","change":"replace","i1":7,"i2":36,"j1":7,"j2":21,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02662","language":"Python","original_status":"Time Limit Exceeded","pass":"MOD = 998244353\nn, s = map(int, input().split())\na = list(map(int, input().split()))\nf = [0] * (s + 1)\nf[0] = pow(2, n, MOD)\nv = pow(2, MOD - 2, MOD)\nfor i in range(n):\n for j in range(s, a[i] - 1, -1):\n f[j] += f[j - a[i]] * v\n for j in range(s + 1):\n f[j] %= MOD\nprint(f[s])\n","fail":"MOD = 998244353\nn, s = map(int, input().split())\na = list(map(int, input().split()))\nf = [0] * (s + 1)\nf[0] = pow(2, n, MOD)\nv = pow(2, MOD - 2, MOD)\nfor x in a:\n for j in range(s, x - 1, -1):\n f[j] += f[j - x] * v\n for j in range(s + 1):\n f[j] %= MOD\nprint(f[s])\n","change":"replace","i1":6,"i2":9,"j1":6,"j2":9,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02664","language":"Python","original_status":"Runtime Error","pass":"S = input()\n\n\ndef makeRepeat(arr):\n repeat = [[arr[0], 0]]\n for x in arr:\n if x == repeat[-1][0]:\n repeat[-1][1] += 1\n else:\n repeat.append([x, 1])\n return repeat\n\n\nans = []\nrepeats = makeRepeat(S)\nfor i, (ch, count) in enumerate(repeats):\n if ch != \"?\":\n ans.append(ch * count)\n else:\n if i - 1 >= 0:\n prev = repeats[i - 1][0]\n nxt = None\n if i + 1 < len(repeats):\n nxt = repeats[i + 1][0]\n\n if prev == \"P\":\n q, r = divmod(count, 2)\n ans.append(\"DP\" * q + \"D\" * r)\n elif nxt == \"D\":\n q, r = divmod(count, 2)\n ans.append(\"P\" * r + \"DP\" * q)\n else:\n ans.append(\"D\" * count)\n\nprint(\"\".join(ans))\n","fail":"inf = float(\"inf\")\n\nS = input()\n\n\nN = len(S)\nbestP = [None for i in range(N)]\nbestD = [None for i in range(N)]\nif S[0] in [\"?\", \"D\"]:\n bestP[0] = 0\n bestD[0] = 1\nelse:\n bestP[0] = 0\n bestD[0] = 0\nfor i in range(1, N):\n bestP[i] = max(bestD[i - 1], bestP[i - 1])\n bestD[i] = max(bestD[i - 1] + 1, bestP[i - 1] + 2)\n if S[i] != \"?\":\n if S[i] == \"P\":\n bestD[i] = -inf\n else:\n assert S[i] == \"D\"\n bestP[i] = -inf\n\nans = [None for i in range(N)]\nif bestP[-1] > bestD[-1]:\n ans[-1] = \"P\"\nelse:\n ans[-1] = \"D\"\nfor i in range(N - 2, -1, -1):\n if S[i] != \"?\":\n ans[i] = S[i]\n else:\n prev = ans[i + 1]\n if prev == \"D\":\n if bestP[i] + 2 > bestD[i] + 1:\n ans[i] = \"P\"\n else:\n ans[i] = \"D\"\n else:\n if bestP[i] > bestD[i]:\n ans[i] = \"P\"\n else:\n ans[i] = \"D\"\n\nprint(\"\".join(ans))\n","change":"replace","i1":0,"i2":33,"j1":0,"j2":44,"error":"WA","stderr":null,"stdout":"PDPDDDP\n"} {"problem_id":"p02665","language":"Python","original_status":"Runtime Error","pass":"n = int(input())\na = list(map(int, input().split()))\na_min = [0] * (n + 1)\na_min[n] = a[n]\nfor i in range(n - 1, -1, -1):\n a_min[i] = a[i] + a_min[i + 1]\n\nb = [1]\nfor i in range(n):\n tmp = b[i] - a[i]\n if tmp < 1 or tmp * 2 < a[i + 1]:\n print(-1)\n break\nelse:\n if n == 0:\n ans = 1 if a[0] == 1 else -1\n print(ans)\n else:\n print(sum(b))\n","fail":"n = int(input())\na = list(map(int, input().split()))\na_min = [0] * (n + 1)\na_min[n] = a[n]\nfor i in range(n - 1, -1, -1):\n a_min[i] = a[i] + a_min[i + 1]\n\nb = [1]\nfor i in range(n):\n tmp = b[i] - a[i]\n b.append(min(tmp * 2, a_min[i + 1]))\n if tmp < 1 or tmp * 2 < a[i + 1]:\n print(-1)\n break\nelse:\n if n == 0:\n ans = 1 if a[0] == 1 else -1\n print(ans)\n else:\n print(sum(b))\n","change":"insert","i1":10,"i2":10,"j1":10,"j2":11,"error":"IndexError: list index out of range","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02665\/Python\/s101181043.py\", line 10, in \n tmp = b[i] - a[i]\nIndexError: list index out of range\n","stdout":null} {"problem_id":"p02665","language":"Python","original_status":"Runtime Error","pass":"#!\/usr\/bin\/env python3\nn = int(input())\na = list(map(int, input().split()))\nif n < 30 and a[-1] > (1 << n):\n print(-1)\n exit()\nfor i in range(min(n, 30)):\n if a[i] > (1 << i) - 1:\n print(-1)\n exit()\ns = sum(a)\nans = 1\ndp = [0] * n\ndp[0] = 1\nfor i in range(1, n):\n dp[i] = min(s, 2 * dp[i - 1])\n ans += dp[i]\n dp[i] -= a[i]\n if dp[i] < 0:\n print(-1)\n exit()\n s -= a[i]\nans += a[-1]\nprint(ans)\n","fail":"#!\/usr\/bin\/env python3\nn = int(input())\na = list(map(int, input().split()))\nif n == 0:\n print([-1, 1][a[0] == 1])\n exit()\nif a[0] > 0:\n print(-1)\n exit()\ns = sum(a)\nans = 1\ndp = [0] * (n + 1)\ndp[0] = 1\nfor i in range(n):\n dp[i + 1] = min(s, 2 * dp[i])\n ans += dp[i + 1]\n dp[i + 1] -= a[i + 1]\n s -= a[i + 1]\n if dp[i] <= 0:\n print(-1)\n exit()\nif dp[-1] < 0:\n print(-1)\n exit()\nprint(ans)\n","change":"replace","i1":3,"i2":23,"j1":3,"j2":24,"error":"0","stderr":null,"stdout":7.0} {"problem_id":"p02670","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nP = list(map(int, input().split()))\nfor i in range(len(P)):\n P[i] -= 1\n\ndp = [[1 + min(i, N - 1 - i, j, N - 1 - j) for j in range(N + 1)] for i in range(N + 1)]\n\npresence = [[1 for j in range(N)] for i in range(N)]\n\nans = 0\nfor i in range(len(P)):\n x = P[i] \/\/ N\n y = P[i] % N\n ans += dp[x][y] - 1\n presence[x][y] = 0\n\n Q = [(x, y)]\n while Q:\n x, y = Q.pop()\n new_value = presence[x][y] + min(\n dp[x - 1][y], dp[x + 1][y], dp[x][y - 1], dp[x][y + 1]\n )\n if new_value != dp[x][y]:\n dp[x][y] = new_value\n if 1 <= x and dp[x - 1][y] > presence[x - 1][y] + dp[x][y]:\n Q.append((x - 1, y))\n if x < N - 1 and dp[x + 1][y] > presence[x + 1][y] + dp[x][y]:\n Q.append((x + 1, y))\n if 1 <= y and dp[x][y - 1] > presence[x][y - 1] + dp[x][y]:\n Q.append((x, y - 1))\n if y < N - 1 and dp[x][y + 1] > presence[x][y + 1] + dp[x][y]:\n Q.append((x, y + 1))\n\nprint(ans)\npass\n","fail":"N = int(input())\nP = list(map(int, input().split()))\n\ndp = [[min(i, N - i - 1, j, N - j - 1) for j in range(N)] for i in range(N)]\n\npresence = [[1 for j in range(N)] for i in range(N)]\n\nans = 0\nfor i in range(len(P)):\n P[i] -= 1\n x, y = divmod(P[i], N)\n ans += dp[x][y]\n presence[x][y] = 0\n\n Q = [(x, y)]\n while Q:\n x, y = Q.pop()\n new_value = dp[x][y] + presence[x][y]\n if 1 <= x and dp[x - 1][y] > new_value:\n dp[x - 1][y] = new_value\n Q.append((x - 1, y))\n if x < N - 1 and dp[x + 1][y] > new_value:\n dp[x + 1][y] = new_value\n Q.append((x + 1, y))\n if 1 <= y and dp[x][y - 1] > new_value:\n dp[x][y - 1] = new_value\n Q.append((x, y - 1))\n if y < N - 1 and dp[x][y + 1] > new_value:\n dp[x][y + 1] = new_value\n Q.append((x, y + 1))\n\n\nprint(ans)\n","change":"replace","i1":2,"i2":35,"j1":2,"j2":33,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02670","language":"Python","original_status":"Time Limit Exceeded","pass":"from collections import deque\n\nn = int(input())\nP = list(int(x) - 1 for x in input().split())\nA = [0] * (n**2)\nremain = [1] * (n**2)\n\nfor i in range(n**2):\n A[i] = min(i % n, n - (i % n) - 1, i \/\/ n, n - (i \/\/ n) - 1)\n\nans = 0\nfor i in range(n**2):\n ans += A[P[i]]\n remain[P[i]] = 0\n que = deque([P[i]])\n visited = [False] * (n**2)\n while que:\n k = que.popleft()\n visited[k] = True\n if k % n != 0: # left\n nk = k - 1\n if not visited[nk]:\n A[nk] = min(A[nk], A[k] + remain[k])\n que.append(nk)\n if n - (k % n) - 1 != 0: # right\n nk = k + 1\n if not visited[nk]:\n A[nk] = min(A[nk], A[k] + remain[k])\n que.append(nk)\n if k \/\/ n != 0: # up\n nk = k - n\n if not visited[nk]:\n A[nk] = min(A[nk], A[k] + remain[k])\n que.append(nk)\n if n - (k \/\/ n) - 1 != 0: # down\n nk = k + n\n if not visited[nk]:\n A[nk] = min(A[nk], A[k] + remain[k])\n que.append(nk)\n\nprint(ans)\n","fail":"from collections import deque\n\nn = int(input())\nP = list(int(x) - 1 for x in input().split())\nA = [0] * (n**2)\nremain = [1] * (n**2)\n\nfor i in range(n**2):\n A[i] = min(i % n, n - (i % n) - 1, i \/\/ n, n - (i \/\/ n) - 1)\n\nans = 0\nfor i in range(n**2):\n ans += A[P[i]]\n remain[P[i]] = 0\n que = deque([P[i]])\n while que:\n k = que.popleft()\n if k % n != 0: # left\n nk = k - 1\n if A[nk] > A[k] + remain[k]:\n A[nk] = A[k] + remain[k]\n que.append(nk)\n if n - (k % n) - 1 != 0: # right\n nk = k + 1\n if A[nk] > A[k] + remain[k]:\n A[nk] = A[k] + remain[k]\n que.append(nk)\n if k \/\/ n != 0: # up\n nk = k - n\n if A[nk] > A[k] + remain[k]:\n A[nk] = A[k] + remain[k]\n que.append(nk)\n if n - (k \/\/ n) - 1 != 0: # down\n nk = k + n\n if A[nk] > A[k] + remain[k]:\n A[nk] = A[k] + remain[k]\n que.append(nk)\n\nprint(ans)\n","change":"replace","i1":15,"i2":38,"j1":15,"j2":36,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02675","language":"Python","original_status":"Runtime Error","pass":"n = input()\n\nif n[1] in [2, 4, 5, 7, 9]:\n print(\"hon\")\nelif n[1] in [0, 1, 6, 8]:\n print(\"pon\")\nelse:\n print(\"bon\")\n","fail":"# N\u306e1\u306e\u4f4d\u304c\n# 2,4,5,7,9\u306e\u3068\u304dhonN\u306e1\u306e\u4f4d\u304c0,1,6,8\u306e\u3068\u304dponN\u306e1\u306e\u4f4d\u304c3\u306e\u3068\u304dbon\u3067\u3059\u3002\n\na = int(input()) % 10\nprint(\"pphbhhphph\"[a] + \"on\")\n","change":"replace","i1":0,"i2":8,"j1":0,"j2":5,"error":"WA","stderr":null,"stdout":"bon\n"} {"problem_id":"p02676","language":"Python","original_status":"Runtime Error","pass":"K = input()\nS = input()\nif len(S) < K:\n print(S)\nelse:\n print(\"S[:K]\" + \"...\")\n","fail":"K = input()\nS = input()\nK = int(K)\nif len(S) <= K:\n print(S)\nelse:\n a = S[:K] + \"...\"\n print(a)\n","change":"replace","i1":2,"i2":6,"j1":2,"j2":8,"error":"TypeError: '<' not supported between instances of 'int' and 'str'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02676\/Python\/s601347674.py\", line 3, in \n if len(S) < K:\nTypeError: '<' not supported between instances of 'int' and 'str'\n","stdout":null} {"problem_id":"p02676","language":"Python","original_status":"Runtime Error","pass":"K = input()\n\nS = int(input())\n\nif len(K) <= S:\n print(K)\n\n\nelse:\n print(K[:S] + \"...\")\n","fail":"K = int(input())\nS = input()\nif len(str(S)) <= K:\n print(S)\nelse:\n print(S[:K] + \"...\")\n","change":"replace","i1":0,"i2":10,"j1":0,"j2":6,"error":"ValueError: invalid literal for int() with base 10: 'nikoandsolstice'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02676\/Python\/s435233989.py\", line 3, in \n S = int(input())\nValueError: invalid literal for int() with base 10: 'nikoandsolstice'\n","stdout":null} {"problem_id":"p02677","language":"Python","original_status":"Runtime Error","pass":"import math\n\na, b, h, m = map(int, input().split())\nang_a = 360 * h \/ 12\nang_b = 360 * m \/ 60\ns_a = 0\ns_b = 0\n\nwhile ang_a - 90 > 0:\n ang_a -= 90\n s_a += 1\nwhile ang_b - 90 > 0:\n ang_b -= 90\n s_b += 1\n\n\ndef ppp(xx, yy, s):\n if s == 0:\n return map(int, xx, yy)\n elif s == 1:\n return map(int, xx, -yy)\n elif s == 2:\n return map(int, -xx, -yy)\n elif s == 3:\n return map(int, -xx, yy)\n else:\n return map(int, [0, 0])\n\n\nx_a = math.cos(ang_a)\ny_a = math.sin(ang_a)\ny_b = math.cos(ang_b)\nx_b = math.sin(ang_b)\n\nx_a, y_a = ppp(x_a, y_a, s_a)\nx_b, y_b = ppp(x_b, y_b, s_b)\nx = abs(x_a, x_b)\ny = abs(y_a, y_b)\nans_r = math.sqrt(x) + math.sqrt(y)\nans = math.sqrt(ans_r)\nprint(ans)\n","fail":"import math\n\na, b, h, m = map(int, input().split())\nang_a = (360 * h \/ 12) + (0.5 * m)\nang_b = 360 * m \/ 60\nang = abs(ang_a - ang_b if ang_a > ang_b else ang_b - ang_a)\nans = math.sqrt((a**2 + b**2) - (2 * a * b * math.cos(math.radians(ang))))\nprint(ans)\n","change":"replace","i1":3,"i2":40,"j1":3,"j2":7,"error":"TypeError: 'float' object is not iterable","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02677\/Python\/s187857401.py\", line 35, in \n x_a, y_a = ppp(x_a, y_a, s_a)\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02677\/Python\/s187857401.py\", line 23, in ppp\n return map(int, -xx, -yy)\nTypeError: 'float' object is not iterable\n","stdout":null} {"problem_id":"p02677","language":"Python","original_status":"Runtime Error","pass":"k = int(input())\ns = list(input())\nan_lis = []\nif len(s) <= k:\n ans = \"\".join(s)\n print(ans)\nelse:\n for i in range(k):\n an_lis.append(s[i])\n an_lis.append(\"...\")\n ans = \"\".join(an_lis)\n print(ans)\n","fail":"a, b, h, m = map(int, input().split())\nimport math\n\na_ang = (h \/ 12 + (1 \/ 12) * (m \/ 60)) * 2 * math.pi\nb_ang = (m \/ 60) * 2 * math.pi\nax = a * math.cos(a_ang)\nbx = b * math.cos(b_ang)\nay = a * math.sin(a_ang)\nby = b * math.sin(b_ang)\n\nx = ax - bx\ny = ay - by\nans = (x**2 + y**2) ** 0.5\nprint(ans)\n","change":"replace","i1":0,"i2":12,"j1":0,"j2":14,"error":"ValueError: invalid literal for int() with base 10: '3 4 9 0'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02677\/Python\/s504646897.py\", line 1, in \n k = int(input())\nValueError: invalid literal for int() with base 10: '3 4 9 0'\n","stdout":null} {"problem_id":"p02677","language":"Python","original_status":"Runtime Error","pass":"import sys\nfrom math import exp, pi\n\nread = sys.stdin.buffer.read\nreadline = sys.stdin.buffer.readline\nreadlines = sys.stdin.buffer.readlines\n\nA, B, H, M = map(int, read().split())\n\nH += M \/ 60\n\nt1 = 2 * pi * H \/ 12\nt2 = 2 * pi * H\n\nz1 = A * exp(t1 * 1j)\nz2 = B * exp(t1 * 1j)\n\nprint(abs(z1 - z2))\n","fail":"import sys\nimport numpy as np\n\nread = sys.stdin.buffer.read\nreadline = sys.stdin.buffer.readline\nreadlines = sys.stdin.buffer.readlines\n\nA, B, H, M = map(int, read().split())\n\nH += M \/ 60\n\nt1 = 2 * np.pi * H \/ 12\nt2 = 2 * np.pi * H\n\nz1 = A * np.exp(t1 * 1j)\nz2 = B * np.exp(t2 * 1j)\n\nprint(abs(z1 - z2))\n","change":"replace","i1":1,"i2":16,"j1":1,"j2":16,"error":"TypeError: must be real number, not complex","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02677\/Python\/s067635273.py\", line 15, in \n z1 = A * exp(t1 * 1j)\nTypeError: must be real number, not complex\n","stdout":null} {"problem_id":"p02678","language":"Python","original_status":"Runtime Error","pass":"from scipy.sparse.csgraph import dijkstra\nimport numpy as np\n\nn, m = map(int, input().split())\ne = np.zeros((n, n))\nfor _ in range(m):\n a, b = map(int, input().split())\n a -= 1\n b -= 1\n e[a][b] = 1\n e[b][a] = 1\ndist, predecessor = dijkstra(e, directed=False, return_predecessors=True)\n\nif all(type(v) == np.int32 for v in predecessor[0][1:]):\n print(\"Yes\")\n for v in predecessor[0][1:]:\n print(v + 1)\nelse:\n print(\"No\")\n","fail":"from collections import deque\n\nn, m = map(int, input().split())\ne = [[] for _ in range(n)]\nfor _ in range(m):\n a, b = map(int, input().split())\n a -= 1\n b -= 1\n e[a].append(b)\n e[b].append(a)\n\ndist = [1000000] * n\nans = [None] * n\nnot_visited = set(range(n))\nnot_visited.remove(0)\nvs = deque([0])\ndist[0] = 0\nwhile vs:\n v = vs.popleft()\n for other_side in e[v]:\n if other_side in not_visited:\n vs.append(other_side)\n not_visited.remove(other_side)\n if dist[other_side] > dist[v] + 1:\n dist[other_side] = dist[v] + 1\n ans[other_side] = v\n\nprint(\"Yes\")\nfor i in ans[1:]:\n print(i + 1)\n","change":"replace","i1":0,"i2":19,"j1":0,"j2":30,"error":"ModuleNotFoundError: No module named 'scipy'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02678\/Python\/s593149455.py\", line 1, in \n from scipy.sparse.csgraph import dijkstra\nModuleNotFoundError: No module named 'scipy'\n","stdout":null} {"problem_id":"p02679","language":"Python","original_status":"Runtime Error","pass":"import sys\nimport math\nfrom collections import defaultdict\n\ninput = sys.stdin.buffer.readline\nMOD = 1000000007\nN = int(input())\ndd = defaultdict(int)\ncount = 1\niwashi = [list(map(int, input().split())) for _ in range(N)]\n\n\nchecked = defaultdict(bool)\nzeros = 0\n\nfor i in range(N):\n if iwashi[i][0] == iwashi[i][1] == 0:\n zeros += 1\n continue\n iw = iwashi[i]\n gcd_iw = math.gcd(iw[0], iw[1])\n if gcd_iw != 0:\n iw = [iw[0] \/ gcd_iw, iw[1] \/ gcd_iw]\n if iw[0] < -1:\n iw *= -1\n dd[tuple(iw)] += 1\nfor key, val in dd.items():\n if checked[key]:\n continue\n vert_key = (key[1], -key[0]) if key[1] >= 0 else (-key[1], key[0])\n vert_val = dd[vert_key] if vert_key in dd else 0\n count *= (pow(2, val, MOD) - 1) + (pow(2, vert_val, MOD) - 1) + 1\n count %= MOD\n checked[vert_key] = True\n\n# 0\u5339\u5165\u308c\u308b\u5834\u5408\u3092\u9664\u5916\ncount -= 1\n\ncount += zeros\nprint(count % MOD)\n","fail":"import sys\nimport math\nfrom collections import defaultdict\n\ninput = sys.stdin.buffer.readline\nMOD = 1000000007\nN = int(input())\ndd = defaultdict(int)\ncount = 1\niwashi = [list(map(int, input().split())) for _ in range(N)]\n\n\nchecked = defaultdict(bool)\nzeros = 0\n\nfor i in range(N):\n if iwashi[i][0] == iwashi[i][1] == 0:\n zeros += 1\n continue\n iw = iwashi[i]\n gcd_iw = math.gcd(iw[0], iw[1])\n if gcd_iw != 0:\n iw = list(map(lambda x: x \/\/ gcd_iw, iw))\n if iw[0] < 0:\n iw = list(map(lambda x: -x, iw))\n if iw[0] == 0 and iw[1] < 0:\n iw = list(map(lambda x: -x, iw))\n dd[tuple(iw)] += 1\n\nfor key, val in dd.items():\n if checked[key]:\n continue\n vert_key = (key[1], -key[0]) if key[1] > 0 else (-key[1], key[0])\n vert_val = dd[vert_key] if vert_key in dd else 0\n count *= (pow(2, val, MOD) - 1) + (pow(2, vert_val, MOD) - 1) + 1\n count %= MOD\n checked[vert_key] = True\n\n# 0\u5339\u5165\u308c\u308b\u5834\u5408\u3092\u9664\u5916\ncount -= 1\n\ncount += zeros\nprint(count % MOD)\n","change":"replace","i1":22,"i2":30,"j1":22,"j2":33,"error":"0","stderr":null,"stdout":"5\n"} {"problem_id":"p02681","language":"Python","original_status":"Runtime Error","pass":"s, t = input().split()\nprint(\"Yes\" if s == t[:-1] else \"No\")\n","fail":"s = input()\nt = input()\nprint(\"Yes\" if s == t[:-1] else \"No\")\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":2,"error":"ValueError: not enough values to unpack (expected 2, got 1)","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02681\/Python\/s074309875.py\", line 1, in \n s, t = input().split()\nValueError: not enough values to unpack (expected 2, got 1)\n","stdout":null} {"problem_id":"p02681","language":"Python","original_status":"Runtime Error","pass":"# A - Registration\ndef main():\n S, T = map(int, open(0).read().split())\n print(\"Yes\" if T[:-1] == S else \"No\")\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"# A - Registration\ndef main():\n S, T = open(0).read().split()\n print(\"Yes\" if T[:-1] == S else \"No\")\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":2,"i2":3,"j1":2,"j2":3,"error":"ValueError: invalid literal for int() with base 10: 'chokudai'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02681\/Python\/s408863353.py\", line 8, in \n main()\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02681\/Python\/s408863353.py\", line 3, in main\n S, T = map(int, open(0).read().split())\nValueError: invalid literal for int() with base 10: 'chokudai'\n","stdout":null} {"problem_id":"p02681","language":"Python","original_status":"Runtime Error","pass":"[a, b, h] = [int(input()) for i in range(3)]\n\n\nresult = (a + b) * h \/\/ 2\nprint(result)\n","fail":"import re\n\na = input()\nb = input()\n\nif re.match(f\"^{a}.$\", b):\n print(\"Yes\")\nelse:\n print(\"No\")\n","change":"replace","i1":0,"i2":5,"j1":0,"j2":9,"error":"ValueError: invalid literal for int() with base 10: 'chokudai'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02681\/Python\/s616201447.py\", line 1, in \n [a, b, h] = [int(input()) for i in range(3)]\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02681\/Python\/s616201447.py\", line 1, in \n [a, b, h] = [int(input()) for i in range(3)]\nValueError: invalid literal for int() with base 10: 'chokudai'\n","stdout":null} {"problem_id":"p02681","language":"Python","original_status":"Runtime Error","pass":"S, T = list(map(str, input().split()))\n\nif (abs(len(T) - len(S)) == 1) and (T[:-1] == S):\n print(\"Yes\")\nelse:\n print(\"No\")\n","fail":"S = list(map(str, input().split()))[0]\nT = list(map(str, input().split()))[0]\n\nif (abs(len(T) - len(S)) == 1) and (T[:-1] == S):\n print(\"Yes\")\nelse:\n print(\"No\")\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":2,"error":"ValueError: not enough values to unpack (expected 2, got 1)","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02681\/Python\/s417304047.py\", line 1, in \n S, T = list(map(str, input().split()))\nValueError: not enough values to unpack (expected 2, got 1)\n","stdout":null} {"problem_id":"p02681","language":"Python","original_status":"Runtime Error","pass":"import sys\n\nN, K = map(int, input().split())\ntown_list = list(map(int, input().split()))\n\nroop = 0\nqueue = [1]\n\nstart = -1\n\nfor now_town in queue:\n if town_list[now_town - 1] in queue:\n start = town_list[now_town - 1]\n break\n queue.append(town_list[now_town - 1])\n\nif start == -1:\n print(queue[K])\n sys.exit()\n\nbefore_len = queue.index(start)\nroop = len(queue) - before_len\n\nprint(queue[before_len + (K - before_len) % roop])\n","fail":"S = input()\nT = input()\n\nif S == T[0:-1]:\n print(\"Yes\")\nelse:\n print(\"No\")\n","change":"replace","i1":0,"i2":24,"j1":0,"j2":7,"error":"ValueError: invalid literal for int() with base 10: 'chokudai'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02681\/Python\/s135786455.py\", line 3, in \n N, K = map(int, input().split())\nValueError: invalid literal for int() with base 10: 'chokudai'\n","stdout":null} {"problem_id":"p02682","language":"Python","original_status":"Time Limit Exceeded","pass":"a, b, c, k = map(int, input().split())\n\nres = 0\ni = 0\n\na_times = 0\nb_times = 0\nc_times = 0\n\nif a == k:\n a_times = k\nelse:\n for i in range(k):\n # print('i = ', i)\n if i < a:\n a_times += 1\n # print('res + 1= ', res)\n elif i + a < a + b:\n b_times += 1\n # print('res + 0 = ', res)\n elif i + a + b < a + b + c:\n c_times += 1\n # print('res - 1 = ', res)\n\nprint(a_times * 1 + b_times * 0 + c_times * -1)\n","fail":"a, b, c, k = map(int, input().split())\n\na_times = 0\nb_times = 0\nc_times = 0\n\nif a <= k:\n a_times = a\n # print('a_times = ', a_times)\n if a_times + b <= k:\n b_times = b\n # print('if - b_times = ', b_times)\n else:\n b_times = k - a_times\n # print('else - b_times = ', b_times)\n if a_times + b_times + c <= k:\n c_times = c\n # print('if - c_times = ', c_times)\n else:\n c_times = k - a_times - b_times\n # print('else - c_times = ', c_times)\nelse:\n a_times = k\n\n\nprint(a_times * 1 + b_times * 0 + c_times * -1)\n","change":"replace","i1":1,"i2":23,"j1":1,"j2":24,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02682","language":"Python","original_status":"Runtime Error","pass":"import sys\n\na, b, c, k = map(int, input().split())\nif a >= k:\n print(k)\n sys.exit()\nelif a + b >= k:\n print(a)\n sys.exit()\n\nones = [1] * a\nzeros = [0] * b\nnegas = [-1] * c\n\ntotals = []\ntotals.extend(ones)\ntotals.extend(zeros)\ntotals.extend(negas)\n\ntotals = totals[0:k]\nprint(sum(totals))\n","fail":"import sys\n\na, b, c, k = map(int, input().split())\nif a >= k:\n print(k)\n sys.exit()\n\ntotal = a\nk = k - a\nif k <= 0:\n print(total)\n sys.exit()\n\nk = k - b\nif k <= 0:\n print(total)\n sys.exit()\n\nprint(total - k)\n","change":"replace","i1":6,"i2":21,"j1":6,"j2":19,"error":"0","stderr":null,"stdout":"2\n"} {"problem_id":"p02682","language":"Python","original_status":"Runtime Error","pass":"A, B, C, K = (int(x) for x in input().split())\n\na = [1] * A\nb = [0] * B\nc = [-1] * C\n\nX = a + b + c\nprint(sum(X[:K]))\n","fail":"A, B, C, K = map(int, input().split())\nif K <= A:\n print(K)\nelif K <= A + B:\n print(A)\nelse:\n print(2 * A + B - K)\n","change":"replace","i1":0,"i2":8,"j1":0,"j2":7,"error":"0","stderr":null,"stdout":"2\n"} {"problem_id":"p02682","language":"Python","original_status":"Runtime Error","pass":"a, b, c, k = map(int, input().split())\nlist1 = [1] * a\nlist0 = [0] * b\nlist_m1 = [-1] * c\n\nlist1.extend(list0)\nlist1.extend(list_m1)\n\nlist1.sort(reverse=True)\n\nans = 0\nfor i in range(k):\n ans += list1[i]\n\nprint(ans)\n","fail":"a, b, c, k = map(int, input().split())\nans = 0\nif k <= a:\n ans = k\nelif k <= a + b:\n ans = a\nelse:\n ans = a + (-1) * (k - a - b)\nprint(ans)\n","change":"replace","i1":1,"i2":14,"j1":1,"j2":8,"error":"0","stderr":null,"stdout":"2\n"} {"problem_id":"p02682","language":"Python","original_status":"Time Limit Exceeded","pass":"a, b, c, k = map(int, input().split())\n\ncards = []\nfor _ in range(a):\n cards.append(1)\nfor _ in range(b):\n cards.append(0)\nfor _ in range(c):\n cards.append(-1)\n\nans = 0\nfor i in range(k):\n ans += cards[i]\n\nprint(ans)\n","fail":"a, b, c, k = map(int, input().split())\n\nimport sys\n\nans = 0\nif a != 0 and a >= k:\n # a = 1\n print(k)\n sys.exit()\nelif a != 0:\n ans += a\n k -= a\n\nif b != 0 and b >= k:\n print(ans)\n sys.exit()\nelif b != 0:\n k -= b\n\nans += k * -1\nprint(ans)\n","change":"replace","i1":2,"i2":14,"j1":2,"j2":20,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02682","language":"Python","original_status":"Time Limit Exceeded","pass":"a, b, c, k = map(int, input().split())\ntotal = 0\n\nwhile k > 0:\n if a > 0:\n total += 1\n a -= 1\n k -= 1\n continue\n if b > 0:\n b -= 1\n k -= 1\n continue\n if c > 0:\n total -= 1\n k -= 1\n continue\nprint(total)\n","fail":"a, b, c, k = map(int, input().split())\n\ntotal = 0\n\nif a > 0:\n if a < k:\n total += a\n k -= a\n else:\n total += k\n print(total)\n k = 0\n\nif b > 0 and k > 0:\n if b < k:\n k -= b\n else:\n print(total)\n k = 0\n\nif c > 0 and k > 0:\n if c < k:\n total -= c\n print(total)\n else:\n total -= k\n print(total)\n","change":"replace","i1":1,"i2":18,"j1":1,"j2":27,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02682","language":"Python","original_status":"Time Limit Exceeded","pass":"import numpy as np\n\na, b, c, k = map(int, input().split())\n\nones = [1 for i in range(a)]\nzeros = [0 for i in range(b)]\nminusOnes = [-1 for i in range(c)]\n\ncombination = np.array(ones + zeros + minusOnes)\nsum = 0\nfor i in range(k):\n sum += combination[i]\nprint(sum)\n","fail":"a, b, c, k = map(int, input().split())\n\nif k <= a:\n sum = k * 1\nelif a < k and k <= a + b:\n sum = a\nelif a + b < k <= a + b + c:\n sum = a + (-1) * (k - a - b)\n\nprint(sum)\n","change":"replace","i1":0,"i2":12,"j1":0,"j2":9,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02682","language":"Python","original_status":"Runtime Error","pass":"A, B, C, K = map(int, input.split(\" \"))\nif K <= A:\n print(K)\nelse:\n K = K - A\n if K <= B:\n print(A)\n else:\n K = K - B\n print(A - K)\n","fail":"A, B, C, K = map(int, input().split(\" \"))\nif K <= A:\n print(K)\nelse:\n K = K - A\n if K <= B:\n print(A)\n else:\n K = K - B\n print(A - K)\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"AttributeError: 'builtin_function_or_method' object has no attribute 'split'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02682\/Python\/s825415458.py\", line 1, in \n A, B, C, K = map(int, input.split(\" \"))\nAttributeError: 'builtin_function_or_method' object has no attribute 'split'\n","stdout":null} {"problem_id":"p02683","language":"Python","original_status":"Runtime Error","pass":"N, M, X = input().split()\nC, A = [], []\nfor _ in range(N):\n tmp = [int(a) for a in input().split()]\n C.append(tmp[0])\n A.append(tmp[1:])\n\nmi = 1 << 100\nfor binary in range(1 << N):\n B = [0] * M\n c = 0\n for i in range(N):\n if binary >> N & 1:\n c += C[i]\n for j in range(M):\n B[j] += A[i][j]\n if min(B) >= X:\n mi = min(c, mi)\nprint(mi if mi < 1 << 99 else -1)\n","fail":"N, M, X = map(int, input().split())\nC, A = [], []\nfor _ in range(N):\n tmp = [int(a) for a in input().split()]\n C.append(tmp[0])\n A.append(tmp[1:])\n\nmi = 1 << 100\nfor binary in range(1 << N):\n B = [0] * M\n c = 0\n for i in range(N):\n if binary >> i & 1:\n c += C[i]\n for j in range(M):\n B[j] += A[i][j]\n if min(B) >= X:\n mi = min(c, mi)\nprint(mi if mi < 1 << 99 else -1)\n","change":"replace","i1":0,"i2":13,"j1":0,"j2":13,"error":"TypeError: 'str' object cannot be interpreted as an integer","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02683\/Python\/s161118337.py\", line 3, in \n for _ in range(N):\nTypeError: 'str' object cannot be interpreted as an integer\n","stdout":null} {"problem_id":"p02684","language":"Python","original_status":"Time Limit Exceeded","pass":"[n, k], [*a] = [[*map(int, t.split())] for t in open(0)]\nans = 1\nfor _ in range(k):\n ans = a[ans - 1]\nprint(ans)\n","fail":"[n, k], [*a] = [[*map(int, t.split())] for t in open(0)]\ncount = 0\nvisited = dict()\ntmp = 1\nwhile count < k:\n visited[tmp] = count\n count += 1\n tmp = a[tmp - 1]\n if tmp in visited:\n break\nif count < k:\n k = (k - count) % (count - visited[tmp])\n for _ in range(k):\n tmp = a[tmp - 1]\nprint(tmp)\n","change":"replace","i1":1,"i2":5,"j1":1,"j2":15,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02684","language":"Python","original_status":"Runtime Error","pass":"class Telp:\n def __init__(self, to, idx):\n self.to = to\n self.idx = idx\n self.visited = False\n self.step = -1\n\n def visit(self, step):\n self.visited = True\n self.step = step\n\n def is_visited(self):\n return self.visited\n\n\nn, k = map(int, input().split())\n\na = list(map(int, input().split()))\n\nnet = {}\n\nfor i in range(n):\n net[i] = Telp(a[i], i)\n\ncurrent = net[0]\ncount = 0\npath = [0]\n\nwhile not current.visited:\n # print(current.to)\n current.visit(count)\n current = net[current.to - 1]\n path.append(current)\n count += 1\n # print(\"count\", count)\n\noffset = current.step\nloop = count - offset\nfact_idx = (k - offset) % loop\n\n# print(\"count, offset, loop, fact_idx\", count, offset, loop, fact_idx)\n# print(\"ans\", path[offset + fact_idx - 1].to)\n\nprint(path[offset + fact_idx - 1].to)\n","fail":"class Telp:\n def __init__(self, to, idx):\n self.to = to\n self.idx = idx\n self.visited = False\n self.step = -1\n\n def visit(self, step):\n self.visited = True\n self.step = step\n\n def is_visited(self):\n return self.visited\n\n\nn, k = map(int, input().split())\n\na = list(map(int, input().split()))\n\nnet = {}\n\nfor i in range(n):\n net[i] = Telp(a[i], i)\n\ncurrent = net[0]\ncount = 0\npath = []\n\nwhile not current.visited:\n # print(current.to)\n path.append(current)\n current.visit(count)\n current = net[current.to - 1]\n count += 1\n if count == k:\n print(path[-1].to)\n exit(0)\n # print(\"count\", count)\n\noffset = current.step\nloop = count - offset\nfact_idx = (k - offset) % loop\n\n# print(\"count, offset, loop, fact_idx\", count, offset, loop, fact_idx)\n# print(\"ans\", path[offset + fact_idx - 1].to)\n\nprint(path[offset + fact_idx - 1].to)\n","change":"replace","i1":26,"i2":34,"j1":26,"j2":37,"error":"0","stderr":null,"stdout":"4\n"} {"problem_id":"p02684","language":"Python","original_status":"Runtime Error","pass":"N, K = map(int, input().split())\nA = list(map(int, input().split()))\n\nNN = [-1] * N\nNN[0] = 0\n\ni = 0\nnum = 0\n\nwhile True:\n num += 1\n i = A[i] - 1\n if NN[i] != -1:\n n1 = NN[i]\n break\n NN[i] = num\n\nn_ = num - n1\n\nif K > N:\n K -= n1\n t = NN.index(n1 + K % n_) + 1\n print(t)\nelse:\n t = NN.index(K)\n print(t) + 1\n","fail":"N, K = map(int, input().split())\nA = list(map(int, input().split()))\n\nNN = [-1] * N\nNN[0] = 0\n\ni = 0\nnum = 0\n\nwhile True:\n num += 1\n i = A[i] - 1\n if NN[i] != -1:\n n1 = NN[i]\n break\n NN[i] = num\n\nn_ = num - n1\n\nif K > n1:\n K -= n1\n t = NN.index(n1 + K % n_) + 1\n print(t)\nelse:\n t = NN.index(K) + 1\n print(t)\n","change":"replace","i1":19,"i2":26,"j1":19,"j2":26,"error":"0","stderr":null,"stdout":"4\n"} {"problem_id":"p02684","language":"Python","original_status":"Time Limit Exceeded","pass":"import sys\nfrom io import StringIO\nimport unittest\n\n\ndef resolve():\n n, k = map(int, input().split())\n a = list(map(int, input().split()))\n\n loop_list = []\n now = 0\n\n if k > n:\n while 1:\n now = a[now] - 1\n\n if now + 1 in loop_list:\n s_index = loop_list.index(now + 1)\n before_loop = s_index\n loop_list = loop_list[s_index:]\n break\n else:\n loop_list.append(now + 1)\n\n l = len(loop_list)\n k -= before_loop\n\n # print(loop_list, l, before_loop)\n print(loop_list[k % l - 1])\n else:\n for _ in range(k):\n now = a[now] - 1\n\n print(now + 1)\n\n\nclass TestClass(unittest.TestCase):\n def assertIO(self, input, output):\n stdout, stdin = sys.stdout, sys.stdin\n sys.stdout, sys.stdin = StringIO(), StringIO(input)\n resolve()\n sys.stdout.seek(0)\n out = sys.stdout.read()[:-1]\n sys.stdout, sys.stdin = stdout, stdin\n self.assertEqual(out, output)\n\n def test_\u5165\u529b\u4f8b_1(self):\n input = \"\"\"4 5\n3 2 4 1\"\"\"\n output = \"\"\"4\"\"\"\n self.assertIO(input, output)\n\n def test_\u5165\u529b\u4f8b_2(self):\n input = \"\"\"6 727202214173249351\n6 5 2 5 3 2\"\"\"\n output = \"\"\"2\"\"\"\n self.assertIO(input, output)\n\n\nif __name__ == \"__main__\":\n # unittest.main()\n resolve()\n","fail":"import sys\nfrom io import StringIO\nimport unittest\n\n\ndef resolve():\n n, k = map(int, input().split())\n a = list(map(int, input().split()))\n\n loop_list = []\n loop_set = set()\n now = 0\n\n if k > n:\n for _ in range(k):\n now = a[now] - 1\n\n if now + 1 in loop_set:\n s_index = loop_list.index(now + 1)\n before_loop = s_index\n loop_list = loop_list[s_index:]\n break\n else:\n loop_list.append(now + 1)\n loop_set.add(now + 1)\n\n l = len(loop_list)\n k -= before_loop\n\n # print(loop_list, l, before_loop)\n print(loop_list[k % l - 1])\n else:\n for _ in range(k):\n now = a[now] - 1\n\n print(now + 1)\n\n\nclass TestClass(unittest.TestCase):\n def assertIO(self, input, output):\n stdout, stdin = sys.stdout, sys.stdin\n sys.stdout, sys.stdin = StringIO(), StringIO(input)\n resolve()\n sys.stdout.seek(0)\n out = sys.stdout.read()[:-1]\n sys.stdout, sys.stdin = stdout, stdin\n self.assertEqual(out, output)\n\n def test_\u5165\u529b\u4f8b_1(self):\n input = \"\"\"4 5\n3 2 4 1\"\"\"\n output = \"\"\"4\"\"\"\n self.assertIO(input, output)\n\n def test_\u5165\u529b\u4f8b_2(self):\n input = \"\"\"6 727202214173249351\n6 5 2 5 3 2\"\"\"\n output = \"\"\"2\"\"\"\n self.assertIO(input, output)\n\n\nif __name__ == \"__main__\":\n # unittest.main()\n resolve()\n","change":"replace","i1":10,"i2":23,"j1":10,"j2":25,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02684","language":"Python","original_status":"Runtime Error","pass":"N, K = map(int, input().split())\nX = list(map(int, input().split()))\ntown = []\ndic = {}\ni = 0\nj = 0\nwhile i not in dic and j < K:\n dic[i] = j\n town.append(i)\n i = X[i] - 1\n j += 1\n\nif j == K:\n print(town[K] + 1)\n\nelse:\n num = dic[i]\n loop = j - num\n print(town[((K - num) % loop) + num] + 1)\n","fail":"N, K = map(int, input().split())\nX = list(map(int, input().split()))\ntown = []\ndic = {}\ni = 0\nj = 0\nwhile i not in dic and j < K:\n dic[i] = j\n town.append(i)\n i = X[i] - 1\n j += 1\n\nif j == K:\n print(i + 1)\n\nelse:\n num = dic[i]\n loop = j - num\n print(town[((K - num) % loop) + num] + 1)\n","change":"replace","i1":13,"i2":14,"j1":13,"j2":14,"error":"0","stderr":null,"stdout":"4\n"} {"problem_id":"p02684","language":"Python","original_status":"Runtime Error","pass":"N, K = map(int, input().split())\nportals = [0] + list(map(int, input().split()))\n\nvisitTowns = list()\nvisitTimes = [0 for _ in range(N + 1)]\n\ncurTown = 1\ntimeBackTo = 0\n\ncurTime = 0\nwhile True:\n if visitTimes[curTown] > 0:\n timeBackTo = visitTimes[curTown]\n break\n\n visitTowns.append(curTown)\n visitTimes[curTown] = curTime\n\n # teleport\n curTown = portals[curTown]\n\n curTime += 1\n print(visitTowns, visitTimes[1:])\n\nnonLoopCount = timeBackTo\nloopSpan = len(visitTowns) - nonLoopCount\n\nif K <= nonLoopCount:\n print(visitTowns[K])\n exit()\n\nrem = (K - nonLoopCount) % loopSpan\nprint(visitTowns[nonLoopCount + rem])\n","fail":"N, K = map(int, input().split())\nportals = [0] + list(map(int, input().split()))\n\nvisitTowns = list()\nvisitTimes = [0 for _ in range(N + 1)]\n\ncurTown = 1\ntimeBackTo = 0\n\ncurTime = 0\nwhile True:\n if visitTimes[curTown] > 0:\n timeBackTo = visitTimes[curTown]\n break\n\n visitTowns.append(curTown)\n visitTimes[curTown] = curTime\n\n # teleport\n curTown = portals[curTown]\n\n curTime += 1\n\nnonLoopCount = timeBackTo\nloopSpan = len(visitTowns) - nonLoopCount\n\nif K <= nonLoopCount:\n print(visitTowns[K])\n exit()\n\nrem = (K - nonLoopCount) % loopSpan\nprint(visitTowns[nonLoopCount + rem])\n","change":"delete","i1":22,"i2":23,"j1":22,"j2":22,"error":"WA","stderr":null,"stdout":"[1] [0, 0, 0, 0]\n[1, 3] [0, 0, 1, 0]\n[1, 3, 4] [0, 0, 1, 2]\n[1, 3, 4, 1] [3, 0, 1, 2]\n4\n"} {"problem_id":"p02684","language":"Python","original_status":"Runtime Error","pass":"n, k = list(map(int, input().split()))\narr = list(map(int, input().split()))\n\nvisited_city = {1: 0}\nvisited_city_inv = {0: 1}\n\nnow = 1\nnum = 0\nwhile True:\n next_city = arr[now - 1]\n num += 1\n if next_city not in visited_city:\n visited_city[next_city] = num\n visited_city_inv[num] = next_city\n now = next_city\n else:\n break\n\nif k < num:\n ans = visited_city[k]\nelse:\n x = visited_city[next_city]\n period = num - x\n ans = visited_city_inv[x + (k - x) % period]\n\nprint(ans)\n# print(visited_city)\n","fail":"n, k = list(map(int, input().split()))\narr = list(map(int, input().split()))\n\nvisited_city = {1: 0}\nvisited_city_inv = {0: 1}\n\nnow = 1\nnum = 0\nwhile True:\n next_city = arr[now - 1]\n num += 1\n if next_city not in visited_city:\n visited_city[next_city] = num\n visited_city_inv[num] = next_city\n now = next_city\n else:\n break\n\nif k < num:\n ans = visited_city_inv[k]\nelse:\n x = visited_city[next_city]\n period = num - x\n ans = visited_city_inv[x + (k - x) % period]\n\nprint(ans)\n# print(visited_city)\n","change":"replace","i1":19,"i2":20,"j1":19,"j2":20,"error":"0","stderr":null,"stdout":"4\n"} {"problem_id":"p02684","language":"Python","original_status":"Runtime Error","pass":"N, K = map(int, input().split())\nA_i = list(map(int, input().split()))\n\nplace = 1\nroad = [0 for i in range(N)]\ncycle = 0\n\nroad[0] = 1\n\nwhile K != 0:\n place = A_i[place - 1]\n K -= 1\n\n if road[place - 1] == 1:\n loop_place = place\n break\n road[place - 1] = 1\n\nwhile K != 0:\n loop_place = A_i[loop_place - 1]\n cycle += 1\n\n if place == loop_place:\n break\n\nK = K % cycle\n\nwhile K != 0:\n place = A_i[place - 1]\n K -= 1\n\nprint(place)\n","fail":"N, K = map(int, input().split())\nA_i = list(map(int, input().split()))\n\nplace = 1\nroad = [0 for i in range(N)]\ncycle = 0\n\nroad[0] = 1\n\nwhile K != 0:\n place = A_i[place - 1]\n K -= 1\n if road[place - 1] == 1:\n loop_place = place\n break\n road[place - 1] = 1\n\nwhile K != 0:\n loop_place = A_i[loop_place - 1]\n cycle += 1\n\n if place == loop_place:\n break\n\nif cycle != 0:\n K = K % cycle\n\nwhile K != 0:\n place = A_i[place - 1]\n K -= 1\n\nprint(place)\n","change":"replace","i1":12,"i2":26,"j1":12,"j2":26,"error":"0","stderr":null,"stdout":"4\n"} {"problem_id":"p02684","language":"Python","original_status":"Time Limit Exceeded","pass":"def main():\n N, K = map(int, input().split())\n A = list(map(int, input().split()))\n path = [-1] * N * 2\n idx = 0\n visited = [False] * N\n cur = 0\n while K:\n if visited[cur]:\n loop = idx - path.index(cur)\n K %= loop\n path[idx] = cur\n visited[cur] = True\n cur = A[cur] - 1\n K -= 1\n idx += 1\n print(cur + 1)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"def main():\n N, K = map(int, input().split())\n A = list(map(int, input().split()))\n path = [-1] * N * 2\n idx = 0\n visited = [False] * N\n cur = 0\n loop = -1\n while K:\n K -= 1\n if loop == -1 and visited[cur]:\n loop = idx - path.index(cur)\n K %= loop\n path[idx] = cur\n visited[cur] = True\n cur = A[cur] - 1\n idx += 1\n print(cur + 1)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":7,"i2":15,"j1":7,"j2":16,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02684","language":"Python","original_status":"Runtime Error","pass":"N, K = map(int, input().split())\nA = list(map(int, input().split()))\n\nvis = set()\nvis.add(1)\ncnt = 0\ncnt2town = {}\ntown2cnt = {}\ncnt2town[0] = 1\ntown2cnt[1] = 0\n\nfor a in A:\n if a in vis:\n c = town2cnt[a]\n rem = K - cnt\n num_loop = cnt - c\n\n k = rem % num_loop\n print(cnt2town[c + k + 1])\n exit()\n\n if cnt == K:\n print(a)\n exit()\n\n cnt += 1\n cnt2town[cnt] = a\n town2cnt[a] = cnt\n vis.add(a)\n","fail":"N, K = map(int, input().split())\nA = list(map(int, input().split()))\n\nvis = set()\nvis.add(1)\ncnt = 0\ncnt2town = {}\ntown2cnt = {}\ncnt2town[0] = 1\ntown2cnt[1] = 0\n\ncnt = 1\nprev = 1\nwhile cnt <= K:\n a = A[prev - 1]\n\n if a in vis:\n c = town2cnt[a]\n\n rem = K - cnt\n num_loop = cnt - c\n\n r = rem % num_loop\n print(cnt2town[c + r])\n\n exit()\n\n cnt2town[cnt] = a\n town2cnt[a] = cnt\n vis.add(a)\n\n prev = a\n cnt += 1\n\n\nprint(a)\n","change":"replace","i1":11,"i2":29,"j1":11,"j2":36,"error":"0","stderr":null,"stdout":"4\n"} {"problem_id":"p02684","language":"Python","original_status":"Runtime Error","pass":"#!\/usr\/bin\/env python\n# -*- coding: utf-8 -*-\n\n\ndef main():\n N, K = map(int, input().split())\n A = list(map(int, input().split()))\n\n R = [False] * (N + 1)\n D = []\n\n p = 1\n\n while True:\n if R[p]:\n break\n D.append(p)\n R[p] = True\n p = A[p - 1]\n\n m = D.index(p)\n c = len(D) - m\n\n if K <= m:\n print(D[K])\n else:\n print(D[m + K - m] % c)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"#!\/usr\/bin\/env python\n# -*- coding: utf-8 -*-\n\n\ndef main():\n N, K = map(int, input().split())\n A = list(map(int, input().split()))\n\n R = [False] * (N + 1)\n D = []\n\n p = 1\n\n while True:\n if R[p]:\n break\n D.append(p)\n R[p] = True\n p = A[p - 1]\n\n m = D.index(p)\n c = len(D) - m\n\n if K <= m:\n print(D[K])\n else:\n print(D[m + (K - m) % c])\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":26,"i2":27,"j1":26,"j2":27,"error":"IndexError: list index out of range","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02684\/Python\/s669353976.py\", line 31, in \n main()\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02684\/Python\/s669353976.py\", line 27, in main\n print(D[m + K - m] % c)\nIndexError: list index out of range\n","stdout":null} {"problem_id":"p02684","language":"Python","original_status":"Runtime Error","pass":"N, K = map(int, input().split())\nA = list(map(int, input().split()))\n\nloop_checker = {}\nbefore_loop_len = 0\nloop_len = 0\n\ncount = 2\nnow = 0\nwhile True:\n if A[now] in loop_checker.values():\n before_loop_len = loop_checker[A[now]]\n loop_len = count - before_loop_len - 1\n break\n else:\n loop_checker[count - 1] = A[now]\n now = A[now] - 1\n count += 1\n\nif K <= before_loop_len:\n print(loop_checker[K])\nelse:\n checkK_prep = K - before_loop_len\n checkK = checkK_prep % loop_len\n print(loop_checker[before_loop_len + checkK])\n","fail":"N, K = map(int, input().split())\nA = list(map(int, input().split()))\n\nflag = [False] * N\ncounted = [1]\n\nnextT = A[0]\nflag[0] = True\nfor x in range(N):\n if flag[nextT - 1] is False:\n counted.append(nextT)\n flag[nextT - 1] = True\n nextT = A[nextT - 1]\n else:\n break\nbefore_loop_len = counted.index(nextT)\nloop_len = x - before_loop_len + 1\n\nif K <= before_loop_len:\n print(counted[K])\nelse:\n checkK_prep = K - before_loop_len\n checkK = checkK_prep % loop_len\n print(counted[before_loop_len + checkK])\n","change":"replace","i1":3,"i2":25,"j1":3,"j2":24,"error":"0","stderr":null,"stdout":"4\n"} {"problem_id":"p02684","language":"Python","original_status":"Time Limit Exceeded","pass":"from collections import deque\nfrom sys import stdin\n\n\ndef main():\n N, K = [int(x) for x in stdin.readline().rstrip().split()]\n As = [int(x) for x in stdin.readline().rstrip().split()]\n pos = 1\n tmp = deque([pos])\n for _ in range(K):\n pos = As[pos - 1]\n if pos in tmp:\n idx_s = tmp.index(pos)\n break\n tmp.append(pos)\n else:\n print(list(tmp)[-1])\n return\n\n K = K - idx_s\n tmp = list(tmp)\n print(tmp[idx_s:][K % (len(tmp) - idx_s)])\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"from collections import deque\nfrom sys import stdin\n\n\ndef main():\n N, K = [int(x) for x in stdin.readline().rstrip().split()]\n As = [int(x) for x in stdin.readline().rstrip().split()]\n pos = 1\n a = [False] * N\n a[0] = True\n tmp = deque([pos])\n for _ in range(K):\n pos = As[pos - 1]\n if a[pos - 1]:\n idx_s = tmp.index(pos)\n break\n a[pos - 1] = True\n tmp.append(pos)\n else:\n print(list(tmp)[-1])\n return\n\n K = K - idx_s\n tmp = list(tmp)\n print(tmp[idx_s:][K % (len(tmp) - idx_s)])\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":8,"i2":14,"j1":8,"j2":17,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02684","language":"Python","original_status":"Time Limit Exceeded","pass":"#!\/usr\/bin\/env python3\n\nimport numpy as np\n\n\n# def input():\n# return sys.stdin.readline().rstrip()\n\n\ndef main():\n n, k = map(int, input().split())\n\n warps = list(map(int, input().split()))\n warps = [0] + warps\n warps = np.array(warps, dtype=int)\n\n dp = np.zeros((k.bit_length() + 1, n + 1), dtype=int)\n\n dp[0, :] = warps\n\n for h in range(1, len(dp)):\n for j in range(len(dp[0] + 1)):\n dp[h][j] = dp[h - 1][dp[h - 1][j]]\n\n node = 1\n # for i in reversed(range(k.bit_length())):\n for i in range(k.bit_length(), -1, -1):\n if k >> i & 1:\n node = dp[i][node]\n\n print(node)\n\n\nmain()\n","fail":"#!\/usr\/bin\/env python3\n\nimport numpy as np\n\n\n# def input():\n# return sys.stdin.readline().rstrip()\n\n\ndef main():\n n, k = map(int, input().split())\n\n warps = list(map(int, input().split()))\n warps = [0] + warps\n warps = np.array(warps, dtype=int)\n\n dp = np.zeros((k.bit_length() + 1, n + 1), dtype=int)\n\n dp[0, :] = warps\n\n for h in range(1, len(dp)):\n # dp[h] = dp[h - 1][dp[h - 1]]\n dp[h] = np.take(dp[h - 1], dp[h - 1])\n\n node = 1\n # for i in reversed(range(k.bit_length())):\n for i in range(k.bit_length(), -1, -1):\n if k >> i & 1:\n node = dp[i][node]\n\n print(node)\n\n\nmain()\n","change":"replace","i1":21,"i2":23,"j1":21,"j2":23,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02684","language":"Python","original_status":"Runtime Error","pass":"N, K = map(int, input().split(\" \"))\nA = [i for i in map(int, input().split(\" \"))]\n\nhist = [0 for i in range(N)]\nroute = []\nloop = []\n\njump = 1\ncur = A[0] - 1\nroute.append(0)\nhist[0] = jump\nwhile hist[cur] == 0:\n jump = jump + 1\n route.append(cur)\n hist[cur] = jump\n cur = A[cur] - 1\n\nloop = route[cur:]\n\nif K < len(route):\n print(route[K] + 1)\nelse:\n K = K - len(route) - 1\n K = K % len(loop)\n print(loop[K] + 1)\n","fail":"N, K = map(int, input().split(\" \"))\nA = [i for i in map(int, input().split(\" \"))]\n\nhist = [-1 for i in range(N)]\nroute = []\nloop = []\n\njump = 0\ncur = A[0] - 1\nroute.append(0)\nhist[0] = jump\nwhile hist[cur] == -1:\n jump = jump + 1\n route.append(cur)\n hist[cur] = jump\n cur = A[cur] - 1\n\nloop = route[hist[cur] :]\n\n# print(cur, hist, route, loop)\n\nif K < len(route):\n print(route[K] + 1)\nelse:\n K = K - len(route)\n # print(K)\n K = K % len(loop)\n # print(K)\n print(loop[K] + 1)\n","change":"replace","i1":3,"i2":24,"j1":3,"j2":28,"error":"WA","stderr":null,"stdout":"3\n"} {"problem_id":"p02684","language":"Python","original_status":"Runtime Error","pass":"import sys\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef main():\n N, K = map(int, input().split())\n A = list(map(int, input().split()))\n went = [0] * N\n went[0] = 1\n Flag = True\n check = [0]\n cnt = 1\n now = 0\n while Flag and (cnt <= K):\n now = A[now] - 1\n if went[now] == 1:\n ind = check.index(now) - 1\n cnt = cnt - ind - 1\n Flag = False\n else:\n check.append(now)\n went[now] = 1\n cnt += 1\n continue\n if len(check) >= K:\n print(check[K] + 1)\n else:\n K = (K - ind) % cnt\n print(check[ind + K] + 1)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"import sys\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef main():\n N, K = map(int, input().split())\n A = list(map(int, input().split()))\n went = [0] * N\n went[0] = 1\n Flag = True\n check = [0]\n cnt = 1\n now = 0\n while Flag and (cnt <= K + 1):\n now = A[now] - 1\n if went[now] == 1:\n ind = check.index(now)\n if ind == 0:\n cnt = len(check)\n else:\n cnt = len(check) - ind\n\n Flag = False\n else:\n check.append(now)\n went[now] = 1\n cnt += 1\n continue\n\n if len(check) > K:\n print(check[K] + 1)\n else:\n if ind == 0:\n K = K % cnt\n print(check[K] + 1)\n else:\n ind -= 1\n K = (K - ind - 1) % cnt\n print(check[ind + K + 1] + 1)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":16,"i2":32,"j1":16,"j2":42,"error":"0","stderr":null,"stdout":"4\n"} {"problem_id":"p02684","language":"Python","original_status":"Runtime Error","pass":"def dfs(v):\n path.append(v)\n visited[v] = 1\n nv = A[v]\n if visited[nv] == 1:\n return nv\n return dfs(nv)\n\n\nN, K = map(int, input().split())\nA = list(map(lambda x: int(x) - 1, input().split()))\nvisited = [-1] * N\npath = []\ncycle_start = dfs(0)\ncycle_len = len(path) - path.index(cycle_start)\nhead_len = len(path) - cycle_len\nif K <= head_len:\n print(path[K] + 1)\nelse:\n K -= head_len\n print(path[head_len + K % cycle_len] + 1)\n","fail":"import sys\n\n\nsys.setrecursionlimit(10**6)\n\n\ndef dfs(v):\n path.append(v)\n visited[v] = 1\n nv = A[v]\n if visited[nv] == 1:\n return nv\n return dfs(nv)\n\n\nN, K = map(int, input().split())\nA = list(map(lambda x: int(x) - 1, input().split()))\nvisited = [0] * N\npath = []\ncycle_start = dfs(0)\ncycle_len = len(path) - path.index(cycle_start)\nhead_len = len(path) - cycle_len\nif K <= head_len:\n print(path[K] + 1)\nelse:\n K -= head_len\n print(path[head_len + K % cycle_len] + 1)\n","change":"replace","i1":0,"i2":12,"j1":0,"j2":18,"error":"0","stderr":null,"stdout":"4\n"} {"problem_id":"p02684","language":"Python","original_status":"Time Limit Exceeded","pass":"# -*- coding: utf-8 -*-\n\n# \u5165\u529b\u3092\u6574\u6570\u306b\u5909\u63db\u3057\u3066\u53d7\u3051\u53d6\u308b\ndef input_int():\n return int(input())\n\n\n# \u30de\u30a4\u30ca\u30b91\u3057\u305f\u5024\u3092\u8fd4\u5374\ndef int1(x):\n return int(x) - 1\n\n\n# \u534a\u89d2\u30b9\u30da\u30fc\u30b9\u533a\u5207\u308a\u5165\u529b\u3092Int\u306b\u5909\u63db\u3057\u3066Map\u3067\u53d7\u3051\u53d6\u308b\ndef input_to_int_map():\n return map(int, input().split())\n\n\n# \u534a\u89d2\u30b9\u30da\u30fc\u30b9\u533a\u5207\u308a\u5165\u529b\u3092Int\u306b\u5909\u63db\u3057\u3066\u53d7\u3051\u53d6\u308b\ndef input_to_int_tuple():\n return tuple(map(int, input().split()))\n\n\n# \u534a\u89d2\u30b9\u30da\u30fc\u30b9\u533a\u5207\u308a\u5165\u529b\u3092Int\u306b\u5909\u63db\u3057\u3066\u30de\u30a4\u30ca\u30b91\u3057\u305f\u5024\u3092\u53d7\u3051\u53d6\u308b\ndef input_to_int_tuple_minus1():\n return tuple(map(int1, input().split()))\n\n\ndef main():\n n, k = input_to_int_map()\n a = {i + 1: int(val) for i, val in enumerate(input().split())}\n\n place = 1\n place_goneds = [place]\n i = 0\n loop_start_index = 0\n while i < n:\n place = a[place]\n goned = False\n for j, place_goned in enumerate(place_goneds):\n if place_goned == place:\n loop_start_index = j\n goned = True\n break\n\n if goned:\n break\n\n place_goneds.append(place)\n i += 1\n\n if k < len(place_goneds):\n return place_goneds[k]\n\n move_cnt = k - loop_start_index\n loop_list = place_goneds[loop_start_index:]\n return loop_list[move_cnt % len(loop_list)]\n\n\nif __name__ == \"__main__\":\n print(main())\n","fail":"# -*- coding: utf-8 -*-\n\n# \u5165\u529b\u3092\u6574\u6570\u306b\u5909\u63db\u3057\u3066\u53d7\u3051\u53d6\u308b\ndef input_int():\n return int(input())\n\n\n# \u30de\u30a4\u30ca\u30b91\u3057\u305f\u5024\u3092\u8fd4\u5374\ndef int1(x):\n return int(x) - 1\n\n\n# \u534a\u89d2\u30b9\u30da\u30fc\u30b9\u533a\u5207\u308a\u5165\u529b\u3092Int\u306b\u5909\u63db\u3057\u3066Map\u3067\u53d7\u3051\u53d6\u308b\ndef input_to_int_map():\n return map(int, input().split())\n\n\n# \u534a\u89d2\u30b9\u30da\u30fc\u30b9\u533a\u5207\u308a\u5165\u529b\u3092Int\u306b\u5909\u63db\u3057\u3066\u53d7\u3051\u53d6\u308b\ndef input_to_int_tuple():\n return tuple(map(int, input().split()))\n\n\n# \u534a\u89d2\u30b9\u30da\u30fc\u30b9\u533a\u5207\u308a\u5165\u529b\u3092Int\u306b\u5909\u63db\u3057\u3066\u30de\u30a4\u30ca\u30b91\u3057\u305f\u5024\u3092\u53d7\u3051\u53d6\u308b\ndef input_to_int_tuple_minus1():\n return tuple(map(int1, input().split()))\n\n\ndef main():\n n, k = input_to_int_map()\n a = {i + 1: int(val) for i, val in enumerate(input().split())}\n\n place = 1\n visit = {place}\n place_visits = [place]\n for i in range(k):\n place = a[place]\n if place in visit:\n left = place_visits.index(place)\n return place_visits[left + (k - left) % (i + 1 - left)]\n else:\n visit.add(place)\n place_visits.append(place)\n\n return place\n\n\nif __name__ == \"__main__\":\n print(main())\n","change":"replace","i1":32,"i2":56,"j1":32,"j2":44,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02684","language":"Python","original_status":"Time Limit Exceeded","pass":"import numpy as np\n\nn, k = map(int, input().split())\na = list(map(lambda x: int(x) - 1, input().split()))\n\ntable = np.zeros((64, n), dtype=np.int64)\ntable[0] = a\n\nfor i in range(61):\n for j in range(n):\n table[i + 1][j] = table[i][table[i][j]]\n\nans = 0\nfor i in range(61, -1, -1):\n if k >> i & 1:\n ans = table[i][ans]\nprint(ans + 1)\n","fail":"n, k = map(int, input().split())\na = list(map(lambda x: int(x) - 1, input().split()))\n\ntable = [[0] * n for _ in [0] * 64]\ntable[0] = a\n\nfor i in range(61):\n for j in range(n):\n table[i + 1][j] = table[i][table[i][j]]\n\nans = 0\nfor i in range(61, -1, -1):\n if k >> i & 1:\n ans = table[i][ans]\nprint(ans + 1)\n","change":"replace","i1":0,"i2":6,"j1":0,"j2":4,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02684","language":"Python","original_status":"Runtime Error","pass":"N, K = map(int, input().split())\nA = list(map(int, input().split()))\n\nB = [A[0]]\n\nfor _ in range(1, N + 10):\n b = A[B[-1] - 1]\n if b in B:\n B += [b]\n break\n else:\n B += [b]\n continue\n\nif len(B) >= K:\n print(B[K])\nelse:\n ind = [i for i, x in enumerate(B) if x == b]\n\n K = K - ind[0]\n mod = K % (ind[1] - ind[0])\n\n print(B[ind[0] + mod - 1])\n","fail":"import sys\n\nreadline = sys.stdin.buffer.readline\n\n\ndef solver(N, K, A):\n i = 0\n i_list = [0]\n reached = [False for _ in range(N)]\n\n while True:\n next_i = A[i]\n\n if reached[next_i]:\n break\n\n reached[next_i] = True\n\n i_list.append(next_i)\n i = next_i\n\n m = i_list.index(next_i)\n\n if m >= K:\n return i_list[K] + 1\n\n le = len(i_list) - m\n K -= m\n ind = K % le\n\n return i_list[m + ind] + 1\n\n\ndef run():\n N, K = map(int, readline().split())\n A = list(map(int, readline().split()))\n A = [a - 1 for a in A]\n\n ans = solver(N, K, A)\n print(ans)\n\n\nrun()\n","change":"replace","i1":0,"i2":23,"j1":0,"j2":43,"error":"0","stderr":null,"stdout":"4\n"} {"problem_id":"p02684","language":"Python","original_status":"Runtime Error","pass":"n, k = map(int, input().split())\na = list(map(int, input().split()))\nrec = [0]\ni = 0\nflag = [0 for _ in range(n + 1)]\nwhile True:\n if flag[rec[i]] == 0:\n flag[rec[i]] = 1\n rec.append(a[rec[i]] - 1)\n else:\n start = rec.index(a[rec[i]] - 1)\n loop = rec[start:]\n pre = rec[:start]\n break\n i += 1\ncount = (k - len(pre)) % len(loop)\nif k < len(pre):\n print(loop[k])\nelse:\n print(loop[count] + 1)\n","fail":"n, k = map(int, input().split())\na = list(map(int, input().split()))\nrec = [0]\ni = 0\nflag = [0 for _ in range(n + 1)]\nwhile True:\n if flag[rec[i]] == 0:\n flag[rec[i]] = 1\n rec.append(a[rec[i]] - 1)\n else:\n start = rec.index(a[rec[i]] - 1)\n loop = rec[start:]\n pre = rec[:start]\n break\n i += 1\ncount = (k - len(pre)) % len(loop)\nif k <= len(pre):\n print(pre[k] + 1)\nelse:\n print(loop[count] + 1)\n","change":"replace","i1":16,"i2":18,"j1":16,"j2":18,"error":"0","stderr":null,"stdout":"4\n"} {"problem_id":"p02685","language":"Python","original_status":"Runtime Error","pass":"n, m, k = [int(t) for t in open(0).read().split()]\nmod = 998244353\n\n\ndef solve(n):\n if n <= k + 1:\n return pow(m, n, mod)\n elif n == k + 2:\n return (pow(m, n, mod) + mod - m) % mod\n else:\n return (m * solve(n - 1) - (m - 1) * solve(n - k - 2)) % mod\n\n\nprint(solve(n))\n","fail":"n, m, k = [int(t) for t in open(0).read().split()]\nmod = 998244353\nmem = [0] * max(k + 3, n + 1)\nfor i in range(k + 2):\n mem[i] = pow(m, i, mod)\nc = 1\nfor i in range(k + 2, n + 1):\n mem[i] = (m * mem[i - 1] - m * c * pow(m - 1, i - k - 2, mod)) % mod\n c = (c * (i - 1) * pow(i - k - 1, -1, mod)) % mod\nprint(mem[n])\n","change":"replace","i1":2,"i2":14,"j1":2,"j2":10,"error":"0","stderr":null,"stdout":"6\n"} {"problem_id":"p02685","language":"Python","original_status":"Time Limit Exceeded","pass":"def cmb(n, r, p):\n return (fac[n] * pow(fac[r], p - 2, p) * pow(fac[n - r], p - 2, p)) % p\n\n\np = 998244353\nN, M, K = map(int, input().split())\nfac = [1] * (N + 1)\nfor i in range(1, N + 1):\n fac[i] = (fac[i - 1] * i) % p\n\nans = 0\nfor k in range(K + 1):\n ans += M * pow(M - 1, N - k - 1, p) * cmb(N - 1, k, p)\n ans %= p\nprint(ans)\n","fail":"p = 998244353\nN, M, K = map(int, input().split())\n\nans = 0\ncmb = 1\nfor k in range(K + 1):\n ans += M * pow(M - 1, N - k - 1, p) * cmb\n ans %= p\n cmb *= (N - 1 - k) * pow(k + 1, p - 2, p)\n cmb %= p\nprint(ans)\n","change":"replace","i1":0,"i2":14,"j1":0,"j2":10,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02687","language":"Python","original_status":"Runtime Error","pass":"ABC = input(\"The element of S: \")\nARC = input(\"The element of S: \")\nif ABC == \"S\":\n print(\"ABC\")\nif ARC == \"S\":\n print(\"ARC\")\n","fail":"s = input()\nif s == \"ABC\":\n print(\"ARC\")\nif s == \"ARC\":\n print(\"ABC\")\n","change":"replace","i1":0,"i2":6,"j1":0,"j2":5,"error":"EOFError: EOF when reading a line","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02687\/Python\/s038660380.py\", line 2, in \n ARC = input(\"The element of S: \")\nEOFError: EOF when reading a line\n","stdout":"The element of S: The element of S: "} {"problem_id":"p02689","language":"Python","original_status":"Runtime Error","pass":"N, M = map(int, input().split())\nH = list(map(int, input().split()))\nA = [0] * N\nB = [0] * N\nfor i in range(M):\n A[i], B[i] = map(int, input().split())\n\nans = 0\nfor i in range(N):\n count = 0\n good = 0\n for j in range(M):\n if A[j] == i + 1:\n count += 1\n if H[B[j] - 1] < H[i]:\n good += 1\n if B[j] == i + 1:\n count += 1\n if H[A[j] - 1] < H[i]:\n good += 1\n if count == good:\n ans += 1\n\nprint(ans)\n","fail":"#!\/usr\/bin\/env python3\nimport sys\n\n\ndef input():\n return sys.stdin.readline()[:-1]\n\n\ndef main():\n N, M = map(int, input().split())\n H = list(map(int, input().split()))\n A = [0] * M\n B = [0] * M\n for i in range(M):\n A[i], B[i] = map(int, input().split())\n\n l = [1] * N\n for i in range(M):\n if H[A[i] - 1] < H[B[i] - 1]:\n l[A[i] - 1] -= 1\n elif H[A[i] - 1] > H[B[i] - 1]:\n l[B[i] - 1] -= 1\n else:\n l[A[i] - 1] -= 1\n l[B[i] - 1] -= 1\n print(l.count(1))\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":0,"i2":24,"j1":0,"j2":30,"error":"0","stderr":null,"stdout":"2\n"} {"problem_id":"p02689","language":"Python","original_status":"Time Limit Exceeded","pass":"n, m = map(int, input().split())\nli_h = list(map(int, input().split()))\nli_route = list()\nremove_idx_set = set()\n\nfor _ in range(m):\n a, b = map(int, input().split())\n\n h_a = li_h[a - 1]\n h_b = li_h[b - 1]\n\n if h_a <= h_b:\n if h_a in li_h:\n remove_idx_set.add(a - 1)\n if h_a >= h_b:\n if h_b in li_h:\n remove_idx_set.add(b - 1)\nfor s in remove_idx_set:\n li_h[s] = 0\nprint(len([v for v in li_h if v != 0]))\n","fail":"n, m = map(int, input().split())\nli_h = list(map(int, input().split()))\nli_route = list()\nremove_idx_set = set()\n\nfor _ in range(m):\n a, b = map(int, input().split())\n\n h_a = li_h[a - 1]\n h_b = li_h[b - 1]\n\n if h_a <= h_b:\n remove_idx_set.add(a - 1)\n if h_a >= h_b:\n remove_idx_set.add(b - 1)\nfor s in remove_idx_set:\n li_h[s] = 0\nprint(len([v for v in li_h if v != 0]))\n","change":"replace","i1":12,"i2":17,"j1":12,"j2":15,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02689","language":"Python","original_status":"Time Limit Exceeded","pass":"N, M = map(int, input().split())\nH_i = list(map(int, input().split()))\nU = [list(map(int, input().split())) for i in range(M)]\n\nhigh_max = []\nans = 0\n\nfor i in range(N):\n Highes = []\n for j in range(M):\n if U[j][0] == i + 1:\n Highes.append(H_i[U[j][1] - 1])\n if U[j][1] == i + 1:\n Highes.append(H_i[U[j][0] - 1])\n\n if Highes == []:\n high_max.append(0)\n else:\n high_max.append(max(Highes))\n\nfor i in range(N):\n if H_i[i] > high_max[i]:\n ans += 1\n\nprint(ans)\n","fail":"N, M = map(int, input().split())\nH = list(map(int, input().split()))\n\ngood = [True] * N\n\nfor _ in range(M):\n A, B = map(int, input().split())\n A -= 1\n B -= 1\n if H[A] >= H[B]:\n good[B] = False\n if H[A] <= H[B]:\n good[A] = False\nprint(sum(good))\n","change":"replace","i1":1,"i2":25,"j1":1,"j2":14,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02689","language":"Python","original_status":"Time Limit Exceeded","pass":"#!\/usr\/bin\/env python3\nN, M = [int(str) for str in input().strip().split()]\nH = [int(str) for str in input().strip().split()]\nAB = [[int(str) - 1 for str in input().strip().split()] for _ in range(M)]\n\n\ndef solve():\n G = [[False] * N for _ in range(N)]\n for a, b in AB:\n G[a][b] = True\n G[b][a] = True\n\n ans = 0\n visited = [False] * N\n for start in range(N):\n if visited[start]:\n continue\n nexts = [i for i in range(N) if G[start][i]]\n if all([H[start] > H[next] for next in nexts]):\n ans += 1\n for next in nexts:\n visited[next] = True\n\n print(ans)\n\n\nsolve()\n","fail":"#!\/usr\/bin\/env python3\nN, M = [int(str) for str in input().strip().split()]\nH = [int(str) for str in input().strip().split()]\nAB = [[int(str) - 1 for str in input().strip().split()] for _ in range(M)]\n\n\ndef solve():\n G = [0] * N\n for a, b in AB:\n G[a] = max(G[a], H[b])\n G[b] = max(G[b], H[a])\n\n ans = 0\n for i in range(N):\n if H[i] > G[i]:\n ans += 1\n\n print(ans)\n\n\nsolve()\n","change":"replace","i1":7,"i2":22,"j1":7,"j2":16,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02689","language":"Python","original_status":"Time Limit Exceeded","pass":"n, m = map(int, input().split())\nh = list(map(int, input().split()))\nab = [tuple(map(int, input().split())) for _ in range(m)]\ndic = {}\nban = {}\nfor i in range(m):\n a = ab[i][0]\n b = ab[i][1]\n if h[a - 1] < h[b - 1]:\n ban[a] = True\n elif h[a - 1] == h[b - 1]:\n ban[a] = True\n ban[b] = True\n else:\n ban[b] = True\n\n if dic.get(a):\n dic[a].append(b)\n else:\n dic[a] = [b]\n\n if dic.get(b):\n dic[b].append(a)\n else:\n dic[b] = [a]\n dic[a] = list(set(dic[a]))\n dic[b] = list(set(dic[b]))\nans = 0\nfor i in range(n):\n if dic.get(i + 1):\n if ban.get(i + 1):\n if ban[i + 1]:\n continue\n flg = True\n for j in range(len(dic[i + 1])):\n if h[i] <= h[dic[i + 1][j] - 1]:\n flg = False\n break\n if flg:\n ans += 1\n else:\n ans += 1\nprint(ans)\n","fail":"n, m = map(int, input().split())\nh = list(map(int, input().split()))\nab = [tuple(map(int, input().split())) for _ in range(m)]\ndic = {}\nban = {}\nfor i in range(m):\n a = ab[i][0]\n b = ab[i][1]\n\n if dic.get(a):\n dic[a] = max(dic[a], h[b - 1])\n else:\n dic[a] = h[b - 1]\n\n if dic.get(b):\n dic[b] = max(dic[b], h[a - 1])\n else:\n dic[b] = h[a - 1]\nans = 0\nfor i in range(n):\n if dic.get(i + 1):\n if dic[i + 1] < h[i]:\n ans += 1\n else:\n ans += 1\nprint(ans)\n","change":"replace","i1":8,"i2":39,"j1":8,"j2":22,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02690","language":"Python","original_status":"Runtime Error","pass":"from itertools import product\n\nx = int(input())\nnum = [i**5 for i in range(-1000, 1000)]\n\nfor a, b in product(num, repeat=2):\n if a - b == x:\n print(int(a**0.2), int(b**0.2))\n break\n","fail":"from itertools import combinations\n\nx = int(input())\nnum = [i**5 for i in range(1000)]\n\nfor a, b in combinations(num, 2):\n if a - b == x:\n print(int(a**0.2), int(b**0.2))\n elif a + b == x:\n print(int(a**0.2), -int(b**0.2))\n elif b - a == x:\n print(int(b**0.2), int(a**0.2))\n else:\n continue\n break\n","change":"replace","i1":0,"i2":9,"j1":0,"j2":15,"error":"TypeError: int() argument must be a string, a bytes-like object or a real number, not 'complex'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02690\/Python\/s068916445.py\", line 8, in \n print(int(a**0.2), int(b**0.2))\nTypeError: int() argument must be a string, a bytes-like object or a real number, not 'complex'\n","stdout":null} {"problem_id":"p02690","language":"Python","original_status":"Time Limit Exceeded","pass":"x = int(input())\n\nfor a in range(9999):\n for b in range(9999):\n if a**5 - b**5 == x:\n print(a, b)\n exit()\n","fail":"x = int(input())\n\nl5 = [i**5 for i in range(0, 10000)]\nfor a5 in l5:\n for b5 in l5:\n if x == a5 - b5:\n print(int(a5 ** (1 \/ 5)), int(b5 ** (1 \/ 5)))\n exit()\n elif x == a5 + b5:\n print(int(a5 ** (1 \/ 5)), int((-1) * b5 ** (1 \/ 5)))\n exit()\n","change":"replace","i1":2,"i2":7,"j1":2,"j2":11,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02690","language":"Python","original_status":"Runtime Error","pass":"x = int(input())\nfor i in range(x \/\/ 2 + 1):\n if pow(x - pow(i, 5), 1 \/ 5).is_integer():\n print(i, int(-pow(x - pow(i, 5), 1 \/ 5)))\n exit()\n","fail":"import numpy as np\n\n\ndef main():\n x = int(input())\n A = np.arange(-120, 120)\n a = A**5\n for i, a_1 in enumerate(a):\n for j, a_2 in enumerate(a):\n if a_1 - a_2 == x:\n print(A[i], A[j])\n return\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":0,"i2":5,"j1":0,"j2":16,"error":"WA","stderr":null,"stdout":"1 -2\n"} {"problem_id":"p02690","language":"Python","original_status":"Runtime Error","pass":"x = int(input())\n\n\ni = 0\n\nwhile i**5 < x:\n i += 1\nfor k in range(i):\n for j in range(-i, i + 1):\n if k**5 - j**5 == x:\n a, b = k, j\nprint(a, b)\n","fail":"x = int(input())\n\n\ni = 0\na, b = 0, 0\nwhile i**5 < x:\n i += 1\nmx = i\nfor k in range(2 * (mx + 1)):\n for j in range(-k, k + 1):\n if k**5 - j**5 == x:\n a, b = k, j\nprint(a, b)\n","change":"replace","i1":4,"i2":9,"j1":4,"j2":10,"error":"0","stderr":null,"stdout":"2 -1\n"} {"problem_id":"p02690","language":"Python","original_status":"Runtime Error","pass":"# \u66b4\u529b\u5373\u53ef\n# \u7bc4\u56f2\u6307\u5b9a A=100 B=-100\u306720000000000\u3068\u304b\u306b\u306a\u308b\u3057\u3069\u3063\u3061\u3082|100|\u7a0b\u5ea6\u3067\u3044\u3044\u306e\u3067\u306f\u306a\u3044\u304b\nx = int(input())\nfor a in range(-100, 101):\n for b in range(-100, 101):\n if a**5 - b**5 == x:\n print(a, b)\n exit()\nprint(3 \/ 0) # \u306f\u3044\n","fail":"# \u66b4\u529b\u5373\u53ef\n# \u7bc4\u56f2\u6307\u5b9a A=100 B=-100\u306720000000000\u3068\u304b\u306b\u306a\u308b\u3057\u3069\u3063\u3061\u3082|100|\u7a0b\u5ea6\u3067\u3044\u3044\u306e\u3067\u306f\u306a\u3044\u304b\n# \u306a\u3093\u304b\u8db3\u308a\u3093\u307f\u305f\u3044\uff08\u306a\u3093\u3067\uff1f\uff09\u306a\u306e\u30674X^2<=10^9\u306a\u308b\u6700\u5927\u306eX\u3092\u6c42\u3081\u3088\u3046\n# 2X = 1000\u3061\u3087\u3044 \u3060\u304b\u3089500\u304f\u3089\u3044\u3042\u308c\u3070\u3044\u3044\u306e\u304b\n# 1000^2\u306a\u306e\u3067\u6642\u9593\u7684\u306b\u306f\u9593\u306b\u5408\u3044\u305d\u3046\nx = int(input())\nfor a in range(-500, 501):\n for b in range(-500, 501):\n if a**5 - b**5 == x:\n print(a, b)\n exit()\nprint(3 \/ 0) # \u306f\u3044\n","change":"replace","i1":2,"i2":5,"j1":2,"j2":8,"error":"WA","stderr":null,"stdout":"1 -2\n"} {"problem_id":"p02690","language":"Python","original_status":"Runtime Error","pass":"x = int(input())\ndet = 1001001001\nfor i in range(1000000):\n if abs(i**5 - x) < abs(det):\n det = i**5 - x\n a = i\n else:\n break\n\nif det < 0:\n for i in range(-1, -1000000, -1):\n if i**5 == det:\n b = i\n break\nelif det == 0:\n b = 0\nelse:\n for i in range(1000000):\n if i**5 == det:\n b = i\n break\n\n\nprint(a, b)\n","fail":"x = int(input())\n\nfor i in range(1000):\n for j in range(1000):\n if i**5 - j**5 == x:\n print(i, j)\n exit()\n elif i**5 - (-j) ** 5 == x:\n print(i, -j)\n exit()\n","change":"replace","i1":1,"i2":24,"j1":1,"j2":10,"error":"0","stderr":null,"stdout":"2 -1\n"} {"problem_id":"p02690","language":"Python","original_status":"Time Limit Exceeded","pass":"def get_divisor(n: int) -> list:\n divisor = []\n for i in range(1, n + 1):\n if i * i > n:\n break\n if n % i == 0:\n divisor.append(i)\n if n \/\/ i != i:\n divisor.append(n \/\/ i)\n # divisor.sort() # if you want sorted divisors\n return divisor\n\n\nx = int(input())\ncand = get_divisor(x)\n# print(cand)\nfor d in cand:\n a = d\n b = 0\n while a**5 - b**5 < x:\n a += 1\n b += 1\n if a**5 - b**5 == x:\n print(a, b)\n break\n\n is_found = False\n for i in range(1, d):\n a = i\n b = i - d\n if a**5 - b**5 == x:\n print(a, b)\n is_found = True\n break\n if is_found:\n break\n\n a = 0\n b = -d\n while a**5 - b**5 < x:\n a -= 1\n b -= 1\n if a**5 - b**5 == x:\n print(a, b)\n break\n","fail":"def get_divisor(n: int) -> list:\n divisor = []\n for i in range(1, n + 1):\n if i * i > n:\n break\n if n % i == 0:\n divisor.append(i)\n if n \/\/ i != i:\n divisor.append(n \/\/ i)\n # divisor.sort() # if you want sorted divisors\n return divisor\n\n\nx = int(input())\ncand = get_divisor(x)\n# print(cand)\nfor d in cand:\n if d**5 == x:\n print(d, 0)\n elif d**5 < x:\n a = d\n b = 0\n while a**5 - b**5 < x:\n a += 1\n b += 1\n if a**5 - b**5 == x:\n print(a, b)\n break\n\n a = 0\n b = -d\n while a**5 - b**5 < x:\n a -= 1\n b -= 1\n if a**5 - b**5 == x:\n print(a, b)\n break\n else:\n if d % 2 == 0 and (d \/\/ 2) ** 5 + (d \/\/ 2) ** 5 > x:\n continue\n if d % 2 == 1 and ((d + 1) \/\/ 2) ** 5 + (d \/\/ 2) ** 5 > x:\n continue\n a = d\n b = 0\n while a**5 - b**5 > x:\n a -= 1\n b -= 1\n # print(a, b, a**5 - b**5)\n if a**5 - b**5 == x:\n print(a, b)\n break\n\n a = 0\n b = -d\n while a**5 - b**5 > x:\n a += 1\n b += 1\n if a**5 - b**5 == x:\n print(a, b)\n break\n","change":"replace","i1":17,"i2":45,"j1":17,"j2":60,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02690","language":"Python","original_status":"Runtime Error","pass":"X = int(input())\n\ngo = [i**5 for i in range(1000)]\n\n\ndef foo():\n for i in range(1000):\n for j in range(i, 1000):\n if go[i] - go[j] == X:\n return i, j\n for j in range(1000):\n if go[i] + go[j] == X:\n return i, -j\n\n\nA, B = foo()\nprint(A, B)\n","fail":"X = int(input())\n\nR = 3000\ngo = [i**5 for i in range(R)]\n\n\ndef foo():\n for i in range(R):\n for j in range(R):\n if go[i] - go[j] == X:\n return i, j\n for j in range(i, R):\n if go[i] + go[j] == X:\n return i, -j\n\n return 0, 0\n\n\nA, B = foo()\nprint(A, B)\n","change":"replace","i1":2,"i2":13,"j1":2,"j2":16,"error":"WA","stderr":null,"stdout":"1 -2\n"} {"problem_id":"p02690","language":"Python","original_status":"Time Limit Exceeded","pass":"X = int(input())\na, b = 0, -24\nwhile a**5 - b**5 != X:\n a += 1\n b = -24\n while a**5 - b**5 != X:\n b += 1\nprint(a, b)\n","fail":"def f(X):\n for i in range(1, 120):\n for j in range(-63, 119):\n if i**5 - j**5 == X:\n return i, j\n\n\nX = int(input())\nprint(*f(X))\n","change":"replace","i1":0,"i2":8,"j1":0,"j2":9,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02690","language":"Python","original_status":"Time Limit Exceeded","pass":"x = int(input())\na = int(x**0.2)\nb = 0\nwhile a**5 - b**5 != x:\n b -= 1\nprint(a, b)\n","fail":"x = int(input())\nfor a in range(-1000, 1000):\n for b in range(-1000, 1000):\n if a**5 - b**5 == x:\n print(a, b)\n quit()\n","change":"replace","i1":1,"i2":6,"j1":1,"j2":6,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02690","language":"Python","original_status":"Runtime Error","pass":"X = int(input())\n\nnumbers = dict()\n\nfor i in range(-101, 101):\n numbers.setdefault(i, i**5)\n\n\nfor i in range(-101, 101):\n for j in range(-101, 101):\n if numbers[i] - numbers[j] == X:\n output = [i, j]\n break\nprint(output[0], output[1])\n","fail":"X = int(input())\n\nnumbers = dict()\n\nfor i in range(-200, 200):\n numbers.setdefault(i, i**5)\n\nfor i in range(-200, 200):\n for j in range(-200, 200):\n if numbers[i] - numbers[j] == X:\n output = [i, j]\n break\n\nprint(output[0], output[1])\n","change":"replace","i1":4,"i2":13,"j1":4,"j2":13,"error":"0","stderr":null,"stdout":"2 -1\n"} {"problem_id":"p02690","language":"Python","original_status":"Time Limit Exceeded","pass":"X = int(input())\n\nfor a in range(0, 10**9):\n a *= a\n bb = X + a**5\n B = bb**0.2\n\n if isinstance(B, float):\n if B.is_integer():\n print(int(B), a)\n break\n\n a *= -1\n bb = X + a**5\n B = bb**0.2\n if isinstance(B, float):\n if B.is_integer():\n print(int(B), a)\n break\n","fail":"def f(B):\n if isinstance(B, float):\n if abs(B - int(B)) < 10**-6:\n return True\n else:\n return False\n return False\n\n\nX = int(input())\n\nfor a in range(0, 10**5):\n bb = X + a**5\n B = bb**0.2\n if f(B):\n print(int(B), a)\n break\n\n a *= -1\n bb = X + a**5\n B = bb**0.2\n if f(B):\n print(int(B), a)\n break\n","change":"replace","i1":0,"i2":19,"j1":0,"j2":24,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02691","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\nA = list(map(int, input().split()))\nA_i = {}\nA_j = {}\nfor i, a in enumerate(A):\n A_i[i] = a + i\n A_j[i] = i - a\n\nr = 0\nfor i in range(n):\n for j in range(i + 1, n):\n if A_i[i] == A_j[j]:\n r += 1\n\nprint(r)\n","fail":"n = int(input())\nA = list(map(int, input().split()))\nA_j = {}\nfor i, a in enumerate(A):\n if A_j.get(i - a):\n A_j[i - a] += 1\n else:\n A_j[i - a] = 1\n\nr = 0\nfor i, a in enumerate(A):\n t = A_j.get(a + i)\n if t:\n r += t\n\nprint(r)\n","change":"replace","i1":2,"i2":13,"j1":2,"j2":14,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02691","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = list(map(int, input().split()))\ndiff_i = [A[i] + i + 1 for i in range(N)]\ndiff_j = [i + 1 - A[i] for i in range(N)]\ndiff = set(diff_i) & set(diff_j)\nans = 0\nfor d in diff:\n ans += diff_i.count(d) * diff_j.count(d)\nprint(ans)\n","fail":"N = int(input())\nA = list(map(int, input().split()))\n\ncnt1 = {}\ncnt2 = {}\n\nfor i in range(N):\n tmp1 = A[i] + i + 1\n tmp2 = i + 1 - A[i]\n if tmp1 not in cnt1:\n cnt1[tmp1] = 1\n else:\n cnt1[tmp1] += 1\n if tmp2 not in cnt2:\n cnt2[tmp2] = 1\n else:\n cnt2[tmp2] += 1\n\ndiff = set(list(cnt1.keys())) & set(list(cnt2.keys()))\n\nans = 0\nfor d in diff:\n ans += cnt1[d] * cnt2[d]\nprint(ans)\n","change":"replace","i1":2,"i2":8,"j1":2,"j2":23,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02691","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = list(map(int, input().split()))\n\n# i < j\n# j - i = a[i] + a[j]\n# a[i] + i = j - a[j]\n\ncount = 0\ncandidate = []\nfor i in range(n):\n sa = i - a[i]\n count += candidate.count(sa)\n wa = i + a[i]\n candidate.append(wa)\n\nprint(count)\n","fail":"from collections import defaultdict\n\nn = int(input())\na = list(map(int, input().split()))\n\nd = defaultdict(int)\nans = 0\nfor i in range(n):\n ans += d[i - a[i]]\n d[a[i] + i] += 1\n\nprint(ans)\n","change":"replace","i1":0,"i2":16,"j1":0,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02691","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\ntmp_A = list(map(int, input().split()))\nA = [0] + tmp_A\n\ntmp_A = sorted(tmp_A)\nmin_h = sum(tmp_A[0:2])\nmax_h = sum(tmp_A[-2:])\n\nans = 0\nfor n in range(1, N + 1):\n now_h = A[n]\n min_i = max(n + 1, min(min_h, N))\n max_i = min(max_h + n + 1, N + 1)\n for i in range(min_i, max_i):\n if A[n] + A[i] is abs(n - i):\n ans += 1\n\nprint(ans)\n","fail":"from collections import defaultdict\n\nN = int(input())\nA = [0] + list(map(int, input().split()))\nd = defaultdict(int)\n\nans = 0\nfor i in range(1, N + 1):\n d[A[i] + i] += 1 # Ai + i\u3092\u6570\u3048\u308b\n ans += d[i - A[i]]\n\nprint(ans)\n","change":"replace","i1":0,"i2":16,"j1":0,"j2":10,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02691","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = [int(x) for x in input().split()]\nc = 0\nfor i in range(n):\n for j in range(i - 1):\n if i - j == a[i] + a[j]:\n c += 1\nprint(c)\n","fail":"n = int(input())\nl = {}\nr = {}\nxc = 0\nfor x in input().split():\n xi = int(x)\n lx = xc + xi\n if lx in l:\n l[lx] += 1\n else:\n l[lx] = 1\n rx = xc - xi\n if rx in r:\n r[rx] += 1\n else:\n r[rx] = 1\n xc += 1\nc = 0\nfor x in l:\n if x in r:\n c += l[x] * r[x]\nprint(c)\n","change":"replace","i1":1,"i2":7,"j1":1,"j2":21,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02691","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = list(map(int, input().split()))\n\ncnt = 0\nfor i in range(n - 1):\n for j in range(i + a[i], n):\n if j - i == a[i] + a[j]:\n cnt += 1\nprint(cnt)\n","fail":"from collections import Counter\n\n\nn = int(input())\na = list(map(int, input().split()))\n\na_plus_idx = Counter([a[i] + i for i in range(n)])\na_minus_idx = Counter([i - a[i] for i in range(n)])\n\ntotal = 0\nfor k, v in a_plus_idx.items():\n total += v * a_minus_idx[k]\n\nprint(total)\n","change":"replace","i1":0,"i2":9,"j1":0,"j2":14,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02691","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = list(map(int, input().split()))\n\nresult = 0\nfor i in range(N):\n a = A[i]\n b = a + i\n for j in range(1, N - a - i):\n if j == A[j + b]:\n result += 1\nprint(result)\n","fail":"N = int(input())\nA = list(map(int, input().split()))\n\nc1 = {}\nc2 = {}\n\nfor i in range(N):\n c1.setdefault(i + A[i], 0)\n c1[i + A[i]] += 1\n c2.setdefault(i - A[i], 0)\n c2[i - A[i]] += 1\n\nresult = 0\nfor k in set(c1).intersection(c2):\n result += c1[k] * c2[k]\nprint(result)\n","change":"replace","i1":3,"i2":10,"j1":3,"j2":15,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02691","language":"Python","original_status":"Runtime Error","pass":"def main():\n n = int(input())\n a = list(map(int, input().split()))\n d = [0] * n\n ans = 0\n for i in range(n):\n ai = a[i]\n l, r = i + ai, i - ai\n if 0 <= l < n:\n d[l] += 1\n if 0 <= r < n:\n ans += d[r]\n print(d)\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"def main():\n n = int(input())\n a = list(map(int, input().split()))\n d = [0] * n\n ans = 0\n for i in range(n):\n ai = a[i]\n l, r = i + ai, i - ai\n if 0 <= l < n:\n d[l] += 1\n if 0 <= r < n:\n ans += d[r]\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"delete","i1":12,"i2":13,"j1":12,"j2":12,"error":"WA","stderr":null,"stdout":"[0, 0, 1, 0, 0, 0]\n[0, 0, 1, 0, 1, 0]\n[0, 0, 1, 0, 1, 1]\n[0, 0, 1, 0, 2, 1]\n[0, 0, 1, 0, 2, 1]\n[0, 0, 1, 0, 2, 1]\n3\n"} {"problem_id":"p02691","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = list(map(int, input().split()))\ncount = 0\nl_array = []\nr_array = []\nfor i, X in enumerate(A):\n l_array.append(i + X)\n r_array.append(i - X)\n\nfor x in l_array:\n count += r_array.count(x)\nprint(count)\n","fail":"from collections import Counter\n\nN = int(input())\nA = list(map(int, input().split()))\ncount = 0\nl_array = []\nr_array = []\nfor i, X in enumerate(A):\n l_array.append(i + X)\n r_array.append(i - X)\n\ncounter = Counter(r_array)\n\nfor x in l_array:\n count += counter.get(x, 0)\nprint(count)\n","change":"replace","i1":0,"i2":11,"j1":0,"j2":15,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02691","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = list(map(int, input().split()))\nans = 0\nfor i in range(N):\n a = A[i]\n for j in range(min(A[i] + i, N), N):\n if a + A[j] == j - i:\n ans += 1\n\nprint(ans)\n","fail":"N = int(input())\nA = list(map(int, input().split()))\nans = 0\n\nd = {}\n\nfor i, a in enumerate(A):\n tmp = i + 1 - a\n if tmp in d.keys():\n d[tmp] += 1\n else:\n d[tmp] = 1\n\n# print(d)\n\nfor i, a in enumerate(A):\n tmp = a + i + 1\n tmptmp = i + 1 - a\n if tmp in d.keys():\n ans += d[tmp]\n if tmptmp in d.keys():\n d[tmptmp] = max(0, d[tmptmp] - 1)\n\nprint(ans)\n","change":"replace","i1":3,"i2":8,"j1":3,"j2":22,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02691","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input().strip())\na = list(map(int, input().split()))\nleft = {}\nfor i in range(len(a)):\n if left.get(a[i] + i):\n left[a[i] + i].append(i)\n else:\n left[a[i] + i] = [i]\nans = 0\nfor i in range(len(a)):\n if left.get(i - a[i]):\n ans += len(list(filter(lambda x: x < i, left[i - a[i]])))\nprint(ans)\n","fail":"n = int(input().strip())\na = list(map(int, input().split()))\ndic = {}\nans = 0\nfor i in range(len(a)):\n if dic.get(i - a[i]):\n ans += dic[i - a[i]]\n if dic.get(a[i] + i):\n dic[a[i] + i] += 1\n else:\n dic[a[i] + i] = 1\nprint(ans)\n","change":"replace","i1":2,"i2":12,"j1":2,"j2":11,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02691","language":"Python","original_status":"Time Limit Exceeded","pass":"# -*- coding: utf-8 -*-\n# \u6574\u6570\u306e\u5165\u529b\nn = int(input())\nh_list = input().split()\nh_list = [int(h) for h in h_list]\n\ncount = 0\n\nfor i in range(n):\n a_height = h_list[i]\n n_aa = i + a_height + 1000000000 + 1\n if n_aa > n:\n n_aa = n\n for k in range(i + 1 + a_height, n_aa):\n b_height = h_list[k]\n if k - i == a_height + b_height:\n count += 1\n\nprint(count)\n","fail":"# -*- coding: utf-8 -*-\n# \u6574\u6570\u306e\u5165\u529b\nn = int(input())\nh_list = input().split()\nh_list = [int(h) for h in h_list]\n\ncount = 0\nresult_dict = {}\n\nfor i in range(n):\n key = (i + 1) + h_list[i]\n value = result_dict.get(key, 0)\n result_dict[key] = value + 1\n\nfor j in range(n):\n key = (j + 1) - h_list[j]\n count += result_dict.get(key, 0)\n\nprint(count)\n","change":"replace","i1":7,"i2":17,"j1":7,"j2":17,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02691","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\nA = list(map(int, input().split()))\nans = 0\nfor i in range(n - 1):\n for j in range(i + 1, n):\n if j - i == A[i] + A[j]:\n ans += 1\nprint(ans)\n","fail":"n = int(input())\nA = [int(x) for x in input().split()]\nbackward = [0] * n\nforward = [0] * n\nfor i, a in enumerate(A):\n if i + a < n:\n forward[i + a] += 1\n if i - a >= 0:\n backward[i - a] += 1\nans = 0\nfor x, y in zip(forward, backward):\n ans += x * y\nprint(ans)\n","change":"replace","i1":1,"i2":7,"j1":1,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02691","language":"Python","original_status":"Time Limit Exceeded","pass":"import sys\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef main():\n N = int(input())\n A = list(map(int, input().split()))\n answer = 0\n for i in range(N):\n for j in range(i + A[i] + 1, N):\n if A[i] + A[j] == j - i:\n answer += 1\n print(answer)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"import sys\nfrom collections import defaultdict\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef main():\n N = int(input())\n A = list(map(int, input().split()))\n L = defaultdict(list)\n R = defaultdict(list)\n for i in range(N):\n L[A[i] + i].append(i)\n R[i - A[i]].append(i)\n K = list(L.keys())\n\n answer = 0\n for k in K:\n l = len(L[k])\n r = len(R[k])\n answer += l * r\n print(answer)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":1,"i2":15,"j1":1,"j2":23,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02691","language":"Python","original_status":"Time Limit Exceeded","pass":"import numpy as np\n\nN = int(input())\nA = np.array(input().split(), np.int32)\nS = np.array([A[i] - i for i in range(N)])\nT = np.array([-A[i] - i for i in range(N)])\n# j > i\n# S[j] == T[i]\nans = 0\nfor j in range(N):\n for i in range(j - 1, -1, -1):\n if S[j] == T[i]:\n ans += 1\nprint(ans)\n","fail":"from _collections import defaultdict\nimport sys\n\nread = sys.stdin.buffer.read\nN = int(input())\nA = [int(i) for i in input().split()]\nD = defaultdict(int)\n\nfor i, a in enumerate(A, 1):\n D[i - a] += 1\n\nans = 0\nfor i, a in enumerate(A, 1):\n ans += D[i + a]\nprint(ans)\n","change":"replace","i1":0,"i2":13,"j1":0,"j2":14,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02691","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = list(map(int, input().split()))\n\nli = []\nfor i in range(N):\n li.append(A[i] + i)\n\nli.sort()\n\ncnt = 0\nfor j in range(N):\n cnt += li.count(j - A[j])\n\nprint(cnt)\n","fail":"from bisect import bisect_left, bisect_right\n\nN = int(input())\nA = list(map(int, input().split()))\n\nli = []\nfor i in range(N):\n li.append(A[i] + i)\n\nli.sort()\n\ncnt = 0\nfor j in range(N):\n target = j - A[j]\n cnt += bisect_right(li, target) - bisect_left(li, target)\n\nprint(cnt)\n","change":"replace","i1":0,"i2":12,"j1":0,"j2":15,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02691","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = list(map(int, input().split()))\n\nans = 0\nfor i in range(n - 1):\n for j in range(i + 1, n):\n if j - i == a[i] + a[j]:\n ans += 1\nprint(ans)\n","fail":"n = int(input())\na = list(map(int, input().split()))\n\nans = 0\ndic1 = {}\ndic2 = {}\nfor i in range(n):\n tmp1 = a[i] + (i + 1)\n tmp2 = -a[i] + (i + 1)\n if tmp1 in dic1:\n dic1[tmp1] += 1\n else:\n dic1[tmp1] = 1\n if tmp2 in dic2:\n dic2[tmp2] += 1\n else:\n dic2[tmp2] = 1\nfor key in dic1.keys():\n if key in dic2:\n ans += dic1[key] * dic2[key]\nprint(ans)\n","change":"replace","i1":4,"i2":8,"j1":4,"j2":20,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02691","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\nheight = list(map(int, input().split()))\nans = 0\nfor i in range(n - 1):\n for j in range(i + 1 + height[i], n):\n if abs(j - i) == (height[i] + height[j]):\n ans += 1\nprint(ans)\n","fail":"from collections import defaultdict\n\nn = int(input())\nheight = list(map(int, input().split()))\nadd_set = defaultdict(int)\nans = 0\nfor i in range(n):\n add_set[i + height[i] + 1] += 1\n if i + 1 - height[i] in add_set:\n ans += add_set[i + 1 - height[i]]\n\nprint(ans)\n","change":"replace","i1":0,"i2":7,"j1":0,"j2":11,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02691","language":"Python","original_status":"Time Limit Exceeded","pass":"from collections import Counter\n\n\nN = int(input())\nA = list(map(int, input().split()))\n\nR = [None] * (N + 1)\nR[N] = Counter()\nL = [None] * (N + 1)\nL[0] = Counter()\n\n# n < i\n# for i in range(N):\n# c = Counter()\n# c[A[i] + i] = 1\n# L[i + 1] = L[i] | c\n\n# n >= i\nc = Counter()\nfor n in range(N - 1, -1, -1):\n R[n] = R[n + 1] | c\n R[n][(n + 1) - A[n]] += 1\n\nans = 0\nfor i, Ai in enumerate(A):\n # n < a\n # c0 = i - a\n # l = L[i][c0]\n\n # n >= a\n c1 = Ai + (i + 1)\n r = R[i + 1][c1]\n\n ans += r\n\nprint(ans)\n","fail":"from collections import Counter\n\n\nN = int(input())\nA = list(map(int, input().split()))\n\n# R = [None] * (N + 1)\n# R[N] = Counter()\n\nR = Counter()\ncnt = 0\nfor n in range(N - 1, 0, -1):\n R[(n + 1) - A[n]] += 1\n c = A[n - 1] + ((n - 1) + 1)\n cnt += R[c]\n\n# ans = 0\n# for i, Ai in enumerate(A):\n# # n < a\n# # c0 = i - a\n# # l = L[i][c0]\n\n# # n >= a\n# c1 = Ai + (i + 1)\n# r = R[i + 1][c1]\n\n# ans += r\n\nprint(cnt)\n","change":"replace","i1":6,"i2":36,"j1":6,"j2":29,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02691","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nAs = list(map(int, input().split()))\n\ni_plus_Ai = [0 for i in range(N)]\ndict = {}\nfor i in range(N):\n i_plus_Ai[i] = i + As[i]\n tmp = i - As[i]\n if tmp not in dict:\n dict[tmp] = [i]\n else:\n dict[tmp].append(i)\n dict[tmp].sort()\n\ncount = 0\nfor i in range(N):\n if i_plus_Ai[i] in dict:\n kouho = dict[i_plus_Ai[i]]\n for j in range(len(kouho)):\n if kouho[j] > i:\n count += len(kouho) - j\n break\n\nprint(count)\n","fail":"N = int(input())\nAs = list(map(int, input().split()))\n\ni_plus_Ai = [0 for i in range(N)]\ndict = {}\nfor i in range(N):\n i_plus_Ai[i] = i + As[i]\n tmp = i - As[i]\n if tmp not in dict:\n dict[tmp] = [i]\n else:\n dict[tmp].append(i)\n\ncount = 0\nfor i in range(N):\n if i_plus_Ai[i] in dict:\n kouho = dict[i_plus_Ai[i]]\n for j in range(len(kouho)):\n if kouho[j] > i:\n count += len(kouho) - j\n break\n\nprint(count)\n","change":"delete","i1":12,"i2":13,"j1":12,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02691","language":"Python","original_status":"Runtime Error","pass":"from collections import defaultdict\n\n\nn = int(input())\na = list(map(int, input().split()))\n\nmemo = defaultdict(int)\nans = 0\nfor i, x in enumerate(a, 1):\n print(memo)\n ans += memo[i - x]\n memo[x + i] += 1\n\nprint(ans)\n","fail":"from collections import defaultdict\n\n\nn = int(input())\na = list(map(int, input().split()))\n\nmemo = defaultdict(int)\nans = 0\nfor i, x in enumerate(a, 1):\n ans += memo[i - x]\n memo[x + i] += 1\n\nprint(ans)\n","change":"delete","i1":9,"i2":10,"j1":9,"j2":9,"error":"WA","stderr":null,"stdout":"defaultdict(, {})\ndefaultdict(, {-1: 0, 3: 1})\ndefaultdict(, {-1: 0, 3: 1, 5: 1})\ndefaultdict(, {-1: 0, 3: 1, 5: 1, 0: 0, 6: 1})\ndefaultdict(, {-1: 0, 3: 1, 5: 2, 0: 0, 6: 1})\ndefaultdict(, {-1: 0, 3: 1, 5: 2, 0: 0, 6: 1, 2: 0, 8: 1})\n3\n"} {"problem_id":"p02691","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = list(map(int, input().split(\" \")))\n\nb = [j - i for i, j in enumerate(a, start=1)]\nc = [-j - i for i, j in enumerate(a, start=1)]\nresult = sum([c.count(i) for i in b])\nprint(result)\n","fail":"n = int(input())\na = list(map(int, input().split(\" \")))\n\nb = [j - i for i, j in enumerate(a, start=1)]\n# c = [-j - i for i, j in enumerate(a, start=1)]\ncount = {}\nfor i, j in enumerate(a, start=1):\n num = -i - j\n if num not in count:\n count[num] = 0\n count[num] += 1\nresult = sum([count.get(i, 0) for i in b])\nprint(result)\n","change":"replace","i1":4,"i2":6,"j1":4,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02692","language":"Python","original_status":"Runtime Error","pass":"n, a, b, c = (int(x) for x in input().split())\nd = {\"A\": a, \"B\": b, \"C\": c}\nS = [input() for _ in range(n)]\nANS = []\n\nfor i, s in enumerate(S):\n if d[s[0]] == 0 and d[s[1]] == 0:\n print(\"No\")\n exit()\n else:\n if d[s[0]] > d[s[1]] or (d[s[0]] == d[s[1]] == 1 and i < n and s[1] in S[i + 1]):\n d[s[1]] += 1\n d[s[0]] -= 1\n ANS.append(s[1])\n else:\n d[s[0]] += 1\n d[s[1]] -= 1\n ANS.append(s[0])\nprint(\"Yes\")\nfor ans in ANS:\n print(ans)\n","fail":"n, a, b, c = (int(x) for x in input().split())\nd = {\"A\": a, \"B\": b, \"C\": c}\nS = [input() for _ in range(n)]\nANS = []\n\nfor i, s in enumerate(S):\n if d[s[0]] == 0 and d[s[1]] == 0:\n print(\"No\")\n exit()\n else:\n if d[s[0]] > d[s[1]] or (\n d[s[0]] == d[s[1]] == 1 and i < n - 1 and s[1] in S[i + 1]\n ):\n d[s[1]] += 1\n d[s[0]] -= 1\n ANS.append(s[1])\n else:\n d[s[0]] += 1\n d[s[1]] -= 1\n ANS.append(s[0])\nprint(\"Yes\")\nfor ans in ANS:\n print(ans)\n","change":"replace","i1":10,"i2":11,"j1":10,"j2":13,"error":"0","stderr":null,"stdout":"Yes\nA\nC\n"} {"problem_id":"p02692","language":"Python","original_status":"Runtime Error","pass":"# -*- coding: utf-8 -*-\n# \u6574\u6570\u306e\u5165\u529b\nn = int(input())\nh_list = input().split()\nh_list = [int(h) for h in h_list]\n\ncount = 0\n\nfor i in range(n):\n a_height = h_list[i]\n if i + 21 < n:\n n_aa = i + 21\n else:\n n_aa = n\n for k in range(i + 1 + a_height, n_aa):\n b_height = h_list[k]\n if k - i == a_height + b_height:\n count += 1\n\nprint(count)\n","fail":"# -*- coding: utf-8 -*-\nn, a, b, c = map(int, input().split())\n\nvalue_dict = {\"A\": a, \"B\": b, \"C\": c}\nresult_list = []\ninput_list = []\nflag = True\n\nfor i in range(n):\n input_list.append(input())\n\nfor next, input in enumerate(input_list, 1):\n if value_dict[input[0]] < value_dict[input[1]]:\n value_dict[input[0]] += 1\n value_dict[input[1]] -= 1\n result_list.append(input[0])\n elif value_dict[input[1]] < value_dict[input[0]]:\n value_dict[input[1]] += 1\n value_dict[input[0]] -= 1\n result_list.append(input[1])\n else:\n if value_dict[input[0]] == 0:\n flag = False\n break\n elif next == len(input_list):\n result_list.append(input[0])\n elif input[0] in input_list[next]:\n value_dict[input[0]] += 1\n value_dict[input[1]] -= 1\n result_list.append(input[0])\n else:\n value_dict[input[1]] += 1\n value_dict[input[0]] -= 1\n result_list.append(input[1])\n\nif flag:\n print(\"Yes\")\n for result in result_list:\n print(result)\n\nelse:\n print(\"No\")\n","change":"replace","i1":1,"i2":20,"j1":1,"j2":42,"error":"ValueError: invalid literal for int() with base 10: '2 1 3 0'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02692\/Python\/s154887579.py\", line 3, in \n n = int(input())\nValueError: invalid literal for int() with base 10: '2 1 3 0'\n","stdout":null} {"problem_id":"p02692","language":"Python","original_status":"Runtime Error","pass":"def main():\n N, A, B, C = map(int, input().split())\n S = [input() for _ in range(N)]\n res = []\n if A + B + C == 2:\n for i in range(N):\n s = S[i]\n if s == \"AB\":\n if A == 0 and B == 0:\n print(\"No\")\n return 1\n if A > B:\n A -= 1\n B += 1\n res.append(\"B\")\n elif A < B:\n A += 1\n B -= 1\n res.append(\"A\")\n else:\n if S == N - 1:\n res.append(\"A\")\n break\n elif S[i + 1] == \"BC\":\n A -= 1\n B += 1\n res.append(\"B\")\n else:\n A += 1\n B -= 1\n res.append(\"A\")\n if s == \"AC\":\n if A == 0 and C == 0:\n print(\"No\")\n return 1\n if A > C:\n A -= 1\n C += 1\n res.append(\"C\")\n elif A < C:\n A += 1\n C -= 1\n res.append(\"A\")\n else:\n if S == N - 1:\n res.append(\"A\")\n break\n elif S[i + 1] == \"BC\":\n A -= 1\n C += 1\n res.append(\"C\")\n else:\n A += 1\n C -= 1\n res.append(\"A\")\n if s == \"BC\":\n if B == 0 and C == 0:\n print(\"No\")\n return 1\n if B > C:\n B -= 1\n C += 1\n res.append(\"C\")\n elif B < C:\n B += 1\n C -= 1\n res.append(\"B\")\n else:\n if S == N - 1:\n res.append(\"B\")\n break\n elif S[i + 1] == \"AC\":\n B -= 1\n C += 1\n res.append(\"C\")\n else:\n B += 1\n C -= 1\n res.append(\"B\")\n print(\"Yes\")\n print(\"\\\\n\".join(map(str, res)))\n return 0\n if A == 0 and B == 0:\n if S[0] == \"AB\":\n print(\"No\")\n return 1\n if A == 0 and C == 0:\n if S[0] == \"AC\":\n print(\"No\")\n return 1\n if C == 0 and B == 0:\n if S[0] == \"BC\":\n print(\"No\")\n return 1\n\n for s in S:\n if s == \"AB\":\n if A == 0 and B == 0:\n print(\"No\")\n return 1\n if A >= B:\n A -= 1\n B += 1\n res.append(\"B\")\n else:\n A += 1\n B -= 1\n res.append(\"A\")\n elif s == \"AC\":\n if A == 0 and C == 0:\n print(\"No\")\n return 1\n if A >= C:\n A -= 1\n C += 1\n res.append(\"C\")\n else:\n A += 1\n C -= 1\n res.append(\"A\")\n\n elif s == \"BC\":\n if B == 0 and C == 0:\n print(\"No\")\n return 1\n if B >= C:\n B -= 1\n C += 1\n res.append(\"C\")\n else:\n B += 1\n C -= 1\n res.append(\"B\")\n else:\n print(\"ERROR\")\n print(\"Yes\")\n print(\"\\\\n\".join(map(str, res)))\n return 0\n\n\nmain()\n","fail":"def main():\n N, A, B, C = map(int, input().split())\n S = [input() for _ in range(N)]\n res = []\n if A + B + C == 2:\n for i in range(N):\n s = S[i]\n if s == \"AB\":\n if A == 0 and B == 0:\n print(\"No\")\n return 1\n if A > B:\n A -= 1\n B += 1\n res.append(\"B\")\n elif A < B:\n A += 1\n B -= 1\n res.append(\"A\")\n else:\n if i == N - 1:\n res.append(\"A\")\n break\n elif S[i + 1] == \"BC\":\n A -= 1\n B += 1\n res.append(\"B\")\n else:\n A += 1\n B -= 1\n res.append(\"A\")\n if s == \"AC\":\n if A == 0 and C == 0:\n print(\"No\")\n return 1\n if A > C:\n A -= 1\n C += 1\n res.append(\"C\")\n elif A < C:\n A += 1\n C -= 1\n res.append(\"A\")\n else:\n if i == N - 1:\n res.append(\"A\")\n break\n elif S[i + 1] == \"BC\":\n A -= 1\n C += 1\n res.append(\"C\")\n else:\n A += 1\n C -= 1\n res.append(\"A\")\n if s == \"BC\":\n if B == 0 and C == 0:\n print(\"No\")\n return 1\n if B > C:\n B -= 1\n C += 1\n res.append(\"C\")\n elif B < C:\n B += 1\n C -= 1\n res.append(\"B\")\n else:\n if i == N - 1:\n res.append(\"B\")\n break\n elif S[i + 1] == \"AC\":\n B -= 1\n C += 1\n res.append(\"C\")\n else:\n B += 1\n C -= 1\n res.append(\"B\")\n print(\"Yes\")\n print(\"\\\\n\".join(map(str, res)))\n return 0\n if A == 0 and B == 0:\n if S[0] == \"AB\":\n print(\"No\")\n return 1\n if A == 0 and C == 0:\n if S[0] == \"AC\":\n print(\"No\")\n return 1\n if C == 0 and B == 0:\n if S[0] == \"BC\":\n print(\"No\")\n return 1\n\n for s in S:\n if s == \"AB\":\n if A == 0 and B == 0:\n print(\"No\")\n return 1\n if A >= B:\n A -= 1\n B += 1\n res.append(\"B\")\n else:\n A += 1\n B -= 1\n res.append(\"A\")\n elif s == \"AC\":\n if A == 0 and C == 0:\n print(\"No\")\n return 1\n if A >= C:\n A -= 1\n C += 1\n res.append(\"C\")\n else:\n A += 1\n C -= 1\n res.append(\"A\")\n\n elif s == \"BC\":\n if B == 0 and C == 0:\n print(\"No\")\n return 1\n if B >= C:\n B -= 1\n C += 1\n res.append(\"C\")\n else:\n B += 1\n C -= 1\n res.append(\"B\")\n else:\n print(\"ERROR\")\n print(\"Yes\")\n print(\"\\\\n\".join(map(str, res)))\n return 0\n\n\nmain()\n","change":"replace","i1":20,"i2":69,"j1":20,"j2":69,"error":"0","stderr":null,"stdout":"Yes\nA\nC\n"} {"problem_id":"p02692","language":"Python","original_status":"Runtime Error","pass":"N, A, B, C = map(int, input().split())\nopts = []\nfor _ in range(N):\n opt = input()\n opts.append((ord(opt[0]) - ord(\"A\"), ord(opt[1]) - ord(\"A\")))\n\nchoices = []\nnums = [A, B, C]\nfor i, opt in enumerate(opts):\n if nums[opt[0]] == 0 and nums[opt[1]] == 0:\n print(\"No\")\n break\n if nums[opt[0]] == 1 and nums[opt[1]] == 1:\n if i < N - 1 and opt != opts[i + 1]:\n choice = next(set(opt) ^ set(opts[i + 1]))\n nums[opt] += 1\n nums[opt ^ opt[0] ^ opt[1]] -= 1\n choices.append(choice)\n continue\n if nums[opt[0]] >= nums[opt[1]]:\n choices.append(opt[1])\n nums[opt[1]] += 1\n nums[opt[0]] -= 1\n else:\n choices.append(opt[0])\n nums[opt[0]] += 1\n nums[opt[1]] -= 1\nelse:\n print(\"Yes\")\n for c in choices:\n print(chr(c + ord(\"A\")))\n","fail":"N, A, B, C = map(int, input().split())\nopts = []\nfor _ in range(N):\n opt = input()\n opts.append((ord(opt[0]) - ord(\"A\"), ord(opt[1]) - ord(\"A\")))\n\nchoices = []\nnums = [A, B, C]\nfor i, opt in enumerate(opts):\n if nums[opt[0]] == 0 and nums[opt[1]] == 0:\n print(\"No\")\n break\n if nums[opt[0]] == 1 and nums[opt[1]] == 1:\n if i < N - 1 and opt != opts[i + 1]:\n choice = (set(opt) & set(opts[i + 1])).pop()\n nums[choice] += 1\n nums[choice ^ opt[0] ^ opt[1]] -= 1\n choices.append(choice)\n continue\n if nums[opt[0]] >= nums[opt[1]]:\n choices.append(opt[1])\n nums[opt[1]] += 1\n nums[opt[0]] -= 1\n else:\n choices.append(opt[0])\n nums[opt[0]] += 1\n nums[opt[1]] -= 1\nelse:\n print(\"Yes\")\n for c in choices:\n print(chr(c + ord(\"A\")))\n","change":"replace","i1":14,"i2":17,"j1":14,"j2":17,"error":"0","stderr":null,"stdout":"Yes\nA\nC\n"} {"problem_id":"p02693","language":"Python","original_status":"Runtime Error","pass":"K = int(input())\nA, B = map(int, input().slice())\nprint(\"OK\" if B - A >= K else \"NG\")\n","fail":"K = int(input())\nA, B = map(int, input().split())\nlarge = (B \/\/ K) * K\nif A <= large:\n print(\"OK\")\nelse:\n print(\"NG\")\n","change":"replace","i1":1,"i2":3,"j1":1,"j2":7,"error":"AttributeError: 'str' object has no attribute 'slice'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02693\/Python\/s877795440.py\", line 2, in \n A, B = map(int, input().slice())\nAttributeError: 'str' object has no attribute 'slice'\n","stdout":null} {"problem_id":"p02693","language":"Python","original_status":"Runtime Error","pass":"K = int(input())\nA = int(input().split()[0])\nB = int(input().split()[1])\n\nfor i in range(A, B + 1):\n if i % K == 0:\n print(\"OK\")\n break\n exit()\nprint(\"NG\")\n","fail":"K = int(input())\nS = input().split()\nA = int(S[0])\nB = int(S[1])\n\nfor i in range(A, B + 1):\n if i % K == 0:\n print(\"OK\")\n exit()\nprint(\"NG\")\n","change":"replace","i1":1,"i2":8,"j1":1,"j2":8,"error":"EOFError: EOF when reading a line","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02693\/Python\/s140867426.py\", line 3, in \n B = int(input().split()[1])\nEOFError: EOF when reading a line\n","stdout":null} {"problem_id":"p02693","language":"Python","original_status":"Runtime Error","pass":"K = int(input())\n\nA, B = map(int, input())\n\nif A \/\/ K <= B \/\/ K and B % K == 0:\n print(\"OK\")\nelse:\n print(\"NG\")\n","fail":"K = int(input())\n\nA, B = map(int, input().split())\n\nif A \/\/ K == B \/\/ K:\n if A % K == 0 or B % K == 0:\n print(\"OK\")\n else:\n print(\"NG\")\nelif A \/\/ K < B \/\/ K:\n print(\"OK\")\nelse:\n print(\"NG\")\n","change":"replace","i1":2,"i2":5,"j1":2,"j2":10,"error":"ValueError: too many values to unpack (expected 2)","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02693\/Python\/s485760562.py\", line 3, in \n A, B = map(int, input())\nValueError: too many values to unpack (expected 2)\n","stdout":null} {"problem_id":"p02693","language":"Python","original_status":"Time Limit Exceeded","pass":"k = int(input())\na, b = map(int, input().split())\ni = 1\nflag = False\n\nwhile i < b:\n dis = i * k\n if dis >= a and dis <= b:\n flag = True\n break\n\n\nif flag:\n print(\"OK\")\nelse:\n print(\"NG\")\n","fail":"k = int(input())\na, b = map(int, input().split())\ni = 1\nflag = False\n\n\nwhile i < b:\n if k == 1:\n flag = True\n break\n dis = i * k\n if dis >= a and dis <= b:\n flag = True\n break\n\n i += 1\n\n\nif flag:\n print(\"OK\")\nelse:\n print(\"NG\")\n","change":"replace","i1":5,"i2":10,"j1":5,"j2":16,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02693","language":"Python","original_status":"Runtime Error","pass":"K = int(input())\narr = list(map(int, input()))\na = arr[1] % K\nb = arr[1] - arr[0]\nif a > b:\n print(\"OK\")\nelse:\n print(\"NG\")\n","fail":"K = int(input())\narr = list(map(int, input().split()))\na = arr[1] % K\nb = arr[1] - arr[0]\nif a <= b:\n print(\"OK\")\nelse:\n print(\"NG\")\n","change":"replace","i1":1,"i2":5,"j1":1,"j2":5,"error":"ValueError: invalid literal for int() with base 10: ' '","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02693\/Python\/s995721766.py\", line 2, in \n arr = list(map(int, input()))\nValueError: invalid literal for int() with base 10: ' '\n","stdout":null} {"problem_id":"p02694","language":"Python","original_status":"Time Limit Exceeded","pass":"mon = 100\nnen = 0\nmoku = int(input())\n\nwhile mon < moku:\n mon = mon \/\/ 100\n nen += 1\n\nprint(nen)\n","fail":"x = int(input())\nnen = 0\na = 100\nwhile a < x:\n a = int(a * 1.01)\n nen += 1\nprint(nen)\n","change":"replace","i1":0,"i2":8,"j1":0,"j2":6,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02695","language":"Python","original_status":"Runtime Error","pass":"from itertools import combinations_with_replacement\n\nN, M, Q = map(int, input().split())\nL = []\nfor _ in range(Q):\n L.append(tuple(map(int, input().split())))\n\nans = 0\nfor A in combinations_with_replacement(range(1, M + 1), min(N, M)):\n tmp = 0\n for a, b, c, d in L:\n if A[b - 1] - A[a - 1] == c:\n tmp += d\n\n if tmp > ans:\n ans = tmp\n\nprint(ans)\n","fail":"from itertools import combinations_with_replacement\n\nN, M, Q = map(int, input().split())\nL = []\nfor _ in range(Q):\n L.append(tuple(map(int, input().split())))\n\nans = 0\n_N = N\nif N < M:\n _N = M\n\nfor A in combinations_with_replacement(range(1, M + 1), _N):\n tmp = 0\n for a, b, c, d in L:\n if a <= _N and b <= _N and A[b - 1] - A[a - 1] == c:\n tmp += d\n\n if tmp > ans:\n ans = tmp\n\nprint(ans)\n","change":"replace","i1":8,"i2":12,"j1":8,"j2":16,"error":"0","stderr":null,"stdout":"110\n"} {"problem_id":"p02695","language":"Python","original_status":"Runtime Error","pass":"import sys\n\nread = sys.stdin.read\nreadline = sys.stdin.readline\n\nN, M, Q, *abcd = map(int, read().split())\ncand = [[0, 1]]\n\nfor _ in range(M):\n new_cand = []\n for j in cand:\n for k in range(j[-1], M + 1):\n new_cand.append(j[:] + [k])\n cand = new_cand[:]\n\nanswer = 0\nabcd = tuple(zip(*[iter(abcd)] * 4))\nfor seq in cand:\n t = 0\n for a, b, c, d in abcd:\n if seq[b] - seq[a] == c:\n t += d\n\n answer = max(answer, t)\n\nprint(answer)\n","fail":"import sys\n\nread = sys.stdin.read\nreadline = sys.stdin.readline\n\nN, M, Q, *abcd = map(int, read().split())\ncand = [[0, 1]]\n\nfor _ in range(N - 1):\n new_cand = []\n for j in cand:\n for k in range(j[-1], M + 1):\n new_cand.append(j[:] + [k])\n cand = new_cand[:]\n\nanswer = 0\nabcd = tuple(zip(*[iter(abcd)] * 4))\nfor seq in cand:\n t = 0\n for a, b, c, d in abcd:\n if seq[b] - seq[a] == c:\n t += d\n answer = max(answer, t)\n\nprint(answer)\n","change":"replace","i1":8,"i2":23,"j1":8,"j2":22,"error":"0","stderr":null,"stdout":"110\n"} {"problem_id":"p02696","language":"Python","original_status":"Time Limit Exceeded","pass":"a, b, n = map(int, input().split())\n\nans = 0\nif b > n:\n x = n\n ans = int(a * x \/\/ b) - int(a * (x \/\/ b))\nelse:\n m = 0\n for i in range(b):\n if int(a * (n - i) \/\/ b) - int(a * ((n - i) \/\/ b)) > m:\n m = int(a * (n - i) \/\/ b) - int(a * ((n - i) \/\/ b))\n ans = m\nprint(ans)\n","fail":"a, b, n = map(int, input().split())\n\nans = 0\nif b > n:\n x = n\n ans = int(a * x \/\/ b) - int(a * (x \/\/ b))\nelse:\n x = n\n ans1 = int(a * x \/\/ b) - int(a * (x \/\/ b))\n x = (n \/\/ b) * b - 1\n ans2 = int(a * x \/\/ b) - int(a * (x \/\/ b))\n ans = max(ans1, ans2)\nprint(ans)\n","change":"replace","i1":7,"i2":12,"j1":7,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02696","language":"Python","original_status":"Runtime Error","pass":"from math import floor\n\nA, B, N = list(map(int, input().split()))\n# print(A, B, N)\n\nx = None\nif N < B:\n x = N\n\nanswer = floor(A * x \/ B) - A * floor(x \/ B)\n\nprint(answer)\n","fail":"from math import floor\n\nA, B, N = list(map(int, input().split()))\n# print(A, B, N)\n\nx = None\nif N < B:\n x = N\nelse:\n x = B\n x = B - 1\n # max_diff = 0\n # for _x in range(B, N + 1):\n # diff = (x \/ B) - floor(x \/ B)\n # if max_diff <= diff:\n # max_diff = diff\n # x = _x\n\nanswer = floor(A * x \/ B) - A * floor(x \/ B)\n\nprint(answer)\n","change":"insert","i1":8,"i2":8,"j1":8,"j2":17,"error":"0","stderr":null,"stdout":"2\n"} {"problem_id":"p02696","language":"Python","original_status":"Time Limit Exceeded","pass":"# coding:utf-8\ndef main():\n import math\n\n a, b, n = map(int, input().split())\n ans = 0\n\n for x in range(n, 0, -1):\n tmp = math.floor((a * x) \/ b) - a * (math.floor(x \/ b))\n ans = max(tmp, ans)\n\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"# coding:utf-8\n\nimport math\n\na, b, n = map(int, input().split())\nx = min(b - 1, n)\n\nans = math.floor((a * x) \/ b) - a * (math.floor(x \/ b))\n\nprint(ans)\n","change":"replace","i1":1,"i2":16,"j1":1,"j2":10,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02696","language":"Python","original_status":"Time Limit Exceeded","pass":"A, B, N = map(int, input().split())\nc = 0\nt = -10\nif N > 100000000:\n for i in range(100000000, N + 1):\n a = (i * A) \/\/ B - A * (i \/\/ B)\n c = max(c, a)\n if t > a or i > 1100000000:\n print(c)\n break\n t = a\n else:\n print(c)\nelse:\n for i in range(N + 1):\n a = (i * A) \/\/ B - A * (i \/\/ B)\n c = max(c, a)\n if t > a or i > 100000000:\n print(c)\n break\n t = a\n else:\n print(c)\n","fail":"A, B, N = map(int, input().split())\nX = min(N, B - 1)\nprint(A * X \/\/ B - A * (X \/\/ B))\n","change":"replace","i1":1,"i2":23,"j1":1,"j2":3,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02696","language":"Python","original_status":"Time Limit Exceeded","pass":"a, b, n = map(int, input().split())\nans = 0\n# floor(a * x \/ b)\n# = floor(a * floor(x \/ b) + a * (x \/ b - floor(x \/ b)))\n# = a * floor(x \/ b) + floor(a * (x \/ b - floor(x \/ b))))\nfor i in range(min(b, n + 1)):\n ans = max(ans, int(a * i \/ b))\nprint(ans)\n","fail":"a, b, n = map(int, input().split())\nans = 0\n# floor(a * x \/ b)\n# = floor(a * floor(x \/ b) + a * (x \/ b - floor(x \/ b)))\n# = a * floor(x \/ b) + floor(a * (x \/ b - floor(x \/ b))))\nprint(int(a * min(b - 1, n) \/ b))\n","change":"replace","i1":5,"i2":8,"j1":5,"j2":6,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02696","language":"Python","original_status":"Time Limit Exceeded","pass":"from sys import stdin, setrecursionlimit\n\n\ndef main():\n input = stdin.buffer.readline\n a, b, n = map(int, input().split())\n\n ans = 0\n\n for x in range(min(b, n + 1)):\n ans = max(int(a * x \/ b) - a * int(x \/ b), ans)\n\n print(ans)\n\n\nif __name__ == \"__main__\":\n setrecursionlimit(10000)\n main()\n","fail":"from sys import stdin, setrecursionlimit\n\n\ndef main():\n input = stdin.buffer.readline\n a, b, n = map(int, input().split())\n\n ans = 0\n\n x = min(b - 1, n)\n ans = max(int(a * x \/ b) - a * int(x \/ b), ans)\n\n print(ans)\n\n\nif __name__ == \"__main__\":\n setrecursionlimit(10000)\n main()\n","change":"replace","i1":9,"i2":11,"j1":9,"j2":11,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02696","language":"Python","original_status":"Time Limit Exceeded","pass":"a, b, n = map(int, input().split())\n\nMax = 0\nfor x in range(1, n + 1):\n Max = max(Max, (a * x) \/\/ b - a * (x \/\/ b))\nprint(Max)\n","fail":"def f(a, b, n):\n if b == 1:\n print(0)\n else:\n Max = 0\n step = 1 if b \/\/ a == 0 else b \/\/ a\n for x in range(b \/\/ a, n + step, step):\n res = (a * x) \/\/ b - a * (x \/\/ b)\n if res > Max:\n Max = res\n print(Max)\n\n\na, b, n = map(int, input().split())\nf(a, b, n)\n","change":"replace","i1":0,"i2":6,"j1":0,"j2":15,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02696","language":"Python","original_status":"Runtime Error","pass":"def m():\n a, b, n = map(int, input().split())\n\n def calc(x):\n return int((a * x) \/ b) - (a * int(x \/ b))\n\n if calc(1) < calc(n \/\/ 2):\n return max([calc(i) for i in range(n \/\/ 2, n + 1)])\n else:\n return max([calc(i) for i in range(1, n \/\/ 2 + 1)])\n\n\nprint(m())\n","fail":"def m():\n a, b, n = map(int, input().split())\n\n def calc(x):\n return int((a * x) \/ b) - (a * int(x \/ b))\n\n return calc(min(n, b - 1))\n\n\nprint(m())\n","change":"replace","i1":6,"i2":10,"j1":6,"j2":7,"error":"0","stderr":null,"stdout":"2\n"} {"problem_id":"p02696","language":"Python","original_status":"Time Limit Exceeded","pass":"A, B, N = map(int, input().split())\nmaxFloor = 0\n\n\ndef floor(x):\n num = int(x \/\/ 1)\n return num\n\n\nfor x in range(N + 1):\n check = floor(A * x \/ B) - A * floor(x \/ B)\n maxFloor = max(maxFloor, check)\nprint(maxFloor)\n","fail":"A, B, N = map(int, input().split())\n\nmaxFloor = 0\n\n\ndef floor(x):\n num = int(x \/\/ 1)\n return num\n\n\nif B - 1 <= N:\n check = floor(A * (B - 1) \/ B) - A * floor((B - 1) \/ B)\n print(check)\nelse:\n check = floor(A * N \/ B) - A * floor(N \/ B)\n print(check)\n","change":"replace","i1":1,"i2":13,"j1":1,"j2":16,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02696","language":"Python","original_status":"Time Limit Exceeded","pass":"A, B, N = map(int, input().split())\n\nans = 0\n\nfor i in range(1, N + 1):\n tmp = (A * i) \/\/ B - A * (i \/\/ B)\n ans = max(ans, tmp)\n\nprint(ans)\n","fail":"A, B, N = map(int, input().split())\n\nx = min(B - 1, N)\nans = (A * x) \/\/ B - A * (x \/\/ B)\nprint(ans)\n","change":"replace","i1":2,"i2":8,"j1":2,"j2":4,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02696","language":"Python","original_status":"Time Limit Exceeded","pass":"a, b, n = map(int, input().split())\nans = 0\n\nfor i in range(1, n + 1):\n num = (a * i) \/\/ b - a * (i \/\/ b)\n if ans < num:\n ans = num\n\nprint(ans)\n","fail":"a, b, n = map(int, input().split())\n\nif b > n:\n x = n\nelse:\n x = b - 1\n\nprint((a * x) \/\/ b)\n","change":"replace","i1":1,"i2":9,"j1":1,"j2":8,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02696","language":"Python","original_status":"Time Limit Exceeded","pass":"import math\n\n\ndef f(A, B, x):\n return math.floor(A * x \/ B) - A * math.floor(x \/ B)\n\n\ndef main(A, B, N):\n last = 0\n x = 0\n while x <= N:\n tmp = f(A, B, x)\n if tmp < last:\n print(last)\n return\n else:\n last = tmp\n x += 1\n else:\n print(last)\n return\n\n\nA, B, N = map(int, input().split())\nmain(A, B, N)\n","fail":"import math\n\n\ndef f(A, B, x):\n return math.floor(A * x \/ B) - A * math.floor(x \/ B)\n\n\ndef main(A, B, N):\n if N < B:\n return f(A, B, N)\n else:\n return f(A, B, B - 1)\n\n\nA, B, N = map(int, input().split())\nprint(main(A, B, N))\n","change":"replace","i1":8,"i2":25,"j1":8,"j2":16,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02696","language":"Python","original_status":"Time Limit Exceeded","pass":"def f(x):\n return (a * x) \/\/ b - a * (x \/\/ b)\n\n\na, b, n = map(int, input().split())\n\nk = (n + 1) \/\/ b\n\nans = 0\nfor x in range(max(0, k * b - 1), n + 1):\n ans = max(ans, f(x))\n\nprint(ans)\n","fail":"def f(x):\n return (a * x) \/\/ b - a * (x \/\/ b)\n\n\na, b, n = map(int, input().split())\n\nk = (n + 1) \/\/ b\n\nx = max(k * b - 1, 0)\nans = f(x)\nans = max(ans, f(n))\nprint(ans)\n","change":"replace","i1":8,"i2":12,"j1":8,"j2":11,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02697","language":"Python","original_status":"Runtime Error","pass":"n, m = map(int, input().split())\nif n % 2 == 1:\n for i in range(1, m + 1):\n print(i, n + 1 - i)\nelse:\n used = [False] * (n + 1)\n i = 1\n count = 0\n while count < m:\n while used[i]:\n i += 1\n print(i, i + count + 1)\n used[i] = True\n used[i + count + 1] = True\n count += 1\n","fail":"n, m = map(int, input().split())\nif n % 2 == 1:\n for i in range(1, m + 1):\n print(i, n + 1 - i)\nelse:\n turning_point = (m + 1) \/\/ 2\n for i in range(1, turning_point + 1):\n print(i, n + 1 - i)\n for i in range(turning_point + 1, m + 1):\n print(i, n - i)\n","change":"replace","i1":5,"i2":15,"j1":5,"j2":10,"error":"WA","stderr":null,"stdout":"1 2\n"} {"problem_id":"p02697","language":"Python","original_status":"Runtime Error","pass":"N, M = map(int, input().split())\n\nsieve = [0] * (100000 + 1)\nsieve[0] = -1\nsieve[1] = -1\nfor i in range(2, 100000 + 1):\n if sieve[i] != 0:\n continue\n sieve[i] = i\n for j in range(i * i, 100000 + 1, i):\n if sieve[j] == 0:\n sieve[j] = i\n\np = []\nfor i in range(N - 1, -1, -1):\n if sieve[i] == i:\n p.append(i)\np.append(1)\n\nt = set()\npp = 0\nfor i in range(M):\n x = i + 1\n y = x + p[pp]\n while y in t:\n pp += 1\n y = x + p[pp]\n t.add(x)\n t.add(y)\n print(x, y)\n pp += 1\n","fail":"N, M = map(int, input().split())\n\nfor i in range(1, M + 1):\n if i % 2 == 1:\n j = (i - 1) \/\/ 2\n print(1 + j, M + 1 - j)\n else:\n j = (i - 2) \/\/ 2\n print(M + 2 + j, 2 * M + 1 - j)\n","change":"replace","i1":2,"i2":31,"j1":2,"j2":9,"error":"WA","stderr":null,"stdout":"1 4\n"} {"problem_id":"p02698","language":"Python","original_status":"Runtime Error","pass":"import bisect\n\nN = int(input())\na = list(map(int, input().split()))\nto = [[] for _ in range(N)]\nfor _ in range(N - 1):\n u, v = map(int, input().split())\n u -= 1\n v -= 1\n to[u].append(v)\n to[v].append(u)\ndel u, v\n\nans = [-1] * N\n\n\ndef dfs(v, prev_dp):\n dp = [*prev_dp]\n if len(dp) == 0 or a[v] > dp[-1]:\n dp.append(a[v])\n else:\n pos = bisect.bisect_left(dp, a[v])\n dp[pos] = a[v]\n ans[v] = len(dp)\n\n for u in to[v]:\n if ans[u] == -1:\n dfs(u, dp)\n\n\ndfs(0, [])\n\n\nfor an in ans:\n print(an)\n","fail":"import bisect\nimport sys\n\n\nN = int(input())\na = list(map(int, input().split()))\nto = [[] for _ in range(N)]\nfor _ in range(N - 1):\n u, v = map(int, input().split())\n u -= 1\n v -= 1\n to[u].append(v)\n to[v].append(u)\ndel u, v\n\nans = [-1] * N\n\n\ndef dfs(v, dp):\n # dp \u306f\u53c2\u7167\u6e21\u3057\n if len(dp) == 0 or a[v] > dp[-1]:\n dp.append(a[v])\n back = -1\n else:\n pos = bisect.bisect_left(dp, a[v])\n back = dp[pos]\n dp[pos] = a[v]\n ans[v] = len(dp)\n\n for u in to[v]:\n if ans[u] == -1:\n dfs(u, dp)\n if back == -1:\n dp.pop()\n else:\n dp[pos] = back\n\n\nsys.setrecursionlimit(10**6)\ndfs(0, [])\n\n\nfor an in ans:\n print(an)\n","change":"replace","i1":1,"i2":30,"j1":1,"j2":39,"error":"0","stderr":null,"stdout":"1\n2\n3\n3\n4\n4\n5\n2\n2\n3\n"} {"problem_id":"p02699","language":"Python","original_status":"Runtime Error","pass":"s, w = map(int, input().split(\"\"))\nres = \"safe\"\nif w >= s:\n res = \"unsafe\"\nprint(res)\n","fail":"s, w = map(int, input().split(\" \"))\nres = \"safe\"\nif w >= s:\n res = \"unsafe\"\nprint(res)\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"ValueError: empty separator","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02699\/Python\/s552737943.py\", line 1, in \n s, w = map(int, input().split(\"\"))\nValueError: empty separator\n","stdout":null} {"problem_id":"p02700","language":"Python","original_status":"Time Limit Exceeded","pass":"A, B, C, D = list(map(int, input().split()))\nwhile A and C:\n A -= D\n C -= B\n if C <= 0:\n print(\"Yes\")\n elif A <= 0:\n print(\"No\")\n","fail":"A, B, C, D = list(map(int, input().split()))\nt1 = (A + D - 1) \/\/ D\nt2 = (C + B - 1) \/\/ B\nprint(\"Yes\" if t2 <= t1 else \"No\")\n","change":"replace","i1":1,"i2":8,"j1":1,"j2":4,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02700","language":"Python","original_status":"Time Limit Exceeded","pass":"a, b, c, d = map(int, input().split())\nwhile True:\n c -= b\n if c == 0:\n print(\"Yes\")\n break\n a -= d\n if a == 0:\n print(\"No\")\n break\n","fail":"a, b, c, d = map(int, input().split())\nwhile True:\n c -= b\n if c <= 0:\n print(\"Yes\")\n break\n a -= d\n if a <= 0:\n print(\"No\")\n break\n","change":"replace","i1":3,"i2":8,"j1":3,"j2":8,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02701","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nL = []\nfor _ in range(N):\n s = input()\n if s in L:\n pass\n else:\n L.append(s)\n\nprint(len(L))\n","fail":"N = int(input())\nL = set()\nfor _ in range(N):\n s = input()\n if s in L:\n pass\n else:\n L.add(s)\n\nprint(len(L))\n","change":"replace","i1":1,"i2":8,"j1":1,"j2":8,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02701","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\n\nunique_list = list()\nfor _ in range(n):\n s = input()\n if s not in unique_list:\n unique_list.append(s)\n\nprint(len(unique_list))\n","fail":"n = int(input())\n\ngacha_set = set()\nfor _ in range(n):\n s = input()\n gacha_set.add(s)\n\nprint(len(gacha_set))\n","change":"replace","i1":2,"i2":9,"j1":2,"j2":8,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02701","language":"Python","original_status":"Runtime Error","pass":"import pandas as pd\n\nN = int(input())\nS = [input() for i in range(N)]\n\ndata = pd.Series(S)\n\nprint(data.nunique())\n","fail":"import numpy as np\n\nN = int(input())\nS = [input() for i in range(N)]\n\nprint(len(np.unique(S)))\n","change":"replace","i1":0,"i2":8,"j1":0,"j2":6,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02701","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\ns = []\np = []\nans = 0\nfor i in range(n):\n s.append(input())\n if s[i] in p:\n pass\n else:\n p.append(s[i])\n ans += 1\nprint(ans)\n","fail":"n = int(input())\ns = []\np = set()\nans = 0\nfor i in range(n):\n s.append(input())\n if s[i] in p:\n pass\n else:\n p.add(s[i])\n ans += 1\nprint(ans)\n","change":"replace","i1":2,"i2":10,"j1":2,"j2":10,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02701","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nD = []\nans = 0\n\nfor _ in range(N):\n S = input()\n if S not in D:\n D.append(S)\n ans += 1\n\nprint(ans)\n","fail":"N = int(input())\nD = {}\nans = 0\n\nfor _ in range(N):\n S = input()\n if S not in D:\n D[S] = True\n ans += 1\n\nprint(ans)\n","change":"replace","i1":1,"i2":8,"j1":1,"j2":8,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02701","language":"Python","original_status":"Runtime Error","pass":"a = map(int, input().split())\ns = list(map(int, input().split()))\n\nprint(len(set(s)))\n","fail":"a = int(input())\ns = [input() for i in range(a)]\n\nprint(len(set(s)))\n","change":"replace","i1":0,"i2":2,"j1":0,"j2":2,"error":"ValueError: invalid literal for int() with base 10: 'apple'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02701\/Python\/s227226698.py\", line 2, in \n s = list(map(int, input().split()))\nValueError: invalid literal for int() with base 10: 'apple'\n","stdout":null} {"problem_id":"p02701","language":"Python","original_status":"Runtime Error","pass":"n = int(input())\ns = [int(input()) for _ in range(n)]\nans = set()\n\nfor i in s:\n ans.add(i)\n\nprint(len(ans))\n","fail":"n = int(input())\ns = [input() for _ in range(n)]\nans = set()\n\nfor i in s:\n ans.add(i)\n\nprint(len(ans))\n","change":"replace","i1":1,"i2":2,"j1":1,"j2":2,"error":"ValueError: invalid literal for int() with base 10: 'apple'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02701\/Python\/s962277082.py\", line 2, in \n s = [int(input()) for _ in range(n)]\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02701\/Python\/s962277082.py\", line 2, in \n s = [int(input()) for _ in range(n)]\nValueError: invalid literal for int() with base 10: 'apple'\n","stdout":null} {"problem_id":"p02701","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nS_list = [input() for i in range(N)]\ncount = 0\nwhile len(S_list) > 0:\n S_list = [s for s in S_list if s != S_list[0]]\n count += 1\nprint(count)\n","fail":"import collections\n\nN = int(input())\nS_list = [input() for i in range(N)]\nc = collections.Counter(S_list)\nprint(len(c))\n","change":"replace","i1":0,"i2":7,"j1":0,"j2":6,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02701","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\n\nans = 0\nu_l = []\nfor _ in range(n):\n s = input()\n if s not in u_l:\n u_l.append(s)\n ans += 1\nprint(ans)\n","fail":"n = int(input())\n\nl = [input() for _ in range(n)]\nprint(len(set(l)))\n","change":"replace","i1":2,"i2":10,"j1":2,"j2":4,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02701","language":"Python","original_status":"Runtime Error","pass":"n = int(input())\ns = (input() for _ in range(n))\nprint(len(s))\n","fail":"n = int(input())\ns = {input() for _ in range(n)}\nprint(len(s))\n","change":"replace","i1":1,"i2":2,"j1":1,"j2":2,"error":"TypeError: object of type 'generator' has no len()","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02701\/Python\/s709317664.py\", line 3, in \n print(len(s))\nTypeError: object of type 'generator' has no len()\n","stdout":null} {"problem_id":"p02701","language":"Python","original_status":"Runtime Error","pass":"N = input()\nList = list(input() for i in range(N))\nprint(len(set(List)))\n","fail":"N = int(input())\nList = list(input() for i in range(N))\nprint(len(set(List)))\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"TypeError: 'str' object cannot be interpreted as an integer","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02701\/Python\/s903293880.py\", line 2, in \n List = list(input() for i in range(N))\nTypeError: 'str' object cannot be interpreted as an integer\n","stdout":null} {"problem_id":"p02701","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nS = []\nfor _ in range(N):\n i = input()\n if i not in S:\n S.append(i)\n\nprint(len(S))\n","fail":"N = int(input())\nS = []\nfor _ in range(N):\n S.append(input())\n\nprint(len(set(S)))\n","change":"replace","i1":3,"i2":8,"j1":3,"j2":6,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02701","language":"Python","original_status":"Runtime Error","pass":"n = int(input)\nlis = [input() for i in range(n)]\nprint(len(set(lis)))\n","fail":"n = int(input())\nlis = [input() for i in range(n)]\nprint(len(set(lis)))\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"TypeError: int() argument must be a string, a bytes-like object or a real number, not 'builtin_function_or_method'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02701\/Python\/s310001383.py\", line 1, in \n n = int(input)\nTypeError: int() argument must be a string, a bytes-like object or a real number, not 'builtin_function_or_method'\n","stdout":null} {"problem_id":"p02701","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\ns = [\"\"] * n\nt = []\nfor i in range(n):\n s[i] = input()\nfor i in range(n):\n if s[i] not in t:\n t.append(s[i])\nprint(len(t))\n","fail":"n = int(input())\ns = [\"\"] * n\nfor i in range(n):\n s[i] = input()\ns = set(s)\nprint(len(s))\n","change":"replace","i1":2,"i2":9,"j1":2,"j2":6,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02701","language":"Python","original_status":"Runtime Error","pass":"import collections\n\nn = int(input())\na = [list(input() for i in range(n))]\nb = collections.Counter(a)\nprint(len(b))\n","fail":"import collections\n\nn = int(input())\na = [input() for i in range(n)]\nb = collections.Counter(a)\nprint(len(b))\n","change":"replace","i1":3,"i2":4,"j1":3,"j2":4,"error":"TypeError: unhashable type: 'list'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02701\/Python\/s293744193.py\", line 5, in \n b = collections.Counter(a)\n File \"\/usr\/lib\/python3.10\/collections\/__init__.py\", line 577, in __init__\n self.update(iterable, **kwds)\n File \"\/usr\/lib\/python3.10\/collections\/__init__.py\", line 670, in update\n _count_elements(self, iterable)\nTypeError: unhashable type: 'list'\n","stdout":null} {"problem_id":"p02701","language":"Python","original_status":"Time Limit Exceeded","pass":"import sys\n\n\ndef main():\n readline = sys.stdin.readline\n N = int(readline())\n li = []\n for _ in range(N):\n S = readline()\n if S not in li:\n li.append(S)\n print(len(li))\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"import sys\n\n\ndef main():\n readline = sys.stdin.readline\n N = int(readline())\n se = set([readline() for _ in range(N)])\n print(len(se))\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":6,"i2":12,"j1":6,"j2":8,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02702","language":"Python","original_status":"Time Limit Exceeded","pass":"def solve(s):\n dp = [0] * 2019\n dp[0] = 1\n r = 0\n for i in range(1, len(s) + 1):\n r += int(s[-i]) * (10 ** (i - 1))\n r %= 2019\n dp[r] += 1\n res = 0\n for r in range(2019):\n res += dp[r] * (dp[r] - 1) \/\/ 2\n return res\n\n\ndef main():\n s = input()\n res = solve(s)\n print(res)\n\n\ndef test():\n assert solve(\"1817181712114\") == 3\n assert solve(\"14282668646\") == 2\n assert solve(\"2119\") == 0\n\n\nif __name__ == \"__main__\":\n test()\n main()\n","fail":"def solve(s):\n dp = [0] * 2019\n dp[0] = 1\n r = 0\n for i in range(1, len(s) + 1):\n r += int(s[-i]) * pow(10, i - 1, 2019)\n r %= 2019\n dp[r] += 1\n res = 0\n for r in range(2019):\n res += dp[r] * (dp[r] - 1) \/\/ 2\n return res\n\n\ndef main():\n s = input()\n res = solve(s)\n print(res)\n\n\ndef test():\n assert solve(\"1817181712114\") == 3\n assert solve(\"14282668646\") == 2\n assert solve(\"2119\") == 0\n\n\nif __name__ == \"__main__\":\n test()\n main()\n","change":"replace","i1":5,"i2":6,"j1":5,"j2":6,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02702","language":"Python","original_status":"Time Limit Exceeded","pass":"S = input()\ndigits = list(map(int, S))\ndivisor = 2019\n\nrem_count = [0] * divisor\nrem_count[0] = 1\nnum = 0\npow10 = 1\ntotal = 0\n\nfor digit in reversed(digits):\n num = digit * pow10 + num\n total += rem_count[num % divisor]\n pow10 *= 10\n rem_count[num % divisor] += 1\n\nprint(total)\n","fail":"S = input()\ndigits = list(map(int, S))\ndivisor = 2019\n\nrem_count = [0] * divisor\nrem_count[0] = 1\nnum = 0\npow10 = 1\ntotal = 0\n\nfor digit in reversed(digits):\n num = digit * pow10 + num\n num %= divisor\n total += rem_count[num % divisor]\n pow10 *= 10\n pow10 %= divisor\n rem_count[num % divisor] += 1\n\nprint(total)\n","change":"replace","i1":12,"i2":14,"j1":12,"j2":16,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02702","language":"Python","original_status":"Time Limit Exceeded","pass":"s = str(input())\n\nnum = [int(s[-1])]\nfor i in range(1, len(s)):\n num.append(num[-1] + pow(10, i) * int(s[-i - 1]))\n\nmod = [1] + [0] * 2018\nans = 0\nfor i in num:\n m = i % 2019\n ans += mod[m]\n mod[m] += 1\nprint(ans)\n","fail":"s = str(input())\n\nnum = [int(s[-1])]\nfor i in range(1, len(s)):\n tmp = num[-1] + pow(10, i, 2019) * int(s[-i - 1])\n num.append(tmp % 2019)\n\nmod = [1] + [0] * 2018\nans = 0\nfor i in num:\n m = i % 2019\n ans += mod[m]\n mod[m] += 1\nprint(ans)\n","change":"replace","i1":4,"i2":5,"j1":4,"j2":6,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02702","language":"Python","original_status":"Time Limit Exceeded","pass":"# D - Multiple of 2019\n\ns = input()\n\n# pow[k] = 10 ** k % 2019\npow = [1]\nwhile len(pow) <= 1 or pow[-1] > 1:\n pow.append(pow[-1] * 10 % 2019)\nn = len(pow) - 1 # 10 ** n == 1 mod 2019\n\n# memo[i % n][m] = (int(s[:i+1]) % 2019 == m\u3067\u3042\u308bi\u306e\u500b\u6570)\nmemo = [{} for i in range(n)]\nmemo[n - 1][0] = 1 # memo[-1][0] = 1\n\ncount = 0 # int(s[i:j+1]) == 0 mod 2019 \u3067\u3042\u308b(i,j)\u306e\u500b\u6570\nmod = 0\nfor j, c in enumerate(s):\n mod = (mod * 10 + int(c)) % 2019 # mod = int(s[:j+1]) % 2019\n for i in range(1, n + 1):\n m = mod * pow[n - i] % 2019 # m == mod * 10 ** (-i) mod 2019\n if m in memo[(j - i + n) % n]:\n count += memo[(j - i + n) % n][m]\n if mod not in memo[j % n]:\n memo[j % n][mod] = 0\n memo[j % n][mod] += 1\n\nprint(count)\n","fail":"# D - Multiple of 2019\n\ns = input()\n\n# pow[k] = 10 ** k % 2019\npow = [1]\nwhile len(pow) <= 1 or pow[-1] > 1:\n pow.append(pow[-1] * 10 % 2019)\nn = len(pow) - 1 # 10 ** n == 1 mod 2019\n\n# memo[i % n][m] = (int(s[:i+1]) % 2019 == m\u3067\u3042\u308bi\u306e\u500b\u6570)\nmemo = [[0] * 2019 for i in range(n)]\nmemo[n - 1][0] = 1 # memo[-1][0] = 1\n\ncount = 0 # int(s[i:j+1]) == 0 mod 2019 \u3067\u3042\u308b(i,j)\u306e\u500b\u6570\nmod = 0\nfor j, c in enumerate(s):\n mod = (mod * 10 + int(c)) % 2019 # mod = int(s[:j+1]) % 2019\n for i in range(1, n + 1):\n m = mod * pow[n - i] % 2019 # m == mod * 10 ** (-i) mod 2019\n count += memo[(j - i + n) % n][m]\n memo[j % n][mod] += 1\n\nprint(count)\n","change":"replace","i1":11,"i2":24,"j1":11,"j2":21,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02702","language":"Python","original_status":"Time Limit Exceeded","pass":"def main():\n A = input()[::-1]\n A = \"0\" + A\n # lis_num = [int(s) for s in A]\n\n # print(lis_num)\n\n # S = [0] * len(lis_num)\n S = [0] * len(A)\n cnt = [0] * 2019\n cnt[0] = 1\n\n for i in range(len(A) - 1):\n S[i + 1] = (S[i] + int(A[i + 1]) * pow(10, i)) % 2019\n cnt[S[i + 1] % 2019] += 1\n\n # print(S)\n\n # for i in S:\n # cnt[i % 2019] += 1\n\n ans = 0\n\n for i in cnt:\n ans += i * (i - 1) \/\/ 2\n\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"def main():\n A = input()[::-1]\n A = \"0\" + A\n # lis_num = [int(s) for s in A]\n\n # print(lis_num)\n\n # S = [0] * len(lis_num)\n S = [0] * len(A)\n cnt = [0] * 2019\n cnt[0] = 1\n\n for i in range(len(A) - 1):\n S[i + 1] = (S[i] + int(A[i + 1]) * pow(10, i, 2019)) % 2019\n cnt[S[i + 1] % 2019] += 1\n\n # print(S)\n\n # for i in S:\n # cnt[i % 2019] += 1\n\n ans = 0\n\n for i in cnt:\n ans += i * (i - 1) \/\/ 2\n\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":13,"i2":14,"j1":13,"j2":14,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02702","language":"Python","original_status":"Time Limit Exceeded","pass":"from collections import defaultdict\n\nS = input()\n\nd = defaultdict(int)\n\nd[0] += 1\n\nmod = 0\nfor i in range(len(S))[::-1]:\n mod = (mod + int(S[i]) * 10 ** (len(S) - i - 1)) % 2019\n # mod = int(S[i:]) % 2019\n d[mod] += 1\n\nans = 0\nfor i in d.values():\n if i > 1:\n ans += i * (i - 1) \/ 2\n\nprint(int(ans))\n","fail":"from collections import defaultdict\n\nS = input()\n\nd = defaultdict(int)\n\nd[0] += 1\n\nmod = 0\nR = 1\nfor i in range(len(S)):\n mod = (mod + R * int(S[len(S) - i - 1])) % 2019\n R = R * 10 % 2019\n d[mod] += 1\nans = 0\nfor i in d.values():\n if i > 1:\n ans += i * (i - 1) \/ 2\n\nprint(int(ans))\n","change":"replace","i1":9,"i2":14,"j1":9,"j2":14,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02702","language":"Python","original_status":"Time Limit Exceeded","pass":"import numpy as np\n\nmod = 2019\nmods_count = np.zeros(2019, dtype=np.int64)\nindexes = list(range(2019))\nindexes_10 = [index * 10 % mod for index in indexes]\n\nmod = 2019\nans = 0\nS = input()\nfor s in S:\n num = int(s)\n new = np.roll(mods_count, num)\n new[num] += 1\n\n ans += new[0]\n mods_count = np.zeros(2019, dtype=np.int64)\n mods_count[indexes_10] += new[indexes]\n\nprint(ans)\n","fail":"from collections import Counter\n\n\nmod = 2019\nS = map(int, reversed(input()))\n\nmods = [0]\nnum = 0\ndigit = 1\nfor s in S:\n num += s * digit\n num %= mod\n mods.append(num)\n digit = digit * 10 % mod\n\ncounter = Counter(mods)\nans = 0\nfor count in counter.values():\n ans += count * (count - 1) \/\/ 2\nprint(ans)\n","change":"replace","i1":0,"i2":19,"j1":0,"j2":19,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02702","language":"Python","original_status":"Time Limit Exceeded","pass":"S = input()\nN = len(S)\n\ncnt = 0\nfor i in range(N - 3):\n for j in range(i + 4, N + 1):\n if int(S[i:j]) % 2019 == 0:\n # print(i, j)\n cnt += 1\nprint(cnt)\n","fail":"S = input()\nN = len(S)\n\nnum = [0] * 2019\nnum[0] = 1\nnow, ans = 0, 0\n_10 = 1\n\nfor i in range(N - 1, -1, -1):\n now = (now + int(S[i]) * _10) % 2019\n _10 *= 10\n _10 %= 2019\n ans += num[now]\n num[now] += 1\n\nprint(ans)\n","change":"replace","i1":3,"i2":10,"j1":3,"j2":16,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02702","language":"Python","original_status":"Time Limit Exceeded","pass":"s = list(input())\nsur_list = [0 for i in range(2019)]\nsur = 0\nans = 0\n\ns.reverse()\n\nfor i in range(len(s)):\n sur_list[sur] += 1\n sur = (int(s[i]) * (10**i) + sur) % 2019\n ans += sur_list[sur]\n\nprint(ans)\n","fail":"s = list(input())\nsur_list = [0 for i in range(2019)]\nsur = 0\nketa = 1\nans = 0\n\ns.reverse()\n\nfor i in range(len(s)):\n keta = (keta * 10) % 2019\n sur_list[sur] += 1\n sur = (int(s[i]) * keta + sur) % 2019\n ans += sur_list[sur]\n\nprint(ans)\n","change":"replace","i1":3,"i2":10,"j1":3,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02702","language":"Python","original_status":"Time Limit Exceeded","pass":"s = list(input())\ns.reverse()\nn = len(s)\nnow = 0\nmods = [0] * 2019\nmods[0] += 1\nfor i in range(n):\n now += pow(10, i) * int(s[i])\n now %= 2019\n mods[now] += 1\nans = 0\nfor i in mods:\n ans += (i * (i - 1)) \/\/ 2\nprint(ans)\n","fail":"if __name__ == \"__main__\":\n\n s = list(input())\n s.reverse()\n n = len(s)\n now = 0\n mods = [0] * 2019\n mods[0] += 1\n ten = 1\n for i in range(n):\n now += ten * int(s[i])\n now %= 2019\n ten *= 10\n ten %= 2019\n mods[now] += 1\n ans = 0\n for i in mods:\n ans += (i * (i - 1)) \/\/ 2\n print(ans)\n","change":"replace","i1":0,"i2":14,"j1":0,"j2":19,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02702","language":"Python","original_status":"Time Limit Exceeded","pass":"from collections import defaultdict\n\nS = input()\nans = 0\nN = len(S)\nmod = 2019\ndp = defaultdict(int)\ncur = 0\nfor i in range(N, -1, -1):\n if i == N:\n dp[0] += 1\n else:\n cur += ((10 ** (N - i - 1)) * int(S[i])) % mod\n cur %= mod\n dp[cur] += 1\nfor v in dp.values():\n if v > 1:\n ans += v * (v - 1) \/\/ 2\nprint(ans)\n","fail":"from collections import defaultdict\n\n\ndef solve(input_s: str):\n ans = 0\n n = len(input_s)\n mod = 2019\n dp = defaultdict(int)\n cur = 0\n for i in range(n, -1, -1):\n if i == n:\n dp[0] += 1\n else:\n # cur += ((10 ** (n - i - 1)) * int(input_s[i])) % mod \u3053\u308c\u306fn\u304c\u3067\u304b\u304f\u306a\u308b\u3068\u3081\u3061\u3083\u3081\u3061\u3083\u9045\u3044\n cur += pow(10, n - i - 1, 2019) * int(input_s[i]) % mod\n cur %= mod\n dp[cur] += 1\n for v in dp.values():\n if v > 1:\n ans += v * (v - 1) \/\/ 2\n return ans\n\n\nif __name__ == \"__main__\":\n S = input()\n print(solve(S))\n","change":"replace","i1":2,"i2":19,"j1":2,"j2":26,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02702","language":"Python","original_status":"Time Limit Exceeded","pass":"S = input()\n\nans = 0\nlists = [0 for i in range(2019)]\nlists[0] += 1\n\ntmp = 1\nnum = 0\nfor i in range(len(S) - 1, -1, -1):\n num += tmp * int(S[i])\n lists[num % 2019] += 1\n tmp *= 10\n\nfor i in range(2019):\n if lists[i] >= 2:\n ans += (lists[i] * (lists[i] - 1)) \/\/ 2\n\nprint(ans)\n","fail":"S = input()\n\nans = 0\nlists = [0 for i in range(2019)]\nlists[0] += 1\n\nnum = 0\nfor i in range(len(S) - 1, -1, -1):\n num += pow(10, len(S) - 1 - i, 2019) * int(S[i])\n lists[num % 2019] += 1\n\nfor i in range(2019):\n if lists[i] >= 2:\n ans += (lists[i] * (lists[i] - 1)) \/\/ 2\n\nprint(ans)\n","change":"replace","i1":6,"i2":12,"j1":6,"j2":10,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02702","language":"Python","original_status":"Time Limit Exceeded","pass":"S = str(input())\n# \u4f59\u308a\u306e\u30ea\u30b9\u30c8\ncounts = [0] * 2019\nn, d = 0, 1\n\nfor s in S[::-1]:\n n += int(s) * d\n d *= 10\n n %= 2019\n counts[n] += 1\nans = counts[0]\nfor count in counts:\n ans += count * (count - 1) \/\/ 2\nprint(ans)\n","fail":"S = str(input())\n# \u4f59\u308a\u306e\u30ea\u30b9\u30c8\ncounts = [0] * 2019\nn, d = 0, 1\n\nfor s in S[::-1]:\n n += int(s) * d\n d *= 10\n n %= 2019\n d %= 2019\n counts[n] += 1\nans = counts[0]\nfor count in counts:\n ans += count * (count - 1) \/\/ 2\nprint(ans)\n","change":"insert","i1":9,"i2":9,"j1":9,"j2":10,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02702","language":"Python","original_status":"Time Limit Exceeded","pass":"s = input()[::-1]\n\ncnt = [0] * 2019\ncnt[0] = 1\ntotal = 0\nans = 0\nx = 1\n\nfor i in s:\n total += int(i) * x\n total %= 2019\n x *= 10 % 2019\n ans += cnt[total]\n cnt[total] += 1\n\nprint(ans)\n","fail":"s = input()[::-1]\n\nn = len(s)\ncnt = [0] * 2019\ncnt[0] = 1\ntotal = 0\nans = 0\nx = 1\n\nfor i in range(n):\n total += int(s[i]) * x\n total %= 2019\n x *= 10\n x %= 2019\n ans += cnt[total]\n cnt[total] += 1\n\nprint(ans)\n","change":"replace","i1":2,"i2":12,"j1":2,"j2":14,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02702","language":"Python","original_status":"Time Limit Exceeded","pass":"S = input()\n\nans = 0\nfor i in range(len(S)):\n m = int(S[i])\n for j in range(i + 1, len(S)):\n m = (10 * m + int(S[j])) % 2019\n if m == 0:\n ans += 1\n\nprint(ans)\n","fail":"from collections import Counter\n\nS = input()\n\nans = 0\nmod_list = [0] * len(S)\nmod_list[-1] = int(S[-1])\nm = 1\nfor i in range(2, len(S) + 1):\n m = (10 * m) % 2019\n mod_list[-i] = (mod_list[-i + 1] + (int(S[-i]) * m)) % 2019\n\nmod_counter = Counter(mod_list)\nmod_counter[0] += 1\n\nans = 0\nfor _, v in mod_counter.items():\n ans += v * (v - 1) \/\/ 2\n\nprint(ans)\n","change":"replace","i1":0,"i2":9,"j1":0,"j2":18,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02702","language":"Python","original_status":"Time Limit Exceeded","pass":"S = input()\nN = len(S)\n\nmap_ = [-1] * 2019\nmap_[0] = 0\nans = 0\nnow = 0\nfor i in range(0, N + 1):\n now += (int(S[N - i - 1]) * (10**i)) % 2019\n map_[now % 2019] += 1\n ans += map_[now % 2019]\n\nprint(ans)\n","fail":"S = input()\nN = len(S)\n\nmap_ = [-1] * 2019\nmap_[0] = 0\nans = 0\nnow = 0\nfor i in range(0, N):\n now = (now + int(S[N - i - 1]) * pow(10, i, 2019)) % 2019\n map_[now] += 1\n ans += map_[now]\n\nprint(ans)\n","change":"replace","i1":7,"i2":11,"j1":7,"j2":11,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02702","language":"Python","original_status":"Time Limit Exceeded","pass":"s = input()\nm = [0 for _ in range(2019)]\nm[0] = 1\nfor i in range(len(s)):\n t = int(s[i:])\n m[t % 2019] += 1\nprint(sum([int(x * (x - 1) \/ 2) for x in m if x > 1]))\n","fail":"s = input()\ns = s[::-1]\nn = len(s)\nm = [0] * 2019\nm[0] = 1\na = 0\nd = 1\nfor i in range(n):\n a = (a + int(s[i]) * d) % 2019\n d = (d * 10) % 2019\n m[a] += 1\nprint(sum([int(x * (x - 1) \/ 2) for x in m if x > 1]))\n","change":"replace","i1":1,"i2":6,"j1":1,"j2":11,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02702","language":"Python","original_status":"Time Limit Exceeded","pass":"from collections import defaultdict\n\nS = input()\nN = len(S)\n\nM = [0] * N\nA = [0] * N\nSUM = [0] * (N + 1)\nMOD = 2019\n\nx = 1\nfor i in range(N):\n M[i] = x % 2019\n x *= 10\nfor i, x in enumerate(S[::-1]):\n A[i] = M[i] * int(x) % MOD\nfor i in range(N):\n SUM[i + 1] = (SUM[i] + A[i]) % MOD\n\nD = defaultdict(int)\nans = 0\nfor x in SUM:\n ans += D[x]\n D[x] += 1\nprint(ans)\n","fail":"S = input()\nN = len(S)\nSUM = [0] * (N + 1)\nMOD = 2019\n\nr = 1 # 10\u306ei\u4e57\u30922019\u3067\u5272\u3063\u305f\u4f59\u308a\nS = S[::-1]\nfor i in range(N):\n A = r * int(S[i])\n SUM[i + 1] = (SUM[i] + A) % MOD\n r = r * 10 % MOD\n\ncnt = [0] * 2019\nans = 0\nfor x in SUM:\n ans += cnt[x]\n cnt[x] += 1\nprint(ans)\n","change":"replace","i1":0,"i2":24,"j1":0,"j2":17,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02702","language":"Python","original_status":"Time Limit Exceeded","pass":"S = input()\nS = list(map(int, S))\n\nnums = [0] * (len(S) + 1)\npow10 = 1\ncounter = dict({0: 1})\nfor i in range(1, len(S) + 1):\n nums[i] = (nums[i - 1] + pow10 * S[-i]) % 2019\n if nums[i] not in counter:\n counter[nums[i]] = 1\n else:\n counter[nums[i]] += 1\n\n pow10 *= 10\n\nans = 0\nfor count in counter.values():\n if count >= 2:\n ans += count * (count - 1) \/\/ 2\n\nprint(ans)\n","fail":"S = input()\nS = list(map(int, S))\n\nt = 1\nr = 0\nd = [0] * 2019\nd[0] += 1\nfor n in reversed(S):\n r = (r + n * t) % 2019\n t = t * 10 % 2019\n d[r] += 1\n\nans = 0\nfor m in d:\n ans += m * (m - 1) \/\/ 2\n\nprint(ans)\n","change":"replace","i1":3,"i2":19,"j1":3,"j2":15,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02702","language":"Python","original_status":"Time Limit Exceeded","pass":"S = input()\nS = list(map(int, S))\n\nr = 0\npow10 = 1\ncounter = [0] * 2019\ncounter[0] = 1\nfor i in range(1, len(S) + 1):\n r = (r + pow10 * S[-i]) % 2019\n counter[r] += 1\n pow10 *= 10\n\nans = 0\nfor count in counter:\n if count >= 2:\n ans += count * (count - 1) \/\/ 2\n\nprint(ans)\n","fail":"S = input()\nS = list(map(int, S))\n\nr = 0\nt = 1\nd = [0] * 2019\nd[0] = 1\nfor i in range(1, len(S) + 1):\n r = (r + t * S[-i]) % 2019\n d[r] += 1\n t = t * 10 % 2019\n\nans = 0\nfor m in d:\n if m >= 2:\n ans += m * (m - 1) \/\/ 2\n\nprint(ans)\n","change":"replace","i1":4,"i2":16,"j1":4,"j2":16,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02703","language":"Python","original_status":"Time Limit Exceeded","pass":"import heapq\n\n\ndef inpl():\n return list(map(int, input().split()))\n\n\nN, M, S = inpl()\nA = 51 # max A\nS = min(S, M * A - 1)\n\nlines = [[] for _ in range(N * (M * A))]\nfor _ in range(M):\n in_s, in_t, cost, time = inpl()\n in_s -= 1\n in_t -= 1\n\n for n in range(cost, M * A):\n s = in_s + n * N\n t = in_t + (n - cost) * N\n lines[s].append((t, time))\n\n s = in_s + (n - cost) * N\n t = in_t + n * N\n lines[t].append((s, time))\n\n\nfor i in range(N):\n cost, time = inpl()\n for n in range(0, M * A):\n s = i + n * N\n if n + cost >= M * A:\n t = i + (M * A - 1) * N\n else:\n t = i + (n + cost) * N\n lines[s].append((t, time))\n\n\nINF = 10**20\n\n\ndef dijkstra(N, S):\n weight = [INF] * N\n weight[S] = 0\n q = [[0, S]]\n heapq.heapify(q)\n while q:\n w0, s = heapq.heappop(q)\n for t, w in lines[s]:\n w += w0\n if weight[t] > w:\n heapq.heappush(q, [w, t])\n weight[t] = w\n\n return weight\n\n\nweight = dijkstra(N * (M * A), 0 + S * N)\n\nfor i in range(1, N):\n ans = INF\n for n in range(M * A):\n ans = min(ans, weight[i + n * N])\n print(ans)\n","fail":"import heapq\n\nINF = 10**20\nA = 50 # max A\n\n\ndef inpl():\n return list(map(int, input().split()))\n\n\ndef main():\n N, M, S = inpl()\n S = min(S, M * A)\n\n lines = [[] for _ in range(N * (M * A + 1))]\n for _ in range(M):\n in_s, in_t, cost, time = inpl()\n in_s -= 1\n in_t -= 1\n\n for n in range(cost, M * A + 1):\n s = in_s + n * N\n t = in_t + (n - cost) * N\n lines[s].append((t, time))\n\n s = in_s + (n - cost) * N\n t = in_t + n * N\n lines[t].append((s, time))\n\n for i in range(N):\n cost, time = inpl()\n for n in range(0, M * A + 1):\n s = i + n * N\n if n + cost > M * A:\n t = i + (M * A) * N\n else:\n t = i + (n + cost) * N\n lines[s].append((t, time))\n\n def dijkstra(N, S):\n weight = [INF] * N\n weight[S] = 0\n q = [[0, S]]\n heapq.heapify(q)\n while q:\n w0, s = heapq.heappop(q)\n for t, w in lines[s]:\n w += w0\n if weight[t] > w:\n heapq.heappush(q, [w, t])\n weight[t] = w\n\n return weight\n\n weight = dijkstra(N * (M * A + 1), 0 + S * N)\n\n ansl = [INF] * N\n for i, w in enumerate(weight):\n n = i % N\n if n == 0:\n continue\n else:\n ansl[n] = min(w, ansl[n])\n\n print(\"\\\\n\".join(map(str, ansl[1:])))\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":1,"i2":64,"j1":1,"j2":69,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02703","language":"Python","original_status":"Time Limit Exceeded","pass":"import heapq\n\nN, M, S = map(int, input().split())\n\nuvab = [list(map(int, input().split())) for _ in range(M)]\ncd = [list(map(int, input().split())) for _ in range(N)]\n\nfor i in range(M):\n uvab[i][0] -= 1\n uvab[i][1] -= 1\n\nrailways = [[] for _ in range(N)]\nmax_a = 0\nfor u, v, a, b in uvab:\n railways[u].append((v, a, b))\n railways[v].append((u, a, b))\n max_a = max(max_a, a)\ndel uvab\n\nmax_silver = max_a * (N - 1)\n\nans = [-1] * N\nd = dict()\nd[(S, 0)] = 0 # silver, station\nQ = [(0, S, 0)] # time, silver, station\nsum_reached = 0\nreached = [False] * N\n\nwhile Q:\n t, sv, st = heapq.heappop(Q)\n if not reached[st]:\n ans[st] = t\n reached[st] = True\n sum_reached += 1\n if sum_reached == N:\n break\n\n new_key = (sv + cd[st][0], st)\n new_value = t + cd[st][1]\n if new_key not in d or d[new_key] > new_value:\n d[new_key] = t + cd[st][1]\n heapq.heappush(Q, (new_value, *new_key))\n\n for dist, a, b in railways[st]:\n if sv >= a:\n new_key = (sv - a, dist)\n new_value = t + b\n if new_key not in d or d[new_key] > new_value:\n d[new_key] = new_value\n heapq.heappush(Q, (new_value, *new_key))\n\nprint(*ans[1:], sep=\"\\\\n\")\n","fail":"import heapq\n\nN, M, S = map(int, input().split())\n\nuvab = [list(map(int, input().split())) for _ in range(M)]\ncd = [list(map(int, input().split())) for _ in range(N)]\n\nfor i in range(M):\n uvab[i][0] -= 1\n uvab[i][1] -= 1\n\nrailways = [[] for _ in range(N)]\nmax_a = 0\nfor u, v, a, b in uvab:\n railways[u].append((v, a, b))\n railways[v].append((u, a, b))\n max_a = max(max_a, a)\ndel uvab\n\nmax_silver = max_a * (N - 1)\n\nans = [-1] * N\nd = dict()\nd[(S, 0)] = 0 # silver, station\nQ = [(0, S, 0)] # time, silver, station\nsum_reached = 0\nreached = [False] * N\n\nwhile Q:\n t, sv, st = heapq.heappop(Q)\n if not reached[st]:\n ans[st] = t\n reached[st] = True\n sum_reached += 1\n if sum_reached == N:\n break\n\n new_key = (min(max_silver, sv + cd[st][0]), st)\n new_value = t + cd[st][1]\n if new_key not in d or d[new_key] > new_value:\n d[new_key] = t + cd[st][1]\n heapq.heappush(Q, (new_value, *new_key))\n\n for dist, a, b in railways[st]:\n if sv >= a:\n new_key = (sv - a, dist)\n new_value = t + b\n if new_key not in d or d[new_key] > new_value:\n d[new_key] = new_value\n heapq.heappush(Q, (new_value, *new_key))\n\nprint(*ans[1:], sep=\"\\\\n\")\n","change":"replace","i1":37,"i2":38,"j1":37,"j2":38,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02705","language":"Python","original_status":"Runtime Error","pass":"n, m = map(int, input().split())\na = list(map(int, input().split()))\nif n - sum(a) >= 0:\n print(n - sum(a))\nelse:\n print(-1)\n","fail":"import math\n\nr = int(input())\nprint(2 * r * math.pi)\n","change":"replace","i1":0,"i2":6,"j1":0,"j2":4,"error":"ValueError: not enough values to unpack (expected 2, got 1)","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02705\/Python\/s499723334.py\", line 1, in \n n, m = map(int, input().split())\nValueError: not enough values to unpack (expected 2, got 1)\n","stdout":null} {"problem_id":"p02705","language":"Python","original_status":"Runtime Error","pass":"import math\n\nprint(int(input()) * 2 * math.pi())\n","fail":"import math\n\nprint(int(input()) * 2 * math.pi)\n","change":"replace","i1":2,"i2":3,"j1":2,"j2":3,"error":"TypeError: 'float' object is not callable","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02705\/Python\/s976752979.py\", line 3, in \n print(int(input()) * 2 * math.pi())\nTypeError: 'float' object is not callable\n","stdout":null} {"problem_id":"p02705","language":"Python","original_status":"Runtime Error","pass":"# coding: utf-8\n\n\ndef main():\n R = input(int())\n return R * 2 * 3.1415\n\n\nprint(main())\n","fail":"# coding: utf-8\n\n\ndef main():\n R = int(input())\n\n return R * 2 * 3.1415\n\n\nprint(main())\n","change":"replace","i1":4,"i2":5,"j1":4,"j2":6,"error":"TypeError: can't multiply sequence by non-int of type 'float'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02705\/Python\/s656493829.py\", line 9, in \n print(main())\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02705\/Python\/s656493829.py\", line 6, in main\n return R * 2 * 3.1415\nTypeError: can't multiply sequence by non-int of type 'float'\n","stdout":"0"} {"problem_id":"p02706","language":"Python","original_status":"Runtime Error","pass":"summer_vacation, amount_of_homework = map(int, input().split())\na = map(int, input().split())\nhomework_list = list[a]\n\ntotal_days = 0\n\nfor i in homework_list:\n total_days += i\n\nif summer_vacation >= total_days:\n print(summer_vacation - total_days)\nelse:\n print(-1)\n","fail":"summer_vacation, amount_of_homework = map(int, input().split())\na = map(int, input().split())\nhomework_list = list(a)\n\ntotal_days = 0\n\nfor i in homework_list:\n total_days += i\n\nif summer_vacation >= total_days:\n print(summer_vacation - total_days)\nelse:\n print(-1)\n","change":"replace","i1":2,"i2":3,"j1":2,"j2":3,"error":"TypeError: 'types.GenericAlias' object is not iterable","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02706\/Python\/s080879362.py\", line 7, in \n for i in homework_list:\nTypeError: 'types.GenericAlias' object is not iterable\n","stdout":null} {"problem_id":"p02706","language":"Python","original_status":"Runtime Error","pass":"n, m = map(int, input().split())\nprint(max(n - sum(list(map(int, input().split())))), -1)\n","fail":"n, m = map(int, input().split())\nA = list(map(int, input().split()))\n\nif n >= sum(A):\n print(n - sum(A))\nelse:\n print(\"-1\")\n","change":"replace","i1":1,"i2":2,"j1":1,"j2":7,"error":"TypeError: 'int' object is not iterable","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02706\/Python\/s791039988.py\", line 2, in \n print(max(n - sum(list(map(int, input().split())))), -1)\nTypeError: 'int' object is not iterable\n","stdout":null} {"problem_id":"p02706","language":"Python","original_status":"Runtime Error","pass":"n, m = map(int, input().split)\na = list(map(int, input().split()))\nct = 0\nfor i in range(m):\n ct += a[i]\n\nif n - ct >= 0:\n print(n - ct)\nelse:\n print(-1)\n","fail":"n, m = map(int, input().split())\na = list(map(int, input().split()))\nct = 0\nfor i in range(m):\n ct += a[i]\n\nif n - ct >= 0:\n print(n - ct)\nelse:\n print(-1)\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"TypeError: 'builtin_function_or_method' object is not iterable","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02706\/Python\/s941071070.py\", line 1, in \n n, m = map(int, input().split)\nTypeError: 'builtin_function_or_method' object is not iterable\n","stdout":null} {"problem_id":"p02706","language":"Python","original_status":"Runtime Error","pass":"# abc163B\n# https:\/\/atcoder.jp\/contests\/abc163\/tasks\/abc163_b\n\n# \u590f\u4f11\u307f\u306fN\u65e5\u9593\n# \u590f\u4f11\u307f\u306e\u5bbf\u984c\u306fM\u500b\n# \u5bbf\u984c\u306f\u540c\u3058\u65e5\u306b\u8907\u6570\u3067\u304d\u306a\u3044\u3001\u5bbf\u984c\u306e\u6642\u306f\u904a\u3076\u3053\u3068\u306f\u3067\u304d\u306a\u3044\n# \u6700\u5927\u4f55\u65e5\u9593\u904a\u3076\u3053\u3068\u304c\u51fa\u6765\u308b\u304b\n# \u590f\u4f11\u307f\u4e2d\u306b\u7d42\u308f\u3089\u305b\u3089\u308c\u306a\u3044\u5834\u5408\u306f\u3001\"-1\"\n\n# \u5165\u529b\nn = int(input())\nm = int(input())\na = list(map(int, input().split()))\n\n# \u51e6\u7406\nanswer = n - sum(a)\n\nif answer > 0:\n print(answer)\nelse:\n print(\"-1\")\n","fail":"# abc163B\n# https:\/\/atcoder.jp\/contests\/abc163\/tasks\/abc163_b\n\n# \u590f\u4f11\u307f\u306fN\u65e5\u9593\n# \u590f\u4f11\u307f\u306e\u5bbf\u984c\u306fM\u500b\n# \u5bbf\u984c\u306f\u540c\u3058\u65e5\u306b\u8907\u6570\u3067\u304d\u306a\u3044\u3001\u5bbf\u984c\u306e\u6642\u306f\u904a\u3076\u3053\u3068\u306f\u3067\u304d\u306a\u3044\n# \u6700\u5927\u4f55\u65e5\u9593\u904a\u3076\u3053\u3068\u304c\u51fa\u6765\u308b\u304b\n# \u590f\u4f11\u307f\u4e2d\u306b\u7d42\u308f\u3089\u305b\u3089\u308c\u306a\u3044\u5834\u5408\u306f\u3001\"-1\"\n\n# \u5165\u529b\nn, m = map(int, input().split())\na = list(map(int, input().split()))\n\n# \u51e6\u7406\n# \u5bbf\u984c\u306b\u304b\u304b\u308b\u5408\u8a08\u65e5\u6570\nanswer = n - sum(a)\n\nif answer < 0:\n print(\"-1\")\nelse:\n print(answer)\n","change":"replace","i1":10,"i2":21,"j1":10,"j2":21,"error":"ValueError: invalid literal for int() with base 10: '41 2'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02706\/Python\/s871946506.py\", line 11, in \n n = int(input())\nValueError: invalid literal for int() with base 10: '41 2'\n","stdout":null} {"problem_id":"p02706","language":"Python","original_status":"Runtime Error","pass":"n, m = map(int, input().split())\na = [0] * m\nfor i in range(m):\n a[i] = int(input())\n\nans = n - sum(a)\nif ans > 0:\n print(ans)\nelse:\n print(-1)\n","fail":"# ABC163B\n\nn, m = map(int, input().split())\na = list(map(int, input().split()))\n\nans = n - sum(a)\nif ans >= 0:\n print(ans)\nelse:\n print(-1)\n","change":"replace","i1":0,"i2":7,"j1":0,"j2":7,"error":"ValueError: invalid literal for int() with base 10: '5 6'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02706\/Python\/s373162453.py\", line 4, in \n a[i] = int(input())\nValueError: invalid literal for int() with base 10: '5 6'\n","stdout":null} {"problem_id":"p02707","language":"Python","original_status":"Time Limit Exceeded","pass":"#!\/usr\/bin\/env python\n# -*- coding: utf-8 -*-\nfrom collections import Counter\n\n\ndef main():\n N = int(input())\n A = list(map(int, input().split()))\n\n for i in range(N):\n print(Counter(A)[i + 1])\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"#!\/usr\/bin\/env python\n# -*- coding: utf-8 -*-\nfrom collections import Counter\n\n\ndef main():\n N = int(input())\n A = list(map(int, input().split()))\n count = Counter(A)\n\n for i in range(N):\n print(count[i + 1])\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":8,"i2":11,"j1":8,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02707","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = list(map(int, input().split()))\n\nfor i in range(n):\n print(a.count(i + 1))\n","fail":"n = int(input())\na = list(map(int, input().split()))\n\nans = [0] * n\n\nfor i in a:\n ans[i - 1] += 1\n\nfor i in range(n):\n print(ans[i])\n","change":"replace","i1":3,"i2":5,"j1":3,"j2":10,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02707","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = list(map(int, input().split()))\nfor i in range(n):\n print(a.count(i + 1))\n","fail":"n = int(input())\na = list(map(int, input().split()))\nresult = [0] * n\nfor x in a:\n result[x - 1] += 1\nfor v in result:\n print(v)\n","change":"replace","i1":2,"i2":4,"j1":2,"j2":7,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02707","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = list(int(i) for i in input().split())\n\nfor i in range(1, n + 1):\n print(a.count(i))\n","fail":"n = int(input())\na = list(int(i) for i in input().split())\nlst = [0] * (n + 1)\n\nfor i in a:\n lst[i] += 1\n\nfor i in range(1, n + 1):\n print(lst[i])\n","change":"replace","i1":2,"i2":5,"j1":2,"j2":9,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02707","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\nA = list(map(int, input().split()))\n\nm = 0\nt = 0\n\nfor i in range(1, n):\n count = A.count(i)\n print(count)\n m += count\n t = i\n if m == n - 1:\n break\nfor _ in range(t, n):\n print(0)\n","fail":"n = int(input())\nA = list(map(int, input().split()))\n\n# m = 0\n# t = 0\n\n# for i in range(1, n):\n# count = A.count(i)\n# print(count)\n# m += count\n# t = i\n# if m == n - 1:\n# break\n# for _ in range(t, n):\n# print(0)\n\nB = [0] * n\nfor i in A:\n B[i - 1] += 1\nfor i in B:\n print(i)\n","change":"replace","i1":3,"i2":15,"j1":3,"j2":21,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02707","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = list(map(int, input().split()))\nfor i in range(1, N + 1):\n print(A.count(i))\n","fail":"N = int(input())\nA = list(map(int, input().split()))\n\nlis = [0] * N\nfor i in range(N - 1):\n lis[(A[i] - 1)] += 1\n\nfor i in range(N):\n print(lis[i])\n","change":"replace","i1":2,"i2":4,"j1":2,"j2":9,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02707","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = list(map(int, input().split()))\nfor i in range(n):\n print(a.count(i + 1))\n","fail":"n = int(input())\na = list(map(int, input().split()))\nb = [0 for i in range(n)]\n\nfor i in a:\n b[i - 1] += 1\n\nfor i in b:\n print(i)\n","change":"replace","i1":2,"i2":4,"j1":2,"j2":9,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02707","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = list(map(int, input().split()))\nB = []\nfor i in range(1, N + 1):\n print(A.count(i))\n","fail":"N = int(input())\nA = list(map(int, input().split()))\nB = [0 for i in range(N)]\nfor i in A:\n B[i - 1] += 1\nfor i in B:\n print(i)\n","change":"replace","i1":2,"i2":5,"j1":2,"j2":7,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02707","language":"Python","original_status":"Time Limit Exceeded","pass":"def main():\n N = int(input())\n A = list(map(int, input().split()))\n\n for i in range(1, N + 1):\n print(A.count(i))\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"from collections import Counter\n\n\ndef main():\n N = int(input())\n A = list(map(int, input().split()))\n\n c = Counter(A)\n\n for i in range(1, N + 1):\n print(c[i])\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":0,"i2":6,"j1":0,"j2":11,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02707","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\n\nls = list(map(int, input().split()))\n\nrg = range(1, n + 1)\n\nfor i in rg:\n c = ls.count(i)\n print(c)\n","fail":"n = int(input())\nls = list(map(int, input().split()))\n\nls2 = [0 for x in range(n)]\n# 0\u304cn\u500b\u306e\u30ea\u30b9\u30c8\u3092\u7528\u610f\u3059\u308b\n\nfor x in ls:\n ls2[x - 1] += 1\n\nfor x in range(n):\n print(ls2[x])\n","change":"replace","i1":1,"i2":9,"j1":1,"j2":11,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02707","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA_i = list(map(int, input().split()))\nuq_A_i = list(set(A_i))\nC = [\"0\\\\n\"] * N\nfor i in uq_A_i:\n C[i - 1] = \"{}\".format(A_i.count(i)) + \"\\\\n\"\nprint(\"\".join(C))\n","fail":"N = int(input())\nA_i = list(map(int, input().split()))\nC = [0] * N\nfor i in A_i:\n C[i - 1] += 1\nprint(*C)\n","change":"replace","i1":2,"i2":7,"j1":2,"j2":6,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02707","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = map(int, input().split())\n\na = list(a)\nfor i in range(n):\n count = 0\n for j in range(i, n - 1):\n if a[j] == i + 1:\n count += 1\n print(count)\n","fail":"n = int(input())\na = map(int, input().split())\n\na = list(a)\nresult = [0] * n\nfor i in range(n - 1):\n result[a[i] - 1] += 1\n\nprint(*result, sep=\"\\\\n\")\n","change":"replace","i1":4,"i2":10,"j1":4,"j2":9,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02707","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = list(map(int, input().split()))\n\nfor i in range(1, n + 1):\n print(a.count(i))\n","fail":"from collections import Counter\n\nn = int(input())\na = list(map(int, input().split()))\n\nc = Counter(a)\n\nfor i in range(1, n + 1):\n if i in c:\n print(c[i])\n else:\n print(0)\n","change":"replace","i1":0,"i2":5,"j1":0,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02707","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = list(map(int, input().split()))\n\nfor i in range(1, n + 1):\n print(a.count(i))\n","fail":"import collections\n\nn = int(input())\na = list(map(int, input().split()))\n\nc = collections.Counter(a)\n\nfor i in range(1, n + 1):\n if i in c:\n print(c[i])\n else:\n print(0)\n","change":"replace","i1":0,"i2":5,"j1":0,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02707","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\na = list(input().split())\nfor i in range(N):\n s = str(i + 1)\n print(a.count(s))\n","fail":"N = int(input())\na = list(map(int, input().split()))\nli = [0] * N\n\nfor i in range(N - 1):\n li[a[i] - 1] = li[a[i] - 1] + 1\n\nfor i in range(N):\n print(li[i])\n","change":"replace","i1":1,"i2":5,"j1":1,"j2":9,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02707","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\nli_a = list(map(int, input().split()))\n\nset_a = set(li_a)\n\nfor i in range(1, n + 1):\n if i in set_a:\n print(li_a.count(i))\n else:\n print(0)\n","fail":"n = int(input())\nli_a = list(map(int, input().split()))\n\ndic = {}\nfor a in li_a:\n dic[a] = dic.get(a, 0) + 1\n\nfor i in range(1, n + 1):\n print(dic.get(i, 0))\n","change":"replace","i1":3,"i2":10,"j1":3,"j2":9,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02707","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\n\nline = list(map(int, input().strip().split(\" \")))\n\nfor i in range(1, n + 1):\n print(line.count(i))\n","fail":"n = int(input())\n\nline = list(map(int, input().strip().split(\" \")))\n\nans = [0 for s in range(n)]\n\nfor i in line:\n ans[i - 1] += 1\n\nfor i in range(n):\n print(ans[i])\n","change":"replace","i1":4,"i2":6,"j1":4,"j2":11,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02707","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = list(map(int, input().split()))\nfor r in [A.count(i) for i in range(1, N + 1)]:\n print(r)\n","fail":"import collections\n\nN = int(input())\nA = list(map(int, input().split()))\nc = collections.Counter(A)\nfor i in range(1, N + 1):\n if c[i]:\n print(c[i])\n else:\n print(0)\n","change":"replace","i1":0,"i2":4,"j1":0,"j2":10,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02707","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = list(map(int, input().split()))\nfor i in range(N):\n print(A.count(i + 1))\n","fail":"N = int(input())\ns = [0 for i in range(N)]\nA = list(map(int, input().split()))\nfor i in A:\n s[i - 1] += 1\nprint(*s, sep=\"\\\\n\")\n","change":"replace","i1":1,"i2":4,"j1":1,"j2":6,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02707","language":"Python","original_status":"Time Limit Exceeded","pass":"num_of_employee = int(input())\nemployeenos = list(map(int, input().split()))\n\nfor i in range(1, num_of_employee + 1):\n print(employeenos.count(i))\n","fail":"import collections\n\nnum_of_employee = int(input())\nemployeenos = list(map(int, input().split()))\n\nc = collections.Counter(employeenos)\nfor i in range(1, num_of_employee + 1):\n print(c[i])\n","change":"replace","i1":0,"i2":5,"j1":0,"j2":8,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02709","language":"Python","original_status":"Time Limit Exceeded","pass":"import numpy as np\n\nfrom sys import stdin\n\n\ndef main():\n n = int(stdin.readline())\n a = list(map(int, stdin.readline().split()))\n\n a2 = [[a[i], i] for i in range(n)]\n a2.sort(reverse=True)\n\n dp = [[0 for _ in range(n + 1)] for _ in range(n + 1)]\n\n ans = 0\n\n for i in range(n + 1):\n for j in range(n + 1 - i):\n s1 = s2 = 0\n if i > 0:\n s1 = dp[i - 1][j] + a2[i + j - 1][0] * (a2[i + j - 1][1] - (i - 1))\n if j > 0:\n s2 = dp[i][j - 1] + a2[i + j - 1][0] * ((n - j) - a2[i + j - 1][1])\n dp[i][j] = np.max([s1, s2])\n ans = np.max([ans, dp[i][n - i]])\n\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"from sys import stdin\n\n\ndef main():\n n = int(stdin.readline())\n a = list(map(int, stdin.readline().split()))\n\n a2 = [[a[i], i] for i in range(n)]\n a2.sort(reverse=True)\n\n dp = [[0 for _ in range(n + 1)] for _ in range(n + 1)]\n\n ans = 0\n\n for i in range(n + 1):\n for j in range(n + 1 - i):\n s1 = s2 = 0\n if i > 0:\n s1 = dp[i - 1][j] + a2[i + j - 1][0] * (a2[i + j - 1][1] - (i - 1))\n if j > 0:\n s2 = dp[i][j - 1] + a2[i + j - 1][0] * ((n - j) - a2[i + j - 1][1])\n dp[i][j] = max(s1, s2)\n ans = max(ans, dp[i][n - i])\n\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":0,"i2":25,"j1":0,"j2":23,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02709","language":"Python","original_status":"Runtime Error","pass":"from copy import deepcopy\n\nN = int(input())\nA = list(map(int, input().split()))\n\nindex = [i for i in range(N)]\nindex = sorted(index, key=lambda i: A[i], reverse=True)\n\n\ndef LorR(index, res):\n i = index[0]\n dist = max(i, N - 1 - i)\n end = False\n cand1 = cand2 = 0\n while not end:\n j = i + dist\n if 0 <= j and j < N and not res[j]:\n r = deepcopy(res)\n r[j] = True\n cand1 = A[i] * dist + loop(index[1:], r)\n end = True\n\n j = i - dist\n if 0 <= j and j < N and not res[j]:\n r = deepcopy(res)\n r[j] = True\n cand2 = A[i] * dist + loop(index[1:], r)\n end = True\n\n dist -= 1\n return max(cand1, cand2)\n\n\ndef loop(index, res):\n if not index:\n return 0\n\n return LorR(index, res)\n\n\nprint(loop(index, [False] * N))\n","fail":"N = int(input())\nA = list(map(int, input().split()))\n\nA = sorted([(val, pos) for pos, val in enumerate(A)], reverse=True)\n\ndp = [0]\nfor i, (val, pos) in enumerate(A):\n ldp = [e + val * abs(pos - (i - r)) for r, e in enumerate(dp)]\n rdp = [e + val * abs(N - 1 - r - pos) for r, e in enumerate(dp)]\n dp = [max(L, R) for L, R in zip(ldp + [0], [0] + rdp)]\n\nprint(max(dp))\n","change":"replace","i1":0,"i2":41,"j1":0,"j2":12,"error":"0","stderr":null,"stdout":"20\n"} {"problem_id":"p02709","language":"Python","original_status":"Time Limit Exceeded","pass":"# \u89e3\u8aacAC\nn = int(input())\nA = list(map(int, input().split()))\nB = []\nfor i, e in enumerate(A):\n B.append((e, i + 1))\nB.sort(reverse=True)\n# dp[i][j]: Ai\u307e\u3067\u5165\u308c\u305f\u6642\u3001\u5de6\u306bj\u500b\u6c7a\u3081\u305f\u6642\u306e\u6700\u5927\u5024\ndp = [[-1] * (n + 1) for _ in range(n + 1)]\ndp[0][0] = 0\n\nfor i in range(n):\n for j in range(i + 1): # \u5de6\u306e\u500b\u6570\n k = i - j # \u53f3\u306e\u500b\u6570\n ni = i + 1\n val, idx = B[i]\n dp[ni][j] = max(dp[ni][j], dp[i][j] + abs(n - k - idx) * val)\n dp[ni][j + 1] = max(dp[ni][j + 1], dp[i][j] + abs(idx - (j + 1)) * val)\nans = 0\nfor i in range(n + 1):\n ans = max(ans, dp[n][i])\nprint(ans)\n","fail":"# \u89e3\u8aacAC\nimport sys\n\ninput = sys.stdin.buffer.readline\n\nn = int(input())\nA = list(map(int, input().split()))\nB = []\nfor i, e in enumerate(A):\n B.append((e, i + 1))\nB.sort(reverse=True)\n# dp[i][j]: Ai\u307e\u3067\u5165\u308c\u305f\u6642\u3001\u5de6\u306bj\u500b\u6c7a\u3081\u305f\u6642\u306e\u6700\u5927\u5024\ndp = [[-1] * (n + 1) for _ in range(n + 1)]\ndp[0][0] = 0\n\nfor i in range(n):\n for j in range(i + 1): # \u5de6\u306e\u500b\u6570\n k = i - j # \u53f3\u306e\u500b\u6570\n ni = i + 1\n val, idx = B[i]\n dp[ni][j] = max(dp[ni][j], dp[i][j] + abs(n - k - idx) * val)\n dp[ni][j + 1] = max(dp[ni][j + 1], dp[i][j] + abs(idx - (j + 1)) * val)\nans = 0\nfor i in range(n + 1):\n ans = max(ans, dp[n][i])\nprint(ans)\n","change":"insert","i1":1,"i2":1,"j1":1,"j2":5,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02710","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nCs = list(map(int, input().split()))\nadj = [[] for _ in range(N)]\nfor _ in range(N - 1):\n a, b = map(int, input().split())\n adj[a - 1].append(b - 1)\n adj[b - 1].append(a - 1)\n\ndegs = [0] * N\nclusters = [[] for _ in range(N)]\n\n\ndef go(curr, fro):\n col = Cs[curr] - 1\n deg = 1\n clust = {}\n for n in adj[curr]:\n if n == fro:\n continue\n ch_deg, ch_clust = yield n, curr\n clusters[col].append(ch_deg - ch_clust.get(col, 0))\n if len(ch_clust) > len(clust):\n clust, ch_clust = ch_clust, clust\n for k, v in ch_clust.items():\n clust[k] = clust.get(k, 0) + v\n deg += ch_deg\n clust[col] = deg\n return deg, clust\n\n\nstack = [[None, None], [go(0, -1), None]]\nwhile len(stack) > 1:\n gen, val = stack[-1]\n try:\n params = gen.send(val)\n except StopIteration as e:\n stack[-2][1] = e.value\n stack.pop()\n else:\n stack.append([go(*params), None])\n\n_, root_clust = stack[0][1]\nfor i in range(N):\n clusters[i].append(N - root_clust.get(i, 0))\n\n\nfor clust in clusters:\n tot = (N * N + N) \/\/ 2\n for cnt in clust:\n tot -= (cnt * cnt + cnt) \/\/ 2\n print(tot)\n","fail":"N = int(input())\nCs = list(map(int, input().split()))\nadj = [[] for _ in range(N)]\nfor _ in range(N - 1):\n a, b = map(int, input().split())\n adj[a - 1].append(b - 1)\n adj[b - 1].append(a - 1)\n\ndegs = [0] * N\nclusters = [[] for _ in range(N)]\n\n\ndef go(curr, fro):\n col = Cs[curr] - 1\n deg = 1\n clust = {}\n for n in adj[curr]:\n if n == fro:\n continue\n ch_deg, ch_clust = yield n, curr\n clusters[col].append(ch_deg - ch_clust.get(col, 0))\n if len(ch_clust) > len(clust):\n clust, ch_clust = ch_clust, clust\n for k, v in ch_clust.items():\n clust[k] = clust.get(k, 0) + v\n deg += ch_deg\n clust[col] = deg\n return deg, clust\n\n\ndef tramp(gen_fn, *args):\n stack = [gen_fn(*args)]\n val = None\n while stack:\n gen = stack[-1]\n try:\n params = gen.send(val)\n except StopIteration as e:\n stack.pop()\n val = e.value\n else:\n stack.append(go(*params))\n val = None\n return val\n\n\n_, root_clust = tramp(go, 0, -1)\nfor i in range(N):\n clusters[i].append(N - root_clust.get(i, 0))\n\n\nfor clust in clusters:\n tot = (N * N + N) \/\/ 2\n for cnt in clust:\n tot -= (cnt * cnt + cnt) \/\/ 2\n print(tot)\n","change":"replace","i1":30,"i2":42,"j1":30,"j2":47,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02710","language":"Python","original_status":"Runtime Error","pass":"import asyncio\n\nN = int(input())\nCs = list(map(int, input().split()))\nadj = [[] for _ in range(N)]\nfor _ in range(N - 1):\n a, b = map(int, input().split())\n adj[a - 1].append(b - 1)\n adj[b - 1].append(a - 1)\n\ndegs = [0] * N\nclusters = [[] for _ in range(N)]\n\n\nasync def go(curr, fro):\n col = Cs[curr] - 1\n deg = 1\n clust = {}\n for n in adj[curr]:\n if n == fro:\n continue\n ch_deg, ch_clust = await go(n, curr)\n clusters[col].append(ch_deg - ch_clust.get(col, 0))\n if len(ch_clust) > len(clust):\n clust, ch_clust = ch_clust, clust\n for k, v in ch_clust.items():\n clust[k] = clust.get(k, 0) + v\n deg += ch_deg\n clust[col] = deg\n return deg, clust\n\n\n_, root_clust = asyncio.get_event_loop().run_until_complete(go(0, -1))\nfor i in range(N):\n clusters[i].append(N - root_clust.get(i, 0))\n\n\nfor clust in clusters:\n tot = (N * N + N) \/\/ 2\n for cnt in clust:\n tot -= (cnt * cnt + cnt) \/\/ 2\n print(tot)\n","fail":"N = int(input())\nCs = list(map(int, input().split()))\nadj = [[] for _ in range(N)]\nfor _ in range(N - 1):\n a, b = map(int, input().split())\n adj[a - 1].append(b - 1)\n adj[b - 1].append(a - 1)\n\nunder_col = [0] * N\nans = [0] * N\n\n\ndef tri(n):\n return n * (n + 1) \/\/ 2\n\n\ndef go(curr, fro):\n col = Cs[curr] - 1\n prev_under = under_col[col]\n deg = 1\n for n in adj[curr]:\n if n == fro:\n continue\n curr_under = under_col[col]\n ch_deg = yield go(n, curr)\n diff_under = under_col[col] - curr_under\n ans[col] += tri(ch_deg - diff_under)\n deg += ch_deg\n under_col[col] = prev_under + deg\n return deg\n\n\ndef tramp(gen):\n stack = [gen]\n val = None\n while stack:\n try:\n stack.append(stack[-1].send(val))\n val = None\n except StopIteration as e:\n stack.pop()\n val = e.value\n return val\n\n\ntramp(go(0, -1))\nfor i in range(N):\n ans[i] += tri(N - under_col[i])\n print(tri(N) - ans[i])\n","change":"replace","i1":0,"i2":42,"j1":0,"j2":49,"error":"0","stderr":"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02710\/Python\/s158459294.py:33: DeprecationWarning: There is no current event loop\n _, root_clust = asyncio.get_event_loop().run_until_complete(go(0, -1))\n","stdout":"5\n4\n0\n"} {"problem_id":"p02711","language":"Python","original_status":"Runtime Error","pass":"N = int(input())\nstr(N)\nlistN = sorted(N)\nif listN.count(\"7\") >= 1:\n print(\"Yes\")\nelse:\n print(\"No\")\n","fail":"N = int(input())\nlistN = sorted(str(N))\nif listN.count(\"7\") >= 1:\n print(\"Yes\")\nelse:\n print(\"No\")\n","change":"replace","i1":1,"i2":3,"j1":1,"j2":2,"error":"TypeError: 'int' object is not iterable","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02711\/Python\/s383379366.py\", line 3, in \n listN = sorted(N)\nTypeError: 'int' object is not iterable\n","stdout":null} {"problem_id":"p02712","language":"Python","original_status":"Runtime Error","pass":"N = int(input().split())\n\nprint(sum([n + 1 for n in range(N) if (n + 1) % 3 != 0 and (n + 1) % 5 != 0]))\n","fail":"N = int(input())\n\nprint(sum([n + 1 for n in range(N) if (n + 1) % 3 != 0 and (n + 1) % 5 != 0]))\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"TypeError: int() argument must be a string, a bytes-like object or a real number, not 'list'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02712\/Python\/s624885598.py\", line 1, in \n N = int(input().split())\nTypeError: int() argument must be a string, a bytes-like object or a real number, not 'list'\n","stdout":null} {"problem_id":"p02713","language":"Python","original_status":"Time Limit Exceeded","pass":"#!\/usr\/bin\/env python3\nfrom functools import reduce\nfrom itertools import product\nfrom math import gcd\n\nk = int(input())\np = list(product(range(1, k + 1), repeat=3))\nprint(sum(reduce(gcd, i) for i in p))\n","fail":"#!\/usr\/bin\/env python3\nfrom functools import reduce\nfrom itertools import combinations\nfrom math import gcd\n\nK = int(input())\n\nsum = K * (K + 1) \/\/ 2\n\nfor i in combinations(range(1, K + 1), 2):\n sum += 6 * reduce(gcd, i)\n\nfor i in combinations(range(1, K + 1), 3):\n sum += 6 * reduce(gcd, i)\n\nprint(sum)\n","change":"replace","i1":2,"i2":8,"j1":2,"j2":16,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02713","language":"Python","original_status":"Time Limit Exceeded","pass":"import math\n\n\ndef gcd(a, b, c):\n\n return math.gcd(math.gcd(a, b), c)\n\n\nk = int(input())\nanswer = 0\nfor w_a in range(1, k + 1):\n for w_b in range(1, k + 1):\n for w_c in range(1, k + 1):\n answer += gcd(w_a, w_b, w_c)\n\nprint(answer)\n","fail":"import math\n\n\nk = int(input())\nanswer = 0\nfor w_a in range(1, k + 1):\n for w_b in range(1, k + 1):\n w = math.gcd(w_a, w_b)\n for w_c in range(1, k + 1):\n answer += math.gcd(w, w_c)\n\nprint(answer)\n","change":"replace","i1":1,"i2":14,"j1":1,"j2":10,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02713","language":"Python","original_status":"Time Limit Exceeded","pass":"import math\nfrom functools import lru_cache\n\n\n@lru_cache(maxsize=None)\ndef gcd(a, b):\n return math.gcd(a, b)\n\n\nK = int(input())\n\ntotal = 0\n\nfor a in range(1, K + 1):\n for b in range(1, K + 1):\n for c in range(1, K + 1):\n total += gcd(gcd(a, b), c)\n\nprint(total)\n","fail":"import sys\nimport math\nfrom functools import lru_cache\n\ngcd = [[0] * 201 for _ in range(201)]\n\nfor i in range(201):\n for j in range(201):\n gcd[i][j] = math.gcd(i, j)\n\nK = int(input())\n\ntotal = 0\n\nfor a in range(1, K + 1):\n for b in range(1, K + 1):\n for c in range(1, K + 1):\n total += gcd[gcd[a][b]][c]\n\nprint(total)\n","change":"replace","i1":0,"i2":17,"j1":0,"j2":18,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02713","language":"Python","original_status":"Time Limit Exceeded","pass":"import math\nfrom functools import reduce\n\n# from collections import defaultdict\n\n\ndef gcd(*numbers):\n return reduce(math.gcd, numbers)\n\n\ndef reducef(x, y):\n return gcdd[(x, y)]\n\n\ndef gcd2(*numbers):\n return reduce(reducef, numbers)\n\n\nK = int(input())\nans = 0\n# gcdd=defaultdict()\ngcdd = {}\nfor a in range(1, K + 1):\n for b in range(1, K + 1):\n if (a, b) not in gcdd:\n gcdd[(a, b)] = gcd(a, b)\n\nfor a in range(1, K + 1):\n for b in range(1, K + 1):\n for c in range(1, K + 1):\n ans += gcd2(a, b, c)\nprint(ans)\n","fail":"from functools import reduce\n\n# from collections import defaultdict\n\n\ndef gcd(x, y):\n while y != 0:\n x, y = y, x % y\n return x\n\n\ndef gcddd(*numbers):\n return reduce(gcd, numbers)\n\n\ndef reducef(x, y):\n return gcdd[(x, y)]\n\n\ndef gcd2(*numbers):\n return reduce(reducef, numbers)\n\n\nK = int(input())\nans = 0\n# gcdd=defaultdict()\ngcdd = {}\nfor a in range(1, K + 1):\n for b in range(1, K + 1):\n if (a, b) not in gcdd:\n gcdd[(a, b)] = gcddd(a, b)\n\nfor a in range(1, K + 1):\n for b in range(1, K + 1):\n for c in range(1, K + 1):\n ans += gcd2(a, b, c)\nprint(ans)\n","change":"replace","i1":0,"i2":26,"j1":0,"j2":31,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02713","language":"Python","original_status":"Time Limit Exceeded","pass":"import math as f\n\nK = int(input())\ntotal = 0\n\nfor i in range(1, K + 1):\n for j in range(1, K + 1):\n for k in range(1, K + 1):\n total += f.gcd(f.gcd(i, j), k)\n\nprint(total)\n","fail":"import math as f\n\nK = int(input())\ntotal = 0\n\nfor i in range(1, K + 1):\n for j in range(1, K + 1):\n ij = f.gcd(i, j)\n if ij == 1:\n total += K\n continue\n for k in range(1, K + 1):\n total += f.gcd(ij, k)\n\nprint(total)\n","change":"replace","i1":7,"i2":9,"j1":7,"j2":13,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02713","language":"Python","original_status":"Runtime Error","pass":"N = int(input())\nA = list(map(int, input().split()))\nworker_list = [0] * N\n\nfor i in range(0, N - 1):\n worker_list[A[i] - 1] += 1\n\nfor i in range(N):\n print(worker_list[i])\n","fail":"from math import gcd\n\n\ndef gcd_3(a, b, c):\n return gcd(gcd(a, b), c)\n\n\nsum_gcd = 0\nK = int(input())\nfor i in range(1, K + 1):\n for j in range(1, K + 1):\n for l in range(1, K + 1):\n sum_gcd += gcd_3(i, j, l)\n\nprint(sum_gcd)\n","change":"replace","i1":0,"i2":9,"j1":0,"j2":15,"error":"EOFError: EOF when reading a line","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02713\/Python\/s110715782.py\", line 2, in \n A = list(map(int, input().split()))\nEOFError: EOF when reading a line\n","stdout":null} {"problem_id":"p02713","language":"Python","original_status":"Time Limit Exceeded","pass":"import math\n\nK = int(input())\n\nsum = 0\n\nfor a in range(K):\n for b in range(K):\n for c in range(K):\n sum += math.gcd(math.gcd(a + 1, b + 1), c + 1)\n\nprint(sum)\n","fail":"import math\n\nK = int(input())\n\nsum = 0\n\nfor a in range(K):\n sum += a + 1\n # print(a + 1, a + 1)\n for b in range(K):\n if a < b:\n gcd2_sum = math.gcd(a + 1, b + 1) * 3 * 2\n sum += gcd2_sum\n # print(a + 1, b + 1, gcd2_sum)\n for c in range(K):\n if b < c:\n gcd3_sum = math.gcd(math.gcd(a + 1, b + 1), c + 1) * 6\n sum += gcd3_sum\n # print(a + 1, b + 1, c + 1, gcd3_sum)\nprint(sum)\n","change":"replace","i1":7,"i2":11,"j1":7,"j2":19,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02713","language":"Python","original_status":"Time Limit Exceeded","pass":"#!\/usr\/bin\/env python3\nn = int(input())\nans = 0\n\n\ndef gcd(n, m):\n a, b = n, m\n if a > b:\n a, b = b, a\n while a != 0:\n a, b = b % a, a\n return b\n\n\nfor i in range(1, n + 1):\n for j in range(1, n + 1):\n for k in range(1, n + 1):\n ans += gcd(k, gcd(i, j))\nprint(ans)\n","fail":"#!\/usr\/bin\/env python3\nn = int(input())\nans = 0\n# gcd_grid = [[0] * 201 for _ in range(201)]\n\n\ndef gcd(n, m):\n \"\"\"if n <= 200 and m <= 200:\n if gcd_grid[n][m] != 0:\n return gcd_grid[n][m]\"\"\"\n a, b = n, m\n if a > b:\n a, b = b, a\n while a != 0:\n a, b = b % a, a\n # gcd_grid[n][m] = b\n # gcd_grid[m][n] = b\n return b\n\n\nfor i in range(1, n + 1):\n for j in range(i + 1, n + 1):\n for k in range(j + 1, n + 1):\n ans += 6 * gcd(k, gcd(i, j))\nfor i in range(1, n + 1):\n for j in range(i + 1, n + 1):\n ans += 6 * gcd(i, j)\nfor i in range(n + 1):\n ans += i\nprint(ans)\n","change":"replace","i1":3,"i2":18,"j1":3,"j2":29,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02713","language":"Python","original_status":"Time Limit Exceeded","pass":"import itertools\nimport math\n\n\ndef gcd(a: int, b: int, c: int) -> int:\n return math.gcd(math.gcd(a, b), c)\n\n\ndef main() -> None:\n k = int(input())\n\n s = sum(gcd(a, b, c) for a, b, c in itertools.product(range(1, k + 1), repeat=3))\n print(s)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"import itertools\nimport math\n\n\ndef gcd(a: int, b: int, c: int) -> int:\n return math.gcd(math.gcd(a, b), c)\n\n\ndef main() -> None:\n k = int(input())\n\n one_to_k = range(1, k + 1)\n s1 = sum(one_to_k)\n s2 = sum(math.gcd(a, b) for a, b in itertools.combinations(one_to_k, 2))\n s3 = sum(gcd(a, b, c) for a, b, c in itertools.combinations(one_to_k, 3))\n print(s1 + 6 * s2 + 6 * s3)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":11,"i2":13,"j1":11,"j2":16,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02713","language":"Python","original_status":"Time Limit Exceeded","pass":"import math\nfrom functools import reduce\n\n\ndef gcd(*numbers):\n return reduce(math.gcd, numbers)\n\n\nK = int(input())\nsumGCD = K * K * K\nfor a in range(2, K + 1, 1):\n for b in range(2, K + 1, 1):\n for c in range(2, K + 1, 1):\n arr = [a, b, c]\n gcdNum = gcd(*arr)\n # if gcdNum != 1:\n # print(arr)\n # print(gcdNum)\n sumGCD += gcdNum - 1\nprint(sumGCD)\n","fail":"import math\n\nK = int(input())\nsumGCD = K * K * K\nfor a in range(2, K + 1, 1):\n for b in range(2, K + 1, 1):\n for c in range(2, K + 1, 1):\n arr = [a, b, c]\n gcdNum = math.gcd(math.gcd(a, b), c)\n # if gcdNum != 1:\n # print(arr)\n # print(gcdNum)\n sumGCD += gcdNum - 1\nprint(sumGCD)\n","change":"replace","i1":1,"i2":15,"j1":1,"j2":9,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02713","language":"Python","original_status":"Time Limit Exceeded","pass":"from math import gcd\nfrom functools import reduce\n\n\ndef gcd_kai(*numbers):\n return reduce(gcd, numbers)\n\n\nK = int(input())\nans = 0\nfor i in range(K):\n for j in range(K):\n for k in range(K):\n ans += gcd_kai(i + 1, j + 1, k + 1)\nprint(ans)\n","fail":"from math import gcd\nfrom functools import reduce\n\n\ndef gcd_kai(*numbers):\n return reduce(gcd, numbers)\n\n\nK = int(input())\nans = 1\nif K == 1:\n next\nelse:\n ans += (K - 1) * K * 3\n ans_sub = 0\n for i in range(2, K):\n for j in range(i + 1, K + 1):\n for k in range(i, K + 1):\n ans_sub += gcd_kai(i, j, k)\n ans += ans_sub * 3\n for i in range(2, K + 1):\n ans += i\nprint(ans)\n","change":"replace","i1":9,"i2":14,"j1":9,"j2":22,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02713","language":"Python","original_status":"Time Limit Exceeded","pass":"import math\n\nk = int(input())\nsum = 0\n\nfor a in range(1, k + 1):\n for b in range(1, k + 1):\n for c in range(1, k + 1):\n sum += math.gcd(c, math.gcd(a, b))\nprint(sum)\n","fail":"from math import gcd\n\nk = int(input())\nsum = 0\n\nfor a in range(1, k + 1):\n for b in range(1, k + 1):\n for c in range(1, k + 1):\n sum += gcd(c, gcd(a, b))\nprint(sum)\n","change":"replace","i1":0,"i2":9,"j1":0,"j2":9,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02713","language":"Python","original_status":"Time Limit Exceeded","pass":"import math\nfrom functools import reduce\n\n\ndef gcd(*numbers):\n return reduce(math.gcd, numbers)\n\n\nK = int(input())\n\nhoge = []\nfor i in range(1, K + 1):\n for j in range(1, K + 1):\n for k in range(1, K + 1):\n hoge.append(gcd(i, j, k))\n\nprint(sum(hoge))\n","fail":"import math\nfrom functools import reduce\n\nK = int(input())\n\nsum = 0\nfor i in range(1, K + 1):\n for j in range(1, K + 1):\n for k in range(1, K + 1):\n sum += reduce(math.gcd, (i, j, k))\n\nprint(sum)\n","change":"replace","i1":3,"i2":17,"j1":3,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02713","language":"Python","original_status":"Time Limit Exceeded","pass":"import math\n\nK = int(input())\n\nsum = 0\nfor i in range(1, K + 1):\n for j in range(1, K + 1):\n for k in range(1, K + 1):\n a = math.gcd(math.gcd(i, j), k)\n # print(math.gcd(math.gcd(i, j), k))\n sum += a\n\nprint(sum)\n","fail":"import math\n\nK = int(input())\n\ngcds = []\n\nfor a in range(1, K + 1):\n for b in range(1, K + 1):\n gcds.append(math.gcd(a, b))\n\n# print(gcds)\n\nans = 0\nfor c in range(1, K + 1):\n for g in gcds:\n if c == 1 or g == 1:\n ans += 1\n else:\n ans += math.gcd(c, g)\n\nprint(ans)\n","change":"replace","i1":4,"i2":13,"j1":4,"j2":21,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02713","language":"Python","original_status":"Time Limit Exceeded","pass":"import math\nfrom functools import reduce\n\n\ndef gcd(*numbers):\n return reduce(math.gcd, numbers)\n\n\nn = int(input())\n\nans = 0\n\nfor i in range(1, n + 1):\n for j in range(1, n + 1):\n for k in range(1, n + 1):\n cnt = gcd(i, j, k)\n ans += cnt\n\nprint(ans)\n","fail":"import math\nfrom functools import reduce\n\n\ndef gcd(*numbers):\n return reduce(math.gcd, numbers)\n\n\nn = int(input())\n\nans = 0\n\nfor i in range(1, n + 1):\n for j in range(i, n + 1):\n for k in range(j, n + 1):\n cnt = gcd(i, j, k)\n if i == j and j == k:\n ans += cnt\n elif (i == j and i != k) or (i == k and i != j) or (j == k and j != i):\n ans += cnt * 3\n else:\n ans += cnt * 6\n\nprint(ans)\n","change":"replace","i1":13,"i2":17,"j1":13,"j2":22,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02713","language":"Python","original_status":"Time Limit Exceeded","pass":"import math\n\nn = int(input())\n\nans = 0\n\nfor i in range(1, n + 1):\n for j in range(1, n + 1):\n for k in range(1, n + 1):\n ans += math.gcd(math.gcd(i, j), k)\n\nprint(ans)\n","fail":"import math\n\nn = int(input())\n\nans = 0\n\nfor i in range(1, n + 1):\n for j in range(1, n + 1):\n a = math.gcd(i, j)\n for k in range(1, n + 1):\n ans += math.gcd(a, k)\n\nprint(ans)\n","change":"replace","i1":8,"i2":10,"j1":8,"j2":11,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02713","language":"Python","original_status":"Time Limit Exceeded","pass":"import math\n\nk = int(input())\n\nk += 1\nans = 0\n\nfor a in range(1, k):\n for b in range(1, k):\n for c in range(1, k):\n ab = math.gcd(a, b)\n bc = math.gcd(b, c)\n abc = math.gcd(ab, bc)\n\n ans += abc\n\nprint(ans)\n","fail":"import math\n\nk = int(input())\n\nk += 1\nans = 0\n\nab = []\n\nfor a in range(1, k):\n for b in range(1, k):\n ab.append(math.gcd(a, b))\n\nfor a in ab:\n for c in range(1, k):\n ans += math.gcd(a, c)\n\nprint(ans)\n","change":"replace","i1":7,"i2":15,"j1":7,"j2":16,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02713","language":"Python","original_status":"Time Limit Exceeded","pass":"import math\nfrom functools import reduce\n\nK = int(input())\n\n# K = 2\n\n\ndef gcd(*numbers):\n return reduce(math.gcd, numbers)\n\n\nans = 0\nfor a in range(1, K + 1):\n for b in range(1, K + 1):\n for c in range(1, K + 1):\n ans += gcd(a, b, c)\n\nprint(ans)\n","fail":"import math\nfrom functools import reduce\nimport itertools\n\nK = int(input())\n\n# K = 2\n\n\ndef gcd(*numbers):\n return reduce(math.gcd, numbers)\n\n\nans = 0\nfor i in range(1, K + 1):\n # i = 1\n ans += gcd(i, i, i)\n\n for j in range(i + 1, K + 1):\n ans += gcd(i, i, j) * 3\n\n for j, k in itertools.product(range(i + 1, K + 1), range(i + 1, K + 1)):\n ans += gcd(i, j, k) * 3\n\nprint(ans)\n","change":"replace","i1":2,"i2":17,"j1":2,"j2":23,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02713","language":"Python","original_status":"Time Limit Exceeded","pass":"def gcd(a, b, c):\n minV = min([a, b, c])\n maxV = max([a, b, c])\n start = minV\n diff = maxV - minV\n if diff < start and diff != 0:\n start = diff\n for gcdV in range(start, 1, -1):\n if (a % gcdV == 0) and (b % gcdV == 0) and (c % gcdV == 0):\n return gcdV\n return 1\n\n\nk = int(input())\nsum = 0\nfor a in range(1, k + 1):\n for b in range(1, k + 1):\n for c in range(1, k + 1):\n sum += gcd(a, b, c)\n\nprint(sum)\n","fail":"import unittest\nfrom io import StringIO\nimport sys\nimport itertools\nimport math\n\n\ndef gcd(a, b, c):\n n = 1\n if a == b:\n if b != c:\n n = 3\n else:\n if b != c:\n n = 6\n else:\n n = 3\n return math.gcd(math.gcd(a, b), c) * n\n\n\ndef resolve():\n K = int(input())\n T = [i for i in range(1, K + 1)]\n Tr = itertools.combinations_with_replacement(T, 3)\n sumT = 0\n for a, b, c in Tr:\n sumT += gcd(a, b, c)\n print(sumT)\n\n\nclass TestClass(unittest.TestCase):\n def assertIO(self, input, output):\n stdout, stdin = sys.stdout, sys.stdin\n sys.stdout, sys.stdin = StringIO(), StringIO(input)\n resolve()\n sys.stdout.seek(0)\n out = sys.stdout.read()[:-1]\n sys.stdout, sys.stdin = stdout, stdin\n self.assertEqual(out, output)\n\n def test_\u5165\u529b\u4f8b_1(self):\n input = \"\"\"2\"\"\"\n output = \"\"\"9\"\"\"\n self.assertIO(input, output)\n\n def test_\u5165\u529b\u4f8b_2(self):\n input = \"\"\"200\"\"\"\n output = \"\"\"10813692\"\"\"\n self.assertIO(input, output)\n\n def test_add(self):\n input = \"\"\"195\"\"\"\n output = \"\"\"9997134\"\"\"\n self.assertIO(input, output)\n\n\nif __name__ == \"__main__\":\n # unittest.main()\n resolve()\n","change":"replace","i1":0,"i2":21,"j1":0,"j2":59,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02713","language":"Python","original_status":"Time Limit Exceeded","pass":"def gcd(a, b):\n return a if b == 0 else gcd(b, a % b)\n\n\nK = int(input())\n\nG = [[0] * (K + 1) for _ in range(K + 1)]\n\nfor a in range(1, K + 1):\n for b in range(1, K + 1):\n G[a][b] = gcd(a, b)\n\nans = 0\nfor a in range(1, K + 1):\n for b in range(1, K + 1):\n for c in range(1, K + 1):\n if G[a][b] == 1:\n ans += 1\n continue\n ans += gcd(G[a][b], c)\nprint(ans)\n","fail":"import numpy as np\n\nK = int(input())\nx = np.arange(1, K + 1)\nnums = np.gcd.outer(np.gcd.outer(x, x), x)\nans = nums.sum()\nprint(ans)\n","change":"replace","i1":0,"i2":20,"j1":0,"j2":6,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02713","language":"Python","original_status":"Time Limit Exceeded","pass":"import math\n\nK = int(input())\nans = 0\nfor a in range(1, K + 1):\n for b in range(1, K + 1):\n for c in range(1, K + 1):\n ans1 = math.gcd(a, b)\n ans2 = math.gcd(ans1, c)\n ans += ans2\n\nprint(ans)\n","fail":"from math import gcd\n\nK = int(input())\nans = 0\nfor i in range(1, K + 1):\n ans += i\nfor i in range(1, K + 1):\n for j in range(i + 1, K + 1):\n ans += gcd(i, j) * 6\n\nfor i in range(1, K - 1):\n for j in range(i + 1, K):\n for k in range(j + 1, K + 1):\n ans += gcd(gcd(i, j), k) * 6\n\nprint(ans)\n","change":"replace","i1":0,"i2":10,"j1":0,"j2":14,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02713","language":"Python","original_status":"Time Limit Exceeded","pass":"from math import gcd\n\nk = int(input())\nd = {}\n\nans = 0\nfor a in range(1, k + 1):\n for b in range(1, k + 1):\n for c in range(1, k + 1):\n if (a, b, c) in d:\n ans += d[(a, b, c)]\n else:\n d[(a, b, c)] = gcd(a, gcd(b, c))\n ans += d[(a, b, c)]\n\nprint(ans)\n","fail":"def GCD(a, b):\n return a if b == 0 else GCD(b, a % b)\n\n\nk = int(input())\n\nans = 0\nfor a in range(1, k + 1):\n for b in range(1, k + 1):\n ab = GCD(a, b)\n if ab == 1:\n ans += k\n continue\n for c in range(1, k + 1):\n ans += GCD(ab, c)\n\nprint(ans)\n","change":"replace","i1":0,"i2":14,"j1":0,"j2":15,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02713","language":"Python","original_status":"Time Limit Exceeded","pass":"import math\n\nk = int(input())\nresult = 0\nfor a in range(1, k + 1):\n for b in range(1, k + 1):\n for c in range(1, k + 1):\n p = math.gcd(a, b)\n q = math.gcd(p, c)\n result += q\nprint(result)\n","fail":"import math\n\nk = int(input())\nresult = 0\nfor a in range(1, k + 1):\n for b in range(1, k + 1):\n p = math.gcd(a, b)\n for c in range(1, k + 1):\n q = math.gcd(p, c)\n result += q\nprint(result)\n","change":"replace","i1":6,"i2":8,"j1":6,"j2":8,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02714","language":"Python","original_status":"Time Limit Exceeded","pass":"# D - RGB Triplets\ndef main():\n _ = int(input())\n S = input().rstrip()\n cnt = 0\n for j, b in enumerate(S[1:-1], 1):\n for i, a in enumerate(S[:j]):\n for k, c in enumerate(S[j + 1 :], j + 1):\n if a == b or a == c or b == c:\n continue\n elif j - i == k - j:\n continue\n cnt += 1\n print(cnt)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"# D - RGB Triplets\nfrom collections import defaultdict\n\n\ndef main():\n _ = int(input())\n S = input().rstrip()\n indices = defaultdict(set)\n for i, c in enumerate(S):\n indices[c].add(i)\n cnt = len(indices[\"R\"]) * len(indices[\"G\"]) * len(indices[\"B\"])\n for c1, c2, c3 in [\"RGB\", \"GBR\", \"BRG\"]:\n cnt -= sum(\n (i + j) % 2 == 0 and (i + j) \/\/ 2 in indices[c3]\n for i in indices[c1]\n for j in indices[c2]\n )\n print(cnt)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":1,"i2":13,"j1":1,"j2":17,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02714","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\ns = list(input())\nr_pos = []\ng_pos = []\nb_pos = []\n\nfor i in range(n):\n st = s[i]\n if st == \"R\":\n r_pos.append(i)\n\n if st == \"G\":\n g_pos.append(i)\n\n if st == \"B\":\n b_pos.append(i)\n\ncolors = [r_pos, g_pos, b_pos]\nif len(colors[0]) > len(colors[1]):\n colors[0], colors[1] = colors[1], colors[0]\nif len(colors[0]) > len(colors[2]):\n colors[0], colors[2] = colors[2], colors[0]\nif len(colors[1]) > len(colors[2]):\n colors[1], colors[2] = colors[2], colors[1]\n\nx_num, y_num, z_num = len(colors[0]), len(colors[1]), len(colors[2])\n\nans = x_num * y_num * z_num\nfor a in colors[0]:\n for b in colors[1]:\n x, y = min(a, b), max(a, b)\n\n dif = y - x\n left_pos = x - dif\n right_pos = y + dif\n mid_pos = 4000\n if dif % 2 == 0:\n mid_pos = x + dif \/\/ 2\n\n left = 0\n right = 0\n mid = 0\n if left_pos in colors[2]:\n left = 1\n if right_pos in colors[2]:\n right = 1\n if mid_pos in colors[2]:\n mid = 1\n\n ans -= left + right + mid\n\nprint(ans)\n","fail":"n = int(input())\ns = list(input())\nr_pos = []\ng_pos = []\nb_pos = []\n\nfor i in range(n):\n st = s[i]\n if st == \"R\":\n r_pos.append(i)\n\n if st == \"G\":\n g_pos.append(i)\n\n if st == \"B\":\n b_pos.append(i)\n\ncolors = [r_pos, g_pos, b_pos]\nif len(colors[0]) > len(colors[1]):\n colors[0], colors[1] = colors[1], colors[0]\nif len(colors[0]) > len(colors[2]):\n colors[0], colors[2] = colors[2], colors[0]\nif len(colors[1]) > len(colors[2]):\n colors[1], colors[2] = colors[2], colors[1]\n\nx_num, y_num, z_num = len(colors[0]), len(colors[1]), len(colors[2])\n\nans = x_num * y_num * z_num\nc = set(colors[2])\nfor a in colors[0]:\n for b in colors[1]:\n x, y = min(a, b), max(a, b)\n\n dif = y - x\n left_pos = x - dif\n right_pos = y + dif\n mid_pos = 4000\n if dif % 2 == 0:\n mid_pos = x + dif \/\/ 2\n\n left = 0\n right = 0\n mid = 0\n if left_pos in c:\n left = 1\n if right_pos in c:\n right = 1\n if mid_pos in c:\n mid = 1\n\n ans -= left + right + mid\n\nprint(ans)\n","change":"replace","i1":28,"i2":47,"j1":28,"j2":48,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02714","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nS = input()\n\nR, G, B = [], [], []\nfor i, s in enumerate(S):\n if s == \"R\":\n R.append(i)\n elif s == \"G\":\n G.append(i)\n else:\n B.append(i)\n\nresult = 0\nfor r in R:\n for g in G:\n for b in B:\n i = min(r, g, b)\n k = max(r, g, b)\n j = (r + g + b) - i - k\n if j - i != k - j:\n result += 1\n\nprint(result)\n","fail":"def check_RGB(c1, c2, c3):\n l = [c1, c2, c3]\n return (\"R\" in l) and (\"G\" in l) and (\"B\" in l)\n\n\nN = int(input())\nS = input()\n\nR, G, B = 0, 0, 0\nfor i, s in enumerate(S):\n if s == \"R\":\n R += 1\n elif s == \"G\":\n G += 1\n else:\n B += 1\n\nresult = R * G * B\n\nwidth = 1\nwhile width * 2 < N:\n i = 0\n first = i\n mid = i + width\n last = i + width * 2\n\n while last < N:\n if check_RGB(S[first], S[mid], S[last]):\n result -= 1\n\n i += 1\n first = i\n mid = i + width\n last = i + width * 2\n\n width += 1\n\nprint(result)\n","change":"replace","i1":0,"i2":21,"j1":0,"j2":36,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02714","language":"Python","original_status":"Time Limit Exceeded","pass":"# https:\/\/atcoder.jp\/contests\/abc162\/tasks\/abc162_d\n\nN = int(input())\nS = input()\n\nans = 0\nfor i in range(N):\n for j in range(i, N):\n for k in range(j, N):\n if j - i == k - j:\n continue\n\n if S[i] != S[j] and S[i] != S[k] and S[j] != S[k]:\n ans += 1\n\nprint(ans)\n","fail":"# https:\/\/atcoder.jp\/contests\/abc162\/tasks\/abc162_d\n\nN = int(input())\nS = input()\n\n\ndef colors(target, a, b):\n for i in range(N):\n for j in range(i + 1, N):\n if S[i] == a and S[j] == b:\n target[i] += 1\n\n\nrg = [0 for _ in range(N)]\ncolors(rg, \"R\", \"G\")\ngr = [0 for _ in range(N)]\ncolors(gr, \"G\", \"R\")\n\ngb = [0 for _ in range(N)]\ncolors(gb, \"G\", \"B\")\nbg = [0 for _ in range(N)]\ncolors(bg, \"B\", \"G\")\n\nrb = [0 for _ in range(N)]\ncolors(rb, \"R\", \"B\")\nbr = [0 for _ in range(N)]\ncolors(br, \"B\", \"R\")\n\nans = 0\nfor i in range(N):\n if S[i] == \"B\":\n for j in range(i + 1, N):\n ans += rg[j]\n ans += gr[j]\n\n k = j + j - i\n if k >= N:\n continue\n if S[i] == \"B\" and S[j] == \"R\" and S[k] == \"G\":\n ans -= 1\n if S[i] == \"B\" and S[j] == \"G\" and S[k] == \"R\":\n ans -= 1\n\n if S[i] == \"R\":\n for j in range(i + 1, N):\n ans += gb[j]\n ans += bg[j]\n\n k = j + j - i\n if k >= N:\n continue\n if S[i] == \"R\" and S[j] == \"G\" and S[k] == \"B\":\n ans -= 1\n if S[i] == \"R\" and S[j] == \"B\" and S[k] == \"G\":\n ans -= 1\n\n if S[i] == \"G\":\n for j in range(i + 1, N):\n ans += rb[j]\n ans += br[j]\n\n k = j + j - i\n if k >= N:\n continue\n if S[i] == \"G\" and S[j] == \"R\" and S[k] == \"B\":\n ans -= 1\n if S[i] == \"G\" and S[j] == \"B\" and S[k] == \"R\":\n ans -= 1\n\nprint(ans)\n","change":"replace","i1":5,"i2":14,"j1":5,"j2":68,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02714","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nS = input()\nexc = 0\nans = S.count(\"R\") * S.count(\"G\") * S.count(\"B\")\n\nfor i in range(N - 2):\n for j in range(i + 1, N - 1):\n k = j + (j - i)\n if N - 1 < k:\n continue\n if S[k] != S[i] and S[k] != S[j] and S[i] != S[j]:\n ans -= 1\n\nprint(ans)\n","fail":"N = int(input())\nS = [s for s in input()]\nans = S.count(\"R\") * S.count(\"G\") * S.count(\"B\")\n\nfor i in range(N - 2):\n for j in range(i + 1, N - 1):\n k = j + (j - i)\n if N - 1 < k:\n continue\n if S[k] != S[i] and S[k] != S[j] and S[i] != S[j]:\n ans -= 1\n\nprint(ans)\n","change":"replace","i1":1,"i2":3,"j1":1,"j2":2,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02714","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nS = input()\nc = 0\nfor i in range(N):\n for j in range(i, N):\n for k in range(j, N):\n if len(set([S[i], S[j], S[k]])) == 3 and j - i != k - j:\n c += 1\nprint(c)\n","fail":"N = int(input())\nS = input()\na = S.count(\"R\") * S.count(\"G\") * S.count(\"B\")\nc = 0\nfor i in range(N):\n for j in range(i + 1, N):\n k = 2 * j - i\n if k >= N:\n continue\n if S[i] != S[j] and S[i] != S[k] and S[j] != S[k]:\n c += 1\nprint(a - c)\n","change":"replace","i1":2,"i2":9,"j1":2,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02714","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nS = input()\nans = S.count(\"R\") * S.count(\"G\") * S.count(\"B\")\n\nfor i in range(N - 2):\n for j in range(i + 1, N - 1):\n if S[i] != S[j]:\n x = 2 * j - i\n if x <= N - 1 and S[i] != S[x] and S[x] != S[j]:\n ans -= 1\n\nprint(ans)\n","fail":"N = int(input())\nS = input()\nans = S.count(\"R\") * S.count(\"G\") * S.count(\"B\")\n\nfor i in range(N - 2):\n for j in range(i + 1, N - 1):\n if S[i] != S[j]:\n x = 2 * j - i\n if x < N and S[i] != S[x] and S[x] != S[j]:\n ans -= 1\n\nprint(ans)\n","change":"replace","i1":8,"i2":9,"j1":8,"j2":9,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02714","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\ns = list(input())\nans = 0\n\nfor i in range(n - 2):\n for j in range(i + 1, n - 1):\n if s[j] == s[i]:\n continue\n for k in range(j + 1, n):\n if s[k] == s[i] or s[k] == s[j] or 2 * j - i == k:\n continue\n\n ans += 1\n\nprint(ans)\n","fail":"n = int(input())\ns = list(input())\nr = 0\ng = 0\nb = 0\n\n\nfor i in range(n):\n if s[i] == \"R\":\n r += 1\n elif s[i] == \"G\":\n g += 1\n else:\n b += 1\n\nans = r * g * b\n\nfor i in range(n - 2):\n for j in range(i + 1, n - 1):\n k = 2 * j - i\n if k < n:\n if s[i] != s[j] and s[i] != s[k] and s[j] != s[k]:\n ans -= 1\n\n\nprint(ans)\n","change":"replace","i1":2,"i2":13,"j1":2,"j2":24,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02714","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nS = input()\nans = 0\nfor i in range(N - 2):\n for j in range(i + 1, N - 1):\n if S[j] != S[i]:\n for k in range(j + 1, N):\n if j - i != k - j and S[k] != S[i] and S[k] != S[j]:\n ans += 1\nprint(ans)\n","fail":"def main():\n N = int(input())\n S = input()\n ans = S.count(\"R\") * S.count(\"G\") * S.count(\"B\")\n for i in range(N):\n for d in range(N - 1):\n j = i + d\n k = j + d\n if k < N and S[i] != S[j] and S[j] != S[k] and S[k] != S[i]:\n ans -= 1\n print(ans)\n\n\nmain()\n","change":"replace","i1":0,"i2":10,"j1":0,"j2":14,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02714","language":"Python","original_status":"Time Limit Exceeded","pass":"def main():\n N = int(input())\n S = input()\n cnt = 0\n for i in range(N):\n for j in range(i + 1, N):\n for k in range(j + 1, N):\n if j - i == k - j:\n if S[j] != S[i] and S[i] != S[k] and S[k] != S[j]:\n cnt += 1\n print(S.count(\"R\") * S.count(\"B\") * S.count(\"G\") - cnt)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"def main():\n N = int(input())\n S = input()\n cnt = 0\n for i in range(N):\n for j in range(i + 1, N):\n k = 2 * j - i\n if k >= N:\n continue\n if S[j] != S[i] and S[i] != S[k] and S[k] != S[j]:\n cnt += 1\n print(S.count(\"R\") * S.count(\"B\") * S.count(\"G\") - cnt)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":6,"i2":10,"j1":6,"j2":11,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02714","language":"Python","original_status":"Time Limit Exceeded","pass":"from _collections import defaultdict\n\nN = int(input())\nS = input()\n\ncounted_dict = defaultdict(list)\nfor i in range(N):\n char = S[i]\n if char == \"R\":\n counted_dict[\"R\"].append(i)\n elif char == \"G\":\n counted_dict[\"G\"].append(i)\n else:\n counted_dict[\"B\"].append(i)\n\ncount = 0\nfor x in range(len(counted_dict[\"R\"])):\n r_pos = counted_dict[\"R\"][x]\n for y in range(len(counted_dict[\"G\"])):\n g_pos = counted_dict[\"G\"][y]\n for z in range(len(counted_dict[\"B\"])):\n b_pos = counted_dict[\"B\"][z]\n colors_pos_list = [r_pos, g_pos, b_pos]\n colors_pos_list.sort()\n if not colors_pos_list[2] + colors_pos_list[0] == 2 * colors_pos_list[1]:\n count += 1\n\nprint(count)\n","fail":"N = int(input())\nS = input()\n\ntotal_comb = S.count(\"R\") * S.count(\"G\") * S.count(\"B\")\n\nminus = 0\nfor i in range(N - 2):\n for j in range(i + 1, N):\n k = 2 * j - i\n if k < N:\n if (S[i] != S[j]) and (S[j] != S[k]) and (S[k] != S[i]):\n minus += 1\n\nprint(total_comb - minus)\n","change":"replace","i1":0,"i2":28,"j1":0,"j2":14,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02714","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\ns = list(input())\n\nans = 0\nlist1 = [\"\", \"\", \"\"]\nfor i in range(n):\n for j in range(n):\n if i < j:\n for k in range(n):\n if j < k:\n if s[i] != s[j]:\n if s[j] != s[k]:\n if s[i] != s[k]:\n if j - i != k - j:\n ans += 1\nprint(ans)\n","fail":"n = int(input())\ns = list(input())\n\nans = s.count(\"R\") * s.count(\"G\") * s.count(\"B\")\n\nfor i in range(n):\n for d in range(n):\n j = i + d\n k = i + 2 * d\n if k >= n:\n break\n if s[i] != s[j] and s[j] != s[k] and s[i] != s[k]:\n ans -= 1\n\nprint(ans)\n","change":"replace","i1":3,"i2":15,"j1":3,"j2":14,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02714","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\nS = input()\n\n# key\u306f(\u8272\u3001j\u306e\u4f4d\u7f6e)\u306e\u30bf\u30d7\u30eb\ndp = {}\n\nans = 0\n\nfor i in range(n - 2):\n c_i = S[i]\n for j in range(i + 1, n - 1):\n if S[j] == c_i:\n continue\n c_j = S[j]\n d_ij = j - i\n if (c_i, c_j, j) in dp:\n ans += dp[(c_i, c_j, j)]\n if j + d_ij < n:\n c_k = S[j + d_ij]\n if c_i != c_j and c_j != c_k and c_k != c_i:\n ans -= 1\n else:\n tmp = 0\n for k in range(j + 1, n):\n c_k = S[k]\n if c_i != c_j and c_j != c_k and c_k != c_i:\n tmp += 1\n dp[(c_i, c_j, j)] = tmp\n if j + d_ij < n:\n c_k = S[j + d_ij]\n if c_i != c_j and c_j != c_k and c_k != c_i:\n tmp -= 1\n ans += tmp\nprint(ans)\n","fail":"n = int(input())\nS = input()\n\n# key\u306f(\u8272\u3001j\u306e\u4f4d\u7f6e)\u306e\u30bf\u30d7\u30eb\ndp = {}\n\nans = 0\n\nfor i in range(n - 2):\n c_i = S[i]\n for j in range(i + 1, n - 1):\n if S[j] == c_i:\n continue\n c_j = S[j]\n d_ij = j - i\n if (c_i, j) in dp:\n ans += dp[(c_i, j)]\n if j + d_ij < n:\n c_k = S[j + d_ij]\n if c_i != c_j and c_j != c_k and c_k != c_i:\n ans -= 1\n else:\n tmp = 0\n for k in range(j + 1, n):\n c_k = S[k]\n if c_i != c_j and c_j != c_k and c_k != c_i:\n tmp += 1\n dp[(c_i, j)] = tmp\n if j + d_ij < n:\n c_k = S[j + d_ij]\n if c_i != c_j and c_j != c_k and c_k != c_i:\n tmp -= 1\n ans += tmp\nprint(ans)\n","change":"replace","i1":15,"i2":28,"j1":15,"j2":28,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02714","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\ns = input()\n\ncnt = 0\n\nfor i in range(n):\n for j in range(i, n):\n for k in range(j, n):\n if (s[i] != s[j] and s[i] != s[k] and s[j] != s[k]) and (j - i != k - j):\n cnt += 1\n\nprint(cnt)\n","fail":"n = int(input())\ns = input()\n\nr = s.count(\"R\")\nb = s.count(\"B\")\ng = s.count(\"G\")\n\ncnt = 0\n\nfor i in range(n):\n for j in range(i + 1, n):\n k = j + j - i\n if k >= n:\n break\n if s[i] != s[j] and s[i] != s[k] and s[j] != s[k]:\n cnt += 1\n\nprint(r * b * g - cnt)\n","change":"replace","i1":2,"i2":12,"j1":2,"j2":18,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02714","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\ns = input()\nrr = 0\ngg = 0\nbb = 0\nfor i in range(n):\n if s[i] == \"R\":\n rr += 1\n if s[i] == \"G\":\n gg += 1\n if s[i] == \"B\":\n bb += 1\n\nans = rr * gg * bb\n\nfor i in range(n):\n for j in range(n):\n if j - i >= 0 and j + i < n:\n if s[j - i] != s[j] and s[j] != s[j + i] and s[j + i] != s[j - i]:\n ans -= 1\nprint(ans)\n","fail":"n = int(input())\ns = input()\nrr = 0\ngg = 0\nbb = 0\nfor i in range(n):\n if s[i] == \"R\":\n rr += 1\n if s[i] == \"G\":\n gg += 1\n if s[i] == \"B\":\n bb += 1\n\nans = rr * gg * bb\n\nfor j in range(n):\n for i in range(min(j + 1, n - j)):\n if s[j - i] != s[j] and s[j] != s[j + i] and s[j + i] != s[j - i]:\n ans -= 1\nprint(ans)\n","change":"replace","i1":15,"i2":20,"j1":15,"j2":19,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02714","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\ns = input()\n\ncount = 0\n\nfor i in range(n):\n for j in range(i, n):\n for k in range(j, n):\n if (s[i] != s[j] and s[i] != s[k] and s[j] != s[k]) and (j - i != k - j):\n count += 1\nprint(count)\n","fail":"n = int(input())\ns = input()\n\nr = s.count(\"R\")\ng = s.count(\"G\")\nb = s.count(\"B\")\n\ncnt = 0\n\nfor i in range(n):\n for j in range(i + 1, n):\n if 2 * j - i < n:\n if s[i] != s[j] and s[i] != s[2 * j - i] and s[j] != s[2 * j - i]:\n cnt += 1\n\nprint(r * g * b - cnt)\n","change":"replace","i1":3,"i2":11,"j1":3,"j2":16,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02714","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\ns = input()\nRL = []\nGL = []\nBL = []\nfor i in range(1, n + 1):\n word = s[i - 1]\n if word == \"R\":\n RL.append(i)\n elif word == \"G\":\n GL.append(i)\n else:\n BL.append(i)\nans = 0\nfor r in RL:\n for g in GL:\n for b in BL:\n delta1 = abs(r - g)\n delta2 = abs(g - b)\n delta3 = abs(b - r)\n if delta1 == delta2:\n continue\n if delta2 == delta3:\n continue\n if delta3 == delta1:\n continue\n ans += 1\nprint(ans)\n","fail":"# from bisect import bisect_left\n\nn = int(input())\ns = input()\nRL = []\nGL = []\nBL = []\nfor i in range(1, n + 1):\n word = s[i - 1]\n if word == \"R\":\n RL.append(i)\n elif word == \"G\":\n GL.append(i)\n else:\n BL.append(i)\nnagasa_r = len(RL)\nnagasa_g = len(GL)\nnagasa_b = len(BL)\nSBL = set(BL)\nans = 0\nif nagasa_b == 0 or nagasa_g == 0 or nagasa_r == 0:\n ans = 0\nelse:\n out_count = 0\n for r in RL:\n for g in GL:\n bigger = max(r, g)\n smaller = min(r, g)\n delta = bigger - smaller\n if (r + g) % 2 == 0:\n outnumber = [bigger + delta, smaller - delta, (r + g) \/\/ 2]\n else:\n outnumber = [bigger + delta, smaller - delta]\n for num in outnumber:\n if num in SBL:\n out_count += 1\n ans += nagasa_b\n ans -= out_count\nprint(ans)\n","change":"replace","i1":0,"i2":27,"j1":0,"j2":38,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02714","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\ns = input()\nans = 0\nfor i in range(len(s)):\n one = s[i]\n for j in range(i + 1, len(s)):\n if s[j] == one:\n continue\n dis1 = j - i\n two = s[j]\n for k in range(j + 1, len(s)):\n if s[k] == one or s[k] == two:\n continue\n else:\n dis2 = k - j\n if dis1 != dis2:\n ans += 1\n\nprint(ans)\n","fail":"n = int(input())\ns = input()\n\nans = s.count(\"R\") * s.count(\"G\") * s.count(\"B\")\n\nfor i in range(n):\n for j in range(i + 1, n):\n k = 2 * j - i\n # \u4e09\u500b\u76ee\u304c\u7bc4\u56f2\u5185 \u304b\u3064 \u4e09\u6587\u5b57\u9055\u3046 \u304b\u3064 \u8ddd\u96e2\u304c\u540c\u3058\u306f\u30c0\u30e1\n if k < n and (s[i] != s[j] and s[j] != s[k] and s[i] != s[k]) and j - i == k - j:\n ans -= 1\n\nprint(ans)\n","change":"replace","i1":2,"i2":17,"j1":2,"j2":11,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02714","language":"Python","original_status":"Time Limit Exceeded","pass":"import sys\nfrom itertools import product\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef main():\n N = int(input())\n S = input()\n r = []\n g = []\n b = []\n for i in range(N):\n if S[i] == \"R\":\n r.append(i)\n elif S[i] == \"G\":\n g.append(i)\n else:\n b.append(i)\n A = product(r, g, b)\n ans = 0\n for a in A:\n a = list(a)\n a.sort()\n if a[2] - a[1] != a[1] - a[0]:\n ans += 1\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"import sys\nfrom collections import Counter\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef main():\n N = int(input())\n S = input()\n C = Counter(S)\n R = C.get(\"R\", 0)\n G = C.get(\"G\", 0)\n B = C.get(\"B\", 0)\n ans = R * G * B\n for left in range(N):\n for mid in range(left + 1, N):\n right = mid + mid - left\n if right < N:\n if S[right] != S[mid] and S[mid] != S[left] and S[right] != S[left]:\n ans -= 1\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":1,"i2":28,"j1":1,"j2":22,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02715","language":"Python","original_status":"Runtime Error","pass":"# YouTube\u89e3\u8aac\nMOD = 1000000007\nn, k = [int(x) for x in input().split()]\nd = [0] * (k + 1)\n\nfor i in range(0, k + 1):\n d[i] = pow(k \/\/ i, n, MOD)\n\nfor i in range(k, 0, -1): # \u5927\u304d\u3044\u307b\u3046\u304b\u3089\n for j in range(i * 2, k + 1, i): # i\u306e\u500d\u6570\n # d[6] = d'[6] - d[12] - d[18] ...\n d[i] -= d[j]\n d[i] %= MOD\nans = 0\nfor i, item in enumerate(d):\n ans += i * item\n ans %= MOD\nprint(ans)\n","fail":"# YouTube\u89e3\u8aac\nMOD = 1000000007\nn, k = [int(x) for x in input().split()]\nd = [0] * (k + 1)\n\nfor i in range(1, k + 1):\n d[i] = pow(k \/\/ i, n, MOD)\n\nfor i in range(k, 0, -1): # \u5927\u304d\u3044\u307b\u3046\u304b\u3089\n for j in range(i * 2, k + 1, i): # i\u306e\u500d\u6570\n # d[6] = d'[6] - d[12] - d[18] ...\n d[i] -= d[j]\n d[i] %= MOD\nans = 0\nfor i, item in enumerate(d):\n ans += i * item\n ans %= MOD\nprint(ans)\n","change":"replace","i1":5,"i2":6,"j1":5,"j2":6,"error":"ZeroDivisionError: integer division or modulo by zero","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02715\/Python\/s098159754.py\", line 7, in \n d[i] = pow(k \/\/ i, n, MOD)\nZeroDivisionError: integer division or modulo by zero\n","stdout":null} {"problem_id":"p02716","language":"Python","original_status":"Time Limit Exceeded","pass":"# unfinished\nINF = 1 << 64\n\n\ndef find_max(a):\n n = len(a)\n odd_a = [a[i] for i in range(n) if i % 2 == 0]\n even_a = [a[i] for i in range(n) if i % 2 == 1]\n\n cum_odd_a = [0]\n sum_odd_a = 0\n for odd_a_elem in odd_a:\n cum_odd_a.append(cum_odd_a[-1] + odd_a_elem)\n sum_odd_a += odd_a_elem\n\n cum_even_a = [0]\n sum_even_a = 0\n for even_a_elem in even_a:\n cum_even_a.append(cum_even_a[-1] + even_a_elem)\n sum_even_a += even_a_elem\n\n max_sum_half_a = -INF\n\n if n % 2 == 0: # n\u304c\u5076\u6570\u3067\u3042\u308b\u5834\u5408\n # \u5947\u6570\u3068\u5076\u6570\u306e\u5883\u76ee\n for i in range(n \/\/ 2 + 1):\n odd_part_sum = cum_odd_a[i]\n even_part_sum = sum_even_a - cum_even_a[i]\n sum_half_a = odd_part_sum + even_part_sum\n\n if sum_half_a > max_sum_half_a:\n max_sum_half_a = sum_half_a\n else: # n\u304c\u5947\u6570\u3067\u3042\u308b\u5834\u5408\n # \u5947\u6570\u3068\u5076\u6570\u306e\u5883\u76ee\n for i in range(n \/\/ 2 + 1):\n odd_part_sum_1 = cum_odd_a[i]\n\n # \u5076\u6570\u3068\u5947\u6570\u306e\u5883\u76ee\n for j in range(i, n \/\/ 2 + 1):\n even_part_sum = cum_even_a[j] - cum_even_a[i]\n odd_part_sum_2 = sum_odd_a - cum_odd_a[j + 1]\n\n sum_half_a = odd_part_sum_1 + even_part_sum + odd_part_sum_2\n\n if sum_half_a > max_sum_half_a:\n max_sum_half_a = sum_half_a\n\n return max_sum_half_a\n\n\ndef main():\n _ = int(input())\n a = list(map(int, input().split()))\n\n print(find_max(a))\n\n\nmain()\n","fail":"def find_max(a):\n n = len(a)\n\n if n <= 3:\n return max(a)\n\n dp = [[-(1 << 64)] * (2 + n % 2) for _ in range(n)]\n\n for i in range(2 + n % 2):\n dp[i][i] = a[i]\n dp[i + 1][i] = a[i]\n\n for i in range(2, n):\n for j in range(2 + n % 2):\n for extra_space in range(j + 1):\n curr_sum = dp[i - (2 + extra_space)][j - extra_space] + a[i]\n if curr_sum > dp[i][j]:\n dp[i][j] = curr_sum\n\n return dp[-1][1 + n % 2]\n\n\ndef main():\n _ = int(input())\n a = list(map(int, input().split()))\n\n print(find_max(a))\n\n\nmain()\n","change":"replace","i1":0,"i2":48,"j1":0,"j2":20,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02717","language":"Python","original_status":"Runtime Error","pass":"A, B, C = [int(i) for i in input().split()]\n\nA, B, C = B, A, C\nA, B, C = C, B, A\n\nprint(f\"{A} {B} {C}\")\n","fail":"A, B, C = [int(i) for i in input().split()]\n\nA, B, C = B, A, C\nA, B, C = C, B, A\n\nprint(\"%s %s %s\" % (A, B, C))\n","change":"replace","i1":5,"i2":6,"j1":5,"j2":6,"error":"0","stderr":null,"stdout":"3 1 2\n"} {"problem_id":"p02717","language":"Python","original_status":"Runtime Error","pass":"#!\/usr\/bin\/env python3\n\na = int(input())\na, b = map(int, input().split())\na = list(str(input()))\n","fail":"#!\/usr\/bin\/env python3\n\na, b, c = map(int, input().split())\nprint(\"{} {} {}\".format(c, a, b))\n","change":"replace","i1":2,"i2":5,"j1":2,"j2":4,"error":"ValueError: invalid literal for int() with base 10: '1 2 3'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02717\/Python\/s892793306.py\", line 3, in \n a = int(input())\nValueError: invalid literal for int() with base 10: '1 2 3'\n","stdout":null} {"problem_id":"p02717","language":"Python","original_status":"Runtime Error","pass":"x, y, z = map(int, input())\nprint(z, x, y)\n","fail":"x, y, z = map(int, input().split())\nprint(z, x, y)\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"ValueError: invalid literal for int() with base 10: ' '","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02717\/Python\/s498360594.py\", line 1, in \n x, y, z = map(int, input())\nValueError: invalid literal for int() with base 10: ' '\n","stdout":null} {"problem_id":"p02717","language":"Python","original_status":"Runtime Error","pass":"X, Y, Z = map(int, input())\nprint(Z, X, Y)\n","fail":"X, Y, Z = map(int, input().split())\nprint(Z, X, Y)\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"ValueError: invalid literal for int() with base 10: ' '","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02717\/Python\/s623686087.py\", line 1, in \n X, Y, Z = map(int, input())\nValueError: invalid literal for int() with base 10: ' '\n","stdout":null} {"problem_id":"p02717","language":"Python","original_status":"Runtime Error","pass":"x, y, z = map(int, input().split())\nprint(z + \" \" + x + \" \" + y)\n","fail":"x, y, z = map(str, input().split())\nprint(z + \" \" + x + \" \" + y)\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"TypeError: unsupported operand type(s) for +: 'int' and 'str'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02717\/Python\/s693185745.py\", line 2, in \n print(z + \" \" + x + \" \" + y)\nTypeError: unsupported operand type(s) for +: 'int' and 'str'\n","stdout":null} {"problem_id":"p02717","language":"Python","original_status":"Runtime Error","pass":"# -*- coding: utf-8 -*-\ndef resolve():\n a, b, c = map(int, list(input()))\n print(a + b + c)\n\n\nif __name__ == \"__main__\":\n resolve()\n","fail":"def resolve():\n a, b, c = map(int, input().split())\n\n temp_a = a\n temp_b = b\n a = temp_b\n b = temp_a\n temp_c = c\n temp_a = a\n c = temp_a\n a = temp_c\n print(a, b, c)\n\n\nresolve()\n","change":"replace","i1":0,"i2":8,"j1":0,"j2":15,"error":"ValueError: invalid literal for int() with base 10: ' '","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02717\/Python\/s151641431.py\", line 8, in \n resolve()\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02717\/Python\/s151641431.py\", line 3, in resolve\n a, b, c = map(int, list(input()))\nValueError: invalid literal for int() with base 10: ' '\n","stdout":null} {"problem_id":"p02717","language":"Python","original_status":"Runtime Error","pass":"XYZ = map(int, input().split())\nprint(XYZ[2], XYZ[1], XYZ[0])\n","fail":"XYZ = input().split()\nprint(XYZ[2], XYZ[0], XYZ[1])\n","change":"replace","i1":0,"i2":2,"j1":0,"j2":2,"error":"TypeError: 'map' object is not subscriptable","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02717\/Python\/s285964975.py\", line 2, in \n print(XYZ[2], XYZ[1], XYZ[0])\nTypeError: 'map' object is not subscriptable\n","stdout":null} {"problem_id":"p02717","language":"Python","original_status":"Runtime Error","pass":"a = int(input())\nb = int(input())\nc = int(input())\nprint(c, a, b)\n","fail":"a, b, c = map(int, input().split())\nprint(c, a, b)\n","change":"replace","i1":0,"i2":3,"j1":0,"j2":1,"error":"ValueError: invalid literal for int() with base 10: '1 2 3'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02717\/Python\/s384192178.py\", line 1, in \n a = int(input())\nValueError: invalid literal for int() with base 10: '1 2 3'\n","stdout":null} {"problem_id":"p02717","language":"Python","original_status":"Runtime Error","pass":"data = input().split()\n\ni = [int(n) for n in data]\n\nprint(f\"{i[2]} {i[0]} {i[1]}\")\n","fail":"data = input().split()\ni = [int(n) for n in data]\nres = \"{} {} {}\"\nprint(res.format(i[2], i[0], i[1]))\n","change":"replace","i1":1,"i2":5,"j1":1,"j2":4,"error":"0","stderr":null,"stdout":"3 1 2\n"} {"problem_id":"p02717","language":"Python","original_status":"Runtime Error","pass":"x, y, z = input().split()\nprint(f\"{z} {x} {y}\")\n","fail":"x, y, z = input().split()\nprint(z, x, y)\n","change":"replace","i1":1,"i2":2,"j1":1,"j2":2,"error":"0","stderr":null,"stdout":"3 1 2\n"} {"problem_id":"p02717","language":"Python","original_status":"Runtime Error","pass":"X = input()\nY = input()\nZ = input()\nA = X\nB = Y\nC = Z\n# swap the contents of the boxes A and B\ntemp = B\nB = A\nA = temp\nprint(A + \" \" + B + \" \" + C)\n# swap the contents of the boxes A and C\nswapAC = C\nC = A\nA = swapAC\nprint(A + \" \" + B + \" \" + C)\n","fail":"X, Y, Z = input().split()\nA = X\nB = Y\nC = Z\n# swap the contents of the boxes A and B\ntemp = B\nB = A\nA = temp\n# swap the contents of the boxes A and C\nswapAC = C\nC = A\nA = swapAC\nprint(A, B, C)\n","change":"replace","i1":0,"i2":16,"j1":0,"j2":13,"error":"EOFError: EOF when reading a line","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02717\/Python\/s970724888.py\", line 2, in \n Y = input()\nEOFError: EOF when reading a line\n","stdout":null} {"problem_id":"p02717","language":"Python","original_status":"Runtime Error","pass":"X, Y, Z = map(int, input().split())\nprint(f\"{Z} {X} {Y}\")\n","fail":"X, Y, Z = map(int, input().split())\nprint(Z, X, Y)\n","change":"replace","i1":1,"i2":2,"j1":1,"j2":2,"error":"0","stderr":null,"stdout":"3 1 2\n"} {"problem_id":"p02718","language":"Python","original_status":"Runtime Error","pass":"N, M = list(map(int, input().split()))\nA = list(map(int, input().split()))\n\nreal = A[M] \/ sum(A)\nideal = 1 \/ (4 * M)\n\nif real >= ideal:\n print(\"Yes\")\nelse:\n print(\"No\")\n","fail":"N, M = list(map(int, input().split()))\nA = list(map(int, input().split()))\n\nA.sort(reverse=True)\nreal = A[M - 1] \/ sum(A)\nideal = 1 \/ (4 * M)\n\nif real >= ideal:\n print(\"Yes\")\nelse:\n print(\"No\")\n","change":"replace","i1":3,"i2":4,"j1":3,"j2":5,"error":"0","stderr":null,"stdout":"Yes\n"} {"problem_id":"p02718","language":"Python","original_status":"Runtime Error","pass":"n, m = set(map(int, input().split()))\na = set(map(int, input().split()))\ncount = 0\nfor x in a:\n if x >= sum(a) \/ (4 * m):\n count += 1\nif m <= count:\n print(\"Yes\")\nelse:\n print(\"No\")\n","fail":"n, m = map(int, input().split())\na = list(map(int, input().split()))\ncount = 0\nfor x in a:\n if x >= sum(a) \/ (4 * m):\n count += 1\nif m <= count:\n print(\"Yes\")\nelse:\n print(\"No\")\n","change":"replace","i1":0,"i2":2,"j1":0,"j2":2,"error":"0","stderr":null,"stdout":"Yes\n"} {"problem_id":"p02718","language":"Python","original_status":"Runtime Error","pass":"n, m = map(int, input().split())\n\na = list(map(int, input().split()))\n\ns = sum(a)\n\na.sort()\n\nif a[m - 1] * a * m >= s:\n print(\"Yes\")\nelse:\n print(\"No\")\n","fail":"n, m = map(int, input().split())\n\na = list(map(int, input().split()))\n\ns = sum(a)\n\na.sort(reverse=True)\n\nif a[m - 1] >= s \/ (4 * m):\n print(\"Yes\")\nelse:\n print(\"No\")\n","change":"replace","i1":6,"i2":9,"j1":6,"j2":9,"error":"TypeError: '>=' not supported between instances of 'list' and 'int'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02718\/Python\/s183139755.py\", line 9, in \n if a[m - 1] * a * m >= s:\nTypeError: '>=' not supported between instances of 'list' and 'int'\n","stdout":null} {"problem_id":"p02718","language":"Python","original_status":"Runtime Error","pass":"# -*- coding: utf-8 -*-\n\nN, M = map(int, input().split())\nA = list(map(int, input().split()))\n\nth = sum(A) \/\/ (4 * M)\n\nsorted_A = sorted(A, key=lambda x: -x)\nif sorted_A[M] < th:\n print(\"No\")\nelse:\n print(\"Yes\")\n","fail":"# -*- coding: utf-8 -*-\n\nN, M = map(int, input().split())\nA = list(map(int, input().split()))\n\nth = 1.0 * sum(A) \/ (4 * M)\n\nsorted_A = sorted(A, key=lambda x: -x)\nif sorted_A[M - 1] < th:\n print(\"No\")\nelse:\n print(\"Yes\")\n","change":"replace","i1":5,"i2":9,"j1":5,"j2":9,"error":"0","stderr":null,"stdout":"Yes\n"} {"problem_id":"p02718","language":"Python","original_status":"Runtime Error","pass":"#!\/usr\/bin\/env python3\n\na = int(input())\na, b = map(int, input().split())\na = list(str(input()))\n","fail":"#!\/usr\/bin\/env python3\n\nimport numpy as np\n\nN, M = map(int, input().split())\nA = list(map(int, input().split()))\n\nA = np.array(A)\n\nnum = np.sum(A >= np.sum(A) \/ (4 * M))\n\nif num >= M:\n print(\"Yes\")\nelse:\n print(\"No\")\n","change":"replace","i1":2,"i2":5,"j1":2,"j2":15,"error":"ValueError: invalid literal for int() with base 10: '4 1'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02718\/Python\/s781697127.py\", line 3, in \n a = int(input())\nValueError: invalid literal for int() with base 10: '4 1'\n","stdout":null} {"problem_id":"p02718","language":"Python","original_status":"Runtime Error","pass":"n, m = map(int, input().split())\na = sorted(list(map(int, input().split())), reverse=True)\nif a[m] >= sum(a) \/ (4 * m):\n print(\"Yes\")\nelse:\n print(\"No\")\n","fail":"n, m = map(int, input().split())\na = sorted(list(map(int, input().split())), reverse=True)\nif a[m - 1] >= sum(a) \/ (4 * m):\n print(\"Yes\")\nelse:\n print(\"No\")\n","change":"replace","i1":2,"i2":3,"j1":2,"j2":3,"error":"0","stderr":null,"stdout":"Yes\n"} {"problem_id":"p02719","language":"Python","original_status":"Time Limit Exceeded","pass":"N, K = map(int, input().split())\n\nflag = 0\nif K == 1:\n print(0)\n quit()\nif K == 2:\n if N % 2:\n print(1)\n quit()\n else:\n print(0)\n quit()\nwhile True:\n ab = abs(N - K)\n if N > ab:\n N = ab\n else:\n break\n\nprint(N)\n","fail":"N, K = map(int, input().split())\n\nflag = 0\nif K == 1:\n print(0)\n quit()\nif K == 2:\n if N % 2:\n print(1)\n quit()\n else:\n print(0)\n quit()\n\ni = N \/\/ K\nN = N - K * i\nwhile True:\n i = N \/\/ K\n ab = abs(N - K)\n if N > ab:\n N = ab\n else:\n break\n\nprint(N)\n","change":"replace","i1":13,"i2":14,"j1":13,"j2":18,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02719","language":"Python","original_status":"Runtime Error","pass":"n, k = map(int, input().split())\nif n == 0:\n print(0)\nelse:\n x = abs(n - k)\n a = n % x\n b = abs(a - k)\n print(min(a, b))\n","fail":"n, k = map(int, input().split())\nif n == 0 or n == k:\n print(0)\nelse:\n a = abs(n % k)\n b = abs(a - k)\n print(min(a, b))\n","change":"replace","i1":1,"i2":6,"j1":1,"j2":5,"error":"0","stderr":null,"stdout":"1\n"} {"problem_id":"p02719","language":"Python","original_status":"Time Limit Exceeded","pass":"N, K = map(int, input().split())\n\nwhile abs(N - K) < N:\n N = abs(N - K)\n\nprint(N)\n","fail":"N, K = map(int, input().split())\n\nN %= K\n\nwhile abs(N - K) < N:\n N = abs(N - K)\n\nprint(N)\n","change":"insert","i1":1,"i2":1,"j1":1,"j2":3,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02719","language":"Python","original_status":"Time Limit Exceeded","pass":"N, K = map(int, input().split())\n\ncm = N\nif N % K == 0:\n print(0)\n exit()\nwhile True:\n cm = min(cm, abs(N - K))\n if cm >= N:\n break\n N = cm\n\nprint(cm)\n","fail":"N, K = map(int, input().split())\n\ncm = N\nk = N % K\nif k == 0:\n print(0)\n exit()\nprint(min(abs(k - K), N))\n","change":"replace","i1":3,"i2":13,"j1":3,"j2":8,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02719","language":"Python","original_status":"Runtime Error","pass":"n, k = map(int, input().split())\n\nprint(min(n % k), (k - (n % k)))\n","fail":"n, k = map(int, input().split())\n\nprint(min((n % k), (k - (n % k))))\n","change":"replace","i1":2,"i2":3,"j1":2,"j2":3,"error":"TypeError: 'int' object is not iterable","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02719\/Python\/s891781735.py\", line 3, in \n print(min(n % k), (k - (n % k)))\nTypeError: 'int' object is not iterable\n","stdout":null} {"problem_id":"p02719","language":"Python","original_status":"Runtime Error","pass":"n, m = (int(x) for x in input().split())\nnum_point = [int(x) for x in input().split()]\ncount = 0\n\nfor n in num_point:\n if n > (sum(num_point) \/ (4 * m)):\n count += 1\n\nif count < m:\n print(\"No\")\nelse:\n print(\"Yes\")\n","fail":"n, m = (int(x) for x in input().split())\n\na = n % m\nb = n \/ m\nif abs(a - m) > a:\n print(a)\nelse:\n print(abs(a - m))\n","change":"replace","i1":1,"i2":12,"j1":1,"j2":8,"error":"EOFError: EOF when reading a line","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02719\/Python\/s837857825.py\", line 2, in \n num_point = [int(x) for x in input().split()]\nEOFError: EOF when reading a line\n","stdout":null} {"problem_id":"p02719","language":"Python","original_status":"Time Limit Exceeded","pass":"list_input = [int(n) for n in input().split()]\n\nN = list_input[0]\nK = list_input[1]\n\nwhile N > abs(N - K):\n N = abs(N - K)\n\nprint(N)\n","fail":"list_input = [int(n) for n in input().split()]\n\nN = list_input[0]\nK = list_input[1]\n\nwhile N > abs(N - K):\n if N >= K:\n N = N % K\n else:\n N = K - N\nprint(N)\n","change":"replace","i1":6,"i2":8,"j1":6,"j2":10,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02719","language":"Python","original_status":"Time Limit Exceeded","pass":"n, k = list(map(int, input().split()))\n\nn_prev = n\n\nwhile True:\n n = abs(n - k)\n if n > n_prev:\n print(n_prev)\n exit()\n else:\n n_prev = n\n","fail":"n, k = list(map(int, input().split()))\n\nprint(min(n % k, abs(k - n % k)))\n","change":"replace","i1":2,"i2":11,"j1":2,"j2":3,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02719","language":"Python","original_status":"Time Limit Exceeded","pass":"N, K = map(int, input().split())\n\ntmp1 = abs(N - K)\n\nwhile True:\n if K == 1:\n print(0)\n break\n tmp2 = abs(tmp1 - K)\n if tmp1 < tmp2:\n print(tmp1)\n break\n else:\n tmp1 = tmp2\n","fail":"N, K = map(int, input().split())\nprint(min(N % K, K - (N % K)))\n","change":"replace","i1":1,"i2":14,"j1":1,"j2":2,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02719","language":"Python","original_status":"Time Limit Exceeded","pass":"n, k = map(int, input().split())\nmin = n\nfin = 0\n\nwhile n >= 0:\n n = n - k\n if n >= 0:\n min = n\n else:\n fin = abs(n)\n\nif min < fin:\n print(min)\nelse:\n print(fin)\n","fail":"n, k = map(int, input().split())\n\nx = n % k\ny = abs(x - k)\n\nif x < y:\n print(x)\nelse:\n print(y)\n","change":"replace","i1":1,"i2":15,"j1":1,"j2":9,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02719","language":"Python","original_status":"Time Limit Exceeded","pass":"n, k = map(int, input().split())\n\nr = []\nif n % k == 0:\n print(0)\n exit()\nwhile True:\n n = abs(n - k)\n r.append(n)\n if r.count(n) >= 2:\n break\n\nprint(min(r))\n","fail":"n, k = map(int, input().split())\n\nr = []\nn = n % k\nif n == 0:\n print(0)\n exit()\nwhile True:\n n = abs(n - k)\n r.append(n)\n if r.count(n) >= 2:\n break\n\nprint(min(r))\n","change":"replace","i1":3,"i2":4,"j1":3,"j2":5,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02719","language":"Python","original_status":"Runtime Error","pass":"N, K = map(int, input().split())\nans = int(N)\nk_range = N \/\/ K\n# print(k_range)\n\nif k_range == 0:\n N = N - K\nelse:\n N_1 = N - (K * k_range)\n N_2 = N - (K * (k_range + 1))\n print(N_1)\n print(N_2)\n\nif abs(N_1) < abs(N_2):\n if ans > abs(N_1):\n ans = abs(N_1)\n else:\n pass\nelse:\n if ans > abs(N_2):\n ans = abs(N_2)\n else:\n pass\nprint(ans)\n","fail":"N, K = map(int, input().split())\nans = int(N)\nN_1 = N\nN_2 = N\nk_range = N \/\/ K\n# print(k_range)\n\nif k_range == 0:\n N = N - K\n if ans > abs(N):\n ans = abs(N)\nelse:\n N_1 = N - (K * k_range)\n N_2 = N - (K * (k_range + 1))\n\nif abs(N_1) < abs(N_2):\n if ans > abs(N_1):\n ans = abs(N_1)\n else:\n pass\nelse:\n if ans > abs(N_2):\n ans = abs(N_2)\n else:\n pass\nprint(ans)\n","change":"replace","i1":2,"i2":12,"j1":2,"j2":14,"error":"WA","stderr":null,"stdout":"3\n-1\n1\n"} {"problem_id":"p02719","language":"Python","original_status":"Time Limit Exceeded","pass":"N, K = map(int, input().split())\nNj = N\nwhile True:\n Ni = Nj\n Nj = abs(Ni - K)\n if Ni > N:\n print(N)\n break\n elif Nj > Ni:\n print(Ni)\n break\n elif K == 1 or Nj == K:\n print(0)\n break\n else:\n continue\n","fail":"n, k = map(int, input().split())\nif n % k == 0:\n print(0)\nelse:\n l = [n]\n p = n \/\/ k\n c = n - (p * k)\n half = k \/\/ 2\n while c > half:\n c = abs(c - k)\n l.append(c)\n print(min(l))\n","change":"replace","i1":0,"i2":16,"j1":0,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02719","language":"Python","original_status":"Runtime Error","pass":"N, K = list(map(int, input().split()))\n\nif N >= K:\n print(N % K)\nelse:\n print(K % N)\n","fail":"N, K = list(map(int, input().split()))\n\nprint(min(N % K, K - (N % K)))\n","change":"replace","i1":2,"i2":6,"j1":2,"j2":3,"error":"WA","stderr":null,"stdout":"3\n"} {"problem_id":"p02719","language":"Python","original_status":"Runtime Error","pass":"n, k = map(int, input().strip().split())\n\nprev = None\n\nn = n % k\nprint(min(n, k % n))\n","fail":"n, k = map(int, input().strip().split())\n\nmin_n = 1000000000000000000000000000\nfor i in range(1000):\n if n > k:\n n %= k\n n = abs(n - k)\n min_n = min(min_n, n)\n\nprint(min_n)\n","change":"replace","i1":2,"i2":6,"j1":2,"j2":10,"error":"0","stderr":null,"stdout":"1\n"} {"problem_id":"p02719","language":"Python","original_status":"Time Limit Exceeded","pass":"n, k = list(map(int, input().split()))\nloop = True\nwhile loop:\n if n > abs(n - k):\n if n > k:\n n = min(n, n % k)\n elif k > n:\n n = min(n, k % n)\n else:\n loop = False\n\nprint(n)\n","fail":"n, k = list(map(int, input().split()))\nif n == k:\n n = 0\nelse:\n while n > abs(n - k):\n if n > k:\n n = min(n, n % k)\n elif k > n:\n n = min(n, k % n)\n\nprint(n)\n","change":"replace","i1":1,"i2":10,"j1":1,"j2":9,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02719","language":"Python","original_status":"Time Limit Exceeded","pass":"N, K = map(int, input().split())\nif N % K == 0:\n print(0)\nelse:\n li = []\n li.append(N)\n aoki = N\n while aoki <= min(li):\n aoki = abs(min(li) - K)\n li.append(aoki)\n print(min(li))\n","fail":"n, k = map(int, input().split())\nif n == 0 or k == 1:\n print(0)\n exit()\nelif n < k:\n print(min(n, abs(n - k)))\n exit()\nelif n % k == 0:\n print(0)\n exit()\nelse:\n mx = n % k\nprint(min(abs(mx - k), mx))\n","change":"replace","i1":0,"i2":11,"j1":0,"j2":13,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02719","language":"Python","original_status":"Time Limit Exceeded","pass":"#!python3\n\n# input\nN, K = list(map(int, input().split()))\n\n\ndef main():\n x = N\n while True:\n y = max(x - K, K - x)\n if y < x:\n x = y\n else:\n break\n print(x)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"#!python3\n\n# input\nN, K = list(map(int, input().split()))\n\n\ndef main():\n s = N % K\n ans = min(s, K - s)\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":7,"i2":15,"j1":7,"j2":10,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02719","language":"Python","original_status":"Runtime Error","pass":"import sys\n\nread = sys.stdin.read\nreadline = sys.stdin.readline\n\nN, K = map(int, read().split())\nd = abs(N - K)\nN %= d\nif abs(N - K) < N:\n print(abs(N - K))\nelse:\n print(N)\n","fail":"import sys\n\nread = sys.stdin.read\nreadline = sys.stdin.readline\n\nN, K = map(int, read().split())\nif N == K:\n print(0)\nelif N > K:\n N %= K\n print(min(N, abs(N - K)))\nelse:\n print(min(N, abs(N - K)))\n","change":"replace","i1":6,"i2":12,"j1":6,"j2":13,"error":"0","stderr":null,"stdout":"1\n"} {"problem_id":"p02719","language":"Python","original_status":"Time Limit Exceeded","pass":"n, k = map(int, input().split())\n# n, k = map(int, \"2 6\".split())\n\nwhile True:\n nc = n\n n = n - k\n if n <= 0:\n if abs(n) < nc:\n print(abs(n))\n break\n else:\n print(nc)\n break\n","fail":"n, k = map(int, input().split())\n# n, k = map(int, \"2 6\".split())\nq = n \/\/ k # \u7b54\u3048\nmod = n % k # \u3042\u307e\u308a\n\nif q == 0:\n\n while True:\n nc = n\n n = n - k\n if n <= 0:\n if abs(n) < nc:\n print(abs(n))\n break\n else:\n print(nc)\n break\nelse:\n n1 = abs(n - (q * k))\n n2 = abs(n - ((q + 1) * k))\n if n1 < n2:\n print(n1)\n else:\n print(n2)\n","change":"replace","i1":2,"i2":13,"j1":2,"j2":24,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02720","language":"Python","original_status":"Runtime Error","pass":"import numpy as np\n\nK = int(input())\n\ntop = np.ones(10, dtype=int)\n# top[0] = 0\nadj = np.eye(10, dtype=int)\nadj[1:, :-1] += np.eye(9, dtype=int)\nadj[:-1, 1:] += np.eye(9, dtype=int)\n\ncounts = [top]\ntmp = top\nfor _ in range(10):\n tmp = tmp.__matmul__(adj)\n counts.append(tmp)\n\nfor i in range(10):\n for j in range(1, 10):\n if K > counts[i][j]:\n K -= counts[i][j]\n else:\n break\n else:\n continue\n break\n\nans = [-1] * (i + 1)\nans[i] = j\n\nfor d in range(i, 0, -1):\n for k in range(max(0, j - 1), min(9, j + 1) + 1):\n if K > counts[d - 1][k]:\n K -= counts[d - 1][k]\n else:\n ans[d - 1] = k\n j = k\n break\n\n\nprint(\"\".join(list(map(str, ans))[::-1]))\n","fail":"import numpy as np\n\nK = int(input())\n\ntop = np.ones(10, dtype=int)\nadj = np.eye(10, dtype=int)\nadj[1:, :-1] += np.eye(9, dtype=int)\nadj[:-1, 1:] += np.eye(9, dtype=int)\n\ncounts = [top]\ntmp = top\nfor _ in range(10):\n tmp = np.dot(tmp, adj)\n counts.append(tmp)\n\nfor i in range(10):\n for j in range(1, 10):\n if K > counts[i][j]:\n K -= counts[i][j]\n else:\n break\n else:\n continue\n break\n\nans = [-1] * (i + 1)\nans[i] = j\n\nfor d in range(i, 0, -1):\n for k in range(max(0, j - 1), min(9, j + 1) + 1):\n if K > counts[d - 1][k]:\n K -= counts[d - 1][k]\n else:\n ans[d - 1] = k\n j = k\n break\n\n\nprint(\"\".join(list(map(str, ans))[::-1]))\n","change":"replace","i1":5,"i2":14,"j1":5,"j2":13,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02720","language":"Python","original_status":"Time Limit Exceeded","pass":"import math\n\nk = int(input())\n\na = []\n\ns = str(k)\nflg = 0\n\nfor i in range(1, 1000000):\n n = math.floor(math.log10(i))\n s = str(i)\n cnt = 0\n\n if n < 1:\n a.append(i)\n else:\n for j in range(n):\n if abs(int(s[j]) - int(s[j + 1])) <= 1:\n cnt += 1\n if cnt == n:\n a.append(i)\n\n if len(a) == k:\n print(a[k - 1])\n break\n","fail":"from collections import deque\n\nk = int(input())\n\nq = deque(range(1, 10))\n\nfor i in range(k):\n t = q.popleft()\n\n if t % 10 != 0:\n q.append(10 * t + t % 10 - 1)\n\n q.append(10 * t + t % 10)\n\n if t % 10 != 9:\n q.append(10 * t + t % 10 + 1)\n\nprint(t)\n","change":"replace","i1":0,"i2":26,"j1":0,"j2":18,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02720","language":"Python","original_status":"Runtime Error","pass":"n = int(input())\n\narr = []\nfor i in range(10000):\n si = str(i + 1)\n for i2 in range(len(si) - 1):\n if abs(int(si[i2]) - int(si[i2 + 1])) >= 2:\n break\n else:\n arr.append(si)\n\nprint(arr[n - 1])\n","fail":"import math\n\nk = int(input())\n\nl = [1, 2, 3, 4, 5, 6, 7, 8, 9]\n\nc = 0\nwhile k > len(l):\n f = l[c] - (l[c] \/\/ 10 * 10)\n\n if f != 0:\n l.append(l[c] * 10 + f - 1)\n\n l.append(l[c] * 10 + f)\n\n if f != 9:\n l.append(l[c] * 10 + f + 1)\n\n c += 1\n\nprint(l[k - 1])\n","change":"replace","i1":0,"i2":12,"j1":0,"j2":21,"error":"0","stderr":null,"stdout":"23\n"} {"problem_id":"p02720","language":"Python","original_status":"Time Limit Exceeded","pass":"k = int(input())\nborder = 10000\nif k < border:\n candidate = 1\n count = 1\n while True:\n if count == k:\n print(candidate)\n break\n\n candidate += 1\n digits = tuple(int(c) for c in str(candidate))\n for i, d in enumerate(digits[:-1]):\n if abs(d - digits[i + 1]) > 1:\n break\n else:\n count += 1\n\nelse:\n candidate = 3234566667\n count = 100000\n while True:\n if count == k:\n print(candidate)\n break\n\n digits = tuple(int(c) for c in str(candidate))\n for i, d in enumerate(digits[:-1]):\n if abs(d - digits[i + 1]) > 1:\n break\n else:\n count -= 1\n\n candidate -= 1\n\n# Candidate 100000 -> 3234566667\n","fail":"def main():\n k = int(input())\n lunluns = [i for i in range(1, 10)]\n if k <= len(lunluns):\n print(lunluns[k - 1])\n return\n\n while True:\n if k <= len(lunluns):\n print(lunluns[k - 1])\n return\n k -= len(lunluns)\n olds = lunluns\n lunluns = []\n for old in olds:\n for i in (-1, 0, 1):\n digit_next = old % 10 + i\n if digit_next < 0 or digit_next > 9:\n continue\n new = old * 10 + digit_next\n lunluns.append(new)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":0,"i2":36,"j1":0,"j2":25,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02720","language":"Python","original_status":"Time Limit Exceeded","pass":"from sys import stdin\n\nK = int(stdin.readline())\n\nif K < 50000:\n count = 0\n for _ in range(1, 3234566667):\n i = str(_)\n L = len(i)\n for j in range(1, L):\n if abs(ord(i[j]) - ord(i[j - 1])) > 1:\n break\n else:\n count += 1\n if count == K:\n print(_)\n quit()\nelse:\n count = 100001\n for _ in range(1, 3234566668)[::-1]:\n i = str(_)\n L = len(i)\n for j in range(1, L):\n if abs(ord(i[j]) - ord(i[j - 1])) > 1:\n break\n else:\n count -= 1\n if count == K:\n print(_)\n quit()\n","fail":"from sys import stdin\nfrom collections import deque\n\nK = int(stdin.readline())\n\ndeque = deque()\nfor i in range(1, 10):\n deque.append(i)\n\nfor i in range(K - 1):\n s = deque.popleft()\n for j in range(-1, 2):\n add = (s % 10) + j\n if 0 <= add <= 9:\n deque.append(s * 10 + add)\n\nprint(deque.popleft())\n","change":"replace","i1":1,"i2":30,"j1":1,"j2":17,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02721","language":"Python","original_status":"Runtime Error","pass":"#!\/usr\/bin\/env python3\nn, k, c = map(int, input().split())\ns = input()\n\nif c == 0:\n if s.cnt(\"o\") == k:\n print(*range(1, n + 1), sep=\"\\\\n\")\n exit()\n\nleft = []\ni = 0\nwhile i < n:\n if s[i] == \"o\":\n left.append(i)\n i += c\n i += 1\n\nright = []\ni = n - 1\nwhile i >= 0:\n if s[i] == \"o\":\n right.append(i)\n i -= c\n i -= 1\nright.reverse()\nfor i in range(len(left)):\n if left[i] == right[i]:\n print(left[i] + 1)\n","fail":"#!\/usr\/bin\/env python3\nn, k, c = map(int, input().split())\ns = input()\n\nif c == 0:\n if s.count(\"o\") == k:\n for i in range(n):\n if s[i] == \"o\":\n print(i + 1)\n exit()\n\nleft = []\ni = 0\nwhile i < n:\n if s[i] == \"o\":\n left.append(i)\n i += c\n i += 1\n\nright = []\ni = n - 1\nwhile i >= 0:\n if s[i] == \"o\":\n right.append(i)\n i -= c\n i -= 1\nright.reverse()\nfor i in range(len(left)):\n if left[i] == right[i]:\n print(left[i] + 1)\n","change":"replace","i1":5,"i2":7,"j1":5,"j2":9,"error":"0","stderr":null,"stdout":"6\n"} {"problem_id":"p02722","language":"Python","original_status":"Runtime Error","pass":"import sympy\n\nn = int(input())\n\ntmp = n - 1\nret = len(sympy.divisors(tmp)) - 1\n\ntmplen = sympy.divisors(n)\n\nfor item in tmplen:\n if item == 1:\n continue\n val = n\n while True:\n if val % item == 0:\n val = val \/\/ item\n else:\n if val % item == 1:\n ret += 1\n break\n\nprint(ret)\n","fail":"def make_divisors(n):\n lower_divisors, upper_divisors = [], []\n i = 1\n while i * i <= n:\n if n % i == 0:\n lower_divisors.append(i)\n if i != n \/\/ i:\n upper_divisors.append(n \/\/ i)\n i += 1\n return lower_divisors + upper_divisors[::-1]\n\n\nn = int(input())\n\ntmp = n - 1\nret = len(make_divisors(tmp)) - 1\n\ntmplen = make_divisors(n)\n\nfor item in tmplen:\n if item == 1:\n continue\n val = n\n while True:\n if val % item == 0:\n val = val \/\/ item\n else:\n if val % item == 1:\n ret += 1\n break\n\nprint(ret)\n","change":"replace","i1":0,"i2":8,"j1":0,"j2":18,"error":"0","stderr":null,"stdout":3.0} {"problem_id":"p02723","language":"Python","original_status":"Runtime Error","pass":"s = input().split()\nif s[2] == s[3] and s[4] == s[5]:\n print(\"Yes\")\nelse:\n print(\"No\")\n","fail":"s = input()\nif s[2] == s[3] and s[4] == s[5]:\n print(\"Yes\")\nelse:\n print(\"No\")\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"IndexError: list index out of range","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02723\/Python\/s530567045.py\", line 2, in \n if s[2] == s[3] and s[4] == s[5]:\nIndexError: list index out of range\n","stdout":null} {"problem_id":"p02723","language":"Python","original_status":"Runtime Error","pass":"s = input()\nif s[3] == s[4] and s[5] == s[6]:\n print(\"Yes\")\nelse:\n print(\"No\")\n","fail":"s = input()\nif s[2] == s[3] and s[4] == s[5]:\n print(\"Yes\")\nelse:\n print(\"No\")\n","change":"replace","i1":1,"i2":2,"j1":1,"j2":2,"error":"WA","stderr":null,"stdout":"No\n"} {"problem_id":"p02723","language":"Python","original_status":"Runtime Error","pass":"s = str(input())\n\nif s[2] == s[3]:\n if s[4] == s[5]:\n print(\"Yes\")\n\nelse:\n print(\"No\")\n","fail":"s = str(input())\n\nif s[2] == s[3]:\n if s[4] == s[5]:\n print(\"Yes\")\n quit()\n\nprint(\"No\")\n","change":"replace","i1":5,"i2":8,"j1":5,"j2":8,"error":"0","stderr":null,"stdout":"Yes\n"} {"problem_id":"p02723","language":"Python","original_status":"Runtime Error","pass":"S = input()\nprint(\"Yes\" if S[3] == S[4] and S[5] == S[6] else \"No\")\n","fail":"S = input()\nprint(\"Yes\" if S[2] == S[3] and S[4] == S[5] else \"No\")\n","change":"replace","i1":1,"i2":2,"j1":1,"j2":2,"error":"WA","stderr":null,"stdout":"No\n"} {"problem_id":"p02724","language":"Python","original_status":"Runtime Error","pass":"from collections import deque\nimport copy\n\nX, Y, A, B, C = map(int, input().split())\np = list(map(int, input().split()))\nq = list(map(int, input().split()))\nr = list(map(int, input().split()))\n\np.sort(reverse=True)\nq.sort(reverse=True)\nr.sort(reverse=True)\n\np1 = deque(p)\nq1 = deque(q)\nr1 = deque(r)\np2 = copy.deepcopy(p1)\nq2 = copy.deepcopy(q1)\nr2 = copy.deepcopy(r1)\n\n\nans = 0\n\nans1 = 0\nfor _ in range(X):\n if len(r1) > 0:\n if p1[0] > r1[0]:\n ans1 += p1.popleft()\n else:\n ans1 += r1.popleft()\n else:\n ans1 += p1.popleft()\n\nfor _ in range(Y):\n if len(r1) > 0:\n if q1[0] > r1[0]:\n ans1 += q1.popleft()\n else:\n ans1 += r1.popleft()\n else:\n ans1 += q1.popleft()\n\nans2 = 0\nfor _ in range(Y):\n if len(r2) > 0:\n if q2[0] > r2[0]:\n ans2 += q2.popleft()\n else:\n ans2 += r2.popleft()\n else:\n ans2 += q2.popleft()\n\nfor _ in range(X):\n if len(r2) > 0:\n if p2[0] > r2[0]:\n ans2 += p2.popleft()\n else:\n ans2 += r2.popleft()\n else:\n ans2 += p2.popleft()\n\nans = max(ans1, ans2)\nprint(ans)\n","fail":"X = int(input())\nans = 0\nans += 1000 * (X \/\/ 500)\nX = X % 500\nans += 5 * (X \/\/ 5)\nprint(ans)\n","change":"replace","i1":0,"i2":61,"j1":0,"j2":5,"error":"ValueError: not enough values to unpack (expected 5, got 1)","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02724\/Python\/s107835112.py\", line 4, in \n X, Y, A, B, C = map(int, input().split())\nValueError: not enough values to unpack (expected 5, got 1)\n","stdout":null} {"problem_id":"p02725","language":"Python","original_status":"Time Limit Exceeded","pass":"K, N = map(int, input().split())\nhouses = list(map(int, input().split()))\n# syaku_houses = []\n# for i, num in enumerate(houses):\n# if i == 0:\n# syaku_houses.append(num)\n# else:\n# syaku_houses.append(num - houses[i - 1])\n# print(syaku_houses)\n\n# min_costs = []\n# for house in syaku_houses:\n\n# \u53f3\u56de\u308a\u304b\u5de6\u56de\u308a\u304b\uff1f\nreverse_houses = []\nfor i in range(N - 1):\n reverse_houses.insert(0, -1 * (K - houses[N - 1 - i]))\nreverse_houses.reverse()\nfor house in reverse_houses:\n houses.insert(0, house)\n\nmin_costs = []\nfor i in range(N):\n min_costs.append(houses[N - 1 + i] - houses[i])\nprint(min(min_costs))\n","fail":"K, N = map(int, input().split())\nhouses = list(map(int, input().split()))\n# syaku_houses = []\n# for i, num in enumerate(houses):\n# if i == 0:\n# syaku_houses.append(num)\n# else:\n# syaku_houses.append(num - houses[i - 1])\n# print(syaku_houses)\n\n# min_costs = []\n# for house in syaku_houses:\n\n# \u53f3\u56de\u308a\u304b\u5de6\u56de\u308a\u304b\uff1f\nfor i in range(N - 1):\n houses.append(K + houses[i])\n\nmin_costs = []\nfor i in range(N):\n min_costs.append(houses[N - 1 + i] - houses[i])\nprint(min(min_costs))\n","change":"replace","i1":14,"i2":20,"j1":14,"j2":16,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02725","language":"Python","original_status":"Runtime Error","pass":"K, N = [int(x) for x in input().split()]\nA = list([int(x) for x in input().split()])\n\nresult = []\n\nfor i in range(N):\n if i == N - 1:\n result.append(K - A[i] + A[0])\n else:\n result.appnd(A[i + 1] - A[i])\n\nresult.sort()\n\nprint(sum(result[:-1]))\n","fail":"K, N = [int(x) for x in input().split()]\nA = list([int(x) for x in input().split()])\n\nresult = []\n\nfor i in range(N):\n if i == N - 1:\n result.append(K - A[i] + A[0])\n else:\n result.append(A[i + 1] - A[i])\n\nresult.sort()\n\nprint(sum(result[:-1]))\n","change":"replace","i1":9,"i2":10,"j1":9,"j2":10,"error":"AttributeError: 'list' object has no attribute 'appnd'. Did you mean: 'append'?","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02725\/Python\/s465874099.py\", line 10, in \n result.appnd(A[i + 1] - A[i])\nAttributeError: 'list' object has no attribute 'appnd'. Did you mean: 'append'?\n","stdout":null} {"problem_id":"p02725","language":"Python","original_status":"Runtime Error","pass":"K, N = map(int, input().split())\nA = [int(e) for e in input().split()]\n\nans = 0\nfor i in range(N - 1):\n S = [A[i + 1] - A[i]]\n S.append((K - A[N - 1]) + A[0])\n m = sorted(S)\n for n in range(N - 1):\n ans += m[n]\nprint(ans)\n","fail":"K, N = map(int, input().split())\nA = [int(e) for e in input().split()]\n\nans = 0\nS = [(A[i + 1] - A[i]) for i in range(N - 1)]\nS.append((K - A[N - 1]) + A[0])\nS.sort\nm = sorted(S)\nfor n in range(N - 1):\n ans += m[n]\nprint(ans)\n","change":"replace","i1":4,"i2":10,"j1":4,"j2":10,"error":"WA","stderr":null,"stdout":"30\n"} {"problem_id":"p02725","language":"Python","original_status":"Time Limit Exceeded","pass":"K, N = [int(x) for x in input().split()]\nA = [int(x) for x in input().split()]\nans = []\nfor i in range(len(A)):\n ans.append(max(A) - min(A))\n A[i] += K\n\nprint(min(ans))\n","fail":"import sys\nimport random\n\n\ndef test(K, N, A):\n ans = []\n maxp = N - 1\n minp = 0\n for i in range(len(A)):\n ans.append(A[maxp] - A[minp])\n A[i] += K\n maxp = (maxp + 1) % (N)\n minp = (minp + 1) % (N)\n print(min(ans))\n\n\nif __name__ == \"__main__\":\n if \"random\" in sys.argv:\n K = int(random.random() * 20000)\n N = int(random.random() * 65536)\n A = sorted([int(random.random() * K) for _ in range(N)])\n else:\n K, N = [int(x) for x in input().split()]\n A = [int(x) for x in input().split()]\n test(K, N, A)\n pass\n","change":"replace","i1":0,"i2":8,"j1":0,"j2":26,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02726","language":"Python","original_status":"Time Limit Exceeded","pass":"import numpy as np\nfrom scipy.sparse.csgraph import floyd_warshall\nfrom scipy.sparse import lil_matrix\n\nN, X, Y = [int(_) for _ in input().split()]\nG = lil_matrix((N, N))\nG[X - 1, Y - 1] = 1\nfor i in range(N - 1):\n G[i, i + 1] = 1\nD = floyd_warshall(G, directed=False)\nfor i in range(1, N):\n print(np.sum(D == i) \/\/ 2)\n","fail":"import numpy as np\n\nN, X, Y = [int(_) for _ in input().split()]\nX -= 1\nY -= 1\ncnt = np.zeros(N, dtype=int)\nfor i in range(0, (X + Y) \/\/ 2):\n # t-i<=abs(i-X)+1+Y-t\n # 2*t<=abs(i-X)+1+Y+i\n # t<= tmax = 0 - - (abs(i-X)+1+Y+i)\/\/2\n # tmin=i-X+1\n # range(tmin,tmin+Y-tmax) + range(1,tmax-i+1) + range(tmin+1,tmin+N-Y)\n tmin = abs(i - X) + 1\n tmax = 0 - -(abs(i - X) + 1 + Y + i) \/\/ 2\n cnt[1 : tmax - i] += 1\n cnt[tmin : tmin + Y - tmax + 1] += 1\n cnt[tmin + 1 : tmin + N - Y] += 1\nfor i in range((X + Y) \/\/ 2, N):\n cnt[1 : N - i] += 1\nprint(*cnt[1:], sep=\"\\\\n\")\n","change":"replace","i1":1,"i2":12,"j1":1,"j2":20,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02726","language":"Python","original_status":"Time Limit Exceeded","pass":"from collections import deque\n\nn, x, y = map(int, input().split())\n\ninf = 100100100\n\nx -= 1\ny -= 1\n\nans = [0] * n\n\nfor i in range(n):\n dist = [inf] * n\n queue = deque()\n queue.append(i)\n dist[i] = 0\n while queue:\n current = queue.popleft()\n d = dist[current]\n\n if current - 1 >= 0 and dist[current - 1] == inf:\n queue.append(current - 1)\n dist[current - 1] = d + 1\n if current + 1 < n and dist[current + 1] == inf:\n queue.append(current + 1)\n dist[current + 1] = d + 1\n if current == x and dist[y] == inf:\n queue.append(y)\n dist[y] = d + 1\n if current == y and dist[x] == inf:\n queue.append(x)\n dist[x] = d + 1\n\n for j in range(n):\n ans[dist[j]] += 1\n\nfor k in range(1, n):\n print(ans[k] \/\/ 2)\n","fail":"from collections import deque, Counter\n\nn, x, y = map(int, input().split())\n\ninf = 100100100\nx -= 1\ny -= 1\n\nans = [0] * n\n\nfor i in range(n):\n dist = [inf] * n\n queue = deque()\n queue.append(i)\n dist[i] = 0\n while queue:\n current = queue.popleft()\n d = dist[current]\n\n if current - 1 >= 0 and dist[current - 1] == inf:\n queue.append(current - 1)\n dist[current - 1] = d + 1\n if current + 1 < n and dist[current + 1] == inf:\n queue.append(current + 1)\n dist[current + 1] = d + 1\n if current == x and dist[y] == inf:\n queue.append(y)\n dist[y] = d + 1\n if current == y and dist[x] == inf:\n queue.append(x)\n dist[x] = d + 1\n\n for j in range(n):\n ans[dist[j]] += 1\n\nfor k in range(1, n):\n print(ans[k] \/\/ 2)\n","change":"replace","i1":0,"i2":6,"j1":0,"j2":5,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02726","language":"Python","original_status":"Time Limit Exceeded","pass":"n, x, y = list(map(int, input().split()))\nx -= 1\ny -= 1\n\ncnt = [0] * n\nfor i in range(n):\n for j in range(n):\n if i >= j:\n continue\n dist = min(j - i, abs(j - y) + 1 + abs(i - x), abs(j - x) + 1 + abs(i - y))\n cnt[dist] += 1\nfor i in range(1, n):\n print(cnt[i])\n","fail":"n, x, y = list(map(int, input().split()))\nx -= 1\ny -= 1\n\ncnt = [0] * n\n\ndist = []\nfor i in range(n):\n dist.append([-1] * n)\nfor i in range(n):\n dist[i][x] = abs(i - x)\n dist[i][y] = abs(i - y)\n dist[x][i] = abs(i - x)\n dist[y][i] = abs(i - y)\n\nfor i in range(n):\n for j in range(n):\n if i >= j:\n continue\n dis = min(j - i, dist[j][y] + 1 + dist[i][x], dist[j][x] + 1 + dist[i][y])\n cnt[dis] += 1\nfor i in range(1, n):\n print(cnt[i])\n","change":"replace","i1":5,"i2":11,"j1":5,"j2":21,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02726","language":"Python","original_status":"Time Limit Exceeded","pass":"import numpy as np\nfrom collections import defaultdict\n\nn, x, y = map(int, input().strip().split())\n\nx -= 1\ny -= 1\n\ninf = 1000000000\ndist = np.full((n, n), inf, dtype=np.int)\n\nfor i in range(n):\n for j in range(n):\n if i == j:\n dist[i][j] = 0\n else:\n path1 = abs(j - i)\n path2 = abs(x - i) + 1 + abs(y - j)\n dist[i][j] = min(abs(j - i), path2)\n\ndist_counts = defaultdict(int)\nfor i in range(n):\n for j in range(i + 1, n):\n d = dist[i][j]\n dist_counts[d] += 1\n\nfor k in range(1, n):\n print(dist_counts[k])\n","fail":"from collections import defaultdict\n\nn, x, y = map(int, input().strip().split())\n\nx -= 1\ny -= 1\n\ndist_counts = defaultdict(int)\nfor i in range(n):\n for j in range(i + 1, n):\n path1 = abs(j - i)\n path2 = abs(x - i) + 1 + abs(y - j)\n dist = min(abs(j - i), path2)\n dist_counts[dist] += 1\n\nfor k in range(1, n):\n print(dist_counts[k])\n","change":"replace","i1":0,"i2":25,"j1":0,"j2":14,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02726","language":"Python","original_status":"Time Limit Exceeded","pass":"n, x, y = map(int, input().split())\nans = [0] * n\na = [n] * n\nx -= 1\ny -= 1\nfor i in range(0, n):\n a = [n] * n\n a[i] = 0\n for j in range(i, 0, -1):\n if j == x:\n a[y] = min(a[y], a[j] + 1)\n if j == y:\n a[x] = min(a[x], a[j] + 1)\n a[j - 1] = min(a[j - 1], a[j] + 1)\n for j in range(i, n - 1):\n if j == x:\n a[y] = min(a[y], a[j] + 1)\n if j == y:\n a[x] = min(a[x], a[j] + 1)\n a[j + 1] = min(a[j + 1], a[j] + 1)\n for j in range(x, 0, -1):\n if j == x:\n a[y] = min(a[y], a[j] + 1)\n if j == y:\n a[x] = min(a[x], a[j] + 1)\n a[j - 1] = min(a[j - 1], a[j] + 1)\n for j in range(x, n - 1):\n if j == x:\n a[y] = min(a[y], a[j] + 1)\n if j == y:\n a[x] = min(a[x], a[j] + 1)\n a[j + 1] = min(a[j + 1], a[j] + 1)\n for j in range(y, 0, -1):\n if j == x:\n a[y] = min(a[y], a[j] + 1)\n if j == y:\n a[x] = min(a[x], a[j] + 1)\n a[j - 1] = min(a[j - 1], a[j] + 1)\n for j in range(y, n - 1):\n if j == x:\n a[y] = min(a[y], a[j] + 1)\n if j == y:\n a[x] = min(a[x], a[j] + 1)\n a[j + 1] = min(a[j + 1], a[j] + 1)\n for k in range(0, n):\n if k != i:\n ans[a[k]] += 1\nfor i in range(1, n):\n print(ans[i] \/\/ 2)\n","fail":"n, x, y = map(int, input().split())\nans = [0] * n\na = [n] * n\nx -= 1\ny -= 1\nfor i in range(0, n):\n a = [n] * n\n a[i] = 0\n b = [i, x, y, x, y]\n for k in b:\n for j in range(k, 0, -1):\n if j == x:\n a[y] = min(a[y], a[j] + 1)\n if j == y:\n a[x] = min(a[x], a[j] + 1)\n a[j - 1] = min(a[j - 1], a[j] + 1)\n for j in range(k, n - 1):\n if j == x:\n a[y] = min(a[y], a[j] + 1)\n if j == y:\n a[x] = min(a[x], a[j] + 1)\n a[j + 1] = min(a[j + 1], a[j] + 1)\n for k in range(0, n):\n ans[a[k]] += 1\nfor i in range(1, n):\n print(ans[i] \/\/ 2)\n","change":"replace","i1":8,"i2":47,"j1":8,"j2":24,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02726","language":"Python","original_status":"Time Limit Exceeded","pass":"n, x, y = map(int, input().split())\n\ninf = 1000000000\nedges = [[inf] * n for _ in range(n)]\nfor i in range(n - 1):\n edges[i][i + 1] = 1\n edges[i + 1][i] = 1\n\nedges[x - 1][y - 1] = 1\n\nfor k in range(n):\n for i in range(n):\n for j in range(n):\n edges[i][j] = min(edges[i][j], edges[i][k] + edges[k][j])\n\ncnts = [0] * (n - 1)\nfor i in range(n - 1):\n for j in range(i + 1, n):\n cnts[edges[i][j] - 1] += 1\n\nfor x in cnts:\n print(x)\n","fail":"n, x, y = map(int, input().split())\n\nans = [0] * n\nfor i in range(1, n + 1):\n for j in range(i + 1, n + 1):\n ans[\n min(j - i, min(abs(i - x) + 1 + abs(y - j), abs(i - y) + 1 + abs(x - j)))\n ] += 1\n\nfor x in ans[1:]:\n print(x)\n","change":"replace","i1":2,"i2":21,"j1":2,"j2":10,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02726","language":"Python","original_status":"Time Limit Exceeded","pass":"# D - Line++\n\nimport queue\n\nN, X, Y = map(int, input().split())\nX, Y = X - 1, Y - 1\nM = [(i, []) for i in range(N)]\nfor i in range(N):\n if i != 0:\n M[i][1].append(i - 1)\n if i != N - 1:\n M[i][1].append(i + 1)\n if i == X:\n M[X][1].append(Y)\n if i == Y:\n M[Y][1].append(X)\n\ncost = [[-1] * N for _ in range(N)]\np = [[None] * N for _ in range(N)]\nQ = queue.Queue()\n\nfor i in range(N):\n Q.put(M[i])\n key = M[i][0]\n cost[key][key] = 0\n p[key][key] = key\n while not Q.empty():\n q = Q.get()\n for j in q[1]:\n if cost[i][j] == -1:\n p[i][j] = q[0]\n cost[i][j] = cost[i][p[i][j]] + 1\n Q.put(M[j])\n\nans = [0] * N\nfor i in range(N):\n for j in range(N):\n ans[cost[i][j]] += 1\n\nfor i in range(1, N):\n print(int(ans[i] \/ 2))\n","fail":"# D - Line++\n\nn, x, y = map(int, input().split())\nx, y = x - 1, y - 1\n\ncnt = [0] * n\nfor i in range(n):\n for j in range(i + 1, n):\n dist = min(j - i, abs(x - i) + abs(y - j) + 1)\n cnt[dist] += 1\n\nfor i in range(1, len(cnt)):\n print(cnt[i])\n","change":"replace","i1":2,"i2":41,"j1":2,"j2":13,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02726","language":"Python","original_status":"Runtime Error","pass":"n, x, y = map(int, input().split())\ncnt = [0] * n\n# \u6f38\u5316\u5f0f\u304c\u5efa\u3066\u3089\u308c\u305d\u3046\u3067\u3081\u3093\u3069\u304f\u3055\u3044\u5834\u5408\u306f\u3001\u7247\u65b9\u3092\u56fa\u5b9a\u3059\u308b\n# \u7aef\u70b9\u3092\u56fa\u5b9a\u3059\u308b 1..n-2 \u304b\u3089\u9806\u306b\u5927\u304d\u3044\u9802\u70b9\u306b\u5411\u304b\u3063\u3066\u4f38\u3073\u3066\u3044\u304f\nfor i in range(n - 1):\n for j in range(i + 1, n):\n if i <= x - 1:\n if j <= x - 1: # 1 idx\n cnt[j - i] += 1\n elif j <= y - 1:\n cnt[min(j - i, x + y - i - j - 1)] += 1\n else:\n cnt[x - y - i + j + 1] += 1\n elif x - 1 < x <= y - 1:\n if j <= y - 1:\n cnt[min(j - i, 1 + (i - x + 1) + (y - 1 - j))] += 1\n else:\n cnt[min(j - i), 1 + (i - x + 1) + (j - y + 1)] += 1\n else:\n cnt[j - i] += 1\n\nfor i in range(1, n):\n print(cnt[i])\n","fail":"n, x, y = map(int, input().split())\ncnt = [0] * n\n# \u6f38\u5316\u5f0f\u304c\u5efa\u3066\u3089\u308c\u305d\u3046\u3067\u3081\u3093\u3069\u304f\u3055\u3044\u5834\u5408\u306f\u3001\u7247\u65b9\u3092\u56fa\u5b9a\u3059\u308b\n# \u7aef\u70b9\u3092\u56fa\u5b9a\u3059\u308b 1..n-2 \u304b\u3089\u9806\u306b\u5927\u304d\u3044\u9802\u70b9\u306b\u5411\u304b\u3063\u3066\u4f38\u3073\u3066\u3044\u304f\nfor i in range(n - 1):\n for j in range(i + 1, n):\n if i <= x - 1:\n if j <= x - 1: # 1 idx\n cnt[j - i] += 1\n elif j <= y - 1:\n cnt[min(j - i, x + y - i - j - 1)] += 1\n else:\n cnt[x - y - i + j + 1] += 1\n elif x - 1 < x <= y - 1:\n if j <= y - 1:\n cnt[min(j - i, 1 + (i - x + 1) + (y - 1 - j))] += 1\n else:\n cnt[min((j - i), 1 + (i - x + 1) + (j - y + 1))] += 1\n else:\n cnt[j - i] += 1\n\nfor i in range(1, n):\n print(cnt[i])\n","change":"replace","i1":17,"i2":18,"j1":17,"j2":18,"error":"TypeError: 'int' object is not iterable","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02726\/Python\/s903600229.py\", line 18, in \n cnt[min(j - i), 1 + (i - x + 1) + (j - y + 1)] += 1\nTypeError: 'int' object is not iterable\n","stdout":null} {"problem_id":"p02726","language":"Python","original_status":"Time Limit Exceeded","pass":"#!\/usr\/bin\/python3\n\n(n, x, y) = map(int, input().split())\n\ncs = [0 for i in range(n)]\n\nfor i in range(1, n + 1):\n for j in range(i + 1, n + 1):\n d = min(abs(j - i), abs(x - i) + 1 + abs(j - y), abs(y - i) + 1 + abs(j - x))\n if d == (abs(y - i) + 1 + abs(j - x)):\n print(i, j, d)\n cs[d] += 1\n\nfor i in range(1, n):\n print(cs[i])\n","fail":"#!\/usr\/bin\/python3\n\n(n, x, y) = map(int, input().split())\n\ncs = [0 for i in range(n)]\n\nfor i in range(1, n + 1):\n for j in range(i + 1, n + 1):\n d = min(abs(j - i), abs(x - i) + 1 + abs(j - y))\n cs[d] += 1\n\nfor i in range(1, n):\n print(cs[i])\n","change":"replace","i1":8,"i2":11,"j1":8,"j2":9,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02726","language":"Python","original_status":"Time Limit Exceeded","pass":"N, X, Y = map(int, input().split())\n\ndist_from_X = list(abs(i - (X - 1)) for i in range(N))\ndist_from_Y = list(abs(i - (Y - 1)) for i in range(N))\n\nans_list = [0] * N\n\nfor i in range(N):\n for j in range(N):\n i_X_Y_j = dist_from_X[i] + 1 + dist_from_Y[j]\n i_Y_X_j = dist_from_Y[i] + 1 + dist_from_X[j]\n i_j = abs(i - j)\n min_dist_i_j = min(i_X_Y_j, i_Y_X_j, i_j)\n ans_list[min_dist_i_j] += 1\n\nfor num in ans_list[1:]:\n print(num \/\/ 2)\n","fail":"N, X, Y = map(int, input().split())\n\ndist_from_X = list(abs(i - (X - 1)) for i in range(N))\ndist_from_Y = list(abs(i - (Y - 1)) for i in range(N))\n\nans_list = [0] * N\n\nfor i in range(N):\n for j in range(i, N):\n i_X_Y_j = dist_from_X[i] + 1 + dist_from_Y[j]\n i_Y_X_j = dist_from_Y[i] + 1 + dist_from_X[j]\n i_j = abs(i - j)\n min_dist_i_j = min(i_X_Y_j, i_Y_X_j, i_j)\n ans_list[min_dist_i_j] += 1\n\nfor num in ans_list[1:]:\n print(num)\n","change":"replace","i1":8,"i2":17,"j1":8,"j2":17,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02726","language":"Python","original_status":"Runtime Error","pass":"from scipy.sparse.csgraph import csgraph_from_dense, dijkstra\nimport numpy as np\n\nN, X, Y = map(int, input().split())\nF = [[0 for i in range(N)] for j in range(N)]\n\nfor i in range(N - 1):\n F[i][i + 1] = 1\n F[i + 1][i] = 1\nF[X - 1][Y - 1] = 1\nF[Y - 1][X - 1] = 1\n\nG = csgraph_from_dense(F, null_value=0)\nd = dijkstra(G)\n\n# print(F)\n# print(d)\n\n# print(np.count_nonzero(d == 1))\nfor i in range(1, N):\n print(np.count_nonzero(d == i) \/\/ 2)\n","fail":"from scipy.sparse.csgraph import csgraph_from_dense, dijkstra\nimport numpy as np\nfrom collections import Counter\n\nN, X, Y = map(int, input().split())\nF = [[0 for i in range(N)] for j in range(N)]\n\nfor i in range(N - 1):\n F[i][i + 1] = 1\n F[i + 1][i] = 1\nF[X - 1][Y - 1] = 1\nF[Y - 1][X - 1] = 1\n\nG = csgraph_from_dense(F, null_value=0)\nd = dijkstra(G)\n\n# print(F)\n# print(d)\n\n# print(np.count_nonzero(d == 1))\ns = Counter(d.flatten().astype(np.int64))\n# print(s)\nfor i in range(1, N):\n if i in s:\n print(s[i] \/\/ 2)\n else:\n print(0)\n","change":"replace","i1":2,"i2":21,"j1":2,"j2":27,"error":"ModuleNotFoundError: No module named 'scipy'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02726\/Python\/s587734199.py\", line 1, in \n from scipy.sparse.csgraph import csgraph_from_dense, dijkstra\nModuleNotFoundError: No module named 'scipy'\n","stdout":null} {"problem_id":"p02726","language":"Python","original_status":"Runtime Error","pass":"N, X, Y = map(int, input().split())\n\n\ndic = {}\n\nX = X - 1\nY = Y - 1\n\nfor i in range(N):\n for j in range(i + 1, N):\n if i <= X and Y <= j:\n v = X - i + 1 + j - Y\n elif (i <= X) and (X <= j and j <= Y):\n v = min(j - i, X - i + 1 + Y - j)\n elif (X <= i and i <= Y) and Y <= j:\n v = min(j - i, i - X + 1 + j - Y)\n elif (X <= i and i <= Y) and (X <= j and j <= Y):\n v = min(j - i, i - X + 1 + Y - j)\n else:\n v = j - i\n\n if v in dic:\n dic[v] += 1\n else:\n dic[v] = 1\n\n\nfor i in range(1, N):\n print(dic[i])\n","fail":"N, X, Y = map(int, input().split())\n\n\ndic = {}\n\nX = X - 1\nY = Y - 1\n\nfor i in range(N):\n for j in range(i + 1, N):\n if i <= X and Y <= j:\n v = X - i + 1 + j - Y\n elif (i <= X) and (X <= j and j <= Y):\n v = min(j - i, X - i + 1 + Y - j)\n elif (X <= i and i <= Y) and Y <= j:\n v = min(j - i, i - X + 1 + j - Y)\n elif (X <= i and i <= Y) and (X <= j and j <= Y):\n v = min(j - i, i - X + 1 + Y - j)\n else:\n v = j - i\n\n if v in dic:\n dic[v] += 1\n else:\n dic[v] = 1\n\n\nfor i in range(1, N):\n if i in dic:\n print(dic[i])\n else:\n print(0)\n","change":"replace","i1":28,"i2":29,"j1":28,"j2":32,"error":"KeyError: 4","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02726\/Python\/s708368036.py\", line 29, in \n print(dic[i])\nKeyError: 4\n","stdout":"5\n4\n1\n"} {"problem_id":"p02726","language":"Python","original_status":"Time Limit Exceeded","pass":"def inpl():\n return list(map(int, input().split()))\n\n\nN, X, Y = inpl()\nX -= 1\nY -= 1\nans = {}\nfor i in range(N):\n for j in range(i + 1, N):\n c = min(j - i, abs(i - X) + 1 + abs(j - Y), abs(i - Y) + 1 + abs(j - X))\n ans[c] = ans.get(c, 0) + 1\n\nfor i in range(1, N):\n print(ans.get(i, 0))\n","fail":"def inpl():\n return list(map(int, input().split()))\n\n\nN, X, Y = inpl()\nX -= 1\nY -= 1\nans = {i: 0 for i in range(N)}\nfor i in range(N):\n for j in range(i + 1, N):\n c = min(j - i, abs(i - X) + 1 + abs(j - Y), abs(i - Y) + 1 + abs(j - X))\n ans[c] += 1\n\nfor i in range(1, N):\n print(ans[i])\n","change":"replace","i1":7,"i2":15,"j1":7,"j2":15,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02726","language":"Python","original_status":"Time Limit Exceeded","pass":"# https:\/\/atcoder.jp\/contests\/abc160\/tasks\/abc160_d\nN, X, Y = map(int, input().split())\n\nvisited = set()\n\n# special case: first advance\nfor i in range(N - 1):\n visited.add((i, i + 1))\nvisited.add((X - 1, Y - 1))\n\nprint(len(visited))\n\nfor _ in range(N - 2):\n total = 0\n\n for point in visited.copy():\n x, y = point\n\n if (x - 1, y) not in visited and x - 1 >= 0:\n visited.add((x - 1, y))\n total += 1\n\n if (x + 1, y) not in visited and x + 1 != y:\n visited.add((x + 1, y))\n total += 1\n\n if (x, y - 1) not in visited and x != y - 1:\n visited.add((x, y - 1))\n total += 1\n\n if (x, y + 1) not in visited and y + 1 < N:\n visited.add((x, y + 1))\n total += 1\n\n print(total)\n","fail":"# https:\/\/atcoder.jp\/contests\/abc160\/tasks\/abc160_d\nN, X, Y = map(int, input().split())\n\nvisited = set()\n\n# special case: first advance\nfor i in range(N - 1):\n visited.add((i, i + 1))\nvisited.add((X - 1, Y - 1))\n\nprint(len(visited))\n\nnext_items = visited.copy()\nfor _ in range(N - 2):\n candidates = []\n\n for point in next_items:\n x, y = point\n\n if (x - 1, y) not in visited and x - 1 >= 0:\n visited.add((x - 1, y))\n candidates.append((x - 1, y))\n\n if (x + 1, y) not in visited and x + 1 != y:\n visited.add((x + 1, y))\n candidates.append((x + 1, y))\n\n if (x, y - 1) not in visited and x != y - 1:\n visited.add((x, y - 1))\n candidates.append((x, y - 1))\n\n if (x, y + 1) not in visited and y + 1 < N:\n visited.add((x, y + 1))\n candidates.append((x, y + 1))\n\n print(len(candidates))\n next_items = candidates\n","change":"replace","i1":12,"i2":35,"j1":12,"j2":37,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02726","language":"Python","original_status":"Time Limit Exceeded","pass":"from collections import deque\n\n\ndef bfs(start, end):\n Q = deque()\n Q.append(start)\n dist[start] = 0\n\n while Q:\n v = Q.popleft()\n\n for nv in G[v]:\n if dist[nv] != -1:\n continue\n Q.append(nv)\n dist[nv] = dist[v] + 1\n\n if nv == end:\n return dist[nv]\n\n\nN, X, Y = map(int, input().split())\nG = [[] for _ in range(N)]\nres = [0] * N\n\nfor i in range(N - 1):\n G[i].append(i + 1)\n G[i + 1].append(i)\n\nif abs(X - Y) != 1:\n G[X - 1].append(Y - 1)\n G[Y - 1].append(X - 1)\n\nfor i in range(N - 1):\n for j in range(i + 1, N):\n dist = [-1] * N\n res[bfs(i, j)] += 1\n\nfor i in range(1, N):\n print(res[i])\n","fail":"N, X, Y = map(int, input().split())\nans = [0 for i in range(1, N)]\n\nfor i in range(1, N):\n for j in range(i + 1, N + 1):\n k = min(abs(j - i), abs(X - i) + 1 + abs(Y - j), abs(Y - i) + 1 + abs(X - j))\n ans[k - 1] += 1\n\nfor i in ans:\n print(i)\n","change":"replace","i1":0,"i2":40,"j1":0,"j2":10,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02727","language":"Python","original_status":"Runtime Error","pass":"import sys\nimport numpy as np\n\nX, Y, A, B, C = map(int, sys.stdin.readline().rstrip().split())\nP = list(map(int, sys.stdin.readline().rstrip().split()))\nQ = list(map(int, sys.stdin.readline().rstrip().split()))\nR = list(map(int, sys.stdin.readline().rstrip().split()))\n\nif A == 1 and B == 1 and C == 1:\n ans = sum(sorted([P[0], Q[0], R[0]], reverse=True)[:2])\n print(ans)\n sys.exit()\n\nPmin = np.min(P)\nQmin = np.min(Q)\nRmax = np.max(R)\n\n# \u7740\u8272\u3059\u308b\u5fc5\u8981\u304c\u306a\u3044\u5834\u5408\nif Pmin > Rmax and Qmin > Rmax:\n sP = np.sort(P)[::-1] if len(set(P)) > 1 else P\n sQ = np.sort(Q)[::-1] if len(set(Q)) > 1 else Q\n ans = np.sum(sP[:X]) + np.sum(sQ[:Y])\n print(ans)\n sys.exit()\n\ngS = P + Q + R\np = A + B\niX = 0\niY = 0\niR = []\naX = [0] * X\naY = [0] * Y\naR = []\nans = 0\nfor index in np.argsort(gS)[::-1]:\n if iX == X and iY == Y:\n break\n if index < A:\n if iX == X:\n continue\n else:\n aX[iX] = gS[index]\n iX += 1\n elif index < p:\n if iY == Y:\n continue\n else:\n aY[iY] = gS[index]\n iY += 1\n else:\n iR.append((iX, iY))\n aR.append(gS[index])\n\nsumX = sum(aX)\nsumY = sum(aY)\nfor (iX, iY), s in zip(iR, aR):\n print(aX, aY)\n if len(aX) == 0:\n sumY = sumY + s - aY.pop()\n if len(aY) == 0:\n break\n elif len(aY) == 0:\n sumX = sumX + s - aX.pop()\n if len(aX) == 0:\n break\n else:\n if s <= aX[-1] and s <= aY[-1]:\n break\n if iX == X:\n sumY = sumY + s - aY.pop()\n elif iY == Y:\n sumX = sumX + s - aX.pop()\n else:\n if aX[-1] < aY[-1]:\n sumX = sumX + s - aX.pop()\n else:\n sumY = sumY + s - aY.pop()\n\nprint(sumX + sumY)\n","fail":"import sys\nimport numpy as np\n\nX, Y, A, B, C = map(int, sys.stdin.readline().rstrip().split())\nP = list(map(int, sys.stdin.readline().rstrip().split()))\nQ = list(map(int, sys.stdin.readline().rstrip().split()))\nR = list(map(int, sys.stdin.readline().rstrip().split()))\n\nif A == 1 and B == 1 and C == 1:\n ans = sum(sorted([P[0], Q[0], R[0]], reverse=True)[:2])\n print(ans)\n sys.exit()\n\nPmin = np.min(P)\nQmin = np.min(Q)\nRmax = np.max(R)\n\n# \u7740\u8272\u3059\u308b\u5fc5\u8981\u304c\u306a\u3044\u5834\u5408\nif Pmin > Rmax and Qmin > Rmax:\n sP = np.sort(P)[::-1] if len(set(P)) > 1 else P\n sQ = np.sort(Q)[::-1] if len(set(Q)) > 1 else Q\n ans = np.sum(sP[:X]) + np.sum(sQ[:Y])\n print(ans)\n sys.exit()\n\ngS = P + Q + R\np = A + B\niX = 0\niY = 0\niR = []\naX = [0] * X\naY = [0] * Y\naR = []\nfor index in np.argsort(gS)[::-1]:\n if iX == X and iY == Y:\n break\n if index < A:\n if iX == X:\n continue\n else:\n aX[iX] = gS[index]\n iX += 1\n elif index < p:\n if iY == Y:\n continue\n else:\n aY[iY] = gS[index]\n iY += 1\n else:\n iR.append((iX, iY))\n aR.append(gS[index])\n\nsumX = sum(aX)\nsumY = sum(aY)\nfor (iX, iY), s in zip(iR, aR):\n if len(aX) == 0 and len(aY) == 0:\n break\n if len(aX) == 0:\n if s <= aY[-1]:\n break\n sumY = sumY + s - aY.pop()\n if len(aY) == 0:\n break\n elif len(aY) == 0:\n if s <= aX[-1]:\n break\n sumX = sumX + s - aX.pop()\n if len(aX) == 0:\n break\n else:\n if s <= aX[-1] and s <= aY[-1]:\n break\n if iX == X:\n sumY = sumY + s - aY.pop()\n elif iY == Y:\n sumX = sumX + s - aX.pop()\n else:\n if aX[-1] < aY[-1]:\n sumX = sumX + s - aX.pop()\n else:\n sumY = sumY + s - aY.pop()\n\nprint(sumX + sumY)\n","change":"replace","i1":33,"i2":62,"j1":33,"j2":66,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02727","language":"Python","original_status":"Runtime Error","pass":"X, Y, A, B, C = map(int, input().split())\np = list(map(int, input().split()))\nq = list(map(int, input().split()))\nr = list(map(int, input().split()))\np.sort(reverse=True)\nq.sort(reverse=True)\nr.sort(reverse=True)\neat_p = p[:X]\neat_q = q[:Y]\n\nans = sum(eat_p) + sum(eat_q)\nif A == 1:\n i = 0\nelse:\n i = -1\nif B == 1:\n j = 0\nelse:\n j = -1\nk = 0\n\nwhile True:\n if k == C or (eat_p[i] >= r[k] and eat_q[j] >= r[k]):\n break\n if eat_p[i] < eat_q[j] and eat_p[i] < r[k]:\n ans += r[k] - eat_p[i]\n k += 1\n i -= 1\n elif eat_p[i] >= eat_q[j] and eat_q[j] < r[k]:\n ans += r[k] - eat_q[j]\n k += 1\n j -= 1\n if i == -A:\n i = 0\n if j == -B:\n j = 0\n\nprint(ans)\n","fail":"X, Y, A, B, C = map(int, input().split())\np = list(map(int, input().split()))\nq = list(map(int, input().split()))\nr = list(map(int, input().split()))\np.sort(reverse=True)\nq.sort(reverse=True)\neat_p = p[:X]\neat_q = q[:Y]\n\nall_apple = eat_p + eat_q + r\nall_apple.sort(reverse=True)\n\nprint(sum(all_apple[: X + Y]))\n","change":"replace","i1":6,"i2":38,"j1":6,"j2":13,"error":"0","stderr":null,"stdout":12.0} {"problem_id":"p02727","language":"Python","original_status":"Time Limit Exceeded","pass":"#!\/usr\/bin\/env python3\n\nX, Y, A, B, C = list(map(int, input().split()))\np_list = list(map(int, input().split())) # 10 ** 5\nq_list = list(map(int, input().split()))\nr_list = list(map(int, input().split()))\n\np_list = sorted(p_list, reverse=True)\nq_list = sorted(q_list, reverse=True)\nr_list = sorted(r_list, reverse=True)\n\ntotal = 0\nfor _ in range(X):\n if r_list and p_list:\n r = r_list[0]\n p = p_list[0]\n\n if p >= r:\n total += p_list.pop(0)\n else:\n total += r_list.pop(0)\n elif r_list:\n total += r_list.pop()\n elif p_list:\n total += p_list.pop()\n else:\n break\n\nfor _ in range(Y):\n if r_list and q_list:\n r = r_list[0]\n q = q_list[0]\n\n if q >= r:\n total += q_list.pop(0)\n else:\n total += r_list.pop(0)\n elif r_list:\n total += r_list.pop(0)\n elif q_list:\n total += q_list.pop(0)\n else:\n break\nans = total\nprint(ans)\n","fail":"#!\/usr\/bin\/env python3\n\nX, Y, A, B, C = list(map(int, input().split()))\np_list = list(map(int, input().split())) # 10 ** 5\nq_list = list(map(int, input().split()))\nr_list = list(map(int, input().split()))\n\np_list = list(sorted(p_list, reverse=True))\nq_list = list(sorted(q_list, reverse=True))\n# r_list = sorted(r_list, reverse=True)\n\np_list = p_list[:X]\nq_list = q_list[:Y]\n\nall_list = p_list + q_list + r_list\nall_list = list(sorted(all_list, reverse=True))\ntotal = sum(all_list[: X + Y])\n\n\nans = total\nprint(ans)\n","change":"replace","i1":7,"i2":43,"j1":7,"j2":19,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02727","language":"Python","original_status":"Runtime Error","pass":"x, y, a, b, c = map(int, input().split())\np = sorted(map(int, input().split()))[::-1]\nq = sorted(map(int, input().split()))[::-1]\nr = sorted(map(int, input().split()))[::-1]\n\nz = 0\nred, green = 0, 0\nans = 0\nwhile True:\n finish = True\n if p[x] <= q[y]:\n if z < c and p[x] < r[z]:\n x -= 1\n z += 1\n finish = False\n else:\n if z < c and q[y] < r[z]:\n y -= 1\n z += 1\n finish = False\n if finish:\n break\nprint(sum(p[:x]) + sum(q[:y]) + sum(q[:z]))\n","fail":"x, y, a, b, c = map(int, input().split())\np = sorted(map(int, input().split()))[::-1]\nq = sorted(map(int, input().split()))[::-1]\nr = sorted(map(int, input().split()))[::-1]\n\nx, y = x - 1, y - 1\nz = 0\nred, green = 0, 0\nans = 0\nwhile True:\n finish = True\n if p[x] <= q[y] or y < 0:\n if z < c and p[x] < r[z]:\n x -= 1\n z += 1\n finish = False\n elif p[x] >= q[y] or x < 0:\n if z < c and q[y] < r[z]:\n y -= 1\n z += 1\n finish = False\n if finish:\n break\nprint(sum(p[: x + 1]) + sum(q[: y + 1]) + sum(r[:z]))\n","change":"replace","i1":5,"i2":23,"j1":5,"j2":24,"error":"IndexError: list index out of range","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02727\/Python\/s242480686.py\", line 11, in \n if p[x] <= q[y]:\nIndexError: list index out of range\n","stdout":null} {"problem_id":"p02727","language":"Python","original_status":"Runtime Error","pass":"x, y, a, b, c = map(int, input().split())\n\np = list(map(int, input().split()))\nq = list(map(int, input().split()))\nr = list(map(int, input().split()))\n\n# step1: sort red\/green apples in descending order\np.sort(reverse=True)\nq.sort(reverse=True)\n\n# step2:clip necessary apples\np = p[:x]\nq = q[:y]\n\n# step3: sort red\/green apples in ascending order\np.sort()\nq.sort()\n\n# step4: sort non-color apples in descending order\nr.sort(reverse=True)\n\n# step5:swap apples to eliminate the least delicious apple\nr_idx = g_idx = 0\nfor idx in range(c):\n\n if r_idx >= x or g_idx >= y:\n break\n\n if r[idx] < p[r_idx] and r[idx] < q[g_idx]:\n break\n\n if r[idx] > p[r_idx] and r[idx] > q[g_idx]:\n if p[r_idx] < q[g_idx]:\n p[r_idx], r[idx] = r[idx], p[r_idx]\n r_idx += 1\n else:\n q[g_idx], r[idx] = r[idx], q[g_idx]\n g_idx += 1\n\n if r[idx] > p[r_idx]:\n p[r_idx], r[idx] = r[idx], p[r_idx]\n r_idx += 1\n\n if r[idx] > q[g_idx]:\n q[g_idx], r[idx] = r[idx], q[g_idx]\n g_idx += 1\n\nprint(sum(p) + sum(q))\n","fail":"x, y, a, b, c = map(int, input().split())\n\np = list(map(int, input().split()))\nq = list(map(int, input().split()))\nr = list(map(int, input().split()))\n\n# step1: sort red\/green apples in descending order\np.sort(reverse=True)\nq.sort(reverse=True)\n\n# step2:clip necessary apples\np = p[:x]\nq = q[:y]\n\n# step3: sort red\/green apples in ascending order\np.sort()\nq.sort()\n\n# step4: sort non-color apples in descending order\nr.sort(reverse=True)\n\n# step5:swap apples to eliminate the least delicious apple\nd = []\n\nd.extend(p)\nd.extend(q)\nd.extend(r)\nd.sort(reverse=True)\n\nprint(sum(d[: x + y]))\n","change":"replace","i1":22,"i2":48,"j1":22,"j2":30,"error":"0","stderr":null,"stdout":12.0} {"problem_id":"p02727","language":"Python","original_status":"Runtime Error","pass":"x, y, a, b, c = map(int, input().split())\np = sorted(map(int, input().split()))\nq = sorted(map(int, input().split()))\nr = sorted(map(int, input().split()))\nv = 0\n\nfor _ in range(x):\n if len(r):\n if p[-1] > r[-1]:\n v += p.pop()\n else:\n v += r.pop()\n else:\n v += p.pop()\n\nfor _ in range(y):\n if len(r):\n if q[-1] > r[-1]:\n v += q.pop()\n else:\n v += r.pop()\n else:\n v += r.pop()\n\nprint(v)\n","fail":"x, y, a, b, c = map(int, input().split())\np = sorted(map(int, input().split()), reverse=True)\nq = sorted(map(int, input().split()), reverse=True)\nr = sorted(map(int, input().split()))\nv = 0\nc = sorted(p[0:x] + q[0:y])\nfor i in range(x + y):\n if len(r):\n if c[i] < r[-1]:\n c[i] = r.pop()\n else:\n break\nprint(sum(c))\n","change":"replace","i1":1,"i2":25,"j1":1,"j2":13,"error":"0","stderr":null,"stdout":12.0} {"problem_id":"p02727","language":"Python","original_status":"Runtime Error","pass":"X, Y, A, B, C = map(int, input().split())\np = sorted([int(i) for i in input().split()], reverse=True)\nq = sorted([int(i) for i in input().split()], reverse=True)\nr = sorted([int(i) for i in input().split()])\n\np = p[:X]\nq = q[:Y]\nplus_r = []\n\nwhile r != [] and (p != [] and r[-1] > p[-1]) or (q != [] and r[-1] > q[-1]):\n if p[-1] < q[-1]:\n p.pop()\n else:\n q.pop()\n plus_r.append(r.pop())\n\nprint(sum(p) + sum(q) + sum(plus_r))\n","fail":"X, Y, A, B, C = map(int, input().split())\np = sorted([int(i) for i in input().split()], reverse=True)\nq = sorted([int(i) for i in input().split()], reverse=True)\nr = sorted([int(i) for i in input().split()])\n\np = p[:X]\nq = q[:Y]\nplus_r = []\n\nwhile r != [] and ((p != [] and r[-1] > p[-1]) or (q != [] and r[-1] > q[-1])):\n if p == []:\n q.pop()\n plus_r.append(r.pop())\n continue\n elif q == []:\n p.pop()\n plus_r.append(r.pop())\n continue\n\n if p[-1] < q[-1]:\n p.pop()\n else:\n q.pop()\n plus_r.append(r.pop())\n\nprint(sum(p) + sum(q) + sum(plus_r))\n","change":"replace","i1":9,"i2":10,"j1":9,"j2":19,"error":"IndexError: list index out of range","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02727\/Python\/s816996261.py\", line 10, in \n while r != [] and (p != [] and r[-1] > p[-1]) or (q != [] and r[-1] > q[-1]):\nIndexError: list index out of range\n","stdout":null} {"problem_id":"p02727","language":"Python","original_status":"Time Limit Exceeded","pass":"X, Y, A, B, C = map(int, input().split())\np, pi = sorted(list(map(int, input().split())), reverse=True)[:X] + [-1], 0\nq, qi = sorted(list(map(int, input().split())), reverse=True)[:Y] + [-1], 0\nr, ri = sorted(list(map(int, input().split())), reverse=True) + [-1], 0\nans, nX, nY = 0, 0, 0\nwhile nX < X or nY < Y:\n if r[ri] >= p[pi] and r[ri] >= q[qi]:\n if nX < X and nY < Y:\n if p[pi] >= q[qi]:\n nX += 1\n else:\n nY += 1\n elif nX < X:\n nX += 1\n elif nY < Y:\n nY += 1\n ans += r[ri]\n ri += 1\n elif p[pi] >= q[qi] and p[pi] >= r[ri]:\n if nX < X:\n nX += 1\n ans += p[pi]\n pi += 1\n elif q[qi] >= r[ri] and q[qi] >= p[pi]:\n if nY < Y:\n nY += 1\n ans += q[qi]\n qi += 1\n\nprint(ans)\n","fail":"X, Y, A, B, C = map(int, input().split())\np = sorted(list(map(int, input().split())))[-X:]\nq = sorted(list(map(int, input().split())))[-Y:]\nr = list(map(int, input().split()))\nprint(sum(sorted(p + q + r)[-(X + Y) :]))\n","change":"replace","i1":1,"i2":30,"j1":1,"j2":5,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02727","language":"Python","original_status":"Runtime Error","pass":"x, y, a, b, c = map(int, input().split())\nLa = sorted(list(map(int, input().split())), reverse=True)\nLb = sorted(list(map(int, input().split())), reverse=True)\nLc = sorted(list(map(int, input().split())), reverse=True)\n\nL = La[:x]\nL.extend(Lb[:y])\nL.sort(reverse=False)\n\nfor i in range(c):\n if L[i] < Lc[i]:\n L[i] = Lc[i]\n\nprint(sum(L))\n","fail":"x, y, a, b, c = map(int, input().split())\nLa = sorted(list(map(int, input().split())), reverse=True)\nLb = sorted(list(map(int, input().split())), reverse=True)\nLc = sorted(list(map(int, input().split())), reverse=True)\n\nL = La[:x]\nL.extend(Lb[:y])\nL.sort(reverse=False)\nmin = min(c, len(L))\n\nfor i in range(min):\n if L[i] < Lc[i]:\n L[i] = Lc[i]\n\nprint(sum(L))\n","change":"replace","i1":8,"i2":10,"j1":8,"j2":11,"error":"0","stderr":null,"stdout":12.0} {"problem_id":"p02727","language":"Python","original_status":"Runtime Error","pass":"x, y, a, b, c = map(int, input().split())\np = sorted(map(int, input().split()))\nq = sorted(map(int, input().split()))\nr = sorted(map(int, input().split()), reverse=True)\npi = len(p) - x\nqi = len(q) - y\nri = 0\nfor _ in range(len(r)):\n if r[ri] <= min(p[pi], q[qi]):\n break\n else:\n if pi >= len(p) and qi >= len(q):\n break\n else:\n if pi < len(p) and qi < len(q):\n if p[pi] < q[qi]:\n p[pi] = r[ri]\n pi += 1\n else:\n q[qi] = r[ri]\n qi += 1\n elif pi >= len(p) and qi < len(q):\n if q[qi] < r[ri]:\n q[qi] = r[ri]\n qi += 1\n elif pi < len(p) and qi >= len(q):\n if p[pi] < r[ri]:\n p[pi] = r[ri]\n pi += 1\n ri += 1\n continue\nprint(sum(p[-x:]) + sum(q[-y:]))\n","fail":"x, y, a, b, c = map(int, input().split())\np = sorted(map(int, input().split()))\nq = sorted(map(int, input().split()))\nr = sorted(map(int, input().split()), reverse=True)\npi = len(p) - x\nqi = len(q) - y\nri = 0\nfor _ in range(len(r)):\n if r[ri] <= min(p[min(pi, len(p) - 1)], q[min(qi, len(q) - 1)]):\n break\n else:\n if pi >= len(p) and qi >= len(q):\n break\n else:\n if pi < len(p) and qi < len(q):\n if p[pi] < q[qi]:\n p[pi] = r[ri]\n pi += 1\n else:\n q[qi] = r[ri]\n qi += 1\n elif pi < len(p) and qi >= len(q):\n p[pi] = r[ri]\n pi += 1\n else:\n q[qi] = r[ri]\n qi += 1\n ri += 1\nprint(sum(p[-x:]) + sum(q[-y:]))\n","change":"replace","i1":8,"i2":31,"j1":8,"j2":28,"error":"0","stderr":null,"stdout":12.0} {"problem_id":"p02727","language":"Python","original_status":"Runtime Error","pass":"X, Y, A, B, C = map(int, input().split())\nP = list(map(int, input().split()))\nQ = list(map(int, input().split()))\nR = list(map(int, input().split()))\n\nP.sort(reverse=True)\nQ.sort(reverse=True)\nR.sort(reverse=True)\n\nS = P[:X] + Q[:Y]\nS.sort(reverse=True)\n\nS_wa = []\nwa = 0\nfor s in S[::-1]:\n wa += s\n S_wa.append(wa)\n# print(S_wa)\nbig = S_wa[-1]\nans = S_wa[-1]\n\nR_wa = []\nwa = 0\nfor r in R:\n wa += r\n R_wa.append(wa)\n# print(R_wa)\n\nfor i in range(len(R_wa)):\n ans = max(ans, big + R_wa[i] - S_wa[i])\nprint(ans)\n","fail":"X, Y, A, B, C = map(int, input().split())\nP = list(map(int, input().split()))\nQ = list(map(int, input().split()))\nR = list(map(int, input().split()))\n\nP.sort(reverse=True)\nQ.sort(reverse=True)\nR.sort(reverse=True)\n\nS = P[:X] + Q[:Y]\nS.sort(reverse=True)\n\nS_wa = []\nwa = 0\nfor s in S[::-1]:\n wa += s\n S_wa.append(wa)\n# print(S_wa)\nbig = S_wa[-1]\nans = S_wa[-1]\n\nR_wa = []\nwa = 0\nfor r in R:\n wa += r\n R_wa.append(wa)\n# print(R_wa)\n\nkazu = min(len(R_wa), len(S_wa))\n\nfor i in range(kazu):\n ans = max(ans, big + R_wa[i] - S_wa[i])\nprint(ans)\n","change":"replace","i1":28,"i2":29,"j1":28,"j2":31,"error":"0","stderr":null,"stdout":12.0} {"problem_id":"p02727","language":"Python","original_status":"Time Limit Exceeded","pass":"from heapq import heapify, heappushpop\n\nX, Y, A, B, C = map(int, input().split())\n# \u5927\u304d\u3044\u9806\u306b\u30bd\u30fc\u30c8\u3057\u3066\u53d7\u3051\u53d6\u3063\u3066\u304a\u304f\np = sorted(list(map(int, input().split())))[::-1]\nq = sorted(list(map(int, input().split())))[::-1]\nr = sorted(list(map(int, input().split())))[::-1]\nans_list = p[:X] + q[:Y] # \u7740\u8272\u3057\u306a\u3044\u5834\u5408\nheapify(ans_list)\nm = min(ans_list)\nfor ri in r:\n if ri > m:\n heappushpop(ans_list, ri)\n m = min(ans_list)\n else:\n break\nprint(sum(ans_list))\n","fail":"from heapq import heapify, heappushpop\n\nX, Y, A, B, C = map(int, input().split())\n# \u5927\u304d\u3044\u9806\u306b\u30bd\u30fc\u30c8\u3057\u3066\u53d7\u3051\u53d6\u3063\u3066\u304a\u304f\np = sorted(list(map(int, input().split())))[::-1]\nq = sorted(list(map(int, input().split())))[::-1]\nr = sorted(list(map(int, input().split())))[::-1]\nans_list = p[:X] + q[:Y] # \u7740\u8272\u3057\u306a\u3044\u5834\u5408\nheapify(ans_list)\nfor ri in r:\n if ri > ans_list[0]:\n heappushpop(ans_list, ri)\n else:\n break\nprint(sum(ans_list))\n","change":"replace","i1":9,"i2":14,"j1":9,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02727","language":"Python","original_status":"Time Limit Exceeded","pass":"x, y, a, b, c = map(int, input().split())\np = sorted(list(map(int, input().split())), reverse=True)\npp = p[:]\nq = sorted(list(map(int, input().split())), reverse=True)\nqq = q[:]\nr = sorted(list(map(int, input().split())), reverse=True)\nrr = r[:]\nans1 = 0\nfor _ in range(x):\n if len(p) > 0 and len(r) > 0:\n if p[0] >= r[0]:\n ans1 += p.pop(0)\n else:\n ans1 += r.pop(0)\n elif len(p) > 0:\n ans1 += p.pop(0)\n else:\n ans1 += r.pop(0)\nfor _ in range(y):\n if len(q) > 0 and len(r) > 0:\n if q[0] >= r[0]:\n ans1 += q.pop(0)\n else:\n ans1 += r.pop(0)\n elif len(q) > 0:\n ans1 += q.pop(0)\n else:\n ans1 += r.pop(0)\n\nans2 = 0\nfor _ in range(y):\n if len(qq) > 0 and len(rr) > 0:\n if qq[0] >= rr[0]:\n ans2 += qq.pop(0)\n else:\n ans2 += rr.pop(0)\n elif len(qq) > 0:\n ans2 += qq.pop(0)\n else:\n ans2 += rr.pop(0)\nfor _ in range(x):\n if len(pp) > 0 and len(rr) > 0:\n if pp[0] >= rr[0]:\n ans2 += pp.pop(0)\n else:\n ans2 += rr.pop(0)\n elif len(pp) > 0:\n ans2 += pp.pop(0)\n else:\n ans2 += rr.pop(0)\nprint(max(ans1, ans2))\n","fail":"x, y, a, b, c = map(int, input().split())\np = sorted(list(map(int, input().split())), reverse=True)\npp = p[:x]\nq = sorted(list(map(int, input().split())), reverse=True)\nqq = q[:y]\nr = list(map(int, input().split()))\n\nl = pp + qq + r\nl.sort(reverse=True)\nprint(sum(l[: (x + y)]))\n","change":"replace","i1":2,"i2":51,"j1":2,"j2":10,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02727","language":"Python","original_status":"Runtime Error","pass":"from collections import deque\n\nX, Y, A, B, C = map(int, input().split())\np = list(map(int, input().split()))\nq = list(map(int, input().split()))\nr = list(map(int, input().split()))\n\np.sort(reverse=True)\nq.sort(reverse=True)\nr.sort(reverse=True)\n\np = deque(p)\nq = deque(q)\nr = deque(r)\n\nans = 0\nfor _ in range(X):\n if p[0] >= r[0]:\n ans += p.popleft()\n else:\n ans += r.popleft()\nfor _ in range(Y):\n if q[0] >= r[0]:\n ans += q.popleft()\n else:\n ans += r.popleft()\n\nprint(ans)\n","fail":"X, Y, A, B, C = map(int, input().split())\np = list(map(int, input().split()))\nq = list(map(int, input().split()))\nr = list(map(int, input().split()))\n\np.sort(reverse=True)\nq.sort(reverse=True)\nr.sort(reverse=True)\n\np = p[:X]\nq = q[:Y]\n\nall = p + q + r\nall.sort(reverse=True)\nans = sum(all[: X + Y])\nprint(ans)\n","change":"replace","i1":0,"i2":27,"j1":0,"j2":15,"error":"0","stderr":null,"stdout":12.0} {"problem_id":"p02727","language":"Python","original_status":"Runtime Error","pass":"x, y, a, b, c = map(int, input().split())\nP = sorted(list(map(int, input().split())), reverse=True)\nQ = sorted(list(map(int, input().split())), reverse=True)\nR = sorted(list(map(int, input().split())))\n\nA = sorted(P[:x] + Q[:y])\nans = sum(A)\n\nfor i in range(c):\n if A[i] < R[-1]:\n ans = ans + R[-1] - A[i]\n R.pop(-1)\n\nprint(ans)\n","fail":"x, y, a, b, c = map(int, input().split())\nP = sorted(list(map(int, input().split())), reverse=True)\nQ = sorted(list(map(int, input().split())), reverse=True)\nR = sorted(list(map(int, input().split())))\n\nA = sorted(P[:x] + Q[:y])\nans = sum(A)\n\nfor i in range(min(c, len(A))):\n if A[i] < R[-1]:\n ans = ans + R[-1] - A[i]\n R.pop(-1)\n\nprint(ans)\n","change":"replace","i1":8,"i2":9,"j1":8,"j2":9,"error":"0","stderr":null,"stdout":12.0} {"problem_id":"p02727","language":"Python","original_status":"Runtime Error","pass":"# -*- coding: utf-8 -*-\n\nX, Y, A, B, C = map(int, input().split())\np = list(map(int, input().split()))\nq = list(map(int, input().split()))\nr = list(map(int, input().split()))\n\n# all_apples = sorted(p + q + r, key=lambda x: -x)\n\np_rest = sorted(p)\nq_rest = sorted(q)\nr_rest = sorted(r)\n\nans = 0\np_count = 0\nq_count = 0\nr_count = 0\nwhile (p_count + q_count + r_count) < (X + Y):\n if p_count < X and q_count < Y:\n candidates = [p_rest[-1], q_rest[-1], r_rest[-1]]\n elif p_count < X and q_count == Y:\n candidates = [p_rest[-1], 0, r_rest[-1]]\n elif p_count == X and q_count < Y:\n candidates = [0, q_rest[-1], r_rest[-1]]\n\n wanna_eat = max(candidates)\n eat_idx = candidates.index(wanna_eat)\n\n if eat_idx == 0:\n p_count += 1\n ans += p_rest.pop()\n elif eat_idx == 1:\n q_count += 1\n ans += q_rest.pop()\n else:\n r_count += 1\n ans += r_rest.pop()\n # print(candidates, eat_idx, wanna_eat, p_count, q_count, r_count)\n\nprint(ans)\n","fail":"# -*- coding: utf-8 -*-\n\nX, Y, A, B, C = map(int, input().split())\np = list(map(int, input().split()))\nq = list(map(int, input().split()))\nr = list(map(int, input().split()))\n\n# all_apples = sorted(p + q + r, key=lambda x: -x)\n\np_rest = sorted(p + [0])\nq_rest = sorted(q + [0])\nr_rest = sorted(r + [0])\n\nans = 0\np_count = 0\nq_count = 0\nr_count = 0\nwhile (p_count + q_count + r_count) < (X + Y):\n if p_count < X and q_count < Y:\n candidates = [p_rest[-1], q_rest[-1], r_rest[-1]]\n elif p_count < X and q_count == Y:\n candidates = [p_rest[-1], 0, r_rest[-1]]\n elif p_count == X and q_count < Y:\n candidates = [0, q_rest[-1], r_rest[-1]]\n\n wanna_eat = max(candidates)\n eat_idx = candidates.index(wanna_eat)\n\n if eat_idx == 0:\n p_count += 1\n ans += p_rest.pop()\n elif eat_idx == 1:\n q_count += 1\n ans += q_rest.pop()\n else:\n r_count += 1\n ans += r_rest.pop()\n # print(candidates, eat_idx, wanna_eat, p_count, q_count, r_count)\n\nprint(ans)\n","change":"replace","i1":9,"i2":12,"j1":9,"j2":12,"error":"0","stderr":null,"stdout":12.0} {"problem_id":"p02727","language":"Python","original_status":"Runtime Error","pass":"x, y, a, b, c = map(int, input().split())\nps = list(map(int, input().split()))\nqs = list(map(int, input().split()))\nrs = list(map(int, input().split()))\nps.sort()\nps = ps[-x:]\nqs.sort()\nqs = qs[-y:]\npqs = ps + qs\npqs.sort()\nrs.sort(reverse=True)\n\nanswer = sum(pqs)\nfor i in range(c):\n diff = rs[i] - pqs[i]\n if diff < 0:\n break\n answer += diff\n\nprint(answer)\n","fail":"x, y, a, b, c = map(int, input().split())\nps = list(map(int, input().split()))\nqs = list(map(int, input().split()))\nrs = list(map(int, input().split()))\nps.sort()\nps = ps[-x:]\nqs.sort()\nqs = qs[-y:]\npqs = ps + qs\npqs.sort()\nrs.sort(reverse=True)\n\nanswer = sum(pqs)\nfor i in range(min(x + y, c)):\n diff = rs[i] - pqs[i]\n if diff < 0:\n break\n answer += diff\n\nprint(answer)\n","change":"replace","i1":13,"i2":14,"j1":13,"j2":14,"error":"0","stderr":null,"stdout":12.0} {"problem_id":"p02729","language":"Python","original_status":"Runtime Error","pass":"N, M = list(int, input().split())\n\nprint(int(N * (N - 1) \/ 2 + M * (M - 1) \/ 2))\n","fail":"N, M = map(int, input().split())\n\nprint(int(N * (N - 1) \/ 2 + M * (M - 1) \/ 2))\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"TypeError: list expected at most 1 argument, got 2","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02729\/Python\/s321382416.py\", line 1, in \n N, M = list(int, input().split())\nTypeError: list expected at most 1 argument, got 2\n","stdout":null} {"problem_id":"p02729","language":"Python","original_status":"Runtime Error","pass":"from scipy.special import comb\n\nn, m = map(int, input().split())\n\nprint(comb(n, 2, exact=True) + comb(m, 2, exact=True))\n","fail":"from math import factorial\n\nn, m = map(int, input().split())\n\nif n > 2 and m > 2:\n print(\n factorial(n) \/\/ (factorial(n - 2) * factorial(2))\n + factorial(m) \/\/ (factorial(m - 2) * factorial(2))\n )\nelif n < 2 and m < 2:\n print(0)\nelif n < 2:\n print(factorial(m) \/\/ (factorial(m - 2) * factorial(2)))\nelif m < 2:\n print(factorial(n) \/\/ (factorial(n - 2) * factorial(2)))\n","change":"replace","i1":0,"i2":5,"j1":0,"j2":15,"error":"ModuleNotFoundError: No module named 'scipy'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02729\/Python\/s504439278.py\", line 1, in \n from scipy.special import comb\nModuleNotFoundError: No module named 'scipy'\n","stdout":null} {"problem_id":"p02729","language":"Python","original_status":"Runtime Error","pass":"from math import factorial\n\nn, m = map(int, input().split())\nif n == 1 and m == 1:\n ans = 0\nelif n == 1:\n ans = factorial(m) \/\/ (factorial(m - 2) * factorial(2))\nelif m == 1:\n ans = factorial(n) \/\/ (factorial(n - 2) * factorial(2))\nelse:\n ans = factorial(n) \/\/ (factorial(n - 2) * factorial(2))\n ans += factorial(m) \/\/ (factorial(m - 2) * factorial(2))\nprint(ans)\n","fail":"from math import factorial\n\nn, m = map(int, input().split())\nif n in [0, 1] and m in [0, 1]:\n ans = 0\nelif n in [0, 1]:\n ans = factorial(m) \/\/ (factorial(m - 2) * factorial(2))\nelif m in [0, 1]:\n ans = factorial(n) \/\/ (factorial(n - 2) * factorial(2))\nelse:\n ans = factorial(n) \/\/ (factorial(n - 2) * factorial(2))\n ans += factorial(m) \/\/ (factorial(m - 2) * factorial(2))\nprint(ans)\n","change":"replace","i1":3,"i2":8,"j1":3,"j2":8,"error":"0","stderr":null,"stdout":"1\n"} {"problem_id":"p02729","language":"Python","original_status":"Runtime Error","pass":"import math\n\n\ndef f(x):\n return math.factorial(x)\n\n\narr = list(map(int, input().split()))\nn = arr[0]\nm = arr[1]\ncnt = 0\ncnt += int(f(n) \/ (2 * f(n - 2)))\nif m > 1:\n cnt += int(f(m) \/ (2 * f(m - 2)))\nprint(int(cnt))\n","fail":"n, m = map(int, input().split())\nprint((n * (n - 1)) \/\/ 2 + (m * (m - 1)) \/\/ 2)\n","change":"replace","i1":0,"i2":15,"j1":0,"j2":2,"error":"0","stderr":null,"stdout":"1\n"} {"problem_id":"p02729","language":"Python","original_status":"Runtime Error","pass":"N, M = map(int, input().split())\n\nprint(N(N - 1) \/\/ 2 + M(M - 1) \/\/ 2)\n","fail":"N, M = map(int, input().split())\n\nprint(N * (N - 1) \/\/ 2 + M * (M - 1) \/\/ 2)\n","change":"replace","i1":2,"i2":3,"j1":2,"j2":3,"error":"TypeError: 'int' object is not callable","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02729\/Python\/s193391695.py\", line 3, in \n print(N(N - 1) \/\/ 2 + M(M - 1) \/\/ 2)\nTypeError: 'int' object is not callable\n","stdout":null} {"problem_id":"p02729","language":"Python","original_status":"Runtime Error","pass":"from math import factorial\n\nN, M = map(int, input().split())\n\nif N == 0:\n combN = 0\nelse:\n combN = factorial(N) \/\/ (factorial(N - 2) * factorial(2))\n\nif M == 0:\n combM = 0\nelse:\n combM = factorial(M) \/\/ (factorial(M - 2) * factorial(2))\n\nprint(combN + combM)\n","fail":"from math import factorial\n\nN, M = map(int, input().split())\n\nif N <= 1:\n combN = 0\nelse:\n combN = factorial(N) \/\/ (factorial(N - 2) * factorial(2))\n\nif M <= 1:\n combM = 0\nelse:\n combM = factorial(M) \/\/ (factorial(M - 2) * factorial(2))\n\nprint(combN + combM)\n","change":"replace","i1":4,"i2":10,"j1":4,"j2":10,"error":"ValueError: factorial() not defined for negative values","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02729\/Python\/s805116877.py\", line 13, in \n combM = factorial(M) \/\/ (factorial(M - 2) * factorial(2))\nValueError: factorial() not defined for negative values\n","stdout":null} {"problem_id":"p02729","language":"Python","original_status":"Runtime Error","pass":"import math\n\nn, m = map(int, input().split())\n\n\ndef combinations_count(n, r):\n return math.factorial(n) \/\/ (math.factorial(n - r) * math.factorial(r))\n\n\nans = combinations_count(m, 2) + combinations_count(n, 2)\n\nprint(ans)\n","fail":"import math\n\nn, m = map(int, input().split())\n\n\ndef combinations_count(n, r):\n return math.factorial(n) \/\/ (math.factorial(n - r) * math.factorial(r))\n\n\nif n >= 2 and m >= 2:\n ans = combinations_count(m, 2) + combinations_count(n, 2)\nelif n < 2 and m < 2:\n ans = 0\nelif n < 2:\n ans = combinations_count(m, 2)\nelif m < 2:\n ans = combinations_count(n, 2)\n\n\nprint(ans)\n","change":"replace","i1":9,"i2":10,"j1":9,"j2":18,"error":"ValueError: factorial() not defined for negative values","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02729\/Python\/s072089097.py\", line 10, in \n ans = combinations_count(m, 2) + combinations_count(n, 2)\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02729\/Python\/s072089097.py\", line 7, in combinations_count\n return math.factorial(n) \/\/ (math.factorial(n - r) * math.factorial(r))\nValueError: factorial() not defined for negative values\n","stdout":null} {"problem_id":"p02729","language":"Python","original_status":"Runtime Error","pass":"# -*- coding: utf-8 -*-\n# \u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u30a4\u30f3\u30dd\u30fc\u30c8\nfrom scipy.special import comb\n\n# \u6a19\u6e96\u5165\u529b\u306e\u53d6\u5f97\nN, M = list(map(int, input().split()))\n\n# \u6c42\u89e3\u51e6\u7406\nresult = comb(N, 2, exact=True) + comb(M, 2, exact=True)\n\n# \u7d50\u679c\u51fa\u529b\nprint(result)\n","fail":"# -*- coding: utf-8 -*-\n# \u6a19\u6e96\u5165\u529b\u306e\u53d6\u5f97\nN, M = list(map(int, input().split()))\n\n# \u6c42\u89e3\u51e6\u7406\nresult = int(N * (N - 1) \/ 2 + M * (M - 1) \/ 2)\n\n# \u7d50\u679c\u51fa\u529b\nprint(result)\n","change":"replace","i1":1,"i2":9,"j1":1,"j2":6,"error":"ModuleNotFoundError: No module named 'scipy'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02729\/Python\/s222855902.py\", line 3, in \n from scipy.special import comb\nModuleNotFoundError: No module named 'scipy'\n","stdout":null} {"problem_id":"p02729","language":"Python","original_status":"Runtime Error","pass":"n = int(input())\nm = int(input())\n\nsum = 0\n\nif n > 1:\n sum += 2 ** (n \/\/ 2)\nelse:\n sum += 1\n\nif m > 1:\n sum += 2 ** (m \/\/ 2)\nelse:\n sum += 1\n\nprint(sum)\n","fail":"n, m = map(int, input().split())\n\ncount = 0\nif n > 1:\n count += n * (n - 1) \/\/ 2\nif m > 1:\n count += m * (m - 1) \/\/ 2\nprint(count)\n","change":"replace","i1":0,"i2":16,"j1":0,"j2":8,"error":"ValueError: invalid literal for int() with base 10: '2 1'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02729\/Python\/s013867231.py\", line 1, in \n n = int(input())\nValueError: invalid literal for int() with base 10: '2 1'\n","stdout":null} {"problem_id":"p02729","language":"Python","original_status":"Runtime Error","pass":"import math\n\n\ndef combinations_count(n, r):\n return math.factorial(n) \/\/ (math.factorial(n - r) * math.factorial(r))\n\n\ndef main():\n n, m = map(int, input().split())\n print(combinations_count(n, 2) + combinations_count(m, 2))\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"import math\n\n\ndef combinations_count(n, r):\n return math.factorial(n) \/\/ (math.factorial(n - r) * math.factorial(r))\n\n\ndef main():\n n, m = map(int, input().split())\n if n < 2:\n even = 0\n else:\n even = combinations_count(n, 2)\n if m < 2:\n odd = 0\n else:\n odd = combinations_count(m, 2)\n print(even + odd)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":9,"i2":10,"j1":9,"j2":18,"error":"ValueError: factorial() not defined for negative values","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02729\/Python\/s584253829.py\", line 14, in \n main()\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02729\/Python\/s584253829.py\", line 10, in main\n print(combinations_count(n, 2) + combinations_count(m, 2))\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02729\/Python\/s584253829.py\", line 5, in combinations_count\n return math.factorial(n) \/\/ (math.factorial(n - r) * math.factorial(r))\nValueError: factorial() not defined for negative values\n","stdout":null} {"problem_id":"p02729","language":"Python","original_status":"Runtime Error","pass":"while True:\n m, n = list(map(int, input().split()))\n print(m * (m - 1) \/ 2 + n * (n - 1) \/ 2)\n","fail":"m, n = list(map(int, input().split()))\nprint(int(m * (m - 1) \/ 2 + n * (n - 1) \/ 2))\n","change":"replace","i1":0,"i2":3,"j1":0,"j2":2,"error":"EOFError: EOF when reading a line","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02729\/Python\/s164214433.py\", line 2, in \n m, n = list(map(int, input().split()))\nEOFError: EOF when reading a line\n","stdout":"1.0\n"} {"problem_id":"p02731","language":"Python","original_status":"Runtime Error","pass":"f = int(input()) \/ 3.0\nprint(\"{.9f}\".format(f * f * f))\n","fail":"f = int(input()) \/ 3.0\nprint(\"{:.9f}\".format(f * f * f))\n","change":"replace","i1":1,"i2":2,"j1":1,"j2":2,"error":"AttributeError: 'float' object has no attribute '9f'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02731\/Python\/s178614375.py\", line 2, in \n print(\"{.9f}\".format(f * f * f))\nAttributeError: 'float' object has no attribute '9f'\n","stdout":null} {"problem_id":"p02732","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = [int(i) for i in input().split()]\n\nu = list(set(A))\nc = []\nsum = 0\nfor j in u:\n _ = A.count(j)\n c.append(_)\n sum += int(_ * (_ - 1) \/ 2)\n\ns = \"\"\nfor k in A:\n v = c[u.index(k)]\n s += str(sum - v + 1) + \"\\\\n\"\nprint(s)\n","fail":"import collections\n\nN = int(input())\nA = [int(i) for i in input().split()]\n\nu = collections.Counter(A)\nsum = 0\nfor j, c in u.items():\n sum += int(c * (c - 1) \/ 2)\n\ns = \"\"\nfor k in A:\n s += str(sum - u[k] + 1) + \"\\\\n\"\nprint(s)\n","change":"replace","i1":0,"i2":15,"j1":0,"j2":13,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02732","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nline = list(map(int, input().split()))\ndic = set(line)\nnums = 0\nfor i in dic:\n cnt = line.count(i) - 1\n nums += (cnt * (cnt + 1)) \/\/ 2\n\nfor i in line:\n cnt = line.count(i) - 1\n print(nums - cnt)\n","fail":"from collections import Counter\nimport time\n\nN = int(input())\nline = list(map(int, input().split()))\ndic = Counter(line)\nnums = 0\nfor num, cnt in dic.items():\n if cnt > 1:\n nums += (cnt * (cnt - 1)) \/\/ 2\nfor i in line:\n print(nums - (dic[i] - 1))\n","change":"replace","i1":0,"i2":11,"j1":0,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02732","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = list(map(int, input().split()))\ndictA = {}\nfor x in A:\n dictA[x] = 0\nfor x1 in A:\n dictA[x1] += 1\n\nfor x2 in A:\n dictB = dictA.copy()\n combisum = 0\n dictB[x2] -= 1\n for x3 in dictB.values():\n combisum += x3 * (x3 - 1) \/\/ 2\n print(combisum)\n","fail":"N = int(input())\nA = list(map(int, input().split()))\ndictA = {}\nfor x in A:\n dictA[x] = 0\nfor x1 in A:\n dictA[x1] += 1\n\ncombisum = 0\nfor y in dictA.values():\n combisum += y * (y - 1) \/\/ 2\n\nfor z in range(N):\n print(combisum - dictA[A[z]] + 1)\n","change":"replace","i1":8,"i2":15,"j1":8,"j2":14,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02732","language":"Python","original_status":"Time Limit Exceeded","pass":"import collections\n\nN = int(input())\nA = list(map(int, input().split()))\n\nc = collections.Counter(A)\n\nsum = 0\n\nfor a in A:\n for key in c.keys():\n if key == a:\n value_k = c[key] - 1\n sum += value_k * (value_k - 1) \/\/ 2\n else:\n value_k = c[key]\n sum += value_k * (value_k - 1) \/\/ 2\n print(sum)\n sum = 0\n","fail":"import collections\n\nN = int(input())\nA = list(map(int, input().split()))\n\nc = collections.Counter(A)\n\nsum_dict = {}\nsum_dict_n = {}\n\nsum = 0\nsum_n = 0\n\nfor key in c.keys():\n coll = c[key] * (c[key] - 1) \/\/ 2\n sum_dict[key] = coll\n sum += coll\n value_k = c[key] - 1\n coll_n = value_k * (value_k - 1) \/\/ 2\n sum_dict_n[key] = coll_n\n\nfor a in A:\n ans = sum\n ans = ans - sum_dict[a] + sum_dict_n[a]\n print(ans)\n","change":"replace","i1":7,"i2":19,"j1":7,"j2":25,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02732","language":"Python","original_status":"Runtime Error","pass":"from scipy.misc import comb\n\nN, M = map(int, input().split())\n\nprint(int(comb(N, 2) + comb(M, 2)))\n","fail":"N = int(input())\nA = list(map(int, input().split()))\n\n\ndef comb2(n):\n return n * (n - 1) \/\/ 2\n\n\ncounts = [0] * (N + 1)\nfor a in A:\n counts[a] += 1\ntotal = sum(map(lambda n: comb2(n), filter(lambda n: n > 1, counts)))\n\nfor a in A:\n print(total - (counts[a] - 1))\n","change":"replace","i1":0,"i2":5,"j1":0,"j2":15,"error":"ModuleNotFoundError: No module named 'scipy'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02732\/Python\/s178651076.py\", line 1, in \n from scipy.misc import comb\nModuleNotFoundError: No module named 'scipy'\n","stdout":null} {"problem_id":"p02732","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = list(map(int, input().split()))\n\ncounts = {}\nfor i in range(N):\n a = A[i]\n if a in counts:\n counts[a] += 1\n continue\n counts[a] = 1\n\n# print(counts)\n\nans_memory = {}\nfor k in range(N):\n if A[k] in ans_memory:\n print(ans_memory[A[k]])\n continue\n\n counts_tmp = counts.copy()\n counts_tmp[A[k]] -= 1\n\n # print(counts_tmp)\n ans = 0\n for v in counts_tmp.values():\n ans += v * (v - 1) \/\/ 2\n ans_memory[A[k]] = ans\n print(ans)\n","fail":"N = int(input())\nA = list(map(int, input().split()))\n\ncounts = {}\nfor i in range(N):\n a = A[i]\n if a in counts:\n counts[a] += 1\n else:\n counts[a] = 1\n\n# print(counts)\n\nans_memory = {}\nans_memory_val = {}\nfor k in range(N):\n if A[k] in ans_memory:\n print(ans_memory[A[k]])\n continue\n if counts[A[k]] in ans_memory_val:\n print(ans_memory_val[counts[A[k]]])\n continue\n\n counts_tmp = counts.copy()\n counts_tmp[A[k]] -= 1\n\n # print(counts_tmp)\n ans = 0\n for v in counts_tmp.values():\n ans += v * (v - 1) \/\/ 2\n ans_memory[A[k]] = ans\n ans_memory_val[counts[A[k]]] = ans\n print(ans)\n","change":"replace","i1":8,"i2":27,"j1":8,"j2":32,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02732","language":"Python","original_status":"Time Limit Exceeded","pass":"def main():\n n = int(input())\n a_list = list(map(int, input().split()))\n\n a_dict = {}\n for a in a_list:\n if a not in a_dict:\n a_dict[a] = 1\n else:\n a_dict[a] += 1\n\n for k in range(n):\n cnt = 0\n a_dict[a_list[k]] -= 1\n for v in a_dict.values():\n if v >= 2:\n cnt += v * (v - 1) \/\/ 2\n a_dict[a_list[k]] += 1\n print(cnt)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"def main():\n n = int(input())\n a_list = list(map(int, input().split()))\n num_list = [0] * n # \u5404\u756a\u53f7\u304c\u66f8\u304b\u308c\u305f\u30dc\u30fc\u30eb\u304c\u4f55\u500b\u3042\u308b\u304b\n method_list = [0] * n # \u540c\u3058\u756a\u53f7\u304c\u66f8\u304b\u308c\u305f\u7570\u306a\u308b2\u3064\u306e\u30dc\u30fc\u30eb\u3092\u9078\u3076\u65b9\u6cd5\n\n for a in a_list:\n num_list[a - 1] += 1\n\n for i in range(n):\n b = num_list[i]\n if b >= 2:\n method_list[i] = b * (b - 1) \/\/ 2\n\n total_method = sum(method_list)\n\n for k in range(n):\n c = a_list[k] # k\u756a\u76ee\u306e\u30dc\u30fc\u30eb\u306b\u66f8\u304b\u308c\u3066\u3044\u308b\u6570\u5b57\n ans = total_method - method_list[c - 1]\n d = num_list[c - 1]\n if d >= 3:\n e = (d - 1) * (d - 2) \/\/ 2\n else:\n e = 0\n ans += e\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":3,"i2":19,"j1":3,"j2":26,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02732","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = list(map(int, input().split()))\n\ncount = {}\nfor x in A:\n if count.get(x):\n count[x] += 1\n else:\n count[x] = 1\n\nfor i in range(N):\n count[A[i]] -= 1\n s = 0\n for x in count.values():\n s += x * (x - 1) \/\/ 2\n print(s)\n count[A[i]] += 1\n","fail":"N = int(input())\nA = list(map(int, input().split()))\n\ncount = {}\nfor x in A:\n if count.get(x):\n count[x] += 1\n else:\n count[x] = 1\n\nsub = {}\ns = 0\nfor i, x in count.items():\n count[i] = x * (x - 1) \/\/ 2\n s += count[i]\n sub[i] = (x - 1) * (x - 2) \/\/ 2\n\nfor i in range(N):\n print(s - count[A[i]] + sub[A[i]])\n","change":"replace","i1":10,"i2":17,"j1":10,"j2":19,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02732","language":"Python","original_status":"Time Limit Exceeded","pass":"import math\n\n\ndef comb(n, r):\n if n < r:\n return 0\n return math.factorial(n) \/\/ (math.factorial(n - r) * math.factorial(r))\n\n\nN = int(input())\nA = list(map(int, input().split()))\n\nd = {}\nfor a in A:\n if a in d:\n d[a] += 1\n else:\n d[a] = 1\n\nd2 = {}\nfor k in range(N):\n a = A[k]\n\n if a not in d2:\n d2[a] = 0\n for i, n in d.items():\n if a == i:\n d2[a] += comb(n - 1, 2)\n else:\n d2[a] += comb(n, 2)\n print(d2[a])\n","fail":"import math\n\n\ndef comb(n, r):\n if n < r:\n return 0\n return math.factorial(n) \/\/ (math.factorial(n - r) * math.factorial(r))\n\n\nN = int(input())\nA = list(map(int, input().split()))\n\nd = {}\nfor a in A:\n if a in d:\n d[a] += 1\n else:\n d[a] = 1\n\nb = 0\nfor n in d.values():\n b += comb(n, 2)\n\nfor k in range(N):\n a = A[k]\n print(b - d[a] + 1)\n","change":"replace","i1":19,"i2":31,"j1":19,"j2":26,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02732","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\ndA = {}\nA = []\nfor a in input().split():\n A.append(a)\n if a in dA:\n dA[a] += 1\n else:\n dA[a] = 1\n\ncA = {}\nfor a in dA:\n cA[a] = dA[a] * (dA[a] - 1) \/\/ 2\n\nfor a in A:\n print(sum(cA.values()) - dA[a] + 1)\n","fail":"n = int(input())\ndA = {}\nA = []\nfor a in input().split():\n A.append(a)\n if a in dA:\n dA[a] += 1\n else:\n dA[a] = 1\n\ncA = {}\nfor a in dA:\n cA[a] = dA[a] * (dA[a] - 1) \/\/ 2\n\ns = sum(cA.values())\nfor a in A:\n print(s - dA[a] + 1)\n","change":"replace","i1":14,"i2":16,"j1":14,"j2":17,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02732","language":"Python","original_status":"Time Limit Exceeded","pass":"# from collections import deque\nfrom collections import Counter\nfrom scipy.misc import comb\nfrom copy import deepcopy\n\nn = int(input())\na = list(map(int, input().split()))\ncnt_n = 0\na_n = deepcopy(a)\nc = Counter(a_n)\nfor key in c:\n cnt_n += comb(c[key], 2, exact=True)\n\nfor k in range(len(a)):\n a_n = deepcopy(a)\n a_k = deepcopy(a[k])\n a_n.pop(k)\n cnt_k = a_n.count(a_k)\n print(cnt_n - cnt_k)\n","fail":"# from collections import deque\nfrom collections import Counter\nfrom scipy.misc import comb\n\n# from copy import deepcopy\n\nn = int(input())\na = list(map(int, input().split()))\nC = Counter(a)\nS = 0\nfor key in C:\n S += comb(C[key], 2, exact=True)\n\nfor k in range(n):\n A = a[k]\n print(S - C[A] + 1)\n","change":"replace","i1":3,"i2":19,"j1":3,"j2":16,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02732","language":"Python","original_status":"Time Limit Exceeded","pass":"from scipy.misc import comb\nfrom sys import stdin\n\nN = int(stdin.readline())\ncount1 = [0] * (N + 1)\ncount2 = [0] * (N + 1)\nA = list(map(int, stdin.readline().split()))\n\nB = list(set(A))\n\nfor b in B:\n num_of_b = A.count(b)\n if num_of_b > 2:\n count1[b] = comb(num_of_b, 2, exact=True)\n count2[b] = comb(num_of_b - 1, 2, exact=True)\n elif num_of_b == 2:\n count1[b] = 1\n\n\nfor a in A:\n ans = 0\n ans += sum(count1) - count1[a]\n ans += count2[a]\n print(ans)\n","fail":"from sys import stdin\n\nN = int(stdin.readline())\na_dict = {}\nA = list(map(int, stdin.readline().split()))\nfor a in A:\n if a in a_dict:\n a_dict[a] += 1\n else:\n a_dict[a] = 1\n\nsum_comb = 0\nB = set(A)\nfor b in B:\n n = a_dict[b]\n sum_comb += n * (n - 1) \/\/ 2\n\nfor a in A:\n ans = sum_comb\n n = a_dict[a]\n ans -= n * (n - 1) \/\/ 2\n ans += (n - 1) * (n - 2) \/\/ 2\n print(ans)\n","change":"replace","i1":0,"i2":23,"j1":0,"j2":22,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02732","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\nnumlist = list(map(int, input().split(\" \")))\nans = []\n\nsum = 0\nfor i in range(1, n + 1):\n tmp = numlist.count(i)\n sum += int(tmp * (tmp - 1) \/ 2)\n\nfor i in numlist:\n print(sum - numlist.count(i) + 1)\n","fail":"n = int(input())\nnumlist = list(map(int, input().split(\" \")))\n\nimport collections\n\nnumcount = collections.Counter(numlist)\n\n\nsum = 0\nfor i in numcount.values():\n sum += int(i * (i - 1) \/ 2)\n\nfor i in numlist:\n print(sum - numcount[i] + 1)\n","change":"replace","i1":2,"i2":11,"j1":2,"j2":14,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02732","language":"Python","original_status":"Time Limit Exceeded","pass":"import math\n\n\ndef kumiawase(n):\n if n == 0 or n == 1:\n return 0\n return math.floor(math.factorial(n) \/ math.factorial(n - 2) \/ 2)\n\n\nn = int(input())\naL = list(map(int, input().split(\" \")))\n\nd = {}\n\nfor a in aL:\n if a in d:\n d[a] += 1\n else:\n d[a] = 1\n\nd2 = {}\nd3 = {}\n\nfor dk, di in d.items():\n d2[dk] = kumiawase(di)\n d3[dk] = kumiawase(di - 1)\n\nfor a in aL:\n sm = sum(d2.values())\n print(sm - d2[a] + d3[a])\n","fail":"import math\nimport collections\n\n\ndef kumiawase(n):\n if n == 0 or n == 1:\n return 0\n return (n**2 - n) \/\/ 2\n\n\nn = int(input())\naL = list(map(int, input().split(\" \")))\n\nd = collections.Counter(aL)\n\ns = 0\nfor i in d.values():\n s += kumiawase(i)\n\nfor a in aL:\n print(s - d[a] + 1)\n","change":"replace","i1":1,"i2":30,"j1":1,"j2":21,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02732","language":"Python","original_status":"Runtime Error","pass":"N = int(input())\nA = [int(a) for a in input().split()]\ncnt = {}\ntotal = 0\n\nfor a in A:\n if a not in cnt:\n cnt[a] = 0\n cnt[a] += 1\n\nfor i in cnt.values():\n total += i * (i - 1) \/\/ 2\n\nfor i in range(N):\n print(total - (cnt[i] - 1))\n","fail":"N = int(input())\nA = [int(a) for a in input().split()]\ncnt = {}\ntotal = 0\n\nfor a in A:\n if a not in cnt:\n cnt[a] = 0\n cnt[a] += 1\n\nfor i in cnt.values():\n total += i * (i - 1) \/\/ 2\n\nfor a in A:\n print(total - (cnt[a] - 1))\n","change":"replace","i1":13,"i2":15,"j1":13,"j2":15,"error":"KeyError: 0","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02732\/Python\/s071344434.py\", line 15, in \n print(total - (cnt[i] - 1))\nKeyError: 0\n","stdout":null} {"problem_id":"p02732","language":"Python","original_status":"Time Limit Exceeded","pass":"import collections\n\nN = int(input())\nA = list(map(int, input().split()))\n# sort_A = sorted(A)\n\nC = collections.Counter(A)\n\nfor a in A:\n s = 0\n for c in C:\n if c == a:\n s += (C[c] - 1) * (C[c] - 2) \/\/ 2\n else:\n s += C[c] * (C[c] - 1) \/\/ 2\n print(s)\n","fail":"import collections\n\nN = int(input())\nA = list(map(int, input().split()))\n# sort_A = sorted(A)\n\nC = collections.Counter(A)\n\ns_all = 0\nfor c in C:\n s_all += C[c] * (C[c] - 1) \/\/ 2\n\nfor a in A:\n s = 0\n s += s_all - (C[a] - 1)\n print(s)\n","change":"replace","i1":8,"i2":15,"j1":8,"j2":15,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02732","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\nbook = {}\narray = [int(i) for i in input().split()]\n\nfor i in array:\n book[i] = book.get(i, 0) + 1\n\nfor i in range(n):\n s = 0\n for k, v in book.items():\n if k == array[i]:\n v -= 1\n s += (v * (v - 1)) \/\/ 2 if v > 0 else 0\n print(s)\n","fail":"n = int(input())\nbook = {}\narray = [int(i) for i in input().split()]\n\nfor i in array:\n book[i] = book.get(i, 0) + 1\n\nsum_val = 0\ndelta = {}\nfor k, v in book.items():\n t = (v * (v - 1)) \/\/ 2 if v > 0 else 0\n sum_val += t\n u = v - 1\n delta[k] = t - (u * (u - 1)) \/\/ 2 if u > 0 else 0\n\nfor i in range(n):\n print(sum_val - delta[array[i]])\n","change":"replace","i1":7,"i2":14,"j1":7,"j2":17,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02732","language":"Python","original_status":"Time Limit Exceeded","pass":"from collections import Counter\n\nN = int(input())\nA = list(map(int, input().split()))\n\n# nC2 = [0] * (N + 1)\n# nC2[0] = 0\n# nC2[1] = 0\n# for i in range(2, N + 1):\n# nC2[i] = i * (i - 1) \/\/ 2\n\n# print(nC2)\n\n\ndef comb(x):\n if x == 0:\n return 0\n if x == 1:\n return 0\n return x * (x - 1) \/\/ 2\n\n\nd = Counter(A)\n# print(d)\nk = d.keys()\n\n# print(k)\n\nfor a in A:\n res = 0\n for kk in k:\n if a == kk:\n res += comb(d[kk] - 1)\n # res += nC2[d[kk] - 1]\n else:\n res += comb(d[kk])\n # res += nC2[d[kk]]\n # print(a, d[a], res)\n print(res)\n","fail":"from collections import Counter\n\nN = int(input())\nA = list(map(int, input().split()))\n\n\ndef comb(x):\n if x == 0:\n return 0\n if x == 1:\n return 0\n return x * (x - 1) \/\/ 2\n\n\nd = Counter(A)\n# print(d)\nk = d.keys()\n\n# print(k)\ntotal = 0\n\nfor kk in k:\n total += comb(d[kk])\n\n# print(total)\n\nfor a in A:\n res = total\n res -= comb(d[a])\n res += comb(d[a] - 1)\n print(res)\n","change":"replace","i1":4,"i2":38,"j1":4,"j2":30,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02732","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\ndata = [i for i in input().split()]\n\nnumber_count = {}\nfor cmp in data:\n if cmp in number_count:\n number_count[cmp] += 1\n continue\n number_count[cmp] = 1\n\nanswer = {}\nfor i in range(N):\n if data[i] in answer:\n print(answer[data[i]])\n continue\n C = 0\n number_count_temp = number_count.copy()\n number_count_temp[str(data[i])] -= 1\n for cmp in number_count_temp:\n C += int(number_count_temp[cmp] * (number_count_temp[cmp] - 1) \/ 2)\n\n print(str(C))\n answer[data[i]] = str(C)\n","fail":"N = int(input())\ndata = [i for i in input().split()]\n\nnumber_count = {}\nfor cmp in data:\n if cmp in number_count:\n number_count[cmp] += 1\n continue\n number_count[cmp] = 1\n\nC_tot = 0\nfor cmp in number_count:\n C_tot += int(number_count[cmp] * (number_count[cmp] - 1) \/ 2)\n\nfor k in range(N):\n C = (\n C_tot\n - int(number_count[data[k]] * (number_count[data[k]] - 1) \/ 2)\n + int((number_count[data[k]] - 1) * (number_count[data[k]] - 2) \/ 2)\n )\n print(str(C))\n","change":"replace","i1":10,"i2":23,"j1":10,"j2":21,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02732","language":"Python","original_status":"Time Limit Exceeded","pass":"from collections import defaultdict\nimport math\n\nN = int(input())\nA = list(map(int, input().split()))\nd = defaultdict(lambda: 0)\nfor i in range(len(A)):\n d[A[i]] += 1\n\nr = 2\ntotal = 0\ncalc_dict = {}\nfor k, v in zip(d.keys(), d.values()):\n if v > 1:\n ans1 = math.factorial(v) \/\/ (math.factorial(v - r) * math.factorial(r))\n else:\n ans1 = 0\n if v > 2:\n ans2 = math.factorial(v - 1) \/\/ (math.factorial(v - 1 - r) * math.factorial(r))\n else:\n ans2 = 0\n total += ans1\n calc_dict[k] = ans1 - ans2\nfor i in range(N):\n print(total - calc_dict[A[i]])\n","fail":"from collections import defaultdict\n\nN = int(input())\nA = list(map(int, input().split()))\nd = defaultdict(lambda: 0)\nfor i in range(len(A)):\n d[A[i]] += 1\ntotal = 0\nfor k, v in d.items():\n total += v * (v - 1) \/\/ 2\nfor a in A:\n print(total - (d[a] - 1))\n","change":"replace","i1":1,"i2":25,"j1":1,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02732","language":"Python","original_status":"Time Limit Exceeded","pass":"from collections import Counter\nfrom math import factorial\n\n\ndef perm(n, r):\n return factorial(n) \/\/ factorial(n - r)\n\n\ndef comb(n, r):\n if n < r:\n return 0\n return perm(n, r) \/\/ factorial(r)\n\n\nN = int(input())\nA = list(map(int, input().split()))\nC = Counter(A)\nD = {k: comb(v, 2) for k, v in C.items()}\n_all = sum(D.values())\nfor a in A:\n print(_all - D[a] + comb(C[a] - 1, 2))\n","fail":"from collections import Counter\n\nN = int(input())\nA = list(map(int, input().split()))\nC = Counter(A)\ncombinations = [0] + [c * (c - 1) \/\/ 2 for c in range(1, 1 + max(C.values()))]\n_all = sum([combinations[c] for c in C.values()])\nfor a in A:\n print(_all - combinations[C[a]] + combinations[C[a] - 1])\n","change":"replace","i1":1,"i2":21,"j1":1,"j2":9,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02732","language":"Python","original_status":"Time Limit Exceeded","pass":"import collections as cl\nimport math\n\n\ndef combinations_count(n, r):\n if n < r:\n return 0\n else:\n return math.factorial(n) \/\/ (math.factorial(n - r) * math.factorial(r))\n\n\nN = int(input())\nA = list(map(int, input().split()))\n\ncnt = cl.Counter(A)\nans = 0\nmem = {}\n\nfor a in A:\n if a in mem:\n print(mem[a])\n continue\n ans = 0\n cnt[a] -= 1\n for v in cnt.values():\n if v < 2:\n continue\n ans += combinations_count(v, 2)\n cnt[a] += 1\n print(ans)\n mem[a] = ans\n","fail":"import collections as cl\nimport math\n\n\ndef combinations_count(n, r):\n if n < r:\n return 0\n else:\n return math.factorial(n) \/\/ (math.factorial(n - r) * math.factorial(r))\n\n\nN = int(input())\nA = list(map(int, input().split()))\n\ncnt = cl.Counter(A)\nans = 0\nfor v in cnt.values():\n ans += combinations_count(v, 2)\n\nfor a in A:\n print(ans - cnt[a] + 1)\n","change":"replace","i1":16,"i2":31,"j1":16,"j2":21,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02732","language":"Python","original_status":"Time Limit Exceeded","pass":"from collections import Counter\n\nN = int(input())\nlst = [int(x) for x in input().split()]\ncounters = Counter(lst)\ndic = {}\nfor k, v in dict(counters).items():\n if v > 1:\n dic[k] = v\n\nm = {}\nfor x in lst:\n n = m.get(x)\n if n is None:\n n = 0\n for k, v in dic.items():\n if k == x:\n v -= 1\n n += v * (v - 1) \/\/ 2\n\n m[x] = n\n print(n)\n","fail":"from collections import Counter\n\nN = int(input())\nlst = [int(x) for x in input().split()]\ndic = dict(Counter(lst))\n\nret = 0\nfor k, v in dic.items():\n ret += v * (v - 1) \/\/ 2\n\n\nfor x in lst:\n n = dic[x]\n if n == 1:\n print(ret)\n else:\n print(ret - (n * (n - 1) \/\/ 2) + ((n - 1) * (n - 2) \/\/ 2))\n","change":"replace","i1":4,"i2":22,"j1":4,"j2":17,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02733","language":"Python","original_status":"Time Limit Exceeded","pass":"from itertools import combinations, chain\n\nH, W, K = map(int, input().split())\nSss = []\nfor _ in range(H):\n Sss.append(list(map(int, input())))\n\n\ndef h_divide(Sss, div_is):\n result = []\n for s, e in zip(chain([0], div_is), chain(div_is, [len(Sss)])):\n result.append(Sss[s:e])\n return result\n\n\ndef _v_end(Sss, start, K):\n count = 0\n for i in range(start, len(Sss[0])):\n s = sum(map(lambda Ss: Ss[i], Sss))\n if count + s > K:\n return i - 1\n count += s\n return len(Sss[0]) - 1\n\n\ndef v_end(Ssss, start, K):\n result = -1\n for Sss in Ssss:\n end = _v_end(Sss, start, K)\n if end < start:\n return -1\n if result < 0 or result > end:\n result = end\n return result\n\n\ndef v_div_count(Ssss, K):\n start, result = 0, 0\n while True:\n end = v_end(Ssss, start, K)\n if end < 0:\n return -1\n if end == len(Ssss[0][0]) - 1:\n break\n result += 1\n start = end + 1\n return result\n\n\nh_cands = list(range(1, len(Sss)))\nans = -1\nfor n in range(len(h_cands) + 1):\n for comb in combinations(h_cands, n):\n Ssss = h_divide(Sss, list(comb))\n cnt = v_div_count(Ssss, K)\n if cnt < 0:\n continue\n if ans < 0 or ans > n + cnt:\n ans = n + cnt\nprint(ans)\n","fail":"from itertools import combinations, chain\n\nH, W, K = map(int, input().split())\nSss = []\nfor _ in range(H):\n Sss.append(list(map(int, input())))\n\n\ndef h_divide(Sss, div_is):\n result = []\n for s, e in zip(chain([0], div_is), chain(div_is, [len(Sss)])):\n result.append(Sss[s:e])\n return result\n\n\ndef _v_end(Sss, start, K):\n count = 0\n for i in range(start, len(Sss[0])):\n s = sum(map(lambda Ss: Ss[i], Sss))\n if count + s > K:\n return i - 1\n count += s\n return len(Sss[0]) - 1\n\n\ndef v_end(Ssss, start, K):\n result = -1\n for Sss in Ssss:\n end = _v_end(Sss, start, K)\n if end < start:\n return -1\n if result < 0 or result > end:\n result = end\n return result\n\n\ndef v_div_count(Ssss, K):\n start, result = 0, 0\n while True:\n end = v_end(Ssss, start, K)\n if end < 0:\n return -1\n if end == len(Ssss[0][0]) - 1:\n break\n result += 1\n start = end + 1\n return result\n\n\nh_cands = list(range(1, len(Sss)))\nans = -1\nfor n in range(len(h_cands) + 1):\n for comb in combinations(h_cands, n):\n if ans > 0 and n >= ans:\n continue\n Ssss = h_divide(Sss, list(comb))\n cnt = v_div_count(Ssss, K)\n if cnt < 0:\n continue\n if ans < 0 or ans > n + cnt:\n ans = n + cnt\nprint(ans)\n","change":"insert","i1":53,"i2":53,"j1":53,"j2":55,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02733","language":"Python","original_status":"Time Limit Exceeded","pass":"import itertools\nimport numpy as np\nfrom sys import stdin\n\nH, W, K = map(int, stdin.readline().split())\nA = np.int32([[int(x) for x in stdin.readline().strip()] for _ in range(H)])\n\nans = H * W\nfor mask in itertools.product([0, 1], repeat=H - 1):\n pivots = [r + 1 for r in range(H - 1) if mask[r]]\n if len(pivots) > ans:\n continue\n\n blocks = np.concatenate([block.sum(axis=0) for block in np.split(A, pivots)])\n blocks = blocks.reshape(len(pivots) + 1, W)\n if blocks.max() > K:\n continue\n\n n_block = blocks.shape[0]\n n_cut = n_block - 1\n sums = np.zeros(n_block, dtype=int)\n\n for c in range(W):\n adds = blocks[:, c]\n sums = sums + adds\n if np.any(sums > K):\n n_cut += 1\n sums = adds\n if n_cut >= ans:\n break\n\n ans = min(ans, n_cut)\n\nprint(ans)\n","fail":"import itertools\n\nH, W, K = map(int, input().split())\nA = [[int(x) for x in input()] for _ in range(H)]\n\n\ndef solve(blocks):\n n_block = len(blocks)\n n_cut = n_block - 1\n sums = [0 for _ in range(n_block)]\n\n for c in range(W):\n adds = [block[c] for block in blocks]\n if any(a > K for a in adds):\n return H * W\n\n sums = [s + a for s, a in zip(sums, adds)]\n if any(s > K for s in sums):\n n_cut += 1\n sums = adds\n\n return n_cut\n\n\nans = H * W\nfor mask in itertools.product([0, 1], repeat=H - 1):\n mask = [1] + list(mask) + [1]\n pivots = [r for r in range(H + 1) if mask[r]]\n blocks = [A[p1:p2] for p1, p2 in zip(pivots[:-1], pivots[1:])]\n blocks = [[sum(row[c] for row in block) for c in range(W)] for block in blocks]\n ans = min(ans, solve(blocks))\nprint(ans)\n","change":"replace","i1":1,"i2":33,"j1":1,"j2":31,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02734","language":"Python","original_status":"Time Limit Exceeded","pass":"import sys\n\ninput = sys.stdin.buffer.readline\nn, s = map(int, input().split())\nA = list(map(int, input().split()))\ndp = [[0] * (s + 1) for _ in range(n + 1)]\n\nmod = 998244353\n# dp[i][s] A[i]\u307e\u3067\u898b\u305f\u6642\u3001\u5408\u8a08s\u306b\u306a\u308b\u6570\u3002\n# \u5404\u3005\u306e\u5730\u70b9\u3067\u65b0\u3057\u304f\u958b\u59cb\u3055\u308c\u308b\u3082\u306e\u3082\u6709\u308b\u306e\u3067\u6bce\u56dedp[i][0]\u306f\uff0b1\ndp[0][0] = 1\nans = 0\nfor i in range(n):\n ni = i + 1\n for j in range(s + 1):\n nj = j\n dp[ni][nj] += dp[i][j]\n dp[ni][nj] %= mod\n nj = j + A[i]\n if nj <= s:\n dp[ni][nj] += dp[i][j]\n dp[ni][nj] %= mod\n dp[ni][0] += 1\n ans += dp[ni][s]\n ans %= mod\nprint(ans)\n","fail":"n, s = map(int, input().split())\nA = list(map(int, input().split()))\nmod = 998244353\ndp = [[0] * (s + 1) for _ in range(n + 1)]\nfor i in range(n):\n dp[i][0] = 1\nfor i in range(n):\n ni = i + 1\n for j in range(s + 1):\n nj = j\n dp[ni][nj] += dp[i][j]\n dp[ni][nj] %= mod\n nj = j + A[i]\n if nj <= s:\n dp[ni][nj] += dp[i][j]\n dp[ni][nj] %= mod\nans = 0\nfor i in range(n + 1):\n ans += dp[i][s]\n ans %= mod\nprint(ans)\n","change":"replace","i1":0,"i2":24,"j1":0,"j2":19,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02734","language":"Python","original_status":"Time Limit Exceeded","pass":"n, s = map(int, input().split())\na = tuple(map(int, input().split()))\nMOD = 998244353\n\n# dp0 = [[0] * (s + 1) for _ in range(n + 1)]\n# dp0[0][0] = 1\n# for i in range(n): # \u3053\u3053\u3092range(i, n)\u306b\u3059\u308b\u3068\u3001f(i, r)\u306e\u8a08\u7b97\u304c\u3067\u304d\u308b\n# for j in range(s + 1):\n# dp0[i + 1][j] += dp0[i][j] # do NOT use a[i]\n# if j + a[i] <= s:\n# dp0[i + 1][j + a[i]] += dp0[i][j] # USE a[i]\n# # f(1, n) = dp0[n][s]\n# # f(1, i) = dp0[i][s] (i = 1, 2, ..., n)\n# print('dp0')\n# print(*dp0, sep='\\\\n')\n\ndp = [[[0] * 2 for _ in range(s + 1)] for _ in range(n + 1)]\ndp[0][0][0] = 1\nans = 0\nfor i in range(n):\n for j in range(s + 1):\n # i\u756a\u76ee\u306e\u8981\u7d20\u306f\u4f7f\u308f\u306a\u3044\n dp[i + 1][j][0] += dp[i][j][0]\n dp[i + 1][j][0] %= MOD\n dp[i + 1][j][1] += dp[i][j][0] + dp[i][j][1]\n dp[i + 1][j][1] %= MOD\n\n if j + a[i] <= s:\n dp[i + 1][j + a[i]][1] += dp[i][j][0] + dp[i][j][1]\n dp[i + 1][j + a[i]][1] %= MOD\n\n ans += dp[i + 1][s][1]\n ans %= MOD\n# dp[r][s][1] = \\\\sum_{i=1}^{r} f(i, r)\n\n# print('dp[][][1]')\n# for i in range(n + 1):\n# print([dp[i][j][1] for j in range(s + 1)])\n\nprint(ans)\n","fail":"n, s = map(int, input().split())\na = tuple(map(int, input().split()))\nMOD = 998244353\n\n# dp = [[0] * (s + 1) for _ in range(n + 1)]\n# dp[0][0] = 1\n# for i in range(n): # \u3053\u3053\u3092range(i, n)\u306b\u3059\u308b\u3068\u3001f(i, r)\u306e\u8a08\u7b97\u304c\u3067\u304d\u308b\n# for j in range(s + 1):\n# dp[i + 1][j] += dp[i][j] # do NOT use a[i]\n# if j + a[i] <= s:\n# dp[i + 1][j + a[i]] += dp[i][j] # USE a[i]\n# # f(1, n) = dp[n][s]\n# # f(1, i) = dp[i][s] (i = 1, 2, ..., n)\n# print('dp')\n# print(*dp, sep='\\\\n')\n\ndp0 = [[0] * (s + 1) for _ in range(n + 1)]\ndp1 = [[0] * (s + 1) for _ in range(n + 1)]\ndp0[0][0] = 1\nans = 0\nfor i in range(n):\n for j in range(s + 1):\n # i\u756a\u76ee\u306e\u8981\u7d20\u306f\u4f7f\u308f\u306a\u3044\n dp0[i + 1][j] += dp0[i][j]\n dp0[i + 1][j] %= MOD\n dp1[i + 1][j] += dp0[i][j] + dp1[i][j]\n dp1[i + 1][j] %= MOD\n\n if j + a[i] <= s:\n dp1[i + 1][j + a[i]] += dp0[i][j] + dp1[i][j]\n dp1[i + 1][j + a[i]] %= MOD\n\n ans += dp1[i + 1][s]\n ans %= MOD\n# dp[r][s][1] = \\\\sum_{i=1}^{r} f(i, r)\n\n# print('dp[][][1]')\n# for i in range(n + 1):\n# print([dp[i][j][1] for j in range(s + 1)])\n\nprint(ans)\n","change":"replace","i1":4,"i2":32,"j1":4,"j2":33,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02734","language":"Python","original_status":"Runtime Error","pass":"import numpy as np\n\nn, s = map(int, input().split())\naaa = list(map(int, input().split()))\n\nfwd_acc = np.zeros((n + 1, s + 1), dtype=np.int64)\nfwd_acc[0][0] = 1\n\nans = 0\nMOD = 998244353\nfor i, a in enumerate(aaa, start=1):\n fwd_acc[i] = fwd_acc[i - 1]\n fwd_acc[i][0] = i\n if a <= s:\n fwd_acc[i][a:] += fwd_acc[i][:-a]\n ans = (ans + fwd_acc[i - 1][s - a] * (n - i + 1)) % MOD\nprint(ans)\n","fail":"import numpy as np\n\nn, s = map(int, input().split())\naaa = list(map(int, input().split()))\n\nfwd_acc = np.zeros((n + 1, s + 1), dtype=np.int64)\nfwd_acc[0][0] = 1\n\nans = 0\nMOD = 998244353\nfor i, a in enumerate(aaa, start=1):\n fwd_acc[i] = fwd_acc[i - 1]\n fwd_acc[i][0] = i\n if a <= s:\n fwd_acc[i][a:] = fwd_acc[i][a:] + fwd_acc[i][:-a]\n fwd_acc[i] %= MOD\n ans = (ans + fwd_acc[i][s]) % MOD\n # print(fwd_acc)\n # print(ans)\nprint(ans)\n","change":"replace","i1":14,"i2":16,"j1":14,"j2":19,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02734","language":"Python","original_status":"Time Limit Exceeded","pass":"from copy import deepcopy\n\nN, S = map(int, input().split())\nA = [0] + list(map(int, input().split()))\nmod = 998244353\n\ndp = [0] * (S + 1)\ndp2 = [0] * (S + 1)\n\n\"\"\"\ndp[i][j] = (i\u500b\u307e\u3067\u306e\u6570\u3092\u4f7f\u3063\u3066j\u70b9\u3068\u308b\u7d44\u307f\u5408\u308f\u305b)\n\u3068\u3057\u305f\u306f\u3044\u3044\u304c\u3001f(L, R)\u3092f(1,L)\u3068f(1, R)\u306b\u5206\u89e3\u3067\u304d\u305a\u306b\u7206\u6b7b\u3057\u305f\u306e\u304c\u6557\u56e0\u3002\n\n\u5404(L, R)\u306b\u5bfe\u3057\u3066dp\u3059\u308b\u3068TLE\u306b\u306a\u308b\u304b\u3089\u624b\u8a70\u307e\u308a\u306b\u306a\u308b\u3068\u601d\u3063\u305f\u308f\u3051\u3060\u3051\u3069\u3001\n\u4e0a\u306edp\u30c6\u30fc\u30d6\u30eb\u3092\u5404i\u306b\u5bfe\u3057\u3066\u4f7f\u3044\u56de\u3057\u3064\u3064\u3001\u65b0\u305f\u306adp\u30c6\u30fc\u30d6\u30eb[1, 0, 0, ...]\u3092\n\u4f5c\u6210\u3057\u3066\u300c\u5143\u306edp\u30c6\u30fc\u30d6\u30eb\u306b\u52a0\u7b97\u3057\u3066\u304a\u3051\u3070\u300ddp\u30c6\u30fc\u30d6\u30eb\u4e00\u500b\u30671\u756a\u76ee\u30b9\u30bf\u30fc\u30c8\u30012\u756a\u76ee\u30b9\u30bf\u30fc\u30c8\u3001\n..., L\u756a\u76ee\u30b9\u30bf\u30fc\u30c8\u306edp\u30c6\u30fc\u30d6\u30eb\u5168\u3066\u3092\u8003\u3048\u3089\u308c\u308b\uff01\n\uff08\u89e3\u8aac\u653e\u9001\u524d\u534a\u3092\u53c2\u8003\uff09\n\"\"\"\n\n# i == 0\u306e\u6642\ndp[0] = 1\nans = 0\n\n# i >= 1\u306e\u6642\nfor i in range(1, N + 1):\n for j in range(S + 1):\n if j - A[i] < 0:\n dp2[j] = dp[j]\n else:\n dp2[j] = dp[j] + dp[j - A[i]]\n ans += dp2[S]\n ans %= mod\n\n dp = deepcopy(dp2)\n dp[0] += 1\n dp2 = [0] * (S + 1)\n\nprint(ans)\n","fail":"N, S = map(int, input().split())\nA = [0] + list(map(int, input().split()))\nmod = 998244353\n\ndp = [0] * (S + 1)\ndp2 = [0] * (S + 1)\n\n\"\"\"\ndp[i][j] = (i\u500b\u307e\u3067\u306e\u6570\u3092\u4f7f\u3063\u3066j\u70b9\u3068\u308b\u7d44\u307f\u5408\u308f\u305b)\n\u3068\u3057\u305f\u306f\u3044\u3044\u304c\u3001f(L, R)\u3092f(1,L)\u3068f(1, R)\u306b\u5206\u89e3\u3067\u304d\u305a\u306b\u7206\u6b7b\u3057\u305f\u306e\u304c\u6557\u56e0\u3002\n\n\u5404(L, R)\u306b\u5bfe\u3057\u3066dp\u3059\u308b\u3068TLE\u306b\u306a\u308b\u304b\u3089\u624b\u8a70\u307e\u308a\u306b\u306a\u308b\u3068\u601d\u3063\u305f\u308f\u3051\u3060\u3051\u3069\u3001\n\u4e0a\u306edp\u30c6\u30fc\u30d6\u30eb\u3092\u5404i\u306b\u5bfe\u3057\u3066\u4f7f\u3044\u56de\u3057\u3064\u3064\u3001\u65b0\u305f\u306adp\u30c6\u30fc\u30d6\u30eb[1, 0, 0, ...]\u3092\n\u4f5c\u6210\u3057\u3066\u300c\u5143\u306edp\u30c6\u30fc\u30d6\u30eb\u306b\u52a0\u7b97\u3057\u3066\u304a\u3051\u3070\u300ddp\u30c6\u30fc\u30d6\u30eb\u4e00\u500b\u30671\u756a\u76ee\u30b9\u30bf\u30fc\u30c8\u30012\u756a\u76ee\u30b9\u30bf\u30fc\u30c8\u3001\n..., L\u756a\u76ee\u30b9\u30bf\u30fc\u30c8\u306edp\u30c6\u30fc\u30d6\u30eb\u5168\u3066\u3092\u8003\u3048\u3089\u308c\u308b\uff01\n\uff08\u89e3\u8aac\u653e\u9001\u524d\u534a\u3092\u53c2\u8003\uff09\n\"\"\"\n\n# i == 0\u306e\u6642\ndp[0] = 1\nans = 0\n\n# i >= 1\u306e\u6642\nfor i in range(1, N + 1):\n for j in range(S + 1):\n if j - A[i] < 0:\n dp2[j] = dp[j]\n else:\n dp2[j] = dp[j] + dp[j - A[i]]\n ans += dp2[S]\n ans %= mod\n\n dp = dp2 # deepcopy\u3057\u306a\u304f\u3066\u3082\u3053\u308c\u3067\u5341\u5206\u306a\u306f\u305a\u3060\u3057\u3001\u30dd\u30a4\u30f3\u30bf\u6e21\u3057\u306a\u306e\u3067\u9ad8\u901f\uff1f\n dp[0] += 1\n dp2 = [0] * (S + 1)\n\nprint(ans)\n","change":"replace","i1":0,"i2":35,"j1":0,"j2":33,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02735","language":"Python","original_status":"Time Limit Exceeded","pass":"import sys\nfrom itertools import permutations\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef main():\n H, W = map(int, input().split())\n\n S = [list(input()) for _ in range(H)]\n C = [2 * i for i in range(H - 1)] + [2 * j + 1 for j in range(W - 1)]\n check = list(permutations(C))\n answer = float(\"inf\")\n for chk in check:\n if S[0][0] == \"#\":\n cnt = 1\n else:\n cnt = 0\n now = [0, 0]\n for i in range(H + W - 2):\n if chk[i] % 2 == 0:\n now[0] += 1\n else:\n now[1] += 1\n if now[0] <= H - 1 and now[1] <= W - 1:\n if S[now[0]][now[1]] == \"#\":\n cnt += 1\n # print(now)\n # print(cnt)\n if cnt < answer:\n answer = cnt\n print(answer)\n\n\nmain()\n","fail":"import sys\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef main():\n H, W = map(int, input().split())\n\n S = [list(input()) for _ in range(H)]\n # print(S)\n check = [[10**9 for i in range(W)] for j in range(H)]\n if S[0][0] == \"#\":\n check[0][0] = 1\n else:\n check[0][0] = 0\n for i in range(1, W):\n left = check[0][i - 1]\n if S[0][i] == \"#\":\n if S[0][i - 1] == \"#\":\n check[0][i] = left\n else:\n check[0][i] = left + 1\n else:\n check[0][i] = left\n for i in range(1, H):\n up = check[i - 1][0]\n if S[i][0] == \"#\":\n if S[i - 1][0] == \"#\":\n check[i][0] = up\n else:\n check[i][0] = up + 1\n else:\n check[i][0] = up\n for i in range(1, H):\n for j in range(1, W):\n # print(S[i][j])\n left = check[i][j - 1]\n up = check[i - 1][j]\n if S[i][j] == \"#\":\n if S[i][j - 1] == \"#\" and S[i - 1][j] == \"#\":\n check[i][j] = min(left, up)\n elif S[i][j - 1] != \"#\" and S[i - 1][j] == \"#\":\n check[i][j] = min(left + 1, up)\n elif S[i][j - 1] == \"#\" and S[i - 1][j] != \"#\":\n check[i][j] = min(left, up + 1)\n else:\n check[i][j] = min(left, up) + 1\n else:\n check[i][j] = min(left, up)\n # print(check)\n print(check[-1][-1])\n\n\nmain()\n","change":"replace","i1":1,"i2":34,"j1":1,"j2":53,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02735","language":"Python","original_status":"Time Limit Exceeded","pass":"#!\/usr\/bin\/env python3\nfrom collections import deque\n\nh, w = map(int, input().split())\nmaze = [[i == \"#\" for i in input()] for _ in range(h)]\n\ndx = [1, 0]\ndy = [0, 1]\n\nque = deque([])\nque.append((0, 0, maze[0][0], 1 if maze[0][0] else 0))\ncount = 10**5\n\nwhile que:\n x, y, b, c = que.pop()\n if x == h - 1 and y == w - 1:\n count = min(count, c)\n elif c < count:\n for i in range(2):\n nx = x + dx[i]\n ny = y + dy[i]\n\n if not (0 <= nx < h and 0 <= ny < w):\n continue\n que.append((nx, ny, maze[nx][ny], c + (not b and maze[nx][ny])))\nprint(count)\n","fail":"#!\/usr\/bin\/env python3\nfrom collections import deque\n\nh, w = map(int, input().split())\nmaze = [[i == \"#\" for i in input()] for _ in range(h)]\n\ndx = [1, 0]\ndy = [0, 1]\n\nque = deque([])\nque.append((0, 0, maze[0][0], 1 if maze[0][0] else 0))\ncount = [[h + w] * w for _ in range(h)]\n\nwhile que:\n x, y, b, c = que.pop()\n if c >= count[x][y]:\n continue\n count[x][y] = c\n if x == h - 1 and y == w - 1:\n continue\n for i in range(2):\n nx = x + dx[i]\n ny = y + dy[i]\n\n if not (0 <= nx < h and 0 <= ny < w):\n continue\n que.append((nx, ny, maze[nx][ny], c + (not b and maze[nx][ny])))\nprint(count[h - 1][w - 1])\n","change":"replace","i1":11,"i2":26,"j1":11,"j2":28,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02741","language":"Python","original_status":"Runtime Error","pass":"import math\n\nfirstInputText = input()\ninputList = firstInputText.split()\na = int(inputList[0])\nb = int(inputList[1])\nc = int(inputList[2])\nx = math.sqrt(a) + math.sqrt(b)\ny = math.sqrt(c)\n# print(x)\n# print(y)\n\n# if math.isclose(x,y):\n# print(\"Yes\")\n# else:\n# print(\"No\")\nif x == y:\n print(\"No\")\nelif x < y:\n print(\"Yes\")\nelse:\n print(\"No\")\n","fail":"list = [\n 1,\n 1,\n 1,\n 2,\n 1,\n 2,\n 1,\n 5,\n 2,\n 2,\n 1,\n 5,\n 1,\n 2,\n 1,\n 14,\n 1,\n 5,\n 1,\n 5,\n 2,\n 2,\n 1,\n 15,\n 2,\n 2,\n 5,\n 4,\n 1,\n 4,\n 1,\n 51,\n]\nfirstInputText = input()\nprint(list[int(firstInputText) - 1])\n","change":"replace","i1":0,"i2":22,"j1":0,"j2":36,"error":"IndexError: list index out of range","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02741\/Python\/s436801336.py\", line 6, in \n b = int(inputList[1])\nIndexError: list index out of range\n","stdout":null} {"problem_id":"p02741","language":"Python","original_status":"Runtime Error","pass":"num = [\n 1,\n 1,\n 1,\n 2,\n 1,\n 2,\n 1,\n 5,\n 2,\n 2,\n 1,\n 5,\n 1,\n 2,\n 1,\n 14,\n 1,\n 5,\n 1,\n 5,\n 2,\n 2,\n 1,\n 15,\n 2,\n 2,\n 5,\n 4,\n 1,\n 4,\n 1,\n 51,\n]\ninput = int(input())\nprint(num[input])\n","fail":"num = [\n 1,\n 1,\n 1,\n 2,\n 1,\n 2,\n 1,\n 5,\n 2,\n 2,\n 1,\n 5,\n 1,\n 2,\n 1,\n 14,\n 1,\n 5,\n 1,\n 5,\n 2,\n 2,\n 1,\n 15,\n 2,\n 2,\n 5,\n 4,\n 1,\n 4,\n 1,\n 51,\n]\ninput = int(input())\nprint(num[input - 1])\n","change":"replace","i1":35,"i2":36,"j1":35,"j2":36,"error":"WA","stderr":null,"stdout":1.0} {"problem_id":"p02742","language":"Python","original_status":"Runtime Error","pass":"H, W = map(int, input().split())\n\nif H == 1 or W == 1:\n print(1)\nelse:\n if (H * W) % 2 == 1:\n ans = H * W \/\/ 2 + 1\n else:\n ans = H * W \/\/ 2\nprint(ans)\n","fail":"H, W = map(int, input().split())\n\nif H == 1 or W == 1:\n print(1)\nelse:\n if (H * W) % 2 == 1:\n ans = H * W \/\/ 2 + 1\n else:\n ans = H * W \/\/ 2\n print(ans)\n","change":"replace","i1":9,"i2":10,"j1":9,"j2":10,"error":0,"stderr":null,"stdout":10} {"problem_id":"p02742","language":"Python","original_status":"Runtime Error","pass":"import math\n\nh, w = map(int, input().split())\n\nif h == 1 or w == 1:\n print(1)\nelif (h * w) % 2 == 0:\n ans = (h * w) \/\/ 2\nelse:\n ans = (h \/\/ 2) * w + math.ceil(w \/ 2)\n\nprint(ans)\n","fail":"import math\n\nh, w = map(int, input().split())\n\nif h == 1 or w == 1:\n ans = 1\nelif (h * w) % 2 == 0:\n ans = (h * w) \/\/ 2\nelse:\n ans = (h \/\/ 2) * w + math.ceil(w \/ 2)\n\nprint(ans)\n","change":"replace","i1":5,"i2":6,"j1":5,"j2":6,"error":0,"stderr":null,"stdout":10} {"problem_id":"p02743","language":"Python","original_status":"Runtime Error","pass":"from math import sqrt, isclose\n\na, b, c = map(int, input().split())\n\nif isclose(sqrt(c) - (sqrt(a) + sqrt(b)), 0):\n print(\"Yes\")\nelse:\n print(\"No\")\n","fail":"from math import sqrt\nfrom decimal import Decimal, getcontext\n\na, b, c = map(int, input().split())\nif c - a - b > 0 and (c - a - b) ** 2 > 4 * a * b:\n print(\"Yes\")\nelse:\n print(\"No\")\n","change":"replace","i1":0,"i2":5,"j1":0,"j2":5,"error":"0","stderr":null,"stdout":"No\n"} {"problem_id":"p02743","language":"Python","original_status":"Runtime Error","pass":"from decimal import Decimal\n\na, b, c = map(int, input().split())\n\n\nA = Decimal(a) ** (1 \/ 2) + Decimal(b) ** (1 \/ 2)\nC = Decimal(c) ** (1 \/ 2)\nif A < C:\n print(\"Yes\")\nelse:\n print(\"No\")\n","fail":"from decimal import Decimal\n\na, b, c = map(int, input().split())\nk = Decimal(0.5)\n\nA = Decimal(a) ** k + Decimal(b) ** k\nC = Decimal(c) ** k\nif A < C:\n print(\"Yes\")\nelse:\n print(\"No\")\n","change":"replace","i1":3,"i2":7,"j1":3,"j2":7,"error":"TypeError: unsupported operand type(s) for ** or pow(): 'decimal.Decimal' and 'float'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02743\/Python\/s242676501.py\", line 6, in \n A = Decimal(a) ** (1 \/ 2) + Decimal(b) ** (1 \/ 2)\nTypeError: unsupported operand type(s) for ** or pow(): 'decimal.Decimal' and 'float'\n","stdout":null} {"problem_id":"p02743","language":"Python","original_status":"Runtime Error","pass":"a, b, c = input().split()\n\nif c - a - b > 0:\n if 4 * a * b < (c - a - b) ** 2:\n print(\"Yes\")\n else:\n print(\"No\")\nelse:\n print(\"No\")\n","fail":"a, b, c = map(int, input().split())\n\nif c - a - b > 0:\n if 4 * a * b < (c - a - b) ** 2:\n print(\"Yes\")\n else:\n print(\"No\")\nelse:\n print(\"No\")\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"TypeError: unsupported operand type(s) for -: 'str' and 'str'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02743\/Python\/s899697147.py\", line 3, in \n if c - a - b > 0:\nTypeError: unsupported operand type(s) for -: 'str' and 'str'\n","stdout":null} {"problem_id":"p02744","language":"Python","original_status":"Runtime Error","pass":"N = int(input())\nA = {\n 1: [\"a\"],\n 2: [\"aa\", \"ab\"],\n 3: [\"aaa\", \"aab\", \"aba\", \"abb\", \"abc\"],\n 4: [\n \"aaaa\",\n \"aaab\",\n \"aabb\",\n \"aabc\",\n \"abaa\",\n \"abab\",\n \"abac\",\n \"abba\",\n \"abbb\",\n \"abbc\",\n \"abca\",\n \"abcb\",\n \"abcc\",\n \"abcd\",\n ],\n 5: [\n \"aaaaa\",\n \"aaaab\",\n \"aaaba\",\n \"aaabb\",\n \"aaabc\",\n \"aabba\",\n \"aabbb\",\n \"aabbc\",\n \"aabca\",\n \"aabcb\",\n \"aabcc\",\n \"aabcd\",\n \"abaaa\",\n \"abaab\",\n \"abaac\",\n \"ababa\",\n \"ababb\",\n \"ababc\",\n \"abaca\",\n \"abacb\",\n \"abacc\",\n \"abacd\",\n \"abbaa\",\n \"abbab\",\n \"abbac\",\n \"abbba\",\n \"abbbb\",\n \"abbbc\",\n \"abbca\",\n \"abbcb\",\n \"abbcc\",\n \"abbcd\",\n \"abcaa\",\n \"abcab\",\n \"abcac\",\n \"abcad\",\n \"abcba\",\n \"abcbb\",\n \"abcbc\",\n \"abcbd\",\n \"abcca\",\n \"abccb\",\n \"abccc\",\n \"abccd\",\n \"abcda\",\n \"abcdb\",\n \"abcdc\",\n \"abcdd\",\n \"abcde\",\n ],\n}\nAns = A[N]\nfor i in range(len(Ans)):\n print(Ans[i])\n","fail":"N = int(input())\nD = [\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\"]\nAns = [[\"a\"]]\nfor i in range(1, 10):\n before = Ans[i - 1]\n # print(before)\n next = []\n for j in before:\n L = set(list(j))\n # print(L)\n for k in range(len(L) + 1):\n # print(j)\n next.append(j + D[k])\n Ans.append(next)\n# print(Ans)\nprint(*Ans[N - 1], sep=\"\\\\n\")\n","change":"replace","i1":1,"i2":76,"j1":1,"j2":16,"error":0,"stderr":null,"stdout":"a\n"} {"problem_id":"p02745","language":"Python","original_status":"Time Limit Exceeded","pass":"\"\"\"\n\u691c\u8a3c: https:\/\/twitter.com\/neterukun_cd\/status\/1283020759942619139\n\"\"\"\n\n\ndef main():\n MAX_N = 2000\n a = [ord(char) for char in input()]\n b = [ord(char) for char in input()]\n c = [ord(char) for char in input()]\n\n len_a = len(a)\n len_b = len(b)\n len_c = len(c)\n\n a += [63] * (MAX_N - len_a + 10)\n b += [63] * (MAX_N - len_b + 10)\n c += [63] * (MAX_N - len_c + 10)\n\n ab = [True] * (2 * MAX_N + 10)\n ba = [True] * (2 * MAX_N + 10)\n bc = [True] * (2 * MAX_N + 10)\n cb = [True] * (2 * MAX_N + 10)\n ca = [True] * (2 * MAX_N + 10)\n ac = [True] * (2 * MAX_N + 10)\n\n for length in range(MAX_N + 1):\n for i in range(MAX_N + 1):\n if i + length > MAX_N:\n break\n\n if a[i + length] != b[i] and a[i + length] != 63 and b[i] != 63:\n ab[length] = False\n if b[i + length] != a[i] and b[i + length] != 63 and a[i] != 63:\n ba[length] = False\n\n if b[i + length] != c[i] and b[i + length] != 63 and c[i] != 63:\n bc[length] = False\n if c[i + length] != b[i] and c[i + length] != 63 and b[i] != 63:\n cb[length] = False\n\n if c[i + length] != a[i] and c[i + length] != 63 and a[i] != 63:\n ca[length] = False\n if a[i + length] != c[i] and a[i + length] != 63 and c[i] != 63:\n ac[length] = False\n\n ans = MAX_N * 6\n \"\"\"\n # AC\n for len1 in range(MAX_N + 1):\n for len2 in range(MAX_N + 1):\n if ab[len1] and bc[len2] and ac[len1 + len2]:\n tmp = max(len_a, len_b + len1, len_c + len1 + len2)\n ans = min(ans, tmp)\n if ba[len1] and ac[len2] and bc[len1 + len2]:\n tmp = max(len_b, len_a + len1, len_c + len1 + len2)\n ans = min(ans, tmp)\n\n for len1 in range(MAX_N + 1):\n for len2 in range(MAX_N + 1):\n if bc[len1] and ca[len2] and ba[len1 + len2]:\n tmp = max(len_b, len_c + len1, len_a + len1 + len2)\n ans = min(ans, tmp)\n if cb[len1] and ba[len2] and ca[len1 + len2]:\n tmp = max(len_c, len_b + len1, len_a + len1 + len2)\n ans = min(ans, tmp)\n\n for len1 in range(MAX_N + 1):\n for len2 in range(MAX_N + 1):\n if ca[len1] and ab[len2] and cb[len1 + len2]:\n tmp = max(len_c, len_a + len1, len_b + len1 + len2)\n ans = min(ans, tmp)\n if ac[len1] and cb[len2] and ab[len1 + len2]:\n tmp = max(len_a, len_c + len1, len_b + len1 + len2)\n ans = min(ans, tmp)\n \"\"\"\n # TLE?\n for len1 in range(MAX_N + 1):\n for len2 in range(MAX_N + 1):\n if ab[len1] and bc[len2] and ac[len1 + len2]:\n tmp = max(len_a, len_b + len1, len_c + len1 + len2)\n ans = min(ans, tmp)\n if ba[len1] and ac[len2] and bc[len1 + len2]:\n tmp = max(len_b, len_a + len1, len_c + len1 + len2)\n ans = min(ans, tmp)\n\n if bc[len1] and ca[len2] and ba[len1 + len2]:\n tmp = max(len_b, len_c + len1, len_a + len1 + len2)\n ans = min(ans, tmp)\n if cb[len1] and ba[len2] and ca[len1 + len2]:\n tmp = max(len_c, len_b + len1, len_a + len1 + len2)\n ans = min(ans, tmp)\n\n if ca[len1] and ab[len2] and cb[len1 + len2]:\n tmp = max(len_c, len_a + len1, len_b + len1 + len2)\n ans = min(ans, tmp)\n if ac[len1] and cb[len2] and ab[len1 + len2]:\n tmp = max(len_a, len_c + len1, len_b + len1 + len2)\n ans = min(ans, tmp)\n\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"\"\"\"\n\u691c\u8a3c: https:\/\/twitter.com\/neterukun_cd\/status\/1283020759942619139\n\"\"\"\nMAX_N = 2000\na = [ord(char) for char in input()]\nb = [ord(char) for char in input()]\nc = [ord(char) for char in input()]\n\nlen_a = len(a)\nlen_b = len(b)\nlen_c = len(c)\n\na += [63] * (MAX_N - len_a + 10)\nb += [63] * (MAX_N - len_b + 10)\nc += [63] * (MAX_N - len_c + 10)\n\nab = [True] * (2 * MAX_N + 10)\nba = [True] * (2 * MAX_N + 10)\nbc = [True] * (2 * MAX_N + 10)\ncb = [True] * (2 * MAX_N + 10)\nca = [True] * (2 * MAX_N + 10)\nac = [True] * (2 * MAX_N + 10)\n\nfor length in range(MAX_N + 1):\n for i in range(MAX_N + 1):\n if i + length > MAX_N:\n break\n\n if a[i + length] != b[i] and a[i + length] != 63 and b[i] != 63:\n ab[length] = False\n if b[i + length] != a[i] and b[i + length] != 63 and a[i] != 63:\n ba[length] = False\n\n if b[i + length] != c[i] and b[i + length] != 63 and c[i] != 63:\n bc[length] = False\n if c[i + length] != b[i] and c[i + length] != 63 and b[i] != 63:\n cb[length] = False\n\n if c[i + length] != a[i] and c[i + length] != 63 and a[i] != 63:\n ca[length] = False\n if a[i + length] != c[i] and a[i + length] != 63 and c[i] != 63:\n ac[length] = False\n\nans = MAX_N * 6\n\"\"\"\n# AC\nfor len1 in range(MAX_N + 1):\n for len2 in range(MAX_N + 1):\n if ab[len1] and bc[len2] and ac[len1 + len2]:\n tmp = max(len_a, len_b + len1, len_c + len1 + len2)\n ans = min(ans, tmp)\n if ba[len1] and ac[len2] and bc[len1 + len2]:\n tmp = max(len_b, len_a + len1, len_c + len1 + len2)\n ans = min(ans, tmp)\n\nfor len1 in range(MAX_N + 1):\n for len2 in range(MAX_N + 1):\n if bc[len1] and ca[len2] and ba[len1 + len2]:\n tmp = max(len_b, len_c + len1, len_a + len1 + len2)\n ans = min(ans, tmp)\n if cb[len1] and ba[len2] and ca[len1 + len2]:\n tmp = max(len_c, len_b + len1, len_a + len1 + len2)\n ans = min(ans, tmp)\n\nfor len1 in range(MAX_N + 1):\n for len2 in range(MAX_N + 1):\n if ca[len1] and ab[len2] and cb[len1 + len2]:\n tmp = max(len_c, len_a + len1, len_b + len1 + len2)\n ans = min(ans, tmp)\n if ac[len1] and cb[len2] and ab[len1 + len2]:\n tmp = max(len_a, len_c + len1, len_b + len1 + len2)\n ans = min(ans, tmp)\n\"\"\"\n# TLE?\nfor len1 in range(MAX_N + 1):\n for len2 in range(MAX_N + 1):\n if ab[len1] and bc[len2] and ac[len1 + len2]:\n tmp = max(len_a, len_b + len1, len_c + len1 + len2)\n ans = min(ans, tmp)\n if ba[len1] and ac[len2] and bc[len1 + len2]:\n tmp = max(len_b, len_a + len1, len_c + len1 + len2)\n ans = min(ans, tmp)\n\n if bc[len1] and ca[len2] and ba[len1 + len2]:\n tmp = max(len_b, len_c + len1, len_a + len1 + len2)\n ans = min(ans, tmp)\n if cb[len1] and ba[len2] and ca[len1 + len2]:\n tmp = max(len_c, len_b + len1, len_a + len1 + len2)\n ans = min(ans, tmp)\n\nfor len1 in range(MAX_N + 1):\n for len2 in range(MAX_N + 1):\n if ca[len1] and ab[len2] and cb[len1 + len2]:\n tmp = max(len_c, len_a + len1, len_b + len1 + len2)\n ans = min(ans, tmp)\n if ac[len1] and cb[len2] and ab[len1 + len2]:\n tmp = max(len_a, len_c + len1, len_b + len1 + len2)\n ans = min(ans, tmp)\n\nprint(ans)\n","change":"replace","i1":3,"i2":105,"j1":3,"j2":100,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02745","language":"Python","original_status":"Time Limit Exceeded","pass":"\"\"\"\n\u691c\u8a3c: https:\/\/twitter.com\/neterukun_cd\/status\/1283020759942619139\n\"\"\"\nMAX_N = 2000\na = [ord(char) for char in input()]\nb = [ord(char) for char in input()]\nc = [ord(char) for char in input()]\n\nlen_a = len(a)\nlen_b = len(b)\nlen_c = len(c)\n\na += [63] * (MAX_N - len_a + 10)\nb += [63] * (MAX_N - len_b + 10)\nc += [63] * (MAX_N - len_c + 10)\n\nab = [True] * (2 * MAX_N + 10)\nba = [True] * (2 * MAX_N + 10)\nbc = [True] * (2 * MAX_N + 10)\ncb = [True] * (2 * MAX_N + 10)\nca = [True] * (2 * MAX_N + 10)\nac = [True] * (2 * MAX_N + 10)\n\nfor length in range(MAX_N + 1):\n for i in range(MAX_N + 1):\n if i + length > MAX_N:\n break\n\n if a[i + length] != b[i] and a[i + length] != 63 and b[i] != 63:\n ab[length] = False\n if b[i + length] != a[i] and b[i + length] != 63 and a[i] != 63:\n ba[length] = False\n\n if b[i + length] != c[i] and b[i + length] != 63 and c[i] != 63:\n bc[length] = False\n if c[i + length] != b[i] and c[i + length] != 63 and b[i] != 63:\n cb[length] = False\n\n if c[i + length] != a[i] and c[i + length] != 63 and a[i] != 63:\n ca[length] = False\n if a[i + length] != c[i] and a[i + length] != 63 and c[i] != 63:\n ac[length] = False\n\nans = MAX_N * 6\n# TLE?\nfor len1 in range(MAX_N + 1):\n for len2 in range(MAX_N + 1):\n length = len1 + len2\n if ab[len1] and bc[len2] and ac[length]:\n tmp = max(len_a, len_b + len1, len_c + length)\n ans = min(ans, tmp)\n if ba[len1] and ac[len2] and bc[length]:\n tmp = max(len_b, len_a + len1, len_c + length)\n ans = min(ans, tmp)\n if bc[len1] and ca[len2] and ba[length]:\n tmp = max(len_b, len_c + len1, len_a + length)\n ans = min(ans, tmp)\n if cb[len1] and ba[len2] and ca[length]:\n tmp = max(len_c, len_b + len1, len_a + length)\n ans = min(ans, tmp)\n if ca[len1] and ab[len2] and cb[length]:\n tmp = max(len_c, len_a + len1, len_b + length)\n ans = min(ans, tmp)\n if ac[len1] and cb[len2] and ab[length]:\n tmp = max(len_a, len_c + len1, len_b + length)\n ans = min(ans, tmp)\n\nprint(ans)\n","fail":"\"\"\"\n\u691c\u8a3c: https:\/\/twitter.com\/neterukun_cd\/status\/1283020759942619139\n\"\"\"\nMAX_N = 2000\na = [ord(char) for char in input()]\nb = [ord(char) for char in input()]\nc = [ord(char) for char in input()]\n\nlen_a = len(a)\nlen_b = len(b)\nlen_c = len(c)\n\na += [63] * (MAX_N - len_a + 10)\nb += [63] * (MAX_N - len_b + 10)\nc += [63] * (MAX_N - len_c + 10)\n\nab = [True] * (2 * MAX_N + 10)\nba = [True] * (2 * MAX_N + 10)\nbc = [True] * (2 * MAX_N + 10)\ncb = [True] * (2 * MAX_N + 10)\nca = [True] * (2 * MAX_N + 10)\nac = [True] * (2 * MAX_N + 10)\n\nfor length in range(MAX_N + 1):\n for i in range(MAX_N + 1):\n if i + length > MAX_N:\n break\n\n if a[i + length] != b[i] and a[i + length] != 63 and b[i] != 63:\n ab[length] = False\n if b[i + length] != a[i] and b[i + length] != 63 and a[i] != 63:\n ba[length] = False\n\n if b[i + length] != c[i] and b[i + length] != 63 and c[i] != 63:\n bc[length] = False\n if c[i + length] != b[i] and c[i + length] != 63 and b[i] != 63:\n cb[length] = False\n\n if c[i + length] != a[i] and c[i + length] != 63 and a[i] != 63:\n ca[length] = False\n if a[i + length] != c[i] and a[i + length] != 63 and c[i] != 63:\n ac[length] = False\n\nans = MAX_N * 6\n\"\"\"\n# AC\nfor len1 in range(MAX_N + 1):\n for len2 in range(MAX_N + 1):\n if ab[len1] and bc[len2] and ac[len1 + len2]:\n tmp = max(len_a, len_b + len1, len_c + len1 + len2)\n ans = min(ans, tmp)\n if ba[len1] and ac[len2] and bc[len1 + len2]:\n tmp = max(len_b, len_a + len1, len_c + len1 + len2)\n ans = min(ans, tmp)\n\nfor len1 in range(MAX_N + 1):\n for len2 in range(MAX_N + 1):\n if bc[len1] and ca[len2] and ba[len1 + len2]:\n tmp = max(len_b, len_c + len1, len_a + len1 + len2)\n ans = min(ans, tmp)\n if cb[len1] and ba[len2] and ca[len1 + len2]:\n tmp = max(len_c, len_b + len1, len_a + len1 + len2)\n ans = min(ans, tmp)\n\nfor len1 in range(MAX_N + 1):\n for len2 in range(MAX_N + 1):\n if ca[len1] and ab[len2] and cb[len1 + len2]:\n tmp = max(len_c, len_a + len1, len_b + len1 + len2)\n ans = min(ans, tmp)\n if ac[len1] and cb[len2] and ab[len1 + len2]:\n tmp = max(len_a, len_c + len1, len_b + len1 + len2)\n ans = min(ans, tmp)\n\"\"\"\n# TLE?\nfor len1 in range(MAX_N + 1):\n for len2 in range(MAX_N + 1):\n if ab[len1] and bc[len2] and ac[len1 + len2]:\n tmp = max(len_a, len_b + len1, len_c + len1 + len2)\n ans = min(ans, tmp)\nfor len1 in range(MAX_N + 1):\n for len2 in range(MAX_N + 1):\n if ba[len1] and ac[len2] and bc[len1 + len2]:\n tmp = max(len_b, len_a + len1, len_c + len1 + len2)\n ans = min(ans, tmp)\nfor len1 in range(MAX_N + 1):\n for len2 in range(MAX_N + 1):\n if bc[len1] and ca[len2] and ba[len1 + len2]:\n tmp = max(len_b, len_c + len1, len_a + len1 + len2)\n ans = min(ans, tmp)\nfor len1 in range(MAX_N + 1):\n for len2 in range(MAX_N + 1):\n if cb[len1] and ba[len2] and ca[len1 + len2]:\n tmp = max(len_c, len_b + len1, len_a + len1 + len2)\n ans = min(ans, tmp)\nfor len1 in range(MAX_N + 1):\n for len2 in range(MAX_N + 1):\n if ca[len1] and ab[len2] and cb[len1 + len2]:\n tmp = max(len_c, len_a + len1, len_b + len1 + len2)\n ans = min(ans, tmp)\nfor len1 in range(MAX_N + 1):\n for len2 in range(MAX_N + 1):\n if ac[len1] and cb[len2] and ab[len1 + len2]:\n tmp = max(len_a, len_c + len1, len_b + len1 + len2)\n ans = min(ans, tmp)\n\nprint(ans)\n","change":"replace","i1":44,"i2":65,"j1":44,"j2":103,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02747","language":"Python","original_status":"Runtime Error","pass":"S = input()\nok = True\nfor i in range(0, len(S), 2):\n if not (S[i] == \"h\" and S[i + 1] == \"i\"):\n ok = False\n break\nprint(\"Yes\" if ok else \"No\")\n","fail":"S = input()\nok = True\nfor i in range(0, len(S), 2):\n try:\n if not (S[i] == \"h\" and S[i + 1] == \"i\"):\n ok = False\n break\n except IndexError:\n ok = False\n break\nprint(\"Yes\" if ok else \"No\")\n","change":"replace","i1":3,"i2":4,"j1":3,"j2":8,"error":0,"stderr":null,"stdout":"Yes\n"} {"problem_id":"p02748","language":"Python","original_status":"Runtime Error","pass":"A, B, M = map(int, input().split())\nx, y, c = [0] * M, [0] * M, [0] * M\na = list(map(int, input().split()))\nb = list(map(int, input().split()))\nfor i in range(M):\n x[i], y[i], c[i] = map(int, input().split())\nans = 0\nsav = 0\nmaxc = max(c)\nci = c.index(maxc)\ndisc = a[ci - 1] + b[ci - 1] - maxc\nprint(min(disc, min(a) + min(b)))\n","fail":"A, B, M = map(int, input().split())\nx, y, c = [0] * M, [0] * M, [0] * M\na = list(map(int, input().split()))\nb = list(map(int, input().split()))\nfor i in range(M):\n x[i], y[i], c[i] = map(int, input().split())\nans, sav = float(\"inf\"), 0\nfor j in range(M):\n sav = a[x[j] - 1] + b[y[j] - 1] - c[j]\n if ans > sav:\n ans = sav\n\nprint(min(ans, min(a) + min(b)))\n","change":"replace","i1":6,"i2":12,"j1":6,"j2":13,"error":"0","stderr":null,"stdout":5.0} {"problem_id":"p02748","language":"Python","original_status":"Runtime Error","pass":"a, b, m = map(int, input().split())\narr = list(map(int, input().split()))\nbrr = list(map(int, input().split()))\ncrr = [[0] * b for _ in range(a)]\nxycs = [tuple(map(int, input().split())) for _ in range(m)]\nans = min(arr) + min(brr)\n\nfor elem in xycs:\n x = elem[0]\n y = elem[1]\n c = elem[2]\n ans = min(arr[x - 1] + arr[y - 1] - c, ans)\n\nprint(ans)\n","fail":"a, b, m = map(int, input().split())\narr = list(map(int, input().split()))\nbrr = list(map(int, input().split()))\nxycs = [tuple(map(int, input().split())) for _ in range(m)]\nans = min(arr) + min(brr)\n\nfor elem in xycs:\n x = elem[0]\n y = elem[1]\n c = elem[2]\n ans = min((arr[x - 1] + brr[y - 1] - c), ans)\n\nprint(ans)\n","change":"replace","i1":3,"i2":12,"j1":3,"j2":11,"error":"0","stderr":null,"stdout":5.0} {"problem_id":"p02748","language":"Python","original_status":"Runtime Error","pass":"import numpy as np\n\n\nA, B, M = map(int, input().split())\na = list(map(int, input().split()))\na = np.array(a)\nb = list(map(int, input().split()))\nb = np.array(b)\nz = [list(map(int, input().split())) for _ in range(M)]\nz = np.array(z)\n\n\nxx, yy = np.meshgrid(a, b)\nxx1 = xx.flatten()\nyy1 = yy.flatten()\n\nxxyy = np.c_[xx1, yy1]\nmem = xxyy.sum(axis=1)\n# mem = list(mem)\nmem2 = []\nfor x, y, c in z:\n mem2.append(a[x - 1] + b[y - 1] - c)\nnp.append(mem, mem2)\n\n\nprint(min(mem))\n# print(mem)\n","fail":"A, B, M = map(int, input().split())\na = list(map(int, input().split()))\nb = list(map(int, input().split()))\nL = [[int(x) for x in input().split()] for _ in range(M)]\n\nreg = min(a) + min(b)\nfor x, y, c in L:\n tmp = a[x - 1] + b[y - 1] - c\n reg = min(reg, tmp)\nprint(reg)\n","change":"replace","i1":0,"i2":27,"j1":0,"j2":10,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02749","language":"Python","original_status":"Runtime Error","pass":"import sys\n\nsys.setrecursionlimit(2 * 10**6)\n\n\ndef inpl():\n return list(map(int, input().split()))\n\n\ndef dfs(n, d):\n if depth[n] != -1:\n return\n depth[n] = d\n for nn in eAB[n]:\n dfs(nn, d + 1)\n return\n\n\nN = int(input())\nAB = [inpl() for i in range(N - 1)]\n\neAB = [[] for i in range(N)]\nfor a, b in AB:\n eAB[a - 1].append(b - 1)\n eAB[b - 1].append(a - 1)\n\ndepth = [-1 for i in range(N)]\n\ndfs(0, 0)\n\neo = [[], []]\nfor i in range(N):\n eo[depth[i] % 2].append(i)\n\nans = [-1 for i in range(N)]\nif len(eo[0]) > N \/\/ 3 and len(eo[1]) > N \/\/ 3:\n for i in range(N \/\/ 3):\n ans[3 * i] = eo[0][i]\n ans[3 * i + 1] = eo[1][i]\n t_0 = i + 1\n t_1 = i + 1\nelif len(eo[0]) <= N \/\/ 3:\n for i in range(len(eo[0])):\n ans[3 * i + 2] = eo[0][i]\n t_0 = len(eo[0])\n t_1 = 0\nelif len(eo[1]) <= N \/\/ 3:\n for i in range(len(eo[1])):\n ans[3 * i + 2] = eo[1][i]\n t_0 = 0\n t_1 = len(eo[1])\n\nfor i in range(N):\n if ans[i] != -1:\n continue\n if t_0 < len(eo[0]):\n ans[i] = eo[0][t_0]\n t_0 += 1\n else:\n ans[i] = eo[1][t_1]\n t_1 += 1\n\nprint(\" \".join(list(map(str, [a + 1 for a in ans]))))\n","fail":"import sys\n\nsys.setrecursionlimit(2 * 10**6)\n\n\ndef inpl():\n return list(map(int, input().split()))\n\n\ndef dfs(n, d):\n if depth[n] != -1:\n return\n depth[n] = d\n for nn in eAB[n]:\n dfs(nn, d + 1)\n return\n\n\nN = int(input())\nAB = [inpl() for i in range(N - 1)]\n\neAB = [[] for i in range(N)]\nfor a, b in AB:\n eAB[a - 1].append(b - 1)\n eAB[b - 1].append(a - 1)\n\ndepth = [-1 for i in range(N)]\n\ndfs(0, 0)\n\neo = [[], []]\nfor i in range(N):\n eo[depth[i] % 2].append(i)\n\n# print(eo)\nans = [-1 for i in range(N)]\nif len(eo[0]) > N \/\/ 3 and len(eo[1]) > N \/\/ 3:\n for i in range(N \/\/ 3):\n ans[eo[0][i]] = 3 * i + 1\n ans[eo[1][i]] = 3 * i + 2\n t_0 = N \/\/ 3\n t_1 = N \/\/ 3\n if N % 3 > 0:\n ans[eo[0][N \/\/ 3]] = 3 * (N \/\/ 3) + 1\n t_0 += 1\n if N % 3 > 1:\n ans[eo[1][N \/\/ 3]] = 3 * (N \/\/ 3) + 2\n t_1 += 1\n # print(ans)\n for i, v in enumerate(eo[0][t_0:] + eo[1][t_1:]):\n ans[v] = 3 * (i + 1)\nelse:\n if len(eo[0]) <= N \/\/ 3:\n ni = 0\n else:\n ni = 1\n tmp = [True for i in range(N + 1)]\n for i in range(len(eo[ni])):\n ans[eo[ni][i]] = 3 * (i + 1)\n tmp[3 * (i + 1)] = False\n tmp = [i for i, t in enumerate(tmp) if t is True]\n j = 1\n for i in range(N):\n if ans[i] != -1:\n continue\n ans[i] = tmp[j]\n j += 1\n\nprint(\" \".join(list(map(str, ans))))\n","change":"replace","i1":34,"i2":63,"j1":34,"j2":69,"error":"WA","stderr":null,"stdout":"1 2 4 5 3\n"} {"problem_id":"p02749","language":"Python","original_status":"Runtime Error","pass":"n = int(input())\nab = [list(map(int, input().split())) for _ in range(n - 1)]\n\nadj = [[] for _ in range(n)]\nfor a, b in ab:\n a -= 1\n b -= 1\n adj[a].append(b)\n adj[b].append(a)\n\n\nclass Tree:\n WHITE = 0\n GRAY = -1\n BLACK = 1\n\n def __init__(self, adj):\n n = len(adj)\n self.adj = adj\n self.colors = [self.WHITE] * n\n self.depths = [-1] * n\n self.depth = 0\n\n def init(self):\n self.__init__(self.adj)\n\n def dfs(self, u):\n if self.colors[u] == self.BLACK:\n return\n\n self.colors[u] = self.GRAY\n self.depths[u] = self.depth\n\n for v in self.adj[u]:\n if self.colors[v] == self.WHITE:\n self.depth += 1\n self.dfs(v)\n self.depth -= 1\n\n self.colors[u] = self.BLACK\n\n\ntree = Tree(adj)\ntree.dfs(0)\n\nev = [i for i, e in enumerate(tree.depths) if e % 2 == 0]\nod = [i for i, e in enumerate(tree.depths) if e % 2]\n\nl_ev = len(ev)\nl_od = len(od)\n\nmod0 = [e for e in range(1, n + 1) if e % 3 == 0]\nmod1 = [e for e in range(1, n + 1) if e % 3 == 1]\nmod2 = [e for e in range(1, n + 1) if e % 3 == 2]\n\nans = [0] * n\n\n\ndef f(li1, li2):\n while li1 and li2:\n i = li1.pop()\n num = li2.pop()\n ans[i] = num\n\n\nif l_ev > n \/ 3 and l_od > n \/ 3:\n f(ev, mod1)\n f(od, mod2)\n f(ev, mod0)\n f(od, mod0)\n\nelif l_ev <= n \/ 3:\n f(ev, mod0)\n f(od, mod0)\n f(od, mod1)\n f(od, mod2)\n\nelse:\n f(od, mod0)\n f(ev, mod0)\n f(ev, mod1)\n f(ev, mod2)\n\nprint(*ans)\n","fail":"import sys\n\nsys.setrecursionlimit(10**6)\n\nn = int(input())\nab = [list(map(int, input().split())) for _ in range(n - 1)]\n\nadj = [[] for _ in range(n)]\nfor a, b in ab:\n a -= 1\n b -= 1\n adj[a].append(b)\n adj[b].append(a)\n\n\nclass Tree:\n WHITE = 0\n GRAY = -1\n BLACK = 1\n\n def __init__(self, adj):\n n = len(adj)\n self.adj = adj\n self.colors = [self.WHITE] * n\n self.depths = [-1] * n\n self.depth = 0\n\n def init(self):\n self.__init__(self.adj)\n\n def dfs(self, u):\n if self.colors[u] == self.BLACK:\n return\n\n self.colors[u] = self.GRAY\n self.depths[u] = self.depth\n\n for v in self.adj[u]:\n if self.colors[v] == self.WHITE:\n self.depth += 1\n self.dfs(v)\n self.depth -= 1\n\n self.colors[u] = self.BLACK\n\n\ntree = Tree(adj)\ntree.dfs(0)\n\nev = [i for i, e in enumerate(tree.depths) if e % 2 == 0]\nod = [i for i, e in enumerate(tree.depths) if e % 2]\n\nl_ev = len(ev)\nl_od = len(od)\n\nmod0 = [e for e in range(1, n + 1) if e % 3 == 0]\nmod1 = [e for e in range(1, n + 1) if e % 3 == 1]\nmod2 = [e for e in range(1, n + 1) if e % 3 == 2]\n\nans = [0] * n\n\n\ndef f(li1, li2):\n while li1 and li2:\n i = li1.pop()\n num = li2.pop()\n ans[i] = num\n\n\nif l_ev > n \/ 3 and l_od > n \/ 3:\n f(ev, mod1)\n f(od, mod2)\n f(ev, mod0)\n f(od, mod0)\n\nelif l_ev <= n \/ 3:\n f(ev, mod0)\n f(od, mod0)\n f(od, mod1)\n f(od, mod2)\n\nelse:\n f(od, mod0)\n f(ev, mod0)\n f(ev, mod1)\n f(ev, mod2)\n\nprint(*ans)\n","change":"insert","i1":0,"i2":0,"j1":0,"j2":4,"error":"WA","stderr":null,"stdout":"3 2 5 1 4\n"} {"problem_id":"p02753","language":"Python","original_status":"Runtime Error","pass":"s = str(input())\nif s == \"AAA\" or s == \"BBB\":\n input(\"No\")\nelse:\n input(\"Yes\")\n","fail":"s = str(input())\nif s == \"AAA\" or s == \"BBB\":\n print(\"No\")\nelse:\n print(\"Yes\")\n","change":"replace","i1":2,"i2":5,"j1":2,"j2":5,"error":"EOFError: EOF when reading a line","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02753\/Python\/s471253623.py\", line 5, in \n input(\"Yes\")\nEOFError: EOF when reading a line\n","stdout":"Yes"} {"problem_id":"p02753","language":"Python","original_status":"Runtime Error","pass":"s = int(input())\nif s in \"AAA-BBB\":\n print(\"No\")\nelse:\n print(\"Yes\")\n","fail":"s = input()\nif s in \"AAA-BBB\":\n print(\"No\")\nelse:\n print(\"Yes\")\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"ValueError: invalid literal for int() with base 10: 'ABA'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02753\/Python\/s787865958.py\", line 1, in \n s = int(input())\nValueError: invalid literal for int() with base 10: 'ABA'\n","stdout":null} {"problem_id":"p02753","language":"Python","original_status":"Runtime Error","pass":"s = input()\nQ = int(input())\nflag = True # flag\u304cTrue\u306e\u3068\u304d\u3001\u5076\u6570\u56de\u6570\u306e\u53cd\u8ee2\u304c\u884c\u308f\u308c\u3066\u3044\u308b\ncnt = 0\nfor _ in range(Q):\n query = list(map(str, input().split()))\n # tmp.append(query)\n if len(query) == 1: # 1\u306equery\u306e\u3068\u304d\n cnt += 1\n if flag:\n flag = False\n else:\n flag = True\n else:\n f, c = query[1], query[2]\n if f == \"1\": # \u5148\u982d\u306b\u8ffd\u52a0\u3059\u308b\u3082\u306e\n if flag:\n s = c + s # \u5076\u6570\u56de\u306e\u53cd\u8ee2\u306a\u3089\u7d20\u76f4\u306b\u5148\u982d\u306b\u8ffd\u52a0\u3059\u308b\n else:\n s += c # \u5947\u6570\u4f1a\u306e\u53cd\u8ee2\u306a\u3089\u5f8c\u308d\u306b\u8ffd\u52a0\u3059\u308b\n else: # \u672b\u5c3e\u306b\u8ffd\u52a0\u3059\u308b\n if flag:\n s += c\n else:\n s = c + s\n\nif cnt % 2 == 1 and cnt != 0:\n s = s[::-1]\nprint(s)\n","fail":"S = input()\nif \"A\" in S and \"B\" in S:\n print(\"Yes\")\nelse:\n print(\"No\")\n","change":"replace","i1":0,"i2":29,"j1":0,"j2":5,"error":"EOFError: EOF when reading a line","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02753\/Python\/s625684460.py\", line 2, in \n Q = int(input())\nEOFError: EOF when reading a line\n","stdout":null} {"problem_id":"p02754","language":"Python","original_status":"Time Limit Exceeded","pass":"n, a, b = map(int, input().split())\n\nx = []\ncnt = 0\nflag = True\nwhile cnt < n:\n if flag:\n for j in range(a):\n if cnt + j >= n:\n break\n x.append(1)\n cnt += a\n flag = False\n else:\n for j in range(b):\n if cnt + j >= n:\n break\n x.append(0)\n cnt += b\n flag = True\n\ncnt = 0\nfor i in range(n):\n if x[i] == 1:\n cnt += 1\n\nprint(cnt)\n","fail":"n, a, b = map(int, input().split())\n\nans = n \/\/ (a + b) * a\nrem = n % (a + b)\nprint(ans + min(rem, a))\n","change":"replace","i1":2,"i2":27,"j1":2,"j2":5,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02754","language":"Python","original_status":"Time Limit Exceeded","pass":"n, a, b = list(map(int, input().split(\" \")))\n\nblue_count = 0\nwhile n != 0:\n # \u9752\n if n > a:\n n -= a\n blue_count += a\n else:\n blue_count += n\n n = 0\n if n > b:\n n -= b\n else:\n n = 0\n\nprint(blue_count)\n","fail":"n, a, b = list(map(int, input().split(\" \")))\n\nblue_count = a * (n \/\/ (a + b))\nn -= (a + b) * (n \/\/ (a + b))\nif n >= a:\n blue_count += a\nelse:\n blue_count += n\nprint(blue_count)\n","change":"replace","i1":2,"i2":16,"j1":2,"j2":8,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02754","language":"Python","original_status":"Runtime Error","pass":"# -*- coding: utf-8 -*-\n\nn, a, b = map(int, input().split())\n\ntemp_plus = (\"1\" * a) + (\"0\" * b)\ntemp = \"\"\nwhile len(temp) <= n:\n temp += temp_plus\n\nprint(temp[0:n].count(\"1\"))\n","fail":"# -*- coding: utf-8 -*-\n\nn, a, b = map(int, input().split())\n\ntemp = n \/\/ (a + b)\namari = n % (a + b)\nresult = temp * a\n\nif amari >= a:\n result += a\nelse:\n result += amari\n\nprint(result)\n","change":"replace","i1":4,"i2":10,"j1":4,"j2":14,"error":"0","stderr":null,"stdout":4.0} {"problem_id":"p02754","language":"Python","original_status":"Time Limit Exceeded","pass":"N, A, B = map(int, input().split())\n\ncurrent_n = N\nb_cnt = 0\nflag = True\nwhile current_n != 0:\n if flag:\n if current_n - A > 0:\n current_n = current_n - A\n b_cnt += A\n else:\n b_cnt += current_n\n current_n = 0\n flag = False\n else:\n if current_n - B > 0:\n current_n = current_n - B\n else:\n current_n = 0\n flag = True\n\nprint(b_cnt)\n","fail":"N, A, B = map(int, input().split())\n\nq, r = divmod(N, A + B)\n\nif r >= A:\n print(q * A + A)\nelse:\n print(q * A + r)\n","change":"replace","i1":2,"i2":22,"j1":2,"j2":8,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02754","language":"Python","original_status":"Time Limit Exceeded","pass":"n, b, r = map(int, input().split())\nans = 0\n\nwhile n > 0:\n ans += min(n, b)\n n -= b + r\n\nprint(ans)\n","fail":"n, b, r = map(int, input().split())\n\nans = n \/\/ (b + r) * b\nn = n % (b + r)\n\nans += min(n, b)\n\nprint(ans)\n","change":"replace","i1":1,"i2":6,"j1":1,"j2":6,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02754","language":"Python","original_status":"Time Limit Exceeded","pass":"n, a, b = map(int, input().split())\n\nans = 0\nwhile True:\n if n >= a:\n n -= a\n ans += a\n else:\n ans += n\n break\n\n if n >= b:\n n -= b\n else:\n break\nprint(ans)\n","fail":"n, a, b = map(int, input().split())\n\nans = n \/\/ (a + b) * a\namari = n - (a + b) * (n \/\/ (a + b))\nans += min(amari, a)\n\nprint(ans)\n","change":"replace","i1":2,"i2":15,"j1":2,"j2":6,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02754","language":"Python","original_status":"Runtime Error","pass":"n, a, b = map(int, input().split().rstrip())\nk = n \/\/ (a + b)\nr = n % (a + b)\nprint(k * a + min(r, a))\n","fail":"n, a, b = map(int, input().rstrip().split())\nk = n \/\/ (a + b)\nr = n % (a + b)\nprint(k * a + min(r, a))\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"AttributeError: 'list' object has no attribute 'rstrip'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02754\/Python\/s608778092.py\", line 1, in \n n, a, b = map(int, input().split().rstrip())\nAttributeError: 'list' object has no attribute 'rstrip'\n","stdout":null} {"problem_id":"p02754","language":"Python","original_status":"Time Limit Exceeded","pass":"n, a, b = map(int, input().split())\n\nacnt = 0\nbcnt = 0\nwhile True:\n acnt += a\n if acnt + bcnt >= n:\n acnt -= (acnt + bcnt) - n\n break\n bcnt += b\n if acnt + bcnt >= n:\n break\nprint(acnt)\n","fail":"n, a, b = map(int, input().split())\namari = n % (a + b)\nsho = n \/\/ (a + b)\nif n <= a:\n print(n)\nelif amari == 0:\n print(a * sho)\nelif amari < a:\n print(a * sho + amari)\nelse:\n print(a * sho + a)\n","change":"replace","i1":1,"i2":13,"j1":1,"j2":11,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02754","language":"Python","original_status":"Runtime Error","pass":"n, a, b = map(int, input().split())\ns = \"a\" * a + \"b\" * b\nS = s * (int(n \/ (a + b)) + 1)\nprint(S[:n].count(\"a\"))\n","fail":"n, a, b = map(int, input().split())\nif a == 0:\n print(0)\nelif n <= a:\n print(n)\nelse:\n r = int(n \/ (a + b))\n if n % (a + b) < a:\n print(n - r * b)\n else:\n print(a * (r + 1))\n","change":"replace","i1":1,"i2":4,"j1":1,"j2":11,"error":"0","stderr":null,"stdout":4.0} {"problem_id":"p02754","language":"Python","original_status":"Time Limit Exceeded","pass":"n, a, b = map(int, input().split())\ncount = 0\nbcount = 0\nturn = 0\nwhile count <= n:\n if turn % 2 == 0:\n if count + a <= n:\n count += a\n bcount += a\n else:\n bcount += n - count\n count += n - count\n\n else:\n if count + b <= n:\n count += b\n else:\n count += b\n turn += 1\nprint(bcount)\n","fail":"n, a, b = map(int, input().split())\ncount = 0\nbcount = 0\nab = a + b\n\nk = int(n \/ ab)\namari = n - k * ab\nbcount += k * a\nif amari >= a:\n bcount += a\nelse:\n bcount += amari\n\nprint(bcount)\n","change":"replace","i1":3,"i2":19,"j1":3,"j2":13,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02754","language":"Python","original_status":"Time Limit Exceeded","pass":"N, A, B = map(int, input().split())\n\nans = 0\n\nwhile N > 0:\n red = min(N, A)\n ans += red\n N -= red\n blue = min(N, B)\n N -= blue\nprint(ans)\n","fail":"N, A, B = map(int, input().split())\n\nrep = N \/\/ (A + B)\nans = A * rep\ndiff = N - (A + B) * rep\nans += min(diff, A)\nprint(ans)\n","change":"replace","i1":2,"i2":10,"j1":2,"j2":6,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02754","language":"Python","original_status":"Time Limit Exceeded","pass":"N, A, B = map(int, input().split())\ncapacity = N\nis_a = True\ncnt = 0\n\nwhile capacity > 0:\n if is_a:\n ball = A\n cnt += min(capacity, ball)\n else:\n ball = B\n\n is_a = not is_a\n capacity -= min(capacity, ball)\n\nprint(cnt)\n","fail":"N, A, B = map(int, input().split())\n\ncombo = A + B\nnum_of_combo = N \/\/ combo\nremaining = N - combo * num_of_combo\n\nprint(num_of_combo * A + min(remaining, A))\n","change":"replace","i1":1,"i2":16,"j1":1,"j2":7,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02755","language":"Python","original_status":"Runtime Error","pass":"import math\n\nA, B = map(int, input().split())\n\nvolume_A = A \/ 0.08\nvolume_B = B \/ 0.1\n\nmin_A, max_A = volume_A, volume_A\nrange_A = 1 \/ 0.08\nmin_B, max_B = volume_B, volume_B\nrange_B = 1 \/ 0.1\n\nfor i in range(math.floor(volume_A - range_A), math.ceil(volume_A + range_A)):\n if math.floor(i * 0.08) == A:\n min_A = min(min_A, i)\n max_A = max(max_A, i)\n\nfor j in range(math.floor(volume_B - range_B), math.ceil(volume_B + range_B)):\n if math.floor(j * 0.1) == B:\n min_B = min(min_B, j)\n max_B = max(max_B, j)\n\nans_A = set()\nfor i in range(min_A, max_A + 1):\n ans_A.add(i)\n\nans_B = set()\nfor j in range(min_B, max_B + 1):\n ans_B.add(j)\n\nans = ans_A & ans_B\n\nif len(ans) == 0:\n print(-1)\nelse:\n print(min(ans))\n","fail":"import math\n\nA, B = map(int, input().split())\n\nvolume_A = math.floor(A \/ 0.08)\nvolume_B = math.floor(B \/ 0.1)\n\nmin_A, max_A = math.inf, -math.inf\nrange_A = math.floor(1 \/ 0.08)\nmin_B, max_B = math.inf, -math.inf\nrange_B = math.floor(1 \/ 0.1)\n# print(range_A)\n# print(range_B)\n\nfor i in range(volume_A - range_A, volume_A + range_A):\n if math.floor(i * 0.08) == A:\n min_A = min(min_A, i)\n max_A = max(max_A, i)\n\nfor j in range(volume_B - range_B, volume_B + range_B):\n if math.floor(j * 0.1) == B:\n min_B = min(min_B, j)\n max_B = max(max_B, j)\n\nans_A = set()\nfor i in range(min_A, max_A + 1):\n ans_A.add(i)\n# print(ans_A)\n\nans_B = set()\nfor j in range(min_B, max_B + 1):\n ans_B.add(j)\n# print(ans_B)\n\nans = ans_A & ans_B\n\nif len(ans) == 0:\n print(-1)\nelse:\n print(min(ans))\n","change":"replace","i1":4,"i2":29,"j1":4,"j2":33,"error":"TypeError: 'float' object cannot be interpreted as an integer","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02755\/Python\/s079173074.py\", line 24, in \n for i in range(min_A, max_A + 1):\nTypeError: 'float' object cannot be interpreted as an integer\n","stdout":null} {"problem_id":"p02755","language":"Python","original_status":"Runtime Error","pass":"A, B = map(int, input().split())\na = [i for i in range(1, 1001) if int(i * 0.08) == A]\nb = [i for i in range(1, 1001) if int(i * 0.1) == B]\nprint(min(set(a) & set(b)))\n","fail":"A, B = map(int, input().split())\na = [i for i in range(1, 1001) if int(i * 0.08) == A]\nb = [i for i in range(1, 1001) if int(i * 0.1) == B]\nc = set(a) & set(b)\nif len(c):\n print(min(c))\nelse:\n print(-1)\n","change":"replace","i1":3,"i2":4,"j1":3,"j2":8,"error":"0","stderr":null,"stdout":25.0} {"problem_id":"p02755","language":"Python","original_status":"Runtime Error","pass":"import math\n\na, b = map(int, input().split())\nfor i in range(1, 101):\n if a == math.floor(i * 0.08):\n for j in range(1, 101):\n if b == math.floor(j * 0.1):\n if i == j:\n break\n else:\n continue\n break\nelse:\n print(-1)\nprint(j)\n","fail":"a, b = map(int, input().split())\nfor i in range(1, 1001):\n if a == int(i * 0.08) and b == int(i * 0.1):\n print(i)\n break\nelse:\n print(-1)\n","change":"replace","i1":0,"i2":15,"j1":0,"j2":7,"error":"0","stderr":null,"stdout":25.0} {"problem_id":"p02756","language":"Python","original_status":"Time Limit Exceeded","pass":"S = list(input())\nQ = int(input())\n\nQuery = [list(input()) for i in range(Q)]\n\nfor i in range(Q):\n if Query[i][0] == \"1\":\n S.reverse()\n else:\n if Query[i][2] == \"1\":\n S.insert(0, Query[i][4])\n else:\n S.append(Query[i][4])\n\nprint(\"\".join(S))\n","fail":"from collections import deque\n\nS = list(input())\nQ = int(input())\n\nS = deque(S)\n\nQuery = [list(input()) for i in range(Q)]\n\nrev_cnt = 0\n\nfor i in range(Q):\n if Query[i][0] == \"1\":\n rev_cnt += 1\n else:\n if Query[i][2] == \"1\":\n if rev_cnt % 2 == 1:\n S.append(Query[i][4])\n else:\n S.appendleft(Query[i][4])\n else:\n if rev_cnt % 2 == 1:\n S.appendleft(Query[i][4])\n else:\n S.append(Query[i][4])\n\nif rev_cnt % 2 == 1:\n while len(S) != 0:\n print(S.pop(), end=\"\")\nelse:\n while len(S) != 0:\n print(S.popleft(), end=\"\")\n\n\nprint()\n","change":"replace","i1":0,"i2":15,"j1":0,"j2":35,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02756","language":"Python","original_status":"Time Limit Exceeded","pass":"s = input()\nq = int(input())\nflag = True\nfor _ in range(q):\n query = input().split()\n if query[0] == \"1\":\n flag = not flag\n else:\n if (query[1] == \"1\" and flag) or (query[1] == \"2\" and not flag):\n s = query[2] + s\n else:\n s = s + query[2]\nsf = 1 if flag else -1\nprint(s[::sf])\n","fail":"from collections import deque\n\ns = deque(input())\nq = int(input())\nflag = True\nfor _ in range(q):\n query = input().split()\n if query[0] == \"1\":\n flag = not flag\n else:\n if (query[1] == \"1\" and flag) or (query[1] == \"2\" and not flag):\n s.appendleft(query[2])\n else:\n s.append(query[2])\nif not flag:\n s.reverse()\nprint(\"\".join(s))\n","change":"replace","i1":0,"i2":14,"j1":0,"j2":17,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02756","language":"Python","original_status":"Runtime Error","pass":"S = list(input())\nQ = int(input())\n\nfor _ in range(Q):\n q = input()\n if len(q) == 1:\n S = list(S)\n S.reverse()\n S = \"\".join(S)\n else:\n T, F, C = q.split()\n if int(F) == 1:\n S = C + S\n else:\n S = S + C\n\nprint(S)\n","fail":"from collections import deque\n\nS = list(input())\nQ = int(input())\n\nd = deque(S)\nhead = \"l\"\n\nfor _ in range(Q):\n q = input()\n if len(q) == 1:\n if head == \"l\":\n head = \"r\"\n else:\n head = \"l\"\n else:\n T, F, C = q.split()\n if int(F) == 1:\n if head == \"l\":\n d.appendleft(C)\n else:\n d.append(C)\n else:\n if head == \"l\":\n d.append(C)\n else:\n d.appendleft(C)\nif head == \"l\":\n print(\"\".join(list(d)))\nelse:\n print(\"\".join(list(d)[::-1]))\n","change":"replace","i1":0,"i2":17,"j1":0,"j2":31,"error":"TypeError: can only concatenate str (not \"list\") to str","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02756\/Python\/s030720432.py\", line 13, in \n S = C + S\nTypeError: can only concatenate str (not \"list\") to str\n","stdout":null} {"problem_id":"p02756","language":"Python","original_status":"Time Limit Exceeded","pass":"s = input()\nq = int(input())\n\n\ndef s_add(r, f):\n if r % 2 == 0:\n if f == 1:\n return True\n else:\n return False\n else:\n if f == 1:\n return False\n else:\n return True\n\n\ncnt = 0\nfor _ in range(q):\n query = input()\n if query == \"1\":\n cnt += 1\n else:\n z, f, c = query.split()\n if s_add(cnt, int(f)):\n s = c + s\n else:\n s += c\n\nif cnt % 2 == 0:\n print(s)\nelse:\n print(s[::-1])\n","fail":"s = input()\nq = int(input())\nleft = \"\"\nright = \"\"\n\n\ndef s_add(r, f):\n if r % 2 == 0:\n if f == 1:\n return True\n else:\n return False\n else:\n if f == 1:\n return False\n else:\n return True\n\n\ncnt = 0\nfor _ in range(q):\n query = input()\n if query == \"1\":\n cnt += 1\n else:\n z, f, c = query.split()\n if s_add(cnt, int(f)):\n left += c\n else:\n right += c\n\nif cnt % 2 == 0:\n print(left[::-1] + s + right)\nelse:\n print(right[::-1] + s[::-1] + left)\n","change":"replace","i1":2,"i2":33,"j1":2,"j2":35,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02756","language":"Python","original_status":"Time Limit Exceeded","pass":"from collections import deque\n\n\ndef main():\n S = list(input())\n D = deque(S)\n Q = int(input())\n T = [tuple(map(str, input().split())) for _ in range(Q)]\n\n for t in T:\n if t[0] == \"1\":\n D.reverse()\n else:\n if t[1] == \"1\":\n D.appendleft(t[2])\n else:\n D.append(t[2])\n\n print(\"\".join(D))\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"from collections import deque\n\n\ndef main():\n S = list(input())\n D = deque(S)\n Q = int(input())\n T = [tuple(map(str, input().split())) for _ in range(Q)]\n r = False\n\n for t in T:\n if t[0] == \"1\" and r == False:\n r = True\n elif t[0] == \"1\" and r == True:\n r = False\n else:\n if t[1] == \"1\" and r == False:\n D.appendleft(t[2])\n elif t[1] == \"1\" and r == True:\n D.append(t[2])\n elif t[1] == \"2\" and r == False:\n D.append(t[2])\n elif t[1] == \"2\" and r == True:\n D.appendleft(t[2])\n\n if r == False:\n print(\"\".join(D))\n else:\n D.reverse()\n print(\"\".join(D))\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":8,"i2":19,"j1":8,"j2":30,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02756","language":"Python","original_status":"Time Limit Exceeded","pass":"S = str(input())\nQ = int(input())\n\ntopFlg = True\n\nfor _ in range(Q):\n query = list(map(str, input().split()))\n if query[0] == \"1\":\n topFlg = not (topFlg)\n else:\n if query[1] == \"1\":\n S = query[2] + S if topFlg else S + query[2]\n else:\n S = S + query[2] if topFlg else query[2] + S\n\nprint(S) if topFlg else print(S[::-1])\n","fail":"S = str(input())\nQ = int(input())\n\ntopFlg = True\n\nleftStr = \"\"\nrightStr = \"\"\n\nfor _ in range(Q):\n query = list(map(str, input().split()))\n if query[0] == \"1\":\n topFlg = not (topFlg)\n else:\n if query[1] == \"1\":\n if topFlg:\n leftStr = query[2] + leftStr\n else:\n rightStr += query[2]\n else:\n if topFlg:\n rightStr += query[2]\n else:\n leftStr = query[2] + leftStr\n\nprint(leftStr + S + rightStr if topFlg else rightStr[::-1] + S[::-1] + leftStr[::-1])\n","change":"replace","i1":4,"i2":16,"j1":4,"j2":25,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02756","language":"Python","original_status":"Runtime Error","pass":"from collections import deque\n\nS = deque(input())\nQ = int(input())\nQueries = [input().split() for _ in range(Q)]\n\nneed_reverse = False\n\nfor q in Queries:\n if q[0] == \"1\":\n need_reverse = not need_reverse\n else:\n if q[1] == \"1\":\n if not need_reverse:\n S.appendleft(q[2])\n else:\n S.append(q[2])\n else:\n if not need_reverse:\n S.append(q[2])\n else:\n S.appendleft(q[2])\n\nprint(S if not need_reverse else S[::-1])\n","fail":"from collections import deque\n\nS = deque(input())\nQ = int(input())\nQueries = [input().split() for _ in range(Q)]\n\nneed_reverse = False\n\nfor q in Queries:\n if q[0] == \"1\":\n need_reverse = not need_reverse\n else:\n if q[1] == \"1\":\n if not need_reverse:\n S.appendleft(q[2])\n else:\n S.append(q[2])\n else:\n if not need_reverse:\n S.append(q[2])\n else:\n S.appendleft(q[2])\n\nS = \"\".join(S)\nprint(S if not need_reverse else S[::-1])\n","change":"insert","i1":23,"i2":23,"j1":23,"j2":24,"error":"WA","stderr":null,"stdout":"deque(['c', 'p', 'a'])\n"} {"problem_id":"p02756","language":"Python","original_status":"Time Limit Exceeded","pass":"# D - String Formation\n\nS = input()\nQ = int(input())\nrev = False\n\nfor _ in range(Q):\n T = [t for t in input().split()]\n t = int(T[0])\n if t == 1:\n rev = not rev\n if t == 2:\n f, c = int(T[1]), T[2]\n if f == 1:\n if rev:\n S = S + c\n else:\n S = c + S\n if f == 2:\n if rev:\n S = c + S\n else:\n S = S + c\n\nprint(S if not rev else S[::-1])\n","fail":"# D - String Formation\n\nfrom collections import deque\n\nS = deque([s for s in input()])\nQ = int(input())\nrev = False\n\nfor _ in range(Q):\n T = [t for t in input().split()]\n t = int(T[0])\n if t == 1:\n rev = not rev\n if t == 2:\n f, c = int(T[1]), T[2]\n if f == 1:\n if rev:\n S.append(c)\n else:\n S.appendleft(c)\n if f == 2:\n if rev:\n S.appendleft(c)\n else:\n S.append(c)\n\nS = \"\".join(list(S))\nprint(S if not rev else S[::-1])\n","change":"replace","i1":2,"i2":24,"j1":2,"j2":27,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02756","language":"Python","original_status":"Time Limit Exceeded","pass":"s = list(input())\nq = int(input())\nrev = False\n\nfor _ in range(q):\n query = input().split()\n t = query[0]\n if t == \"1\":\n rev = not rev\n continue\n f = query[1]\n c = query[2]\n if not rev and f == \"2\" or rev and f == \"1\":\n s.append(c)\n else:\n s.insert(0, c)\nif rev:\n s = reversed(s)\nprint(\"\".join(s))\n","fail":"from collections import deque\n\ns = input()\nq = int(input())\n\ndeq = deque(s)\nrev = False\n\nfor _ in range(q):\n query = input().split()\n t = query[0]\n if t == \"1\":\n rev = not rev\n continue\n f = query[1]\n c = query[2]\n if not rev and f == \"2\" or rev and f == \"1\":\n deq.append(c)\n else:\n deq.appendleft(c)\nif rev:\n deq = reversed(deq)\nprint(\"\".join(deq))\n","change":"replace","i1":0,"i2":19,"j1":0,"j2":23,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02756","language":"Python","original_status":"Time Limit Exceeded","pass":"s = input()\nq = int(input())\nflag = 0\ncnt = 0\n\nfor i in range(q):\n t = input()\n if len(t) == 1:\n cnt += 1\n if flag == 0:\n flag = 1\n elif flag == 1:\n flag = 0\n else:\n _, a, b = (str(i) for i in t.split())\n if a == \"1\":\n if flag == 0:\n s = b + s\n elif flag == 1:\n s = s + b\n elif a == \"2\":\n if flag == 0:\n s = s + b\n elif flag == 1:\n s = b + s\n\nif cnt % 2 == 0:\n print(s)\nelse:\n print(s[::-1])\n","fail":"def main():\n s = input()\n q = int(input())\n flag = 0\n cnt = 0\n front = []\n back = []\n\n for i in range(q):\n t = input()\n if len(t) == 1:\n cnt += 1\n if flag == 0:\n flag = 1\n elif flag == 1:\n flag = 0\n else:\n _, a, b = (str(i) for i in t.split())\n if a == \"1\":\n if flag == 0:\n front.append(b)\n elif flag == 1:\n back.append(b)\n elif a == \"2\":\n if flag == 0:\n back.append(b)\n elif flag == 1:\n front.append(b)\n\n if cnt % 2 == 0:\n front = front[::-1]\n s = \"\".join(front) + s + \"\".join(back)\n else:\n back = back[::-1]\n s = \"\".join(back) + s[::-1] + \"\".join(front)\n\n print(s)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":0,"i2":30,"j1":0,"j2":41,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02756","language":"Python","original_status":"Runtime Error","pass":"from collections import deque\n\ns = deque(input())\nlen_queries = int(input())\nqueries = [input().split() for _ in range(len_queries)]\n\nis_forward = True\nfor query in queries:\n if \"1\" == query[0]:\n is_forward = not is_forward\n else:\n if is_forward:\n insert_index = 0 if \"1\" == query[1] else len(s)\n s.insert(insert_index, query[2])\n else:\n insert_index = len(s) if \"1\" == query[1] else 0\n s.insert(insert_index, query[2])\nif not is_forward:\n s.reverse()\nprint(\"\".join(s))\n","fail":"from collections import deque\n\ns = deque(input())\nlen_queries = int(input())\nqueries = [input().split() for _ in range(len_queries)]\n\nis_forward = True\nfor query in queries:\n if \"1\" == query[0]:\n is_forward = not is_forward\n else:\n if is_forward:\n if \"1\" == query[1]:\n s.appendleft(query[2])\n else:\n s.append(query[2])\n else:\n if \"1\" == query[1]:\n s.append(query[2])\n else:\n s.appendleft(query[2])\nif not is_forward:\n s.reverse()\nprint(\"\".join(s))\n","change":"replace","i1":12,"i2":17,"j1":12,"j2":21,"error":"0","stderr":null,"stdout":"cpa\n"} {"problem_id":"p02756","language":"Python","original_status":"Time Limit Exceeded","pass":"s = input()\nQ = int(input())\nflag = True # flag\u304cTrue\u306e\u3068\u304d\u3001\u5076\u6570\u56de\u6570\u306e\u53cd\u8ee2\u304c\u884c\u308f\u308c\u3066\u3044\u308b\ncnt = 0\nquery = [list(map(str, input().split())) for _ in range(Q)]\nfor i in range(Q):\n a = query[i]\n # tmp.append(query)\n if len(a) == 1: # 1\u306equery\u306e\u3068\u304d\n cnt += 1\n if flag:\n flag = False\n else:\n flag = True\n else:\n f, c = a[1], a[2]\n if f == \"1\": # \u5148\u982d\u306b\u8ffd\u52a0\u3059\u308b\u3082\u306e\n if flag:\n s = c + s # \u5076\u6570\u56de\u306e\u53cd\u8ee2\u306a\u3089\u7d20\u76f4\u306b\u5148\u982d\u306b\u8ffd\u52a0\u3059\u308b\n else:\n s += c # \u5947\u6570\u4f1a\u306e\u53cd\u8ee2\u306a\u3089\u5f8c\u308d\u306b\u8ffd\u52a0\u3059\u308b\n else: # \u672b\u5c3e\u306b\u8ffd\u52a0\u3059\u308b\n if flag:\n s += c\n else:\n s = c + s\n\nif cnt % 2 == 1 and cnt != 0:\n s = s[::-1]\nprint(s)\n","fail":"s = input()\nQ = int(input())\nflag = True # flag\u304cTrue\u306e\u3068\u304d\u3001\u5076\u6570\u56de\u6570\u306e\u53cd\u8ee2\u304c\u884c\u308f\u308c\u3066\u3044\u308b\ncnt = 0\nquery = [list(map(str, input().split())) for _ in range(Q)]\nbefore = [] # \u5148\u982d\u306b\u8ffd\u52a0\u3059\u308b\u6642\nafter = [] # \u672b\u5c3e\u306b\u8ffd\u52a0\u3059\u308b\u6642\nfor i in range(Q):\n a = query[i]\n if len(a) == 1: # 1\u306equery\u306e\u3068\u304d\n cnt += 1\n if flag:\n flag = False\n else:\n flag = True\n else:\n f, c = a[1], a[2]\n if f == \"1\": # \u5148\u982d\u306b\u8ffd\u52a0\u3059\u308b\u3082\u306e\n if flag:\n # s = c + s # \u5076\u6570\u56de\u306e\u53cd\u8ee2\u306a\u3089\u7d20\u76f4\u306b\u5148\u982d\u306b\u8ffd\u52a0\u3059\u308b\n before.append(c)\n else:\n # s += c # \u5947\u6570\u4f1a\u306e\u53cd\u8ee2\u306a\u3089\u5f8c\u308d\u306b\u8ffd\u52a0\u3059\u308b\n after.append(c)\n else: # \u672b\u5c3e\u306b\u8ffd\u52a0\u3059\u308b\n if flag:\n # s += c # \u672b\u5c3e\u306b\u8ffd\u52a0\n after.append(c)\n else:\n # s = c + s # \u5148\u982d\u306b\u8ffd\u52a0\n before.append(c)\nbefore.reverse()\n# print(before)\n# print(s)\n# print(after)\ns = \"\".join(before) + s + \"\".join(after)\nif cnt % 2 == 1 and cnt != 0:\n s = s[::-1]\nprint(s)\n","change":"replace","i1":5,"i2":27,"j1":5,"j2":36,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02756","language":"Python","original_status":"Time Limit Exceeded","pass":"s = input()\nq = int(input())\nreverseFlag = False\n\n\ndef getQuery():\n yield input().split()\n\n\nfor _ in range(q):\n for query in getQuery():\n if query[0] == \"1\":\n reverseFlag = not reverseFlag\n else:\n if query[1] == \"1\":\n s = (s + query[2]) if reverseFlag else (query[2] + s)\n else:\n s = (query[2] + s) if reverseFlag else (s + query[2])\n\nif reverseFlag:\n s = s[::-1]\n\nprint(s)\n","fail":"from collections import deque\n\ns = input()\nq = int(input())\nd = deque(s)\nreverseFlag = False\n\n\ndef getQuery():\n yield input().split()\n\n\nfor _ in range(q):\n for query in getQuery():\n if query[0] == \"1\":\n reverseFlag = not reverseFlag\n else:\n if query[1] == \"1\":\n if reverseFlag:\n d.append(query[2])\n else:\n d.appendleft(query[2])\n else:\n if reverseFlag:\n d.appendleft(query[2])\n else:\n d.append(query[2])\n\nans = \"\".join(d)\nif reverseFlag:\n ans = ans[::-1]\n\nprint(ans)\n","change":"replace","i1":0,"i2":23,"j1":0,"j2":33,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02756","language":"Python","original_status":"Time Limit Exceeded","pass":"from collections import deque\n\ns = deque(list(input()))\nn = int(input())\nq = [list(input().split()) for _ in range(n)]\nfor tfc in q:\n if tfc[0] == \"1\":\n s.reverse()\n else:\n if tfc[1] == \"1\":\n s.appendleft(tfc[2])\n else:\n s.append(tfc[2])\n\nprint(\"\".join(s))\n","fail":"from collections import deque\n\ns = deque(list(input()))\nn = int(input())\nq = [list(input().split()) for _ in range(n)]\nrev = False\n\nfor tfc in q:\n if tfc[0] == \"1\" and rev is False:\n rev = True\n elif tfc[0] == \"1\" and rev is True:\n rev = False\n elif rev is False:\n if tfc[1] == \"1\":\n s.appendleft(tfc[2])\n else:\n s.append(tfc[2])\n elif rev is True:\n if tfc[1] == \"1\":\n s.append(tfc[2])\n else:\n s.appendleft(tfc[2])\n\nif rev:\n s.reverse()\nprint(\"\".join(s))\n","change":"replace","i1":5,"i2":14,"j1":5,"j2":25,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02756","language":"Python","original_status":"Time Limit Exceeded","pass":"S = input()\nQ = int(input())\nreverseCount = 0\nfor _ in range(Q):\n query = input()\n if len(query) == 1:\n reverseCount += 1\n else:\n _, F, C = query.split(\" \")\n if (int(F) + reverseCount) % 2 == 1:\n S = C + S\n else:\n S = S + C\nif reverseCount % 2 == 0:\n print(S)\nelse:\n print(S[::-1])\n","fail":"S = input()\nQ = int(input())\nreverseCount = 0\npre = \"\"\npro = \"\"\nfor _ in range(Q):\n query = input()\n if len(query) == 1:\n reverseCount += 1\n else:\n _, F, C = query.split(\" \")\n if (int(F) + reverseCount) % 2 == 1:\n pre = C + pre\n else:\n pro = pro + C\nS = pre + S + pro\nif reverseCount % 2 == 0:\n print(S)\nelse:\n print(S[::-1])\n","change":"replace","i1":3,"i2":13,"j1":3,"j2":16,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02756","language":"Python","original_status":"Time Limit Exceeded","pass":"s = input()\nq = int(input())\nrev = False\nfor _ in range(q):\n query = input()\n if query == \"1\":\n rev = not rev\n else:\n _, f, c = query.split(\" \")\n if f == \"1\":\n if rev:\n s = s + c\n else:\n s = c + s\n else:\n if rev:\n s = c + s\n else:\n s = s + c\n\nif rev:\n s = s[::-1]\nprint(s)\n","fail":"s = input()\nq = int(input())\nrev = False\nL = \"\"\nR = \"\"\nfor _ in range(q):\n query = input()\n if query == \"1\":\n rev = not rev\n else:\n _, f, c = query.split(\" \")\n if f == \"1\":\n if rev:\n R = R + c\n else:\n L = c + L\n else:\n if rev:\n L = c + L\n else:\n R = R + c\n\nif rev:\n s = s[::-1]\n L = L[::-1]\n R = R[::-1]\n print(R + s + L)\nelse:\n print(L + s + R)\n","change":"replace","i1":3,"i2":23,"j1":3,"j2":29,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02756","language":"Python","original_status":"Time Limit Exceeded","pass":"import collections\n\nS = input()\nQ = int(input())\n\nd = collections.deque(S)\n\nfor _ in range(Q):\n Qi = input()\n if Qi == \"1\":\n d.reverse()\n else:\n T, F, C = Qi.split()\n if F == \"1\":\n d.appendleft(C)\n else:\n d.append(C)\n\nprint(\"\".join(d))\n","fail":"import collections\n\n\nclass Formatter:\n def __init__(self, s):\n self._d = collections.deque(s)\n self._d_reverse = collections.deque(reversed(s))\n\n def reverse(self):\n self._d, self._d_reverse = self._d_reverse, self._d\n\n def append(self, s):\n self._d.append(s)\n self._d_reverse.appendleft(s)\n\n def appendleft(self, s):\n self._d.appendleft(s)\n self._d_reverse.append(s)\n\n def __iter__(self):\n return iter(self._d)\n\n\nS = input()\nQ = int(input())\n\nd = Formatter(S)\n\nfor _ in range(Q):\n Qi = input()\n if Qi == \"1\":\n d.reverse()\n else:\n T, F, C = Qi.split()\n if F == \"1\":\n d.appendleft(C)\n else:\n d.append(C)\n\nprint(\"\".join(d))\n","change":"replace","i1":1,"i2":6,"j1":1,"j2":27,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02756","language":"Python","original_status":"Time Limit Exceeded","pass":"s = str(input())\nn = int(input())\n\nfor _ in range(n):\n q = input()\n\n # \u53cd\u8ee2\u306e\u5834\u5408\n if q[0] == \"1\":\n s = s[::-1]\n continue\n\n # q = q.split()\n\n if q[2] == \"1\":\n s = q[4] + s\n\n if q[2] == \"2\":\n s = s + q[4]\n\nprint(s)\n","fail":"s = str(input())\nn = int(input())\n\nstat = 0\nfront = \"\"\nback = \"\"\n\nfor _ in range(n):\n q = input()\n\n # \u53cd\u8ee2\u306e\u5834\u5408\n if q[0] == \"1\":\n stat = (stat + 1) % 2\n continue\n\n judge = int(q[2])\n if stat == 1:\n if judge == 1:\n judge = 2\n elif judge == 2:\n judge = 1\n\n if judge == 1:\n front = q[4] + front\n\n if judge == 2:\n back = back + q[4]\n\ns = front + s + back\nif stat == 1:\n s = s[::-1]\n\nprint(s)\n","change":"replace","i1":2,"i2":18,"j1":2,"j2":31,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02756","language":"Python","original_status":"Time Limit Exceeded","pass":"# \u5148\u982d\u3068\u672b\u5c3e\u3092\u4fdd\u3061\u3064\u3064\ns = input()\nq = int(input())\nx, y = [], []\nr = 0\nfor _ in range(q):\n query = input().split()\n if query[0] == \"1\":\n r += 1\n # \u3053\u308c\u9045\u3044\u304b\uff1f\n x, y = y[::-1], x[::-1]\n elif query[0] == \"2\":\n f, c = query[1], query[2]\n if f == \"1\":\n # x.append(c)\n x = x[::-1]\n x.append(c)\n x = x[::-1]\n elif f == \"2\":\n y.append(c)\nif r % 2 == 1:\n s = s[::-1]\nprint(\"\".join(x) + s + \"\".join(y))\n","fail":"# \u5148\u982d\u3068\u672b\u5c3e\u3092\u4fdd\u3061\u3064\u3064\nfrom collections import deque\n\ns = input()\nq = int(input())\nx, y = deque(), deque()\nr = 0\nfor _ in range(q):\n query = input().split()\n if query[0] == \"1\":\n r += 1\n x, y = y, x\n elif query[0] == \"2\":\n f, c = query[1], query[2]\n if f == \"1\":\n if r % 2 == 0:\n x.appendleft(c)\n else:\n x.append(c)\n elif f == \"2\":\n if r % 2 == 1:\n y.appendleft(c)\n else:\n y.append(c)\n\nif r % 2 == 1:\n s = s[::-1]\n x = reversed(x)\n y = reversed(y)\nprint(\"\".join(x) + s + \"\".join(y))\n","change":"replace","i1":1,"i2":22,"j1":1,"j2":29,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02756","language":"Python","original_status":"Time Limit Exceeded","pass":"s = input()\nnum_query = int(input())\n\nfor _ in range(0, num_query):\n query = input()\n if query[0] == \"1\":\n s = s[::-1]\n else:\n _, pos, character = query.split()\n if pos == \"1\":\n s = character + s\n else:\n s = s + character\nprint(s)\n","fail":"s = input()\nnum_query = int(input())\n\nformer = \"\"\nlatter = \"\"\nis_rev = False\n\nfor _ in range(0, num_query):\n query = input()\n if query[0] == \"1\":\n is_rev = not is_rev\n else:\n pos = query[2]\n character = query[4]\n if pos == \"1\":\n if is_rev:\n latter += character\n else:\n former = character + former\n else:\n if is_rev:\n former = character + former\n else:\n latter += character\n\nif is_rev:\n ans = latter[::-1] + s[::-1] + former[::-1]\nelse:\n ans = former + s + latter\nprint(ans)\n","change":"replace","i1":2,"i2":14,"j1":2,"j2":30,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02756","language":"Python","original_status":"Time Limit Exceeded","pass":"# coding: utf-8\n\nS = input()\nQ = int(input())\n\n\nrev = False\nfor _ in range(Q):\n line = input()\n\n if line[0] == \"1\":\n rev = not rev\n\n else:\n if line[2] == \"1\":\n if rev:\n S = \"\".join([S, line[4]])\n else:\n S = \"\".join([line[4], S])\n else:\n if rev:\n S = \"\".join([line[4], S])\n else:\n S = \"\".join([S, line[4]])\n\nif rev:\n print(S[::-1])\nelse:\n print(S)\n","fail":"# coding: utf-8\n\nS = input()\nQ = int(input())\n\n\nheads = {}\ntails = {}\nh = 0\nt = 0\nrev = False\nfor _ in range(Q):\n line = input()\n\n if line[0] == \"1\":\n rev = not rev\n\n else:\n if line[2] == \"1\":\n if rev:\n # S = \"\".join([S, line[4]])\n tails[t] = line[4]\n t += 1\n else:\n # S = \"\".join([line[4], S])\n heads[h] = line[4]\n h += 1\n else:\n if rev:\n # S = \"\".join([line[4], S])\n heads[h] = line[4]\n h += 1\n else:\n # S = \"\".join([S, line[4]])\n tails[t] = line[4]\n t += 1\n\nhead = [None] * h\ntail = [None] * t\n\nfor i in range(h):\n head[i] = heads[i]\nhead = head[::-1]\n\nfor i in range(t):\n tail[i] = tails[i]\n\nhead_joint = \"\".join(head)\ntail_joint = \"\".join(tail)\njoint = \"\".join([head_joint, S, tail_joint])\n\nif rev:\n print(joint[::-1])\nelse:\n print(joint)\n","change":"replace","i1":6,"i2":29,"j1":6,"j2":55,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02756","language":"Python","original_status":"Time Limit Exceeded","pass":"s = input()\nq = int(input())\nstatus = 1\nfor i in range(q):\n query = [i for i in input().split()]\n if query[0] == \"1\":\n status *= -1\n else:\n if (query[1] == \"1\" and status == 1) or (query[1] == \"2\" and status == -1):\n s = query[2] + s\n else:\n s = s + query[2]\n\nprint(s if status == 1 else s[::-1])\n","fail":"s = input()\nq = int(input())\nstatus = 1\ntop = []\nbottom = []\nfor i in range(q):\n query = [i for i in input().split()]\n if query[0] == \"1\":\n status *= -1\n else:\n if (query[1] == \"1\" and status == 1) or (query[1] == \"2\" and status == -1):\n top.append(query[2])\n else:\n bottom.append(query[2])\n\ntmp = \"\".join(top[::-1]) + s + \"\".join(bottom)\nprint(tmp if status == 1 else tmp[::-1])\n","change":"replace","i1":3,"i2":14,"j1":3,"j2":17,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02756","language":"Python","original_status":"Time Limit Exceeded","pass":"S = input()\nQ = int(input())\nrev = 1\nfor _ in range(Q):\n query = input()\n if len(query) == 1:\n rev *= -1\n else:\n T, F, C = query.split()\n if rev == 1:\n if F == \"1\":\n S = C + S\n else:\n S = S + C\n else:\n if F == \"1\":\n S = S + C\n else:\n S = C + S\n\nif rev == -1:\n S = S[::-1]\n\nprint(S)\n","fail":"from collections import deque\n\nS = list(input())\nQ = int(input())\n\nS = deque(S)\nrev = 1\nfor _ in range(Q):\n query = input()\n if len(query) == 1:\n rev *= -1\n else:\n T, F, C = query.split()\n if rev == 1:\n if F == \"1\":\n S.appendleft(C)\n else:\n S.append(C)\n else:\n if F == \"1\":\n S.append(C)\n else:\n S.appendleft(C)\n\nif rev == -1:\n S = reversed(S)\n\nprint(\"\".join(S))\n","change":"replace","i1":0,"i2":24,"j1":0,"j2":28,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02756","language":"Python","original_status":"Time Limit Exceeded","pass":"s = input()\nN = int(input())\nQ = [input().split() for _ in range(N)]\n\nfor q in Q:\n if int(q[0]) == 1:\n s = s[::-1]\n elif int(q[1]) == 1:\n s = q[2] + s\n else:\n s = s + q[2]\n\nprint(s)\n","fail":"s = input()\nN = int(input())\nQ = [input().split() for _ in range(N)]\n\nhead = \"\"\ntail = \"\"\nreverse = 0\n\nfor q in Q:\n if int(q[0]) == 1:\n reverse = 1 - reverse\n elif int(q[1]) == 1:\n if reverse:\n tail += q[2]\n else:\n head += q[2]\n else:\n if reverse:\n head += q[2]\n else:\n tail += q[2]\n\nif reverse:\n print(tail[::-1] + s[::-1] + head)\nelse:\n print(head[::-1] + s + tail)\n","change":"replace","i1":4,"i2":13,"j1":4,"j2":26,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02756","language":"Python","original_status":"Time Limit Exceeded","pass":"s = input()\nn = int(input())\nQ = [list(map(str, input().split())) for i in range(n)]\n\nfor i in range(n):\n op = Q[i]\n if len(op) == 1:\n s = s[::-1]\n elif op[1] == \"1\":\n s = op[2] + s\n else:\n s = s + op[2]\nprint(s)\n","fail":"import collections\n\ns = collections.deque(list(input()))\nq = int(input())\nrev = 0 # \u53cd\u8ee2\u3059\u308b\u306a\u30891\u305d\u3046\u3067\u306a\u3044\u306a\u30890\nfor i in range(q):\n tfc = list(input().split())\n if tfc[0] == \"1\":\n rev = abs(rev - 1) # rev\u304c\u5165\u529b\u3055\u308c\u308b\u305f\u3073\u306b1\u304b0\u306b\u5909\u66f4\u3055\u308c\u308b\n else:\n t, f, c = tfc\n if rev:\n if f == \"1\":\n s.append(c)\n else:\n s.appendleft(c)\n else:\n if f == \"1\":\n s.appendleft(c)\n else:\n s.append(c)\nif rev: # \u53cd\u8ee2\u3055\u308c\u308b\u5834\u5408\u9006\u5411\u304d\u306b\u51fa\u529b\u3055\u308c\u306a\u3051\u308c\u3070\u3044\u3051\u306a\u3044\n t = []\n for i in range(len(s)):\n t.append(s.pop())\n print(\"\".join(t))\nelse:\n print(\"\".join(s))\n","change":"replace","i1":0,"i2":13,"j1":0,"j2":28,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02756","language":"Python","original_status":"Time Limit Exceeded","pass":"s = input()\nq = int(input())\nr = False\nfor _ in range(q):\n xs = input().split()\n if xs[0] == \"1\":\n r = not r\n else:\n if (not r and xs[1] == \"1\") or (r and xs[1] == \"2\"):\n s = \"\".join([xs[2], s])\n else:\n s = \"\".join([s, xs[2]])\nprint(s[::-1] if r else s)\n","fail":"from collections import deque\n\ns = input()\nq = int(input())\n\nd = deque()\nfor v in s:\n d.append(v)\nr = False\nfor _ in range(q):\n xs = input().split()\n if xs[0] == \"1\":\n r = not r\n else:\n if (not r and xs[1] == \"1\") or (r and xs[1] == \"2\"):\n d.appendleft(xs[2])\n else:\n d.append(xs[2])\ns = \"\".join(d)\nprint(s[::-1] if r else s)\n","change":"replace","i1":0,"i2":12,"j1":0,"j2":19,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02756","language":"Python","original_status":"Time Limit Exceeded","pass":"S = list(input())\nQ = int(input())\n\nflag = 0\nfor _ in range(Q):\n q = input()\n if q == \"1\":\n flag += 1\n else:\n _, t, c = q.split()\n if flag % 2 == 0:\n if t == \"1\":\n S.insert(0, c)\n else:\n S.append(c)\n else:\n if t == \"2\":\n S.insert(0, c)\n else:\n S.append(c)\n\nif flag % 2 == 1:\n S.reverse()\nprint(\"\".join(S))\n","fail":"from collections import deque\n\nS = list(input())\nd = deque(S)\nQ = int(input())\n\nflag = 0\nfor _ in range(Q):\n q = input()\n if q == \"1\":\n flag += 1\n else:\n _, t, c = q.split()\n if flag % 2 == 0:\n if t == \"1\":\n d.appendleft(c)\n else:\n d.append(c)\n else:\n if t == \"2\":\n d.appendleft(c)\n else:\n d.append(c)\n\nif flag % 2 == 1:\n d.reverse()\nprint(\"\".join(list(d)))\n","change":"replace","i1":0,"i2":24,"j1":0,"j2":27,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02756","language":"Python","original_status":"Time Limit Exceeded","pass":"S = list(input())\nQ = int(input())\ninversion_flag = False\nfor _ in range(Q):\n query_list = list(input().split())\n if query_list[0] == \"1\":\n inversion_flag = not inversion_flag\n continue\n C = query_list[2]\n if query_list[1] == \"2\":\n if inversion_flag:\n S.insert(0, C)\n else:\n S.append(C)\n else:\n if inversion_flag:\n S.append(C)\n else:\n S.insert(0, C)\n\nif inversion_flag:\n print(*S[::-1], sep=\"\")\nelse:\n print(*S, sep=\"\")\n","fail":"from collections import deque\n\nS = deque(input())\nQ = int(input())\ninversion_flag = False\nfor _ in range(Q):\n query_list = list(input().split())\n if query_list[0] == \"1\":\n inversion_flag = not inversion_flag\n continue\n C = query_list[2]\n if query_list[1] == \"2\":\n if inversion_flag:\n S.appendleft(C)\n else:\n S.append(C)\n else:\n if inversion_flag:\n S.append(C)\n else:\n S.appendleft(C)\n\nS = list(S)\nif inversion_flag:\n print(*S[::-1], sep=\"\")\nelse:\n print(*S, sep=\"\")\n","change":"replace","i1":0,"i2":20,"j1":0,"j2":23,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02756","language":"Python","original_status":"Time Limit Exceeded","pass":"import sys\n\ninput = sys.stdin.readline\n\n\ndef main():\n S = input().rstrip()\n Q = int(input())\n query = [None] * Q\n for i in range(Q):\n query[i] = input().split()\n\n ans = S\n is_reversed = False\n for q in query:\n if int(q[0]) == 1:\n is_reversed = not is_reversed\n else:\n F, C = int(q[1]), q[2]\n if F == 1:\n if is_reversed:\n ans = \"\".join([ans, C])\n else:\n ans = \"\".join([C, ans])\n else:\n if is_reversed:\n ans = \"\".join([C, ans])\n else:\n ans = \"\".join([ans, C])\n\n if is_reversed:\n ans = ans[::-1]\n\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"import sys\n\ninput = sys.stdin.readline\n\n\ndef main():\n S = input().rstrip()\n Q = int(input())\n query = [None] * Q\n for i in range(Q):\n query[i] = input().split()\n\n prefix = []\n surfix = []\n is_reversed = False\n for q in query:\n if q[0] == \"1\":\n is_reversed = not is_reversed\n else:\n F, C = q[1], q[2]\n if F == \"1\":\n if is_reversed:\n surfix.append(C)\n else:\n prefix.append(C)\n else:\n if is_reversed:\n prefix.append(C)\n else:\n surfix.append(C)\n\n ans = \"\".join([\"\".join(prefix)[::-1], S, \"\".join(surfix)])\n if is_reversed:\n ans = ans[::-1]\n\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":12,"i2":30,"j1":12,"j2":32,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02756","language":"Python","original_status":"Time Limit Exceeded","pass":"from collections import deque\n\n\nS = deque(input())\nQ = int(input())\n\nfor _ in range(Q):\n Query = input().split()\n if Query[0] == \"1\":\n S = deque(reversed(S))\n else:\n F, C = Query[1], Query[2]\n if F == \"1\":\n S.appendleft(C)\n else:\n S.append(C)\n\nprint(\"\".join(S))\n","fail":"from collections import deque\n\n\nS = deque(input())\nQ = int(input())\nreverse_count = 0\n\nfor _ in range(Q):\n Query = input().split()\n if Query[0] == \"1\":\n reverse_count += 1\n else:\n F, C = Query[1], Query[2]\n if F == \"1\":\n if reverse_count % 2 == 0:\n S.appendleft(C)\n else:\n S.append(C)\n else:\n if reverse_count % 2 == 0:\n S.append(C)\n else:\n S.appendleft(C)\n\nif reverse_count % 2 == 1:\n S.reverse()\nprint(\"\".join(S))\n","change":"replace","i1":5,"i2":17,"j1":5,"j2":26,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02756","language":"Python","original_status":"Time Limit Exceeded","pass":"s = input()\nq = int(input())\n\nrev = 0\nfor _ in range(q):\n que = input()\n if que[0] == \"1\":\n rev ^= 1\n\n else:\n t, f, c = que.split()\n if rev:\n if f == \"1\":\n s = s + c\n else:\n s = c + s\n\n else:\n if f == \"1\":\n s = c + s\n else:\n s = s + c\n\nif rev:\n print(s[::-1])\nelse:\n print(s)\n","fail":"from collections import deque\n\ns = input()\nq = int(input())\n\ns = deque(s)\n\nrev = 0\nfor _ in range(q):\n que = input()\n if que[0] == \"1\":\n rev ^= 1\n\n else:\n t, f, c = que.split()\n if rev:\n if f == \"1\":\n s.append(c)\n else:\n s.appendleft(c)\n\n else:\n if f == \"1\":\n s.appendleft(c)\n else:\n s.append(c)\n\ns = list(s)\nif rev:\n print(*s[::-1], sep=\"\")\nelse:\n print(*s, sep=\"\")\n","change":"replace","i1":0,"i2":27,"j1":0,"j2":32,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02756","language":"Python","original_status":"Time Limit Exceeded","pass":"#!\/usr\/bin\/env python3\ns = input()\nq = int(input())\nli = [\"\", s]\ncur = 1\nfor _ in range(q):\n query = input().split()\n if query[0] == \"1\":\n cur ^= 1\n else:\n f, c = query[1:]\n if f == \"1\":\n li[cur ^ 1] += c\n else:\n li[cur] += c\nans = li[0][::-1] + li[1]\nif cur == 0:\n ans = ans[::-1]\nprint(ans)\n","fail":"#!\/usr\/bin\/env python3\nfrom collections import deque\n\ns = input()\nq = int(input())\ndeq = deque(s)\ncur = 1\nfor _ in range(q):\n query = input().split()\n if query[0] == \"1\":\n cur ^= 1\n else:\n f, c = query[1:]\n f = int(f) - 1\n if cur ^ f:\n deq.appendleft(c)\n else:\n deq.append(c)\nans = \"\"\nwhile len(deq) > 0:\n ans += deq.popleft() if cur else deq.pop()\nprint(ans)\n","change":"replace","i1":1,"i2":18,"j1":1,"j2":21,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02756","language":"Python","original_status":"Time Limit Exceeded","pass":"S = input()\nQ = int(input())\nquery = [list(input().split()) for _ in range(Q)]\nis_reverse = False\nfor q in query:\n if q[0] == \"1\":\n is_reverse = not is_reverse\n else:\n if is_reverse:\n if q[1] == \"2\":\n S = q[2] + S\n else:\n S += q[2]\n else:\n if q[1] == \"1\":\n S = q[2] + S\n else:\n S += q[2]\n\nif is_reverse:\n print(S[::-1])\nelse:\n print(S)\n","fail":"S = list(input())\nQ = int(input())\nquery = [list(input().split()) for _ in range(Q)]\nmae = []\nato = []\nis_reverse = False\nfor q in query:\n if q[0] == \"1\":\n is_reverse = not is_reverse\n else:\n if is_reverse:\n if q[1] == \"2\":\n mae.append(q[2])\n else:\n ato.append(q[2])\n else:\n if q[1] == \"1\":\n mae.append(q[2])\n else:\n ato.append(q[2])\nmae.reverse()\nmae.extend(S)\nmae.extend(ato)\nif is_reverse:\n mae.reverse()\n print(\"\".join(mae))\nelse:\n print(\"\".join(mae))\n","change":"replace","i1":0,"i2":23,"j1":0,"j2":28,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02756","language":"Python","original_status":"Time Limit Exceeded","pass":"def main():\n s = input()\n q = int(input())\n\n for _ in range(q):\n query = list(input())\n if query[0] == \"1\":\n s = s[::-1]\n elif query[0] == \"2\":\n if query[2] == \"1\":\n s = query[4] + s\n elif query[2] == \"2\":\n s = s + query[4]\n\n print(s)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"from collections import deque\n\n\ndef main():\n s = input()\n q = int(input())\n d = deque(s)\n is_reversed = False\n\n for _ in range(q):\n query = list(input().split())\n\n if query[0] == \"1\":\n if is_reversed:\n is_reversed = False\n else:\n is_reversed = True\n\n elif query[0] == \"2\":\n if query[1] == \"1\":\n if is_reversed:\n d.append(query[2])\n else:\n d.appendleft(query[2])\n elif query[1] == \"2\":\n if is_reversed:\n d.appendleft(query[2])\n else:\n d.append(query[2])\n\n if is_reversed:\n print(*(list(d)[::-1]), sep=\"\")\n else:\n print(*list(d), sep=\"\")\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":0,"i2":15,"j1":0,"j2":34,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02757","language":"Python","original_status":"Time Limit Exceeded","pass":"import copy\n\nn, p = list(map(int, input().split()))\ns = input()\n\n\nmemo = {}\nans = 0\nfor i in range(n):\n memo2 = {int(s[i]) % p: 1}\n for j in memo:\n if (j * 10 + int(s[i])) % p not in memo2:\n memo2[(j * 10 + int(s[i])) % p] = memo[j]\n else:\n memo2[(j * 10 + int(s[i])) % p] += memo[j]\n memo = copy.deepcopy(memo2)\n if 0 in memo:\n ans += memo[0]\nprint(ans)\n","fail":"n, p = map(int, input().split())\ns = input()\n\nans = 0\nif p == 2:\n for i, char in enumerate(s):\n if int(char) % 2 == 0:\n ans += i + 1\n print(ans)\n\nelif p == 5:\n for i, char in enumerate(s):\n if int(char) % 5 == 0:\n ans += i + 1\n print(ans)\n\nelse:\n a = [0] * (n + 1)\n for i in range(n):\n a[i + 1] = a[i] + int(s[n - i - 1]) * pow(10, i, p)\n a[i + 1] %= p\n memo = {}\n for i in range(n + 1):\n if a[i] not in memo:\n memo[a[i]] = 1\n else:\n memo[a[i]] += 1\n for i in memo:\n ans += memo[i] * (memo[i] - 1) \/\/ 2\n print(ans)\n","change":"replace","i1":0,"i2":19,"j1":0,"j2":30,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02757","language":"Python","original_status":"Time Limit Exceeded","pass":"n, p = map(int, input().split())\ns = list(input())\n\nans = 0\nif p == 2 or p == 5:\n for i in range(n):\n if int(s[i]) % p == 0:\n ans += i + 1\nelse:\n d = [0] * (n + 1)\n for i in range(n - 1, -1, -1):\n a = (int(s[i]) * 10 ** ((n - 1) - i)) % p\n d[i - 1] = (d[i] + a) % p\n cnt = [0] * p\n for i in range(n, -1, -1):\n ans += cnt[d[i]]\n cnt[d[i]] += 1\n\nprint(ans)\n","fail":"n, p = map(int, input().split())\n\ns = list(input())\n\nans = 0\nif p == 2 or p == 5:\n for i in range(n):\n if int(s[i]) % p == 0:\n ans += i + 1\nelse:\n d = [0] * (n + 1)\n ten = 1\n for i in range(n - 1, -1, -1):\n a = int(s[i]) * ten % p\n ten *= 10\n ten %= p\n d[i - 1] = (d[i] + a) % p\n cnt = [0] * p\n for i in range(n, -1, -1):\n ans += cnt[d[i]]\n cnt[d[i]] += 1\n\nprint(ans)\n","change":"replace","i1":1,"i2":12,"j1":1,"j2":16,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02757","language":"Python","original_status":"Runtime Error","pass":"N, P = map(int, input().split())\nnum = input().strip()\ndp = [0] * N\nans = 0\nlast = 0\nfor i in range(N):\n last = (10 * last + int(num[i])) % P\n if last == 0:\n ans += 1 + dp[last]\n dp[last] += 1\n else:\n ans += dp[last]\n dp[last] += 1\nprint(ans)\n","fail":"N, P = map(int, input().split())\nnum = input().strip()\nans = 0\nif P == 2:\n for idx, nu in enumerate(num):\n if nu in \"24680\":\n ans += idx + 1\nelif P == 5:\n for idx, nu in enumerate(num):\n if nu in \"50\":\n ans += idx + 1\nelse:\n nnum = [0] * N\n base = 1\n for i in range(N - 1, -1, -1):\n nnum[i] = (int(num[i]) * base) % P\n base = (base * 10) % P\n for i in range(1, N):\n nnum[i] = (nnum[i] + nnum[i - 1]) % P\n dp = [0] * P\n for i in range(N):\n if nnum[i] == 0:\n ans += 1 + dp[nnum[i]]\n else:\n ans += dp[nnum[i]]\n dp[nnum[i]] += 1\nprint(ans)\n","change":"replace","i1":2,"i2":13,"j1":2,"j2":26,"error":"0","stderr":null,"stdout":6.0} {"problem_id":"p02757","language":"Python","original_status":"Runtime Error","pass":"# li = [[0] * 4 for i in range(3)]\n\n# A = list.map(int, input().split())\n\nN, P = map(int, input().split())\n\nS = input()\n\n\nmemo = {}\n\n\ndef dfs(n):\n # print(n)\n if n in memo:\n return memo[n]\n\n i = n + 1\n while i <= N:\n temp_int = int(S[n:i])\n # print(temp_int)\n if temp_int % P == 0:\n memo[n] = 1 + dfs(i)\n return memo[n]\n\n i += 1\n return 0\n\n\nans = 0\nfor i in range(N):\n temp = dfs(i)\n ans += temp\n\nprint(ans)\n","fail":"N, P = map(int, input().split())\nS = input()\nnow = 0\nhyou = [0] * P\nhyou[0] = 1\ncnt = 1\nans = 0\n\nif P == 2 or P == 5:\n for i, t in enumerate(S[::-1]):\n temp = int(t)\n if temp % P == 0:\n\n ans += N - i\n print(ans)\n exit()\n\nfor i, t in enumerate(S[::-1]):\n now = (now + int(t) * pow(10, i, P)) % P\n ans += hyou[now]\n hyou[now] += 1\n\nprint(ans)\n","change":"replace","i1":0,"i2":33,"j1":0,"j2":21,"error":"0","stderr":null,"stdout":6.0} {"problem_id":"p02759","language":"Python","original_status":"Runtime Error","pass":"if int(input()) % 2 == 0:\n print(int(input()) \/\/ 2)\nelse:\n print(int(input()) \/\/ 2 + 1)\n","fail":"x = int(input())\nif x % 2 == 0:\n print(x \/\/ 2)\nelse:\n print(x \/\/ 2 + 1)\n","change":"replace","i1":0,"i2":4,"j1":0,"j2":5,"error":"EOFError: EOF when reading a line","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02759\/Python\/s333296086.py\", line 4, in \n print(int(input()) \/\/ 2 + 1)\nEOFError: EOF when reading a line\n","stdout":null} {"problem_id":"p02759","language":"Python","original_status":"Runtime Error","pass":"N, X = 6, 1\nARR = [1, 6, 1, 2, 0, 4]\n\nN, X = 3, 3\nARR = [2, 2, 2]\n\nN, X = 5, 9\nARR = [3, 1, 4, 1, 5]\n\nN, X = 2, 0\nARR = [5, 5]\n\nN, X = map(int, input().split())\n\nARR = list(map(int, input().split()))\n\n\ndef calculate(n, x, arr):\n result = 0\n for i in range(1, n):\n sSum = arr[i - 1] + arr[i]\n if sSum <= x:\n continue\n\n diff = sSum - x\n\n if diff <= arr[i]:\n arr[i] -= diff\n result += diff\n else:\n result += diff\n arr[i] = 0\n\n print(result)\n\n\ncalculate(N, X, ARR)\n","fail":"import math\n\nN = int(input())\n\nprint(math.ceil(N \/ 2))\n","change":"replace","i1":0,"i2":37,"j1":0,"j2":5,"error":"ValueError: not enough values to unpack (expected 2, got 1)","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02759\/Python\/s176257737.py\", line 13, in \n N, X = map(int, input().split())\nValueError: not enough values to unpack (expected 2, got 1)\n","stdout":null} {"problem_id":"p02759","language":"Python","original_status":"Runtime Error","pass":"n = input()\npaper = 0\nif n % 2 == 0:\n paper = n \/ 2\nelse:\n paper = n \/ 2 + 1\nprint(paper)\n","fail":"n = int(input())\nprint((n + 1) \/\/ 2)\n","change":"replace","i1":0,"i2":7,"j1":0,"j2":2,"error":"TypeError: not all arguments converted during string formatting","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02759\/Python\/s809156396.py\", line 3, in \n if n % 2 == 0:\nTypeError: not all arguments converted during string formatting\n","stdout":null} {"problem_id":"p02759","language":"Python","original_status":"Runtime Error","pass":"#!\/usr\/bin\/env python3\n\n\ndef main():\n N = map(int, open(0).read().split())\n print(-(-N \/\/ 2))\n\n\nmain()\n","fail":"#!\/usr\/bin\/env python3\n\n\ndef main():\n N = int(input())\n print(-(-N \/\/ 2))\n\n\nmain()\n","change":"replace","i1":4,"i2":5,"j1":4,"j2":5,"error":"TypeError: bad operand type for unary -: 'map'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02759\/Python\/s289619736.py\", line 9, in \n main()\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02759\/Python\/s289619736.py\", line 6, in main\n print(-(-N \/\/ 2))\nTypeError: bad operand type for unary -: 'map'\n","stdout":null} {"problem_id":"p02760","language":"Python","original_status":"Runtime Error","pass":"bingo = [input().split() for _ in range(3)]\n\nn = int(input())\n\nnums = [[] for _ in range(3)]\n\ncheck = list()\n\nfor i in range(3):\n for j in range(3):\n check[i].append(False)\n if bingo[i][j] in nums:\n check[i][j] = True\n\nANS = \"No\"\n\nfor i in range(3):\n if (check[i][0]) and (check[i][1]) and (check[i][2]):\n ANS = \"Yes\"\nfor i in range(3):\n if (check[0][i]) and (check[1][i]) and (check[2][i]):\n ANS = \"Yes\"\nif (check[0][0]) and (check[1][1]) and (check[2][2]):\n ANS = \"Yes\"\nif (check[0][2]) and (check[1][1]) and (check[2][0]):\n ANS = \"Yes\"\n\nprint(ANS)\n","fail":"bingo = [input().split() for _ in range(3)]\n\nn = int(input())\n\nnums = [input() for _ in range(n)]\n\ncheck = [[] for _ in range(3)]\n\nfor i in range(3):\n for j in range(3):\n if bingo[i][j] in nums:\n check[i].append(True)\n else:\n check[i].append(False)\n\nANS = \"No\"\n\nfor i in range(3):\n if (check[i][0]) and (check[i][1]) and (check[i][2]):\n ANS = \"Yes\"\nfor i in range(3):\n if (check[0][i]) and (check[1][i]) and (check[2][i]):\n ANS = \"Yes\"\nif (check[0][0]) and (check[1][1]) and (check[2][2]):\n ANS = \"Yes\"\nif (check[0][2]) and (check[1][1]) and (check[2][0]):\n ANS = \"Yes\"\n\nprint(ANS)\n","change":"replace","i1":4,"i2":13,"j1":4,"j2":14,"error":"IndexError: list index out of range","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02760\/Python\/s062828081.py\", line 11, in \n check[i].append(False)\nIndexError: list index out of range\n","stdout":null} {"problem_id":"p02761","language":"Python","original_status":"Runtime Error","pass":"N, M = map(int, input().split())\n\n\ndef answer():\n digs = [-1] * N\n for _ in range(M):\n s, c = map(int, input().split())\n s -= 1\n if s == 0 and c == 0:\n return -1\n if digs[s] not in {c, -1}:\n return -1\n digs[s] = c\n if digs[0] == -1:\n digs[0] = 1\n if digs[1] == -1:\n digs[1] = 0\n if digs[2] == -1:\n digs[2] = 0\n return \"\".join(map(str, digs))\n\n\nprint(answer())\n","fail":"N, M = map(int, input().split())\n\n\ndef answer():\n digs = [-1] * N\n for _ in range(M):\n s, c = map(int, input().split())\n s -= 1\n if digs[s] not in {c, -1}:\n return -1\n digs[s] = c\n if digs[0] == -1:\n digs[0] = int(N > 1)\n elif digs[0] == 0 and N > 1:\n return -1\n for i in range(1, N):\n if digs[i] == -1:\n digs[i] = 0\n return \"\".join(map(str, digs))\n\n\nprint(answer())\n","change":"replace","i1":8,"i2":19,"j1":8,"j2":18,"error":"0","stderr":null,"stdout":702.0} {"problem_id":"p02761","language":"Python","original_status":"Runtime Error","pass":"N, M = map(int, input().split())\nlst = [0] * N\nif M == 0 and N != 1:\n lst[0] = 1\nelse:\n dic = {}\n for _ in range(M):\n s, c = map(int, input().split())\n n = dic.get(s)\n if n is not None and n != c:\n print(-1)\n exit()\n dic[s] = c\n\nfor k, v in dic.items():\n lst[k - 1] = v\n\nif N != 1 and lst[0] == 0:\n print(-1)\n exit()\n\nif len(lst) != 0 and lst[0] == 0:\n lst[0] = 1\n\nprint(\"\".join(map(str, lst)))\n","fail":"N, M = map(int, input().split())\nif M == 0:\n if N == 1:\n print(0)\n else:\n print(\"1\" + \"0\" * (N - 1))\n exit()\n\ndic = {}\nfor _ in range(M):\n s, c = map(int, input().split())\n if s == 1 and c == 0 and N != 1:\n print(-1)\n exit()\n n = dic.get(s)\n if n is not None and n != c:\n print(-1)\n exit()\n dic[s] = c\n\nlst = [0] * N\nfor k, v in dic.items():\n lst[k - 1] = v\n\nif len(lst) != 1 and lst[0] == 0:\n lst[0] = 1\n\nprint(\"\".join(map(str, lst)))\n","change":"replace","i1":1,"i2":22,"j1":1,"j2":25,"error":"0","stderr":null,"stdout":702.0} {"problem_id":"p02761","language":"Python","original_status":"Runtime Error","pass":"n, m = map(int, input().split())\na = [list(map(int, input().split())) for _ in range(m)]\n\nfor x in range(1000):\n ok = True\n s = str(x)\n if len(s) != n:\n continue\n if not all([int(s[a[i][0] - 1]) == a[i][1] for i in range(m)]):\n continue\n print(x)\n exit(1)\n\nprint(-1)\n","fail":"n, m = map(int, input().split())\na = [list(map(int, input().split())) for _ in range(m)]\n\nfor x in range(1000):\n ok = True\n s = str(x)\n if len(s) != n:\n continue\n if not all([int(s[a[i][0] - 1]) == a[i][1] for i in range(m)]):\n continue\n print(x)\n exit(0)\n\nprint(-1)\n","change":"replace","i1":11,"i2":12,"j1":11,"j2":12,"error":"1","stderr":null,"stdout":702.0} {"problem_id":"p02761","language":"Python","original_status":"Runtime Error","pass":"N, M = map(int, input().split())\n\nS = [0] * M\nC = [0] * M\n\nfor i in range(M):\n S[i], C[i] = input().split()\n\nans = -1\nfor i in range(10 * (N - 1) + 1, 10 * N):\n for s, c in zip(S, C):\n if not str(i)[int(s) - 1] == c:\n break\n else:\n ans = i\n break\n if not ans == -1:\n break\n","fail":"N, M = map(int, input().split())\n\nK = [0, -1, -1, -1]\nans = -1\nfor i in range(M):\n s, c = map(int, input().split())\n if not N == 1 and s == 1 and c == 0:\n break\n if K[s] >= 0 and not K[s] == c:\n break\n K[s] = c\nelse:\n if K[1] == -1 and N >= 2:\n K[1] = 1\n if K[1] == -1 and N == 1:\n K[1] = 0\n if K[2] == -1:\n K[2] = 0\n if K[3] == -1:\n K[3] = 0\n\n ans = \"\".join(map(str, K[1 : N + 1]))\n\nprint(ans)\n","change":"replace","i1":2,"i2":18,"j1":2,"j2":24,"error":"WA","stderr":null,"stdout":null} {"problem_id":"p02761","language":"Python","original_status":"Runtime Error","pass":"N, M = map(int, input().split())\nsc = [tuple(map(int, input().split())) for _ in range(M)]\n\nfor i in range(1000):\n t = str(i)\n if len(t) != N:\n continue\n ok = True\n for s, c in sc:\n if t[int(s)] != int(c):\n ok = False\n break\n if ok:\n print(i)\n exit()\nprint(-1)\n","fail":"N, M = map(int, input().split())\nsc = [tuple(map(int, input().split())) for _ in range(M)]\n\nfor i in range(1000):\n t = str(i)\n if len(t) != N:\n continue\n ok = True\n for s, c in sc:\n if int(t[s - 1]) != c:\n ok = False\n break\n if ok:\n print(i)\n exit()\nprint(-1)\n","change":"replace","i1":9,"i2":10,"j1":9,"j2":10,"error":"WA","stderr":null,"stdout":-1.0} {"problem_id":"p02761","language":"Python","original_status":"Runtime Error","pass":"import sys\n\nn, m = list(map(int, input().split()))\nar = [list(map(int, input().split())) for _ in range(m)]\nans = [0 for _ in range(n)]\n\nfor a in ar:\n if a[0] == 1 and a[1] == 0:\n print(-1)\n sys.exit()\n if ans[a[0] - 1] != 0 and ans[a[0] - 1] != a[1]:\n print(-1)\n sys.exit()\n ans[a[0] - 1] = a[1]\n\nif ans[0] == 0:\n if ans[1] == 0:\n ans[1] = 1\n ans[0] = 1\n\nans = int(\"\".join(map(str, ans)))\nprint(ans)\n","fail":"import math\n\nn, m = map(int, input().split(\" \"))\n\nans = list([0 for _ in range(n)])\n\nerr = False\nfor i in range(m):\n s, c = map(int, input().split(\" \"))\n if s == 1 and c == 0:\n if n == 1:\n print(0)\n exit()\n err = True\n elif ans[s - 1] == 0:\n ans[s - 1] = c\n elif not ans[s - 1] == c:\n err = True\n\nif ans[0] == 0:\n ans[0] = 1\n\nif (n == 1 and ans[0] == 0) or (n == 1 and m == 0):\n print(0)\n exit()\n\nif err:\n print(-1)\n exit()\n\nprint(\"\".join(map(str, ans)))\n","change":"replace","i1":0,"i2":22,"j1":0,"j2":31,"error":"0","stderr":null,"stdout":702.0} {"problem_id":"p02761","language":"Python","original_status":"Runtime Error","pass":"def main():\n N, M = map(int, input().split())\n P = {tuple(map(int, input().split())) for _ in range(M)}\n P = sorted(P)\n ans = [0 for _ in range(N)]\n\n if N > 1 and (1, 0) in P:\n print(-1)\n return\n\n if N > 1 and P[0][0] != 1:\n ans[0] = 1\n\n for i in range(len(P) - 1):\n if P[i][0] == P[i + 1][0]:\n print(-1)\n return\n\n for p in P:\n ans[p[0] - 1] = p[1]\n\n print(\"\".join(map(str, ans)))\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"def main():\n N, M = map(int, input().split())\n P = {tuple(map(int, input().split())) for _ in range(M)}\n P = sorted(P)\n ans = [0 for _ in range(N)]\n\n if N == 1 and M == 0:\n print(0)\n return\n\n if N == 2 and M == 0:\n print(10)\n return\n\n if N == 3 and M == 0:\n print(100)\n return\n\n if N > 1 and (1, 0) in P:\n print(-1)\n return\n\n if N > 1 and P[0][0] != 1:\n ans[0] = 1\n\n for i in range(len(P) - 1):\n if P[i][0] == P[i + 1][0]:\n print(-1)\n return\n\n for p in P:\n ans[p[0] - 1] = p[1]\n\n print(\"\".join(map(str, ans)))\n\n\nif __name__ == \"__main__\":\n main()\n","change":"insert","i1":5,"i2":5,"j1":5,"j2":17,"error":"0","stderr":null,"stdout":702.0} {"problem_id":"p02762","language":"Python","original_status":"Time Limit Exceeded","pass":"from collections import deque, defaultdict\n\nN, M, K = map(int, input().split())\nrepn = [[] for _ in range(N + 1)]\nrepnNum = [0] * (N + 1)\nfor _ in range(M):\n a, b = map(int, input().split())\n repn[a].append(b)\n repn[b].append(a)\n repnNum[a] += 1\n repnNum[b] += 1\n\nblock = [[] for _ in range(N + 1)]\nfor _ in range(K):\n c, d = map(int, input().split())\n block[c].append(d)\n block[d].append(c)\n\n\ndef cand(i):\n visited = [0] * (N + 1)\n visited[i] = 1\n component = [i]\n num = 1\n\n q = deque([i])\n while q:\n u = q.popleft()\n for v in repn[u]:\n if visited[v] == 0:\n visited[v] = 1\n q.append(v)\n component.append(v)\n num += 1\n\n return component, num\n\n\ncomponents = defaultdict(set)\ncomp_num = defaultdict(int)\nans = []\nfor i in range(1, N + 1):\n if i not in components:\n l, num = cand(i)\n for f in l:\n components[f] = set(l)\n comp_num[f] = num\n\n out = 0\n for b in block[i]:\n if b in components[i]:\n out += 1\n\n ans.append(comp_num[i] - out - repnNum[i] - 1)\nprint(\" \".join(map(str, ans)))\n","fail":"class UnionFind:\n \"\"\"\n https:\/\/note.nkmk.me\/python-union-find\/\n DFS\u306e\u4e0a\u4f4d\u4e92\u63db\u3068\u8003\u3048\u3066\u826f\u3044\n \uff12\u8981\u7d20x, y\u304cpath-connected\u304b\u3069\u3046\u304b\u3092log\u30aa\u30fc\u30c0\u30fc\u3067\u5224\u5b9a\u3059\u308b\uff08\u87ba\u65cb\u672c\u306e14.1\u7bc0\u53c2\u7167\uff09\n \u3055\u3089\u306b\u9023\u7d50\u6210\u5206\u306e\u8981\u7d20\u6570\u304cO(1)\u3067\u53d6\u5f97\u53ef\u80fd\u306a\u3088\u3046\u306b\u6539\u9020\u3057\u3066\u3042\u308b\n \"\"\"\n\n def __init__(self, n):\n \"\"\"\n \u8981\u7d20\u6570\u3092n\u3068\u3057\u3066\u3001\u5404\u30ce\u30fc\u30c9\u30920,1,...,(n-1)\u306e\u756a\u53f7\u3067\u7ba1\u7406\u3059\u308b\n parents\u306f\u5404\u30ce\u30fc\u30c9\u306e\u5c5e\u3059\u308b\u6728\u306e\u6839\u3092\u8868\u3059\n \u305f\u3060\u3057\u6839\u30ce\u30fc\u30c9\u306eparent\u306b\u306f(\u305d\u306e\u6728\u306e\u30ce\u30fc\u30c9\u6570)*(-1)\u3092\u683c\u7d0d\u3059\u308b\n \"\"\"\n self.n = n\n self.parents = [-1] * n\n\n def find(self, x):\n \"\"\"\n x\u306e\u5c5e\u3059\u308b\u6728\u306e\u6839\u3092\u8fd4\u3059\n \u3053\u306e\u3068\u304d\u540c\u6642\u306b\u7d4c\u8def\u5727\u7e2e\u3057\u3066\u3001\u63a2\u7d22\u9014\u4e2d\u306e\u30ce\u30fc\u30c9\u3092\u5168\u3066\u6839\u306b\u7e4b\u304e\u76f4\u3059\n \"\"\"\n if self.parents[x] < 0:\n return x\n else:\n self.parents[x] = self.find(self.parents[x])\n return self.parents[x]\n\n def union(self, x, y):\n \"\"\"\n x, y\u306e\u305d\u308c\u305e\u308c\u5c5e\u3059\u308b\u6728Tx, Ty\u306e\u6839\u540c\u58eb\u3092\u7e4b\u3050\n \u3053\u306e\u3068\u304d\u6728\u306e\u8981\u7d20\u6570\u304c\u5c0f\u3055\u3044\u65b9\u3092\u5927\u304d\u3044\u65b9\u306b\u7e4b\u3050\uff08rank\u3067\u306f\u306a\u304fsize\u3092\u7528\u3044\u308b\uff09\n \"\"\"\n x = self.find(x)\n y = self.find(y)\n\n if x == y:\n return\n\n if self.parents[x] > self.parents[y]:\n x, y = y, x\n\n self.parents[x] += self.parents[y]\n self.parents[y] = x\n\n def size(self, x):\n \"\"\"\n x\u306e\u5c5e\u3059\u308b\u6728\u306e\u8981\u7d20\u6570\u3092\u8fd4\u3059\n \u6839\u306e\u89aa\u3092\u8981\u7d20\u6570\u306e(-1)\u500d\u3067\u5b9a\u3081\u3066\u304a\u3044\u305f\u304a\u304b\u3052\u3067O(1)\u3067\u53d6\u5f97\u53ef\u80fd\n \"\"\"\n return -self.parents[self.find(x)]\n\n def same(self, x, y):\n \"\"\"\n x\u3068y\u304cpath-connected\u304b\u3092\u5224\u5b9a\u3059\u308b\n \"\"\"\n return self.find(x) == self.find(y)\n\n def members(self, x):\n \"\"\"\n x\u306e\u5c5e\u3059\u308b\u6728\u306e\u8981\u7d20\u3092\u5217\u6319\u3059\u308b\n \"\"\"\n root = self.find(x)\n return [i for i in range(self.n) if self.find(i) == root]\n\n def roots(self):\n \"\"\"\n \u9023\u7d50\u6210\u5206\u306e\u4ee3\u8868\u5143\u306e\u30ea\u30b9\u30c8\u3092\u8fd4\u3059\n \"\"\"\n return [i for i, x in enumerate(self.parents) if x < 0]\n\n def group_count(self):\n \"\"\"\n \u9023\u7d50\u6210\u5206\u306e\u500b\u6570\u3092\u8fd4\u3059\n \"\"\"\n return len(self.roots())\n\n def all_group_members(self):\n \"\"\"\n \u9023\u7d50\u6210\u5206\u304a\u3088\u3073\u305d\u308c\u305e\u308c\u306e\u4ee3\u8868\u5143\u3092\u307e\u3068\u3081\u305f\u8f9e\u66f8\u3092\u8fd4\u3059\n \u4ee3\u8868\u5143\u304c\u30ad\u30fc\u306b\u306a\u3063\u3066\u308b\n \"\"\"\n return {r: self.members(r) for r in self.roots()}\n\n def __str__(self):\n \"\"\"\n \u9023\u7d50\u6210\u5206\u304a\u3088\u3073\u305d\u306e\u4ee3\u8868\u5143\u3092\u51fa\u529b\n \"\"\"\n return \"\\\\n\".join(\"{}: {}\".format(r, self.members(r)) for r in self.roots())\n\n\n\"\"\"\n\u3053\u3053\u304b\u3089\u672c\u554f\u306e\u89e3\u7b54\n\"\"\"\n\nN, M, K = map(int, input().split())\nuf = UnionFind(N)\nfriend_num = [0] * N\nfor _ in range(M):\n a, b = map(int, input().split())\n uf.union(a - 1, b - 1)\n friend_num[a - 1] += 1\n friend_num[b - 1] += 1\nblock = [[] for _ in range(N)]\nfor _ in range(K):\n c, d = map(int, input().split())\n block[c - 1].append(d - 1)\n block[d - 1].append(c - 1)\n\nans = []\nfor i in range(N):\n num = uf.size(i) - friend_num[i] - 1\n for j in block[i]:\n if uf.same(i, j):\n num -= 1\n ans.append(num)\nprint(\" \".join(map(str, ans)))\n","change":"replace","i1":0,"i2":54,"j1":0,"j2":116,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02762","language":"Python","original_status":"Runtime Error","pass":"from collections import Counter\n\nN, M, K = map(int, input().split())\nAB = [tuple(map(int, input().split())) for _ in range(M)]\nCD = [tuple(map(int, input().split())) for _ in range(K)]\n\n\nclass UnionFind:\n def __init__(self, n):\n self.parent = list(range(n))\n\n def root(self, x):\n if self.parent[x] == x:\n return x\n return self.root(self.parent[x])\n\n def root_and_depth(self, x, i=0):\n if self.parent[x] == x:\n return x, i\n return self.root(self.parent[x]), i + 1\n\n def unite(self, x, y):\n rx, ix = self.root_and_depth(x)\n ry, iy = self.root_and_depth(y)\n if rx != ry:\n if ix < iy:\n self.parent[rx] = ry\n else:\n self.parent[ry] = rx\n\n\nuf = UnionFind(N)\n\nfor a, b in AB:\n uf.unite(a - 1, b - 1)\n\nroots = [uf.root(i) for i in range(N)]\ncounter_roots = Counter(roots)\n\nans = [counter_roots[roots[i]] - 1 for i in range(N)]\n\nfor a, b in AB:\n if roots[a - 1] == roots[b - 1]:\n ans[a - 1] -= 1\n ans[b - 1] -= 1\nfor a, b in CD:\n if roots[a - 1] == roots[b - 1]:\n ans[a - 1] -= 1\n ans[b - 1] -= 1\n\nprint(*ans)\n","fail":"from collections import Counter\n\nN, M, K = map(int, input().split())\nAB = [tuple(map(int, input().split())) for _ in range(M)]\nCD = [tuple(map(int, input().split())) for _ in range(K)]\n\n\nclass UnionFind:\n def __init__(self, n):\n self.parent = list(range(n))\n self.rank = [0] * n\n\n def root(self, x):\n if self.parent[x] == x:\n return x\n else:\n self.parent[x] = self.root(self.parent[x])\n return self.parent[x]\n\n def unite(self, x, y):\n root_x = self.root(x)\n root_y = self.root(y)\n if self.rank[x] > self.rank[y]:\n self.parent[root_y] = root_x\n elif self.rank[x] < self.rank[y]:\n self.parent[root_x] = root_y\n elif root_x != root_y:\n self.parent[root_y] = root_x\n self.rank[x] += 1\n pass\n\n\nuf = UnionFind(N)\n\nfor a, b in AB:\n uf.unite(a - 1, b - 1)\n\nroots = [uf.root(i) for i in range(N)]\ncounter_roots = Counter(roots)\n\nans = [counter_roots[roots[i]] - 1 for i in range(N)]\n\nfor a, b in AB:\n if roots[a - 1] == roots[b - 1]:\n ans[a - 1] -= 1\n ans[b - 1] -= 1\nfor a, b in CD:\n if roots[a - 1] == roots[b - 1]:\n ans[a - 1] -= 1\n ans[b - 1] -= 1\n\nprint(*ans)\n","change":"replace","i1":10,"i2":29,"j1":10,"j2":30,"error":"0","stderr":null,"stdout":"0 1 0 1\n"} {"problem_id":"p02762","language":"Python","original_status":"Time Limit Exceeded","pass":"import itertools\nimport sys\n\nreadline = sys.stdin.buffer.readline\n\n\nclass UnionFind:\n def __init__(self, n):\n self.par = [i for i in range(n)]\n self.rank = [0 for _ in range(n)]\n\n def find(self, x):\n if self.par[x] == x:\n return x\n else:\n self.par[x] = self.find(self.par[x])\n return self.par[x]\n\n def unite(self, x, y):\n x = self.find(x)\n y = self.find(y)\n if x == y:\n return\n if self.rank[x] < self.rank[y]:\n self.par[x] = y\n else:\n self.par[y] = x\n if self.rank[x] == self.rank[y]:\n self.rank[x] += 1\n\n def same(self, x, y):\n return self.find(x) == self.find(y)\n\n def get_size(self, x):\n return -self.par[self.find(x)]\n\n\ndef main():\n N, M, K = map(int, readline().split())\n AB = [list(map(int, readline().split())) for _ in range(M)]\n CD = [list(map(int, readline().split())) for _ in range(K)]\n\n E = UnionFind(N)\n\n ans = [0 for _ in range(N)]\n for a, b in AB:\n a -= 1\n b -= 1\n E.unite(a, b)\n ans[a] -= 1\n ans[b] -= 1\n\n for i, j in itertools.combinations(list(range(N)), 2):\n if E.same(i, j):\n ans[i] += 1\n ans[j] += 1\n\n for i, j in CD:\n i -= 1\n j -= 1\n if E.same(i, j):\n ans[i] -= 1\n ans[j] -= 1\n\n print(*ans)\n\n\nmain()\n","fail":"import collections\nimport itertools\nimport sys\n\nreadline = sys.stdin.buffer.readline\n\n\nclass UnionFind:\n def __init__(self, n):\n self.par = [i for i in range(n)]\n self.rank = [0 for _ in range(n)]\n\n def find(self, x):\n if self.par[x] == x:\n return x\n else:\n self.par[x] = self.find(self.par[x])\n return self.par[x]\n\n def unite(self, x, y):\n x = self.find(x)\n y = self.find(y)\n if x == y:\n return\n if self.rank[x] < self.rank[y]:\n self.par[x] = y\n else:\n self.par[y] = x\n if self.rank[x] == self.rank[y]:\n self.rank[x] += 1\n\n def same(self, x, y):\n return self.find(x) == self.find(y)\n\n\ndef main():\n N, M, K = map(int, readline().split())\n AB = [list(map(int, readline().split())) for _ in range(M)]\n CD = [list(map(int, readline().split())) for _ in range(K)]\n\n E = UnionFind(N)\n\n ans = [0 for _ in range(N)]\n for a, b in AB:\n a -= 1\n b -= 1\n E.unite(a, b)\n ans[a] -= 1\n ans[b] -= 1\n\n for i in range(N):\n E.find(i)\n\n ll = collections.defaultdict(int)\n for i in E.par:\n ll[i] += 1\n\n for i in range(N):\n ans[i] += ll[E.par[i]] - 1\n\n for i, j in CD:\n i -= 1\n j -= 1\n if E.same(i, j):\n ans[i] -= 1\n ans[j] -= 1\n\n print(*ans)\n\n\nmain()\n","change":"replace","i1":0,"i2":56,"j1":0,"j2":59,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02762","language":"Python","original_status":"Runtime Error","pass":"from collections import Counter\nimport numpy as np\nfrom scipy.sparse.csgraph import connected_components\nfrom scipy.sparse import csr_matrix\n\nN, M, K = map(int, input().split())\nexc = [set() for _ in range(N)]\nedge = []\n\nfor _ in range(M):\n a, b = map(int, input().split())\n exc[a - 1].add(b - 1)\n exc[b - 1].add(a - 1)\n edge.append((a - 1, b - 1))\n\nedge = np.array(edge).T\nmatr = csr_matrix(([1 for _ in range(M)], edge), (N, N))\n_, labels = connected_components(matr)\nct = Counter(labels)\n\nfor _ in range(K):\n c, d = map(int, input().split())\n if labels[c - 1] == labels[d - 1]:\n exc[c - 1].add(d - 1)\n exc[d - 1].add(c - 1)\n\nans = [ct[labels[i]] - len(exc[i]) - 1 for i in range(N)]\nprint(*ans)\n","fail":"from sys import exit\nfrom collections import Counter\nimport numpy as np\nfrom scipy.sparse.csgraph import connected_components\nfrom scipy.sparse import csr_matrix\n\nN, M, K = map(int, input().split())\nexc = [set() for _ in range(N)]\nedge = []\n\nif M == 0:\n print(*[0 for _ in range(N)])\n exit()\n\nfor _ in range(M):\n a, b = map(int, input().split())\n exc[a - 1].add(b - 1)\n exc[b - 1].add(a - 1)\n edge.append((a - 1, b - 1))\n\nedge = np.array(edge).T\nmatr = csr_matrix(([1 for _ in range(M)], edge), (N, N))\n_, labels = connected_components(matr)\nct = Counter(labels)\n\nfor _ in range(K):\n c, d = map(int, input().split())\n if labels[c - 1] == labels[d - 1]:\n exc[c - 1].add(d - 1)\n exc[d - 1].add(c - 1)\n\nans = [ct[labels[i]] - len(exc[i]) - 1 for i in range(N)]\nprint(*ans)\n","change":"replace","i1":0,"i2":8,"j1":0,"j2":13,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02762","language":"Python","original_status":"Runtime Error","pass":"# \u540c\u3058\u6728\u306b\u5c5e\u3059\u308b(==\u305d\u3053\u307e\u3067\u305f\u3069\u308a\u3064\u3051\u308b\u304b\u3069\u3046\u304b\uff09\u306e\u5224\u5b9a\u306bunionfind\n# \u540c\u3058\u6728\u306b\u5c5e\u3057\u3066\u3044\u308b\u30ce\u30fc\u30c9\u306f\u3042\u3068\u3067\u6570\u3048\u308b\u3053\u3068\u304c\u3067\u304d\u308b\uff08\u305d\u3046\u3060\u306d\uff09\n# \u9664\u5916\u3059\u308b\u3084\u3064\u304c\u51fa\u3066\u304f\u308b\u3002\u76f4\u306e\u53cb\u9054+\u30d6\u30ed\u30c3\u30af\u95a2\u4fc2\u306b\u3042\u308b\u3084\u3064\uff08\u3068\u81ea\u5206\uff09\n# \u540c\u3058\u6728\u306b\u5c5e\u3057\u3066\u3044\u308b\u30ce\u30fc\u30c9\u306e\u7dcf\u6570 - (\u76f4\u306e\u53cb\u9054+\u30d6\u30ed\u30c3\u30af\u95a2\u4fc2+\u81ea\u5206\u81ea\u8eab)\u304c\u7b54\u3048\nn, m, k = map(int, input().split())\npar = [i for i in range(n)]\nans = [0 for _ in range(n)]\n\n\ndef root(x):\n if x == par[x]:\n return x\n y = root(par[x])\n par[x] = y\n return y\n\n\ndef union(x, y):\n if x > y:\n x, y = y, x\n rx, ry = root(x), root(y)\n if rx != ry:\n par[ry] = rx\n\n\nfriends = [[] for _ in range(n)]\nblocks = [[] for _ in range(n)]\n\nfor _ in range(m):\n a, b = map(int, input().split())\n union(a - 1, b - 1)\n friends[a - 1].append(b - 1)\n friends[b - 1].append(a - 1)\nfor _ in range(k):\n c, d = map(int, input().split())\n blocks[c - 1].append(d - 1)\n blocks[d - 1].append(c - 1)\n\n# \u6728\u306b\u5c5e\u3057\u3066\u3044\u308b\u3084\u3064\u3092\u6570\u3048\u308b\u305c\ngroup_count = [0 for _ in range(n)]\nfor i in range(n):\n group_count[root(i)] += 1\n# \u7b54\u3048\u3092\u4f5c\u308b\u305c\nfor i in range(n):\n # \u521d\u671f\u5316\uff08\u3058\u3083\u306a\u3044\u3051\u3069\uff09\n ans[i] += group_count[root(i)]\n # \u76f4\u306e\u53cb\u9054\u3092\u9664\u304f\n ans[i] -= len(friends[i])\n # \u30d6\u30ed\u30c3\u30af\u3057\u3066\u308b\u3084\u3064\u3092\u9664\u304f\n for b in blocks[i]:\n ra, rb = root(i), root(b)\n if ra == rb:\n ans[i] -= 1\n # \u81ea\u5206\u81ea\u8eab\u3092\u9664\u304f\n ans[i] -= 1\nprint(\" \".join(list(map(str, ans))))\n","fail":"# \u540c\u3058\u6728\u306b\u5c5e\u3059\u308b(==\u305d\u3053\u307e\u3067\u305f\u3069\u308a\u3064\u3051\u308b\u304b\u3069\u3046\u304b\uff09\u306e\u5224\u5b9a\u306bunionfind\n# \u540c\u3058\u6728\u306b\u5c5e\u3057\u3066\u3044\u308b\u30ce\u30fc\u30c9\u306f\u3042\u3068\u3067\u6570\u3048\u308b\u3053\u3068\u304c\u3067\u304d\u308b\uff08\u305d\u3046\u3060\u306d\uff09\n# \u9664\u5916\u3059\u308b\u3084\u3064\u304c\u51fa\u3066\u304f\u308b\u3002\u76f4\u306e\u53cb\u9054+\u30d6\u30ed\u30c3\u30af\u95a2\u4fc2\u306b\u3042\u308b\u3084\u3064\uff08\u3068\u81ea\u5206\uff09\n# \u540c\u3058\u6728\u306b\u5c5e\u3057\u3066\u3044\u308b\u30ce\u30fc\u30c9\u306e\u7dcf\u6570 - (\u76f4\u306e\u53cb\u9054+\u30d6\u30ed\u30c3\u30af\u95a2\u4fc2+\u81ea\u5206\u81ea\u8eab)\u304c\u7b54\u3048\nfrom sys import setrecursionlimit\n\nsetrecursionlimit(10**8)\nn, m, k = map(int, input().split())\npar = [i for i in range(n)]\nans = [0 for _ in range(n)]\n\n\ndef root(x):\n if x == par[x]:\n return x\n y = root(par[x])\n par[x] = y\n return y\n\n\ndef union(x, y):\n if x > y:\n x, y = y, x\n rx, ry = root(x), root(y)\n if rx != ry:\n par[ry] = rx\n\n\nfriends = [[] for _ in range(n)]\nblocks = [[] for _ in range(n)]\n\nfor _ in range(m):\n a, b = map(int, input().split())\n union(a - 1, b - 1)\n friends[a - 1].append(b - 1)\n friends[b - 1].append(a - 1)\nfor _ in range(k):\n c, d = map(int, input().split())\n blocks[c - 1].append(d - 1)\n blocks[d - 1].append(c - 1)\n\n# \u6728\u306b\u5c5e\u3057\u3066\u3044\u308b\u3084\u3064\u3092\u6570\u3048\u308b\u305c\ngroup_count = [0 for _ in range(n)]\nfor i in range(n):\n group_count[root(i)] += 1\n# \u7b54\u3048\u3092\u4f5c\u308b\u305c\nfor i in range(n):\n # \u521d\u671f\u5316\uff08\u3058\u3083\u306a\u3044\u3051\u3069\uff09\n ans[i] += group_count[root(i)]\n # \u76f4\u306e\u53cb\u9054\u3092\u9664\u304f\n ans[i] -= len(friends[i])\n # \u30d6\u30ed\u30c3\u30af\u3057\u3066\u308b\u3084\u3064\u3092\u9664\u304f\n for b in blocks[i]:\n ra, rb = root(i), root(b)\n if ra == rb:\n ans[i] -= 1\n # \u81ea\u5206\u81ea\u8eab\u3092\u9664\u304f\n ans[i] -= 1\nprint(\" \".join(list(map(str, ans))))\n","change":"insert","i1":4,"i2":4,"j1":4,"j2":7,"error":"0","stderr":null,"stdout":"0 1 0 1\n"} {"problem_id":"p02762","language":"Python","original_status":"Runtime Error","pass":"class UnionFind:\n def __init__(self, n_nodes):\n self.parent = [i for i in range(n_nodes)]\n self.rank = [0] * n_nodes\n self.size = [1] * n_nodes\n\n def find(self, x):\n if x == self.parent[x]:\n return x\n else:\n self.parent[x] = self.find(self.parent[x])\n return self.parent[x]\n\n def unite(self, x, y):\n x = self.find(x)\n y = self.find(y)\n\n if x == y:\n return\n\n if self.rank[x] > self.rank[y]:\n self.parent[y] = x\n self.size[x] += self.size[y]\n else:\n self.parent[x] = y\n self.size[y] += self.size[x]\n if self.rank[x] == self.rank[y]:\n self.rank[x] += 1\n\n def check(self, x, y):\n return self.find(x) == self.find(y)\n\n def get_size(self, x):\n return self.size[self.find(x)]\n\n\nN, M, K = map(int, input().split())\ntree = UnionFind(N)\nexclusion = [[] for _ in range(N)]\nfor _ in range(M):\n a, b = map(int, input().split())\n a -= 1\n b -= 1\n tree.unite(a, b)\n exclusion[a].append(b)\n exclusion[b].append(a)\n\nfor _ in range(K):\n c, d = map(int, input().split())\n c -= 1\n d -= 1\n if not tree.check(c, d):\n continue\n exclusion[c].append(d)\n exclusion[d].append(c)\n\nfor i in range(N):\n # \u540c\u4e00\u30b0\u30eb\u30fc\u30d7\u3067\u81ea\u5206\u4ee5\u5916\u306e\u4eba\u6570\n n = tree.get_size(i) - 1\n ans = n - len(exclusion[i])\n print(ans, end=\" \")\n","fail":"import sys\n\nsys.setrecursionlimit(10**6)\n\n\nclass UnionFind:\n def __init__(self, n_nodes):\n self.parent = [i for i in range(n_nodes)]\n self.rank = [0] * n_nodes\n self.size = [1] * n_nodes\n\n def find(self, x):\n if x == self.parent[x]:\n return x\n else:\n self.parent[x] = self.find(self.parent[x])\n return self.parent[x]\n\n def unite(self, x, y):\n x = self.find(x)\n y = self.find(y)\n\n if x == y:\n return\n\n if self.rank[x] > self.rank[y]:\n self.parent[y] = x\n self.size[x] += self.size[y]\n else:\n self.parent[x] = y\n self.size[y] += self.size[x]\n if self.rank[x] == self.rank[y]:\n self.rank[x] += 1\n\n def check(self, x, y):\n return self.find(x) == self.find(y)\n\n def get_size(self, x):\n return self.size[self.find(x)]\n\n\nN, M, K = map(int, input().split())\ntree = UnionFind(N)\nexclusion = [[] for _ in range(N)]\nfor _ in range(M):\n a, b = map(int, input().split())\n a -= 1\n b -= 1\n tree.unite(a, b)\n exclusion[a].append(b)\n exclusion[b].append(a)\n\nfor _ in range(K):\n c, d = map(int, input().split())\n c -= 1\n d -= 1\n if not tree.check(c, d):\n continue\n exclusion[c].append(d)\n exclusion[d].append(c)\n\nfor i in range(N):\n # \u540c\u4e00\u30b0\u30eb\u30fc\u30d7\u3067\u81ea\u5206\u4ee5\u5916\u306e\u4eba\u6570\n n = tree.get_size(i) - 1\n ans = n - len(exclusion[i])\n print(ans, end=\" \")\n","change":"insert","i1":0,"i2":0,"j1":0,"j2":5,"error":"WA","stderr":null,"stdout":"0 1 0 1 "} {"problem_id":"p02762","language":"Python","original_status":"Time Limit Exceeded","pass":"from scipy.sparse import csr_matrix\nfrom scipy.sparse.csgraph import connected_components\n\nfrom collections import Counter\n\nn, m, k = map(int, input().split())\nab = [list(map(int, input().split())) for _ in range(m)]\ncd = [list(map(int, input().split())) for _ in range(k)]\n\ng = [[0] * n for _ in range(n)]\n\nfor a, b in ab:\n a -= 1\n b -= 1\n g[a][b] = 1\n g[b][a] = 1\n\ncsr = csr_matrix(g)\ncomp, labels = connected_components(csr)\n\ncounter = Counter(labels)\n\nans = [counter[labels[i]] - 1 for i in range(n)]\n\nfor a, b in ab:\n a -= 1\n b -= 1\n if labels[a] == labels[b]:\n ans[a] -= 1\n ans[b] -= 1\n\nfor c, d in cd:\n c -= 1\n d -= 1\n if labels[c] == labels[d]:\n ans[c] -= 1\n ans[d] -= 1\n\nprint(*ans)\n","fail":"import sys\n\nsys.setrecursionlimit(10**7)\n\n\nclass Tree:\n WHITE = -2\n GRAY = -1\n BLACK = 1\n\n def __init__(self, adj):\n n = len(adj)\n self.adj = adj\n self.colors = [self.WHITE] * n\n self.depths = [-1] * n\n self.depth = 0\n\n def init(self):\n self.__init__(self.adj)\n\n def dfs(self, u, c):\n if self.colors[u] >= 0:\n return\n\n self.colors[u] = self.GRAY\n self.depths[u] = self.depth\n\n for v in self.adj[u]:\n if self.colors[v] == self.WHITE:\n self.dfs(v, c)\n\n self.colors[u] = c\n\n\nfrom collections import Counter\n\nn, m, k = map(int, input().split())\nab = [list(map(int, input().split())) for _ in range(m)]\ncd = [list(map(int, input().split())) for _ in range(k)]\n\nadj = [[] for _ in range(n)]\nfor a, b in ab:\n a -= 1\n b -= 1\n adj[a].append(b)\n adj[b].append(a)\n\ntree = Tree(adj)\nfor i in range(n):\n tree.dfs(i, i)\n\nlabels = tree.colors\n\ncounter = Counter(labels)\n\nans = [counter[labels[i]] - 1 for i in range(n)]\n\nfor a, b in ab:\n a -= 1\n b -= 1\n if labels[a] == labels[b]:\n ans[a] -= 1\n ans[b] -= 1\n\nfor c, d in cd:\n c -= 1\n d -= 1\n if labels[c] == labels[d]:\n ans[c] -= 1\n ans[d] -= 1\n\nprint(*ans)\n","change":"replace","i1":0,"i2":19,"j1":0,"j2":52,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02765","language":"Python","original_status":"Runtime Error","pass":"n, r = map(int, input())\nif n >= 10:\n print(r)\nelse:\n print(r + 100 * (10 - n))\n","fail":"n, r = map(int, input().split())\nif n >= 10:\n print(r)\nelse:\n print(r + 100 * (10 - n))\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"ValueError: invalid literal for int() with base 10: ' '","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02765\/Python\/s819191130.py\", line 1, in \n n, r = map(int, input())\nValueError: invalid literal for int() with base 10: ' '\n","stdout":null} {"problem_id":"p02766","language":"Python","original_status":"Runtime Error","pass":"MAX_N = 1_000_000_000\nn, k = map(int, input().split())\n\nfor i in range(MAX_N):\n if n < pow(k, i):\n print(i)\n break\n","fail":"MAX_N = pow(10, 9)\nn, k = map(int, input().split())\n\nfor i in range(MAX_N):\n if n < pow(k, i):\n print(i)\n break\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"0","stderr":null,"stdout":4.0} {"problem_id":"p02766","language":"Python","original_status":"Runtime Error","pass":"n, k = map(int, input().spilt())\ny = 1\nwhile n > 1:\n y += 1\n n = n \/\/ k\nprint(y)\n","fail":"n, k = map(int, input().split())\ni = k\ny = 1\nwhile n >= i:\n y += 1\n i *= k\nprint(y)\n","change":"replace","i1":0,"i2":5,"j1":0,"j2":6,"error":"AttributeError: 'str' object has no attribute 'spilt'. Did you mean: 'split'?","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02766\/Python\/s426288966.py\", line 1, in \n n, k = map(int, input().spilt())\nAttributeError: 'str' object has no attribute 'spilt'. Did you mean: 'split'?\n","stdout":null} {"problem_id":"p02766","language":"Python","original_status":"Runtime Error","pass":"str = input()\na, b = str.split()\na, b = int(a), int(b)\n\nprint(len(str(int(a, b))))\n","fail":"a, b = input().split()\na, b = int(a), int(b)\n\ndigit = 0\nfor i in range(100):\n if a <= b**i - 1:\n digit = i\n break\n\nprint(digit)\n","change":"replace","i1":0,"i2":5,"j1":0,"j2":10,"error":"TypeError: int() can't convert non-string with explicit base","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02766\/Python\/s700990219.py\", line 5, in \n print(len(str(int(a, b))))\nTypeError: int() can't convert non-string with explicit base\n","stdout":null} {"problem_id":"p02766","language":"Python","original_status":"Time Limit Exceeded","pass":"n, k = map(int, input().split())\ncounter = 1\nwhile n != 1:\n n = int(n \/ k)\n counter += 1\nprint(counter)\n","fail":"n, k = map(int, input().split())\ncounter = 1\nwhile n >= k:\n n = int(n \/ k)\n counter += 1\nprint(counter)\n","change":"replace","i1":2,"i2":3,"j1":2,"j2":3,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02767","language":"Python","original_status":"Runtime Error","pass":"n = int(input())\nx = list(map(int, input().split()))\nx.sort()\nsigmaList = list()\nfor p in range(x[0], x[n - 1]):\n sigma = 0\n for i in range(n):\n sigma += (x[i] - p) ** 2\n sigmaList.append(sigma)\n\nprint(min(sigmaList))\n","fail":"n = int(input())\nx = list(map(int, input().split()))\nx.sort()\nsigmaList = list()\nfor p in range(x[0], x[n - 1] + 1):\n sigma = 0\n for i in range(n):\n sigma += (x[i] - p) ** 2\n sigmaList.append(sigma)\nprint(min(sigmaList))\n","change":"replace","i1":4,"i2":10,"j1":4,"j2":9,"error":0,"stderr":null,"stdout":5} {"problem_id":"p02767","language":"Python","original_status":"Runtime Error","pass":"n = int(input())\nx = list(map(int, input().split()))\n\nsum_list = []\nstart = min(x)\nstop = max(x)\nfor i in range(start, stop):\n sum = 0\n for j in x:\n sum += (i - j) ** 2\n sum_list.append(sum)\n\nprint(min(sum_list))\n","fail":"n = int(input())\nx = list(map(int, input().split()))\n\nsum_list = []\nfor i in range(1, 100):\n sum = 0\n for j in x:\n sum += (i - j) ** 2\n sum_list.append(sum)\n\nprint(min(sum_list))\n","change":"replace","i1":4,"i2":7,"j1":4,"j2":5,"error":0,"stderr":null,"stdout":5} {"problem_id":"p02767","language":"Python","original_status":"Runtime Error","pass":"n = int(input())\nx = list(map(int, input().split()))\n\nsum_list = []\nstart = min(x)\nstop = max(x)\nfor i in range(start, stop):\n sum = 0\n for j in x:\n sum += (i - j) ** 2\n sum_list.append(sum)\n\nprint(min(sum_list))\n","fail":"n = int(input())\nx = list(map(int, input().split()))\n\nsum_list = []\nstart = min(x)\nstop = max(x)\nfor i in range(1, 100):\n sum = 0\n for j in x:\n sum += (i - j) ** 2\n sum_list.append(sum)\n\nprint(min(sum_list))\n","change":"replace","i1":6,"i2":7,"j1":6,"j2":7,"error":0,"stderr":null,"stdout":5} {"problem_id":"p02767","language":"Python","original_status":"Runtime Error","pass":"N = int(input())\nX_list = list(map(int, input().split()))\n\nhp_list = []\nfor p in range(int(min(X_list)), int(max(X_list))):\n hp = 0\n for x in X_list:\n hp += abs(x - p) ** 2\n hp_list.append(hp)\n\nprint(min(hp_list))\n","fail":"N = int(input())\nX_list = list(map(int, input().split()))\n\nhp_list = []\nfor p in range(int(min(X_list)), int(max(X_list))):\n hp = 0\n for x in X_list:\n hp += abs(x - p) ** 2\n hp_list.append(hp)\n\nprint(min(hp_list) if len(hp_list) > 0 else 0)\n","change":"replace","i1":10,"i2":11,"j1":10,"j2":11,"error":0,"stderr":null,"stdout":5} {"problem_id":"p02768","language":"Python","original_status":"Time Limit Exceeded","pass":"#!\/usr\/bin\/env python\n\n\ndef pow(m, n):\n if n == 0:\n return 1\n elif n % 2 == 0:\n return (pow(m, int(n \/ 2)) ** 2) % mod\n elif n % 2 == 1:\n return (pow(m, int((n - 1) * 0.5)) ** 2 * m) % mod\n\n\ndef conb(n, a):\n mod1 = 1\n mod2 = 1\n for i in range(a):\n mod1 *= n - i\n mod2 *= i + 1\n mod2 = pow(mod2, mod - 2)\n return (mod1 * mod2) % mod\n\n\nn, a, b = (int(val) for val in input().split())\n\n\nans = 1\nnoa = 1\nnob = 1\nmod = 1000000007\nans = pow(2, n) - 1 - conb(n, a) - conb(n, b)\nans %= mod\nprint(ans)\n","fail":"#!\/usr\/bin\/env python\n\n\ndef pow(m, n):\n if n == 0:\n return 1\n elif n % 2 == 0:\n return (pow(m, int(n \/ 2)) ** 2) % mod\n elif n % 2 == 1:\n return (pow(m, int((n - 1) * 0.5)) ** 2 * m) % mod\n\n\ndef conb(n, a):\n mod1 = 1\n mod2 = 1\n for i in range(a):\n mod1 *= n - i\n mod1 %= mod\n mod2 *= i + 1\n mod2 %= mod\n mod2 = pow(mod2, mod - 2)\n return (mod1 * mod2) % mod\n\n\nn, a, b = (int(val) for val in input().split())\n\n\nans = 1\nnoa = 1\nnob = 1\nmod = 1000000007\nans = pow(2, n) - 1 - conb(n, a) - conb(n, b)\nans %= mod\nprint(ans)\n","change":"replace","i1":17,"i2":18,"j1":17,"j2":20,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02768","language":"Python","original_status":"Runtime Error","pass":"n, a, b = map(int, input().split())\nmod = 10**9 + 7\nans = 0\nMAX = 500000000\nfac = [1, 1] + [0] * MAX\nfinv = [1, 1] + [0] * MAX\ninv = [0, 1] + [0] * MAX\nfor i in range(2, MAX):\n fac[i] = fac[i - 1] * i % mod\n inv[i] = -inv[mod % i] * (mod \/\/ i) % mod\n finv[i] = finv[i - 1] * inv[i] % mod\n\n\ndef neko(n, r):\n if n < r:\n return 0\n if n < 0 or r < 0:\n return 0\n return fac[n] * (finv[r] * finv[n - r] % mod) % mod\n\n\nif n % 2:\n for i in range((n + 1) \/\/ 2):\n ans += neko(n, i) * 2 % mod\n ans -= neko(n, a)\n ans -= neko(n, b)\n print(max(ans - 1, 0))\nelse:\n for i in range(n \/\/ 2):\n ans += neko(n, i) * 2 % mod\n ans += neko(n, n \/\/ 2)\n ans -= neko(n, a)\n ans -= neko(n, b)\n print(max(ans - 1, 0))\n","fail":"n, a, b = map(int, input().split())\nmod = 10**9 + 7\n\n\ndef neko(n, k):\n if n < k:\n return 0\n if n < 0 or k < 0:\n return 0\n k = min(n - k, k)\n ans = 1\n inv = [1] * (k + 1)\n if k >= 1:\n ans *= (n - k + 1) % mod\n for i in range(2, k + 1):\n inv[i] = mod - inv[mod % i] * (mod \/\/ i) % mod\n ans = ans * (n - k + i) * inv[i] % mod\n return ans\n\n\nprint((pow(2, n, mod) - 1 - neko(n, a) - neko(n, b)) % mod)\n","change":"replace","i1":2,"i2":34,"j1":2,"j2":21,"error":"1","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02768\/Python\/s827318561.py\", line 5, in \n fac = [1, 1] + [0] * MAX\nMemoryError\n","stdout":null} {"problem_id":"p02770","language":"Python","original_status":"Time Limit Exceeded","pass":"import sys\n\ninput = sys.stdin.readline\n\n\ndef main():\n K, Q = map(int, input().split())\n D = list(map(int, input().split()))\n\n for _ in range(Q):\n n, x, m = map(int, input().split())\n md = [D[i] % m for i in range(K)]\n smda = 0\n mda0 = 0\n for i in range((n - 1) % K):\n if md[i] == 0:\n mda0 += 1\n smda += md[i]\n roop = (n - 1) \/\/ K\n res = n - 1 - (x % m + sum(md) * roop + smda) \/\/ m - md.count(0) * roop - mda0\n print(res)\n\n\nmain()\n","fail":"import sys\n\ninput = sys.stdin.readline\n\n\ndef main():\n K, Q = map(int, input().split())\n D = list(map(int, input().split()))\n\n for _ in range(Q):\n n, x, m = map(int, input().split())\n md = [D[i] % m for i in range(K)]\n smda = 0\n mda0 = 0\n for i in range((n - 1) % K):\n if md[i] == 0:\n mda0 += 1\n smda += md[i]\n smd = smda\n md0 = mda0\n for i in range((n - 1) % K, K):\n if md[i] == 0:\n md0 += 1\n smd += md[i]\n roop = (n - 1) \/\/ K\n res = n - 1 - (x % m + smd * roop + smda) \/\/ m - md0 * roop - mda0\n print(res)\n\n\nmain()\n","change":"replace","i1":18,"i2":20,"j1":18,"j2":26,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02770","language":"Python","original_status":"Time Limit Exceeded","pass":"import numpy as np\n\nk, q = map(int, input().split())\nd = list(map(int, input().split()))\nnxm = [map(int, input().split()) for _ in range(q)]\n\nfor n, x, m in nxm:\n dd = [e % m for e in d]\n dd = np.array(dd)\n\n ans = n - 1\n divq, divr = divmod(n - 1, k)\n\n dd_r = dd[:divr]\n\n ans -= (k - np.count_nonzero(dd)) * divq\n ans -= divr - np.count_nonzero(dd_r)\n\n last = x + np.sum(dd) * divq + np.sum(dd_r)\n ans -= last \/\/ m - x \/\/ m\n\n print(ans)\n","fail":"import numpy as np\n\nk, q = map(int, input().split())\nd = np.array(input().split(), np.int64)\nnxm = [map(int, input().split()) for _ in range(q)]\n\nfor n, x, m in nxm:\n dd = d % m\n\n ans = n - 1\n divq, divr = divmod(n - 1, k)\n\n dd_r = dd[:divr]\n\n ans -= (k - np.count_nonzero(dd)) * divq\n ans -= divr - np.count_nonzero(dd_r)\n\n last = x + np.sum(dd) * divq + np.sum(dd_r)\n ans -= last \/\/ m - x \/\/ m\n\n print(ans)\n","change":"replace","i1":3,"i2":9,"j1":3,"j2":8,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02771","language":"Python","original_status":"Runtime Error","pass":"nums = list(map(int, input.split(\" \")))\nif len(set(nums)) == 2:\n print(\"Yes\")\nelse:\n print(\"No\")\n","fail":"nums = list(map(int, input().split(\" \")))\nif len(set(nums)) == 2:\n print(\"Yes\")\nelse:\n print(\"No\")\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"AttributeError: 'builtin_function_or_method' object has no attribute 'split'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02771\/Python\/s880754388.py\", line 1, in \n nums = list(map(int, input.split(\" \")))\nAttributeError: 'builtin_function_or_method' object has no attribute 'split'\n","stdout":null} {"problem_id":"p02771","language":"Python","original_status":"Runtime Error","pass":"li = list(map(int, input().split()))\nif (set(len(li))) == 2:\n print(\"Yes\")\nelse:\n print(\"No\")\n","fail":"li = list(map(int, input().split()))\nif (len(set(li))) == 2:\n print(\"Yes\")\nelse:\n print(\"No\")\n","change":"replace","i1":1,"i2":2,"j1":1,"j2":2,"error":"TypeError: 'int' object is not iterable","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02771\/Python\/s620789941.py\", line 2, in \n if (set(len(li))) == 2:\nTypeError: 'int' object is not iterable\n","stdout":null} {"problem_id":"p02772","language":"Python","original_status":"Runtime Error","pass":"n = int(input())\narr = [input() for _ in range(n)]\ndic = {}\nfor i in range(n):\n if arr[i] not in dic:\n dic[arr[i]] = 1\n else:\n dic[arr[i]] += 1\nlargest = max(dic.values())\nans = []\nfor keys in dic.keys():\n if dic[keys] == largest:\n ans.append(keys)\nans = sorted(ans)\nfor words in ans:\n print(words)\n","fail":"N = int(input())\nA = list(map(int, input().split()))\n\nfor a in A:\n if a % 2 == 1:\n continue\n if a % 3 == 0 or a % 5 == 0:\n continue\n print(\"DENIED\")\n exit()\nprint(\"APPROVED\")\n","change":"replace","i1":0,"i2":16,"j1":0,"j2":11,"error":"EOFError: EOF when reading a line","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02772\/Python\/s663457315.py\", line 2, in \n arr = [input() for _ in range(n)]\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02772\/Python\/s663457315.py\", line 2, in \n arr = [input() for _ in range(n)]\nEOFError: EOF when reading a line\n","stdout":null} {"problem_id":"p02772","language":"Python","original_status":"Runtime Error","pass":"# \u5076\u6570\u304b\u30643\u307e\u305f\u306f5\u3067\u5272\u308a\u5207\u308c\u308b\n\nN = int(input())\na = list(map(int(input().split())))\nfor i in range(N):\n if a[i] % 2 == 0:\n if a[i] % 3 != 0 and a[i] % 5 != 0:\n print(\"DENIED\")\n exit(0)\nprint(\"APPROVED\")\n","fail":"N = int(input())\na = list(map(int, input().split()))\nresult = \"APPROVED\"\nfor i in range(N):\n if a[i] % 2 == 0:\n if a[i] % 3 != 0 and a[i] % 5 != 0:\n result = \"DENIED\"\n break\nprint(result)\n","change":"replace","i1":0,"i2":10,"j1":0,"j2":9,"error":"TypeError: int() argument must be a string, a bytes-like object or a real number, not 'list'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02772\/Python\/s817582230.py\", line 4, in \n a = list(map(int(input().split())))\nTypeError: int() argument must be a string, a bytes-like object or a real number, not 'list'\n","stdout":null} {"problem_id":"p02773","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\n\nexisted_dict = {}\nmax_count = 0\nmax_text_list = []\nfor _ in range(N):\n text = input()\n if text in existed_dict.keys():\n existed_dict[text] += 1\n else:\n existed_dict[text] = 1\n if existed_dict[text] == max_count:\n max_count = existed_dict[text]\n max_text_list.append(text)\n elif existed_dict[text] > max_count:\n max_count = existed_dict[text]\n max_text_list = []\n max_text_list.append(text)\n else:\n pass\n\nfor text in sorted(max_text_list):\n print(text)\n","fail":"N = int(input())\n\nexisted_dict = {}\nmax_count = 0\nmax_text_list = []\nfor _ in range(N):\n text = input()\n if existed_dict.get(text): # \u3053\u3053\u304b\n existed_dict[text] += 1\n else:\n existed_dict[text] = 1\n if existed_dict[text] == max_count:\n max_count = existed_dict[text]\n max_text_list.append(text)\n elif existed_dict[text] > max_count:\n max_count = existed_dict[text]\n max_text_list = []\n max_text_list.append(text)\n else:\n pass\n\nfor text in sorted(max_text_list): # \u3053\u3053\n print(text)\n","change":"replace","i1":7,"i2":22,"j1":7,"j2":22,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02773","language":"Python","original_status":"Time Limit Exceeded","pass":"#!\/usr\/bin\/env python3\n# -*- coding: utf-8 -*-\nfrom collections import Counter\n\n\ndef main():\n N = int(input())\n S = [input() for _ in range(N)]\n S = Counter(S)\n\n result = []\n for key, value in S.items():\n if value == S.most_common()[0][1]:\n result.append(key)\n result.sort()\n for r in result:\n print(r)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"#!\/usr\/bin\/env python3\n# -*- coding: utf-8 -*-\nfrom collections import Counter\n\n\ndef main():\n N = int(input())\n S = [input() for _ in range(N)]\n S = Counter(S)\n\n SM = S.most_common()[0][1]\n S = sorted(S.items(), key=lambda x: [-x[1], x[0]])\n for key, value in S:\n if value == SM:\n print(key)\n else:\n break\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":10,"i2":17,"j1":10,"j2":17,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02773","language":"Python","original_status":"Runtime Error","pass":"def main():\n n = int(input())\n words = {}\n for _ in range(n):\n a = input()\n if a in words:\n words[a] += 1\n else:\n words[a] = 1\n\n max_val = max(words.values())\n # words_sorted = sorted(words.items(), key=lambda x: x[0])\n for key, value in sorted(words):\n if value != max_val:\n continue\n else:\n print(key)\n # key value\u3092\u4e21\u65b9print\u3059\u308b\u3068\u304d\n # print('{}:{}'.format(key, value))\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"def main():\n n = int(input())\n words = {}\n for _ in range(n):\n a = input()\n if a in words:\n words[a] += 1\n else:\n words[a] = 1\n\n max_val = max(words.values())\n # words_sorted = sorted(words.items(), key=lambda x: x[0])\n for key, value in sorted(words.items()):\n if value != max_val:\n continue\n else:\n print(key)\n # key value\u3092\u4e21\u65b9print\u3059\u308b\u3068\u304d\n # print('{}:{}'.format(key, value))\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":12,"i2":13,"j1":12,"j2":13,"error":"ValueError: too many values to unpack (expected 2)","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02773\/Python\/s861205933.py\", line 23, in \n main()\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02773\/Python\/s861205933.py\", line 13, in main\n for key, value in sorted(words):\nValueError: too many values to unpack (expected 2)\n","stdout":null} {"problem_id":"p02773","language":"Python","original_status":"Time Limit Exceeded","pass":"from collections import Counter\n\n\ndef main():\n n = int(input())\n ss = [input() for _ in range(n)]\n max_num = Counter(ss).most_common()[0][1]\n max_verbs = [Counter(ss).most_common()[0][0]]\n for i in range(1, len(Counter(ss).most_common())):\n if Counter(ss).most_common()[i][1] != max_num:\n break\n max_verbs.append(Counter(ss).most_common()[i][0])\n\n max_verbs = sorted(max_verbs)\n for ans in max_verbs:\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"def main():\n n = int(input())\n ss = {}\n max_s = 0\n for _ in range(n):\n s = input()\n if s not in ss:\n ss[s] = 0\n else:\n ss[s] += 1\n max_s = max(max_s, ss[s])\n\n ss = sorted(ss.items(), key=lambda x: x[0])\n anss = [s for s, i in ss if i == max_s]\n for ans in anss:\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":0,"i2":15,"j1":0,"j2":15,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02773","language":"Python","original_status":"Time Limit Exceeded","pass":"from collections import Counter\n\nn = int(input())\nS = [input() for i in range(n)]\n\nL = Counter(S)\nK = sorted([kv[0] for kv in L.items() if kv[1] == max(L.values())])\n\nfor i in range(len(K)):\n print(K[i])\n","fail":"from collections import Counter\n\nn = int(input())\nS = [input() for i in range(n)]\n\nL = Counter(S)\nm = 0\nfor v in L.values():\n m = max(m, v)\nans = []\nfor k, v in L.items():\n if v == m:\n ans.append(k)\nans.sort()\nprint(*ans, sep=\"\\\\n\")\n","change":"replace","i1":6,"i2":10,"j1":6,"j2":15,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02773","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nS = [input() for i in range(N)]\n\ncount = {}\nfor i in range(N):\n if not S[i] in count:\n count[S[i]] = 1\n else:\n count[S[i]] += 1\nmax_k_list = [kv[0] for kv in count.items() if kv[1] == max(count.values())]\nmax_k_list.sort()\nfor i in range(len(max_k_list)):\n print(max_k_list[i])\n","fail":"from collections import Counter\n\nN = int(input())\nS = [input() for i in range(N)]\n\nC = Counter(S)\n\nC = sorted(C.items(), key=lambda x: x[1], reverse=True)\n\n\ncnt_max = C[0][1]\nans = []\nfor i in range(len(C)):\n if cnt_max > C[i][1]:\n break\n else:\n ans.append(C[i][0])\n\nans.sort()\n\nfor w in ans:\n print(w)\n","change":"replace","i1":0,"i2":13,"j1":0,"j2":22,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02773","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\ns = [input() for i in range(n)]\nset_s = sorted(set(s))\nmax_num = 0\nfor i in set_s:\n max_num = max(max_num, s.count(i))\nfor i in set_s:\n if s.count(i) == max_num:\n print(i)\n","fail":"from collections import Counter\n\nn = int(input())\ns = sorted([input() for i in range(n)])\n\ncounter = Counter(s)\nmax_num = max(counter.values())\nans_list = [i for i in counter if counter[i] == max_num]\nfor i in sorted(ans_list):\n print(i)\n","change":"replace","i1":0,"i2":9,"j1":0,"j2":10,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02773","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\n\n# \u6587\u5b57\u5217\u306e\u51fa\u73fe\u56de\u6570\u3092\u683c\u7d0d\nS = {}\nfor _ in range(N):\n s = input()\n if s in S:\n S[s] += 1\n else:\n S[s] = 1\n\n# \u51fa\u73fe\u56de\u6570\u304c\u6700\u5927\u306e\u6587\u5b57\u5217\u3092ans\u306b\u683c\u7d0d\u3057\u3001\u6607\u9806\u306b\u30bd\u30fc\u30c8\u3059\u308b\nans = [k for k, v in S.items() if v == max(S.values())]\nans.sort()\n\n# \u51fa\u529b\nfor a in ans:\n print(a)\n","fail":"N = int(input())\n\n# \u6587\u5b57\u5217\u306e\u51fa\u73fe\u56de\u6570\u3092\u683c\u7d0d\nS = {}\nfor _ in range(N):\n s = input()\n if s in S:\n S[s] += 1\n else:\n S[s] = 1\n\n# \u51fa\u73fe\u56de\u6570\u304c\u6700\u5927\u306e\u6587\u5b57\u5217\u3092ans\u306b\u683c\u7d0d\u3057\u3001\u6607\u9806\u306b\u30bd\u30fc\u30c8\u3059\u308b\n# ans = [k for k, v in S.items() if v == max(S.values())]\n# ans.sort()\nmax_value = max(S.values())\nans = sorted([k for k, v in S.items() if v == max_value])\n\n# \u51fa\u529b\nfor a in ans:\n print(a)\n","change":"replace","i1":12,"i2":14,"j1":12,"j2":16,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02773","language":"Python","original_status":"Time Limit Exceeded","pass":"import collections\n\nN = int(input())\ndata = [input() for i in range(N)]\n\ndicdata = collections.Counter(data)\n\nnewdata = [k for k, v in dicdata.items() if v == max(dicdata.values())]\n\nnewdata.sort()\n\n[print(i) for i in newdata]\n","fail":"import collections\n\nN = int(input())\ndata = [input() for i in range(N)]\n\ndicdata = collections.Counter(data)\n\nm = max(dicdata.values())\n\nnewdata = [k for k, v in dicdata.items() if v == m]\n\nnewdata.sort()\n\n[print(i) for i in newdata]\n","change":"replace","i1":7,"i2":8,"j1":7,"j2":10,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02773","language":"Python","original_status":"Time Limit Exceeded","pass":"import collections\n\nn = int(input())\ns = []\n\ns_append = s.append\nfor _ in range(n):\n s_append(input())\n\npop_times = collections.Counter(s)\nmost_common_word = []\n\nmost_common_word_append = most_common_word.append\nfor i in pop_times.most_common():\n if pop_times.most_common()[0][1] == i[1]:\n most_common_word_append(i[0])\n\nfor x in sorted(most_common_word):\n print(x)\n","fail":"n = int(input())\ns = [input() for _ in range(n)]\nd = {}\nans = []\n\nfor st in s:\n d[st] = d.get(st, 0) + 1\n\nt = max(d.values())\nans_append = ans.append\n\nfor x in d:\n if d[x] == t:\n ans_append(x)\n\nans = sorted(ans)\nfor x in ans:\n print(x)\n","change":"replace","i1":0,"i2":18,"j1":0,"j2":17,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02773","language":"Python","original_status":"Time Limit Exceeded","pass":"import collections\n\nN = int(input())\nS = [input() for i in range(N)]\n\ncount = collections.Counter(S)\n\n# print(count)\n\nmax_k_list = [kv[0] for kv in count.items() if kv[1] == max(count.values())]\n\nmax_k_list.sort()\n\nfor i in max_k_list:\n print(i)\n","fail":"import collections\n\nN = int(input())\nS = [input() for i in range(N)]\n\n# print(S)\n\ncount = collections.Counter(S)\n\n# print(count)\n\nmax_value = max(count.values())\n\nmax_k_list = []\n\nfor k, v in sorted(count.items(), key=lambda x: x[1], reverse=True):\n if v == max_value:\n max_k_list.append(k)\n else:\n break\n\nmax_k_list.sort()\n\nfor i in max_k_list:\n print(i)\n","change":"replace","i1":5,"i2":10,"j1":5,"j2":20,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02773","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nS = [input() for _ in range(N)]\n\nkey = set(S)\n\n_dict = {}\nfor s in key:\n _dict[s] = S.count(s)\n\nsort_dict = sorted(_dict.items(), key=lambda x: -x[1])\nc = sort_dict[0][1]\nlst = list()\nfor item in sort_dict:\n\n if c == item[1]:\n lst += [item[0]]\n c = item[1]\n else:\n break\n\nlst.sort()\n\nfor i in lst:\n print(i)\n","fail":"from collections import Counter\n\nN = int(input())\nS = [input() for _ in range(N)]\n\nc = Counter(S)\n_max = max(c.values())\n\nans = []\nfor k, v in c.items():\n if v == _max:\n ans += [k]\n\nfor a in sorted(ans):\n print(a)\n","change":"replace","i1":0,"i2":24,"j1":0,"j2":15,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02773","language":"Python","original_status":"Time Limit Exceeded","pass":"import collections\n\nN = int(input())\nS = []\nfor _ in range(N):\n S.append(input())\nc = collections.Counter(S)\nans = []\nmax = c.most_common()[0][1]\ni = 0\ncurrent = c.most_common()[i]\nwhile current[1] == max:\n ans.append(current[0])\n i += 1\n if len(c) <= i:\n break\n current = c.most_common()[i]\n\nans.sort()\nfor s in ans:\n print(s)\n","fail":"import collections\n\nN = int(input())\nS = []\nfor _ in range(N):\n S.append(input())\n\nc = collections.Counter(S)\nmax = c.most_common()[0][1]\nans = [i[0] for i in c.items() if i[1] == max]\nans.sort()\n\nfor s in ans:\n print(s)\n","change":"replace","i1":6,"i2":19,"j1":6,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02773","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\ninput_line = [input() for _ in range(N)]\ncount = {}\nfor w in input_line:\n if w in count:\n count[w] += 1\n else:\n count[w] = 1\n\nkeys = [k for k, v in count.items() if v == max(count.values())]\nfor w in sorted(keys):\n print(w)\n","fail":"N = int(input())\ninput_line = [input() for _ in range(N)]\ncount = {}\nfor w in input_line:\n if w in count:\n count[w] += 1\n else:\n count[w] = 1\nmax_values = max(count.values())\nkeys = [k for k, v in count.items() if v == max_values]\nfor w in sorted(keys):\n print(w)\n","change":"replace","i1":8,"i2":10,"j1":8,"j2":10,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02773","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\n\ns = [0] * n\nv = [0] * (n - 1)\nw = [0]\n\nfor i in range(n):\n s[i] = input()\n\nt = sorted(s)\n\nfor i in range(n - 1):\n if t[i] == t[i + 1]:\n v[i] = 1\n\nu = sorted(set(t), key=t.index)\n\nfor i in range(n - 1):\n if v[i] != 0:\n w[len(w) - 1] += 1\n else:\n w.append(0)\n\nfor i in range(len(w)):\n if max(w) == w[i]:\n print(u[i])\n","fail":"import collections\n\nn = int(input())\ns = [input() for i in range(n)]\n\ncount = collections.Counter(s)\n\nmax_v = max(count.values())\n\nresult = [key for key, val in count.items() if val == max_v]\n\nprint(\"\\\\n\".join(sorted(result)))\n","change":"replace","i1":0,"i2":26,"j1":0,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02773","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\ns_list = [input() for i in range(n)]\ns_set = set(s_list)\nmax = 0\nmax_elements = []\nfor i in s_set:\n c = s_list.count(i)\n if c > max:\n max = c\n max_elements = [i]\n if c == max and i not in max_elements:\n max_elements.append(i)\n\nfor i in sorted(max_elements):\n print(i)\n","fail":"n = int(input())\na = dict()\n\nfor i in range(n):\n s = input()\n a.setdefault(s, 0)\n a[s] += 1\n\nans = []\nmx = 0\nfor key, value in a.items():\n if mx < value:\n mx = value\n ans = [key]\n elif mx == value:\n ans.append(key)\n\nans.sort()\nfor i in ans:\n print(i)\n","change":"replace","i1":1,"i2":14,"j1":1,"j2":19,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02773","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nS = [input() for _ in range(N)]\n\ncount = dict()\nfor x in S:\n count[x] = count.get(x, 0) + 1\n\nsorted_kv = list(sorted(count.items(), key=lambda x: (-x[1], x[0])))\nmax_val = sorted_kv[0][1]\n\nres = []\nfor k, v in sorted_kv:\n if v == max_val:\n print(k)\n else:\n break\n","fail":"N = int(input())\n\ncount = dict()\nfor _ in range(N):\n x = input()\n count[x] = count.get(x, 0) + 1\n\nmax_val = -float(\"infinity\")\nfor k, v in sorted(count.items(), key=lambda x: (-x[1], x[0])):\n max_val = max(v, max_val)\n if v == max_val:\n print(k)\n else:\n break\n","change":"replace","i1":1,"i2":12,"j1":1,"j2":10,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02773","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\nstr_dic = {}\nfor _ in range(n):\n inp = input()\n if inp in str_dic:\n str_dic[inp] += 1\n else:\n str_dic[inp] = 1\n\nmax_str = [s[0] for s in str_dic.items() if s[1] == max(str_dic.values())]\n\nfor s in sorted(max_str):\n print(s)\n","fail":"n = int(input())\nstr_dic = {}\nfor _ in range(n):\n inp = input()\n if inp in str_dic:\n str_dic[inp] += 1\n else:\n str_dic[inp] = 1\n\nmax_num = max(str_dic.values())\n\nmax_str = [s[0] for s in str_dic.items() if s[1] == max_num]\n\nfor s in sorted(max_str):\n print(s)\n","change":"replace","i1":9,"i2":10,"j1":9,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02773","language":"Python","original_status":"Time Limit Exceeded","pass":"import collections\n\nN = int(input())\nS = [str(input()) for _ in range(N)]\n\nc = collections.Counter(S)\n\nans = [i[0] for i in c.items() if i[1] >= c.most_common(1)[0][1]]\nans.sort()\n\nfor a in ans:\n print(a)\n","fail":"N = int(input())\nS = [str(input()) for _ in range(N)]\n\nS.sort()\n\nans = []\nmost = 0\ntmpstr = S[0]\ntmpcnt = 0\n\n\nfor s in S:\n if tmpstr == s:\n tmpcnt += 1\n else:\n if tmpcnt > most:\n ans.clear()\n ans.append(tmpstr)\n most = tmpcnt\n\n elif tmpcnt == most:\n ans.append(tmpstr)\n\n tmpcnt = 1\n tmpstr = s\n\nif tmpcnt > most:\n ans.clear()\n ans.append(tmpstr)\n most = tmpcnt\nelif tmpcnt == most:\n ans.append(tmpstr)\n\nfor a in ans:\n print(a)\n","change":"replace","i1":0,"i2":9,"j1":0,"j2":32,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02773","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nS = [input() for _ in range(N)]\ndic = {}\nfor s in S:\n if s in dic:\n dic[s] += 1\n else:\n dic[s] = 1\n\nfor key, value in sorted(dic.items()):\n if value == max(dic.values()):\n print(key)\n","fail":"N = int(input())\nS = [input() for _ in range(N)]\ndic = {}\nfor s in S:\n if s in dic:\n dic[s] += 1\n else:\n dic[s] = 1\n\nmax = max(dic.values())\nfor key, value in sorted(dic.items()):\n if value == max:\n print(key)\n","change":"replace","i1":9,"i2":11,"j1":9,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02773","language":"Python","original_status":"Time Limit Exceeded","pass":"from collections import Counter\n\nN = int(input())\n\nS = [input() for _ in range(N)]\n\ndic = Counter(S)\n\nans = [key for key, value in dic.items() if value == max(dic.values())]\n\nfor key in sorted(ans):\n print(key, end=\"\")\n print(\"\")\n","fail":"from collections import Counter\n\nN = int(input())\nS = [input() for _ in range(N)]\n\ndic = Counter(S)\n\ntmp = max(dic.values())\nans = [key for key, value in dic.items() if value == tmp]\n\n# \u3082\u3046\u3061\u3087\u3044\u304b\u3063\u3053\u3044\u3044\u66f8\u304d\u65b9\u304c\u3042\u308b\u306f\u305a\u3002\u30ea\u30b9\u30c8\u30921\u884c1str\u51fa\u529b and \u6700\u5f8c\u306b\u6539\u884c\u3057\u306a\u3044\u3088\u3046\u306b\nfor key in sorted(ans):\n print(key, end=\"\")\n print(\"\")\n","change":"replace","i1":3,"i2":10,"j1":3,"j2":11,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02773","language":"Python","original_status":"Time Limit Exceeded","pass":"import collections\n\nN = int(input())\nvote_list = [input() for i in range(N)]\nvote_list.sort()\n\ncount = collections.Counter(vote_list)\nmax_count = count.most_common()[0][1]\n\nif max_count == 1:\n for i in vote_list:\n print(i)\nelif len(list(set(vote_list))) == 1:\n print(vote_list[0])\nelse:\n i = 0\n for i in range(10000000000):\n if count.most_common()[i][1] == max_count:\n print(count.most_common()[i][0])\n else:\n break\n","fail":"import collections\n\nN = int(input())\nvote_list = [input() for i in range(N)]\nvote_list.sort()\n\ncount = collections.Counter(vote_list)\nmax_count = count.most_common()[0][1]\nans = []\n\nfor alpha, beta in count.items():\n if beta == max_count:\n ans.append(alpha)\nans.sort()\nprint(\"\\\\n\".join(ans))\n","change":"replace","i1":8,"i2":21,"j1":8,"j2":15,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02774","language":"Python","original_status":"Time Limit Exceeded","pass":"from itertools import combinations\n\nn, k = [int(i) for i in input().split()]\na = [int(i) for i in input().split()]\nproducts = []\nfor i in combinations(a, 2):\n products.append(i[0] * i[1])\nprint(sorted(products)[k - 1])\n","fail":"import numpy as np\n\nn, k = [int(i) for i in input().split()]\na = np.array(sorted([int(i) for i in input().split()]))\nposi = a[a > 0]\nzero = a[a == 0]\nnega = a[a < 0]\n\n# 2\u5206\u63a2\u7d22, mid \u3088\u308a\u5c0f\u3055\u3044\u3082\u306e\u3092\u6570\u3048\u308b\nl = -(10**18) - 1\nr = 10**18 + 1\nwhile r - l > 1:\n mid = (r + l) \/\/ 2\n cnt = 0\n if mid >= 0:\n cnt += len(zero) * n\n\n cnt += a.searchsorted(mid \/\/ posi, side=\"right\").sum()\n cnt += (n - a.searchsorted(-(-mid \/\/ nega), side=\"left\")).sum()\n cnt -= np.count_nonzero(a * a <= mid)\n cnt \/\/= 2\n if cnt >= k:\n r = mid\n else:\n l = mid\nprint(r)\n","change":"replace","i1":0,"i2":8,"j1":0,"j2":26,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02775","language":"Python","original_status":"Time Limit Exceeded","pass":"S = \"0\" + input()\n\ndigits = [int(c) for c in S.rstrip(\"0\")]\n\nf = [\n None,\n [None] * len(digits),\n [None] * len(digits),\n] # f[sign][place] where sign is 1 or -1\n\n\nfor place in reversed(range(len(digits))):\n for sign in [-1, 1]:\n if place == len(digits) - 1:\n if sign > 0:\n exact = digits[place]\n else:\n exact = 10 - digits[place]\n f[sign][place] = exact\n continue\n\n if sign > 0:\n exact = digits[place]\n overpay = exact + 1 # Overpaying flips the sign of the balance\n else:\n assert sign < 0\n exact = 10 - digits[place] - 1\n overpay = exact + 1\n f[sign][place] = min(exact + f[sign][place + 1], overpay + f[-sign][place + 1])\nprint(f[1][0])\n","fail":"S = \"0\" + input()\n\ndigits = [int(c) for c in S.rstrip(\"0\")]\nN = len(digits)\n\n# Track number of bills necessary to create digits[:i]\n# Can either pay exact or overpay by one bill to flip the sign of the balance\ndpPos = [None] * len(digits)\ndpNeg = [None] * len(digits)\n\ndpPos[-1] = digits[-1]\ndpNeg[-1] = 10 - digits[-1]\n\nfor place in reversed(range(len(digits) - 1)):\n # Positive balance case\n exact = digits[place]\n overpay = exact + 1\n dpPos[place] = min(exact + dpPos[place + 1], overpay + dpNeg[place + 1])\n # Negative balance case\n exact = 10 - digits[place] - 1\n overpay = exact + 1\n dpNeg[place] = min(exact + dpNeg[place + 1], overpay + dpPos[place + 1])\nprint(dpPos[0])\n","change":"replace","i1":3,"i2":30,"j1":3,"j2":23,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02777","language":"Python","original_status":"Runtime Error","pass":"S, T = map(input().split())\nA, B = map(int, input().split())\nU = input()\n\nprint(\"A-1 B\" if U == S else \"A B-1\")\n","fail":"S, T = input().split()\nA, B = map(int, input().split())\nU = input()\n\nprint(A - 1, B) if U == S else print(A, B - 1)\n","change":"replace","i1":0,"i2":5,"j1":0,"j2":5,"error":"TypeError: map() must have at least two arguments.","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02777\/Python\/s951886607.py\", line 1, in \n S, T = map(input().split())\nTypeError: map() must have at least two arguments.\n","stdout":null} {"problem_id":"p02777","language":"Python","original_status":"Runtime Error","pass":"S = list(map(str, input().split()))\nA = list(map(int, input().split()))\nU = int(input())\n\nind = S.index(U)\n\nA[ind] -= 1\n\nprint(\"\".join(A))\n","fail":"S = list(map(str, input().split()))\nA = list(map(int, input().split()))\nU = input()\n\nind = S.index(U)\n\nA[ind] -= 1\n\nprint(\" \".join(list(map(str, A))))\n","change":"replace","i1":2,"i2":9,"j1":2,"j2":9,"error":"ValueError: invalid literal for int() with base 10: 'red'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02777\/Python\/s433629607.py\", line 3, in \n U = int(input())\nValueError: invalid literal for int() with base 10: 'red'\n","stdout":null} {"problem_id":"p02777","language":"Python","original_status":"Runtime Error","pass":"S, T = input().split()\nA, B = input().split()\nU = input()\n\nprint(f\"{int(A) - 1 if S == U else 0} {int(B) - 1 if T == U else 0}\")\n","fail":"S, T = input().split()\nA, B = input().split()\nU = input()\n\nprint(\"{} {}\".format(int(A) - (1 if S == U else 0), int(B) - (1 if T == U else 0)))\n","change":"replace","i1":4,"i2":5,"j1":4,"j2":5,"error":"WA","stderr":null,"stdout":"2 0\n"} {"problem_id":"p02777","language":"Python","original_status":"Runtime Error","pass":"S, T = input().split()\nA, B = map(int, input().split())\nU = input()\n\nif U == S:\n A -= 1\nelse:\n B -= 1\n\nprint(f\"{A} {B}\")\n","fail":"S, T = input().split()\nA, B = map(int, input().split())\nU = input()\n\nif U == S:\n A -= 1\nelse:\n B -= 1\n\nprint(A, B)\n","change":"replace","i1":9,"i2":10,"j1":9,"j2":10,"error":"0","stderr":null,"stdout":"2 4\n"} {"problem_id":"p02777","language":"Python","original_status":"Runtime Error","pass":"S, T = list(input().split())\nA, B = list(map(int, input().split()))\nU = input()\ndict = {}\ndict[S] = A\ndict[T] = B\ndict[U] -= 1\nprint(f\"{dict[S]} {dict[T]}\")\n","fail":"S, T = list(input().split())\nA, B = list(map(int, input().split()))\nU = input()\ndict = {}\ndict[S] = A\ndict[T] = B\ndict[U] -= 1\nprint(dict[S], dict[T])\n","change":"replace","i1":7,"i2":8,"j1":7,"j2":8,"error":"0","stderr":null,"stdout":"2 4\n"} {"problem_id":"p02777","language":"Python","original_status":"Runtime Error","pass":"s, t = map(input().split())\n\na, b = map(int(input().split()))\n\nu = input()\n\nif s == u:\n print(a - 1, b)\nelif t == u:\n print(a, b - 1)\n","fail":"s, t = input().split()\n\na, b = map(int, input().split())\n\nu = input()\n\nif s == u:\n print(a - 1, b)\nelif t == u:\n print(a, b - 1)\n","change":"replace","i1":0,"i2":3,"j1":0,"j2":3,"error":"TypeError: map() must have at least two arguments.","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02777\/Python\/s053537362.py\", line 1, in \n s, t = map(input().split())\nTypeError: map() must have at least two arguments.\n","stdout":null} {"problem_id":"p02777","language":"Python","original_status":"Runtime Error","pass":"keys = input.split()\nvalues = tuple(map(int, input().split()))\n\nball = dict(zip(keys, values))\nu = input()\n\nball[u] -= 1\nprint(ball[keys[0]], ball[keys[1]])\n","fail":"keys = input().split()\nvalues = tuple(map(int, input().split()))\n\nball = dict(zip(keys, values))\nu = input()\n\nball[u] -= 1\nprint(ball[keys[0]], ball[keys[1]])\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"AttributeError: 'builtin_function_or_method' object has no attribute 'split'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02777\/Python\/s850348662.py\", line 1, in \n keys = input.split()\nAttributeError: 'builtin_function_or_method' object has no attribute 'split'\n","stdout":null} {"problem_id":"p02779","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = input().split()\nfor i in A:\n A = [j for j in A if j != i]\n if len(A) == N - 1:\n N -= 1\n continue\n else:\n print(\"NO\")\n break\nif N == 0:\n print(\"YES\")\n","fail":"N = int(input())\nA = input().split()\nif len(A) == len(set(A)):\n print(\"YES\")\nelse:\n print(\"NO\")\n","change":"replace","i1":2,"i2":12,"j1":2,"j2":6,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02779","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = list(map(int, input().split()))\nfor i in a:\n if a.count(i) >= 2:\n print(\"NO\")\n exit()\nprint(\"YES\")\n","fail":"n = int(input())\na = list(map(int, input().split()))\nb = set(a)\na.sort()\nif len(a) != len(b):\n print(\"NO\")\nelse:\n print(\"YES\")\n","change":"replace","i1":2,"i2":7,"j1":2,"j2":8,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02779","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = [int(x) for x in input().split()]\nd = []\np = 0\nfor i in range(N):\n if A[i] in d:\n p = 1\n break\n d.append(A[i])\nif p == 0:\n print(\"YES\")\nelse:\n print(\"NO\")\n","fail":"N = int(input())\nA = [int(x) for x in input().split()]\nA.sort()\np = 0\nfor i in range(N - 1):\n if A[i] == A[i + 1]:\n p = 1\n break\nif p == 0:\n print(\"YES\")\nelse:\n print(\"NO\")\n","change":"replace","i1":2,"i2":9,"j1":2,"j2":8,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02779","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = input().split()\nflag = False\nfor i in range(n):\n for j in range(i + 1, n):\n if a[i] == a[j]:\n flag = True\n break\n if flag:\n break\n\nif flag:\n print(\"NO\")\nelse:\n print(\"YES\")\n","fail":"n = int(input())\na = [int(i) for i in input().split()]\nif len(a) != len(set(a)):\n print(\"NO\")\nelse:\n print(\"YES\")\n","change":"replace","i1":1,"i2":12,"j1":1,"j2":3,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02779","language":"Python","original_status":"Runtime Error","pass":"already = [False] * 200000\nn = int(input())\na = list(map(int, input().split()))\nfor x in a:\n if already[x]:\n print(\"NO\")\n break\n already[x] = True\nelse:\n print(\"YES\")\n","fail":"already = {}\nn = int(input())\na = list(map(int, input().split()))\nfor x in a:\n if already.get(x):\n print(\"NO\")\n break\n already[x] = True\nelse:\n print(\"YES\")\n","change":"replace","i1":0,"i2":5,"j1":0,"j2":5,"error":"0","stderr":null,"stdout":"YES\n"} {"problem_id":"p02780","language":"Python","original_status":"Time Limit Exceeded","pass":"n, k = map(int, input().split())\np = list(map(int, input().split()))\nans = 0\n\ntmp = 0\nfor i in range(n):\n tmp += sum(range(1, p[i] + 1)) \/ p[i]\n if i >= k:\n tmp -= sum(range(1, p[i - k] + 1)) \/ p[i - k]\n ans = max(ans, tmp)\n\nprint(ans)\n","fail":"n, k = map(int, input().split())\np = list(map(int, input().split()))\nans = 0\ne = [sum(range(1, pi + 1)) \/ pi for pi in p]\n\ntmp = 0\nfor i in range(n):\n tmp += e[i]\n if i >= k:\n tmp -= e[i - k]\n ans = max(ans, tmp)\n\nprint(ans)\n","change":"replace","i1":3,"i2":9,"j1":3,"j2":10,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02780","language":"Python","original_status":"Time Limit Exceeded","pass":"N, K = map(int, input().split())\nP = list(map(int, input().split()))\nA = [(p + 1) \/ 2 for p in P]\nans = 0\nfor i in range(K - 1, N):\n a = 0\n for j in range(K):\n a += A[i - j]\n if a > ans:\n ans = a\nprint(ans)\n","fail":"N, K = map(int, input().split())\nP = list(map(int, input().split()))\nA = [(p + 1) \/ 2 for p in P]\nB = [0 for i in range(N)]\nB[0] = A[0]\nfor i in range(1, N):\n B[i] = B[i - 1] + A[i]\nans = 0\nfor i in range(K - 1, N):\n if i == K - 1:\n a = B[i]\n else:\n a = B[i] - B[i - K]\n if ans < a:\n ans = a\nprint(ans)\n","change":"replace","i1":3,"i2":9,"j1":3,"j2":14,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02780","language":"Python","original_status":"Time Limit Exceeded","pass":"def f(i):\n return (i + 1) \/ 2\n\n\nn, k = [int(i) for i in input().split()]\np = [f(int(i)) for i in input().split()]\nans = sum(p[0:k])\nfor i in range(1, n - 2):\n ans = max(ans, sum(p[i : i + k]))\nprint(ans)\n","fail":"def f(x):\n return (x + 1) \/ 2\n\n\nn, k = [int(i) for i in input().split()]\np = [f(int(i)) for i in input().split()]\nans = sum(p[:k])\na = ans\nfor i in range(k, n):\n a = a + p[i] - p[i - k]\n ans = max(ans, a)\nprint(ans)\n","change":"replace","i1":0,"i2":9,"j1":0,"j2":11,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02780","language":"Python","original_status":"Time Limit Exceeded","pass":"N, K = map(int, input().split())\nP = list(map(int, input().split()))\n\nV = [0] * (N + 1)\n\nfor i in range(N):\n V[i + 1] = V[i] + sum(range(1, P[i] + 1)) \/ P[i]\n\n# print(V)\n\nres = 0\nfor i in range(N + 1 - K):\n res = max(res, V[i + K] - V[i])\n\nprint(res)\n","fail":"N, K = map(int, input().split())\nP = list(map(int, input().split()))\n\nV = [0] * (N + 1)\nS = [0] * (1010)\nfor i in range(1009):\n S[i + 1] = S[i] + (i + 1)\n# print(S)\n\nfor i in range(N):\n p = P[i]\n V[i + 1] = V[i] + S[p] \/ p\n\n# print(V)\n\nres = 0\nfor i in range(N + 1 - K):\n res = max(res, V[i + K] - V[i])\n\nprint(res)\n","change":"replace","i1":4,"i2":7,"j1":4,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02780","language":"Python","original_status":"Time Limit Exceeded","pass":"N, K = map(int, input().split())\nP = list(map(int, input().split()))\nanswer = 0\nfor i in range(N - K + 1):\n t = 0\n for j in range(i, i + K):\n j = P[j]\n t += (j * (j + 1) \/ 2) \/ j\n answer = max(answer, t)\nprint(answer)\n","fail":"N, K = map(int, input().split())\nP = list(map(int, input().split()))\nt = [0] * 1000000\nfor i in range(N):\n t[i + 1] = t[i] + P[i] + 1\nans = 0\nfor i in range(N - K + 1):\n ans = max(ans, t[i + K] - t[i])\nprint(ans \/ 2)\n","change":"replace","i1":2,"i2":10,"j1":2,"j2":9,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02780","language":"Python","original_status":"Time Limit Exceeded","pass":"n, k = map(int, input().split())\np = list(map(int, input().split()))\nans = 0\nfor i in range(n - k + 1):\n x = 0\n for j in range(k):\n pj = p[i + j]\n x += (1 + pj) \/ 2\n ans = max(ans, x)\nprint(ans)\n","fail":"n, k = map(int, input().split())\np = list(map(int, input().split()))\na = [0 for _ in range(n + 1)]\nfor i, pi in enumerate(p):\n a[i + 1] = a[i] + (1 + pi) \/ 2\n\nans = 0\nfor i in range(n - k + 1):\n ans = max(ans, a[i + k] - a[i])\nprint(ans)\n","change":"replace","i1":2,"i2":9,"j1":2,"j2":9,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02780","language":"Python","original_status":"Time Limit Exceeded","pass":"N, K = map(int, input().split())\np = list(map(int, input().split()))\n\nfrst_idx = 0\nMAX = 0\nfor i in range(N - K + 1):\n MAX = max(MAX, (sum(p[i : i + K]) + K) * 0.5)\nprint(MAX)\n","fail":"N, K = map(int, input().split())\np = list(map(int, input().split()))\n\nMAX = 0\n# dp[i] i \u756a\u76ee\u304b\u3089 i + K - 1 \u756a\u76ee\u307e\u3067\u306e\u30b5\u30a4\u30b3\u30ed\u306e\u671f\u5f85\u5024\u306e\u548c\ndp = [0] * N\nfor i in range(N - K + 1):\n if i < 1:\n dp[i] = 0.5 * (sum(p[:K]) + K)\n else:\n dp[i] = dp[i - 1] - 0.5 * p[i - 1] + 0.5 * p[i + K - 1]\n\n MAX = max(MAX, dp[i])\nprint(MAX)\n","change":"replace","i1":3,"i2":7,"j1":3,"j2":13,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02780","language":"Python","original_status":"Time Limit Exceeded","pass":"from collections import deque\n\n\nline = input().split(\" \")\nN, K = int(line[0]), int(line[1])\nline = input().split(\" \")\ndices = [int(c) for c in line]\n\nmax_E = 0\nexpectations = deque([0] * K, maxlen=K)\n\nE = 0\nfor dice in dices:\n E -= expectations.popleft()\n e = sum(range(1, dice + 1)) \/ dice\n expectations.append(e)\n E += e\n if E < max_E:\n continue\n else:\n max_E = E\n\nprint(max_E)\n","fail":"from collections import deque\n\n\nline = input().split(\" \")\nN, K = int(line[0]), int(line[1])\nline = input().split(\" \")\ndices = [int(c) for c in line]\n\nmax_E = 0\nexpectations = deque([0] * K, maxlen=K)\ne_memo = {}\nE = 0\nfor dice in dices:\n E -= expectations.popleft()\n if e_memo.get(dice) is None:\n e_memo[dice] = sum(range(1, dice + 1)) \/ dice\n e = e_memo[dice]\n expectations.append(e)\n E += e\n if E < max_E:\n continue\n else:\n max_E = E\n\nprint(max_E)\n","change":"replace","i1":10,"i2":15,"j1":10,"j2":17,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02780","language":"Python","original_status":"Runtime Error","pass":"N, K = list(map(int, input().split()))\np = list(map(int, input().split()))\n\n# cumulated value\nc_p = [0] * N\nc_p[0] = p[0]\n\nfor i in range(1, N):\n c_p[i] = c_p[i - 1] + p[i]\n\nmax_e = 0\n\nfor i in range(N - K + 1):\n e = c_p[i + K] - c_p[i]\n if e > max_e:\n max_e = e\n\nprint((max_e + K) \/ 2)\n","fail":"N, K = list(map(int, input().split()))\np = list(map(int, input().split()))\n\n# cumulated value\nc_p = [0] * N\nc_p[0] = p[0]\n\nfor i in range(1, N):\n c_p[i] = c_p[i - 1] + p[i]\n\nmax_e = c_p[K - 1]\n\nfor i in range(K, N):\n e = c_p[i] - c_p[i - K]\n max_e = max(max_e, e)\n\nprint((max_e + K) \/ 2)\n","change":"replace","i1":10,"i2":16,"j1":10,"j2":15,"error":"IndexError: list index out of range","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02780\/Python\/s069038365.py\", line 14, in \n e = c_p[i + K] - c_p[i]\nIndexError: list index out of range\n","stdout":null} {"problem_id":"p02780","language":"Python","original_status":"Time Limit Exceeded","pass":"def main():\n N, K = map(int, input().split())\n P = [(v + 1) \/ 2 for v in map(int, input().split())]\n\n ans = 0\n for i in range(N - K + 1):\n ans = max(ans, sum(P[i : i + K]))\n\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"def main():\n N, K = map(int, input().split())\n P = [(v + 1) \/ 2 for v in map(int, input().split())]\n\n ans = tmp = sum(P[0:K])\n for i in range(N - K):\n tmp = tmp - P[i] + P[i + K]\n ans = max(ans, tmp)\n\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":4,"i2":7,"j1":4,"j2":8,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02780","language":"Python","original_status":"Runtime Error","pass":"import sys\nfrom itertools import accumulate\n\n\ndef solve():\n N, K = map(int, sys.stdin.readline().split())\n cusum_p = list(accumulate(map(int, sys.stdin.read().split()), initial=0))\n return (max(i - j for i, j in zip(cusum_p[K:], cusum_p[:-K])) + K) \/ 2\n\n\nif __name__ == \"__main__\":\n answer = solve()\n print(answer)\n","fail":"import sys\nfrom itertools import accumulate\n\n\ndef solve():\n N, K = map(int, sys.stdin.readline().split())\n cusum_p = (0,) + tuple(accumulate(map(int, sys.stdin.read().split())))\n return (max(i - j for i, j in zip(cusum_p[K:], cusum_p[:-K])) + K) \/ 2\n\n\nif __name__ == \"__main__\":\n answer = solve()\n print(answer)\n","change":"replace","i1":6,"i2":7,"j1":6,"j2":7,"error":"WA","stderr":null,"stdout":7.0} {"problem_id":"p02780","language":"Python","original_status":"Runtime Error","pass":"n, k = map(int, input().split())\np = list(map(int, input().split()))\n\np_sum = [0] * (n + 1)\n\nfor i in range(1, n + 1):\n p_sum[i] = p_sum[i - 1] + p[i]\n\nans = 0\nfor i in range(-k + 1):\n ans = max(ans, p_sum[i + k] - p_sum[i])\n\nans = (ans + k) \/ 2\nprint(ans)\n","fail":"n, k = map(int, input().split())\np = list(map(int, input().split()))\n\np_sum = [0] * (n + 1)\n\nfor i in range(n):\n p_sum[i + 1] = p_sum[i] + p[i]\n\nans = 0\nfor i in range(n - k + 1):\n ans = max(ans, p_sum[i + k] - p_sum[i])\n\nans = (ans + k) \/ 2\nprint(ans)\n","change":"replace","i1":5,"i2":10,"j1":5,"j2":10,"error":"IndexError: list index out of range","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02780\/Python\/s305740242.py\", line 7, in \n p_sum[i] = p_sum[i - 1] + p[i]\nIndexError: list index out of range\n","stdout":null} {"problem_id":"p02780","language":"Python","original_status":"Time Limit Exceeded","pass":"N, K = map(int, input().split())\nlst = [int(x) for x in input().split()]\na = len(lst) - K + 1\nn = 0\nret_lst = []\nfor i in range(a):\n m = sum(lst[i : i + K])\n if n < m:\n n = m\n ret_lst = lst[i : i + K]\n\nll = [x \/ 2 * (x + 1) \/ x for x in ret_lst]\nprint(sum(ll))\n","fail":"N, K = map(int, input().split())\nlst = [int(x) for x in input().split()]\ntmp = sum(lst[:K])\nret = tmp\nfor i in range(N - K):\n tmp -= lst[i]\n tmp += lst[i + K]\n ret = max(ret, tmp)\nprint((ret + K) \/ 2)\n","change":"replace","i1":2,"i2":13,"j1":2,"j2":9,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02781","language":"Python","original_status":"Runtime Error","pass":"N = input()\nK = int(input())\n\na = 1\nb = [0] * (K + 1)\nb[0] = 1\nb[1] = int(N[0]) - 1\n\nfor c in N[1:]:\n t = int(c)\n for i in range(K - 1, -1, -1):\n b[i + 1] += b[i] * 9\n if t != 0:\n b[a + 1] += t - 1\n b[a] += 1\n a += 1\n\nif a == K:\n print(b[K] + 1)\nelse:\n print(b[K])\n","fail":"N = input()\nK = int(input())\n\na = 1\nb = [0] * (K + 1)\nb[0] = 1\nb[1] = int(N[0]) - 1\n\nfor c in N[1:]:\n t = int(c)\n for i in range(K - 1, -1, -1):\n b[i + 1] += b[i] * 9\n if t != 0:\n if a + 1 <= K:\n b[a + 1] += t - 1\n if a <= K:\n b[a] += 1\n a += 1\n\nif a == K:\n print(b[K] + 1)\nelse:\n print(b[K])\n","change":"replace","i1":13,"i2":15,"j1":13,"j2":17,"error":0,"stderr":null,"stdout":19} {"problem_id":"p02782","language":"Python","original_status":"Runtime Error","pass":"r1, c1, r2, c2 = [int(_) for _ in input().split()]\nmod = 10**9 + 7\n\nf = [1] * (10**6 + 1)\nfor i in range(1, 10**6 + 1):\n f[i] = i * f[i - 1] % mod\nfi = {}\n\n\ndef comb(n, r):\n if r not in fi:\n fi[r] = pow(f[r], mod - 2, mod)\n if n - r not in fi:\n fi[n - r] = pow(f[n - r], mod - 2, mod)\n return (f[n] * fi[r] * fi[n - r]) % mod\n\n\nans = 0\nfor x in range(c1, c2 + 1):\n ans += comb(r2 + x + 1, x + 1) - comb(r1 + x, x + 1)\n ans %= mod\nprint(ans)\n","fail":"r, c, R, C = [int(_) for _ in input().split()]\nmod = 10**9 + 7\n\nf = [1] * (3 * 10**6 + 10)\nfor i in range(1, 3 * 10**6 + 10):\n f[i] = i * f[i - 1] % mod\nfi = {}\n\n\ndef comb(n, r):\n if r not in fi:\n fi[r] = pow(f[r], mod - 2, mod)\n if n - r not in fi:\n fi[n - r] = pow(f[n - r], mod - 2, mod)\n return (f[n] * fi[r] * fi[n - r]) % mod\n\n\na1 = (C + 2) * f[c + 1] * f[C + R + 2] - (c + 1) * f[C + 2] * f[c + R + 1]\na1 *= (\n pow(R + 1, mod - 2, mod)\n * pow(f[c + 1], mod - 2, mod)\n * pow(f[C + 2], mod - 2, mod)\n * pow(f[R], mod - 2, mod)\n)\na2 = (C + 2) * f[c + 1] * f[C + r + 1] - (c + 1) * f[C + 2] * f[c + r]\na2 *= (\n pow(r, mod - 2, mod)\n * pow(f[c + 1], mod - 2, mod)\n * pow(f[C + 2], mod - 2, mod)\n * pow(f[r - 1], mod - 2, mod)\n)\nans = a1 - a2\nans %= mod\nprint(ans)\n","change":"replace","i1":0,"i2":21,"j1":0,"j2":33,"error":"0","stderr":null,"stdout":14.0} {"problem_id":"p02782","language":"Python","original_status":"Time Limit Exceeded","pass":"def inpl():\n return list(map(int, input().split()))\n\n\ndef cmb(n, r):\n # combination\n if n < r:\n return 0\n r = min(n - r, r)\n if r == 0:\n return 1\n return (over[n] * under[r] * under[n - r]) % MOD\n\n\n# \u4e92\u3044\u306b\u7d20\u306ax, y\u306b\u3064\u3044\u3066\u3001a * x + b * y = 1\u306e\u89e3\u306e\u4e00\u3064\u3092\u6c42\u3081\u308b\u3002\ndef extGCD(x, y):\n r = [1, 0, x]\n w = [0, 1, y]\n # print(r, w)\n while w[2] != 1:\n # print(r, w)\n q = r[2] \/\/ w[2]\n w_tmp = [r[0] - q * w[0], r[1] - q * w[1], r[2] % w[2]]\n r, w = w, w_tmp\n\n return w[:2]\n\n\ndef mod_inv(a, m):\n x, _ = extGCD(a, m)\n return (x + m) % m\n\n\ndef g(x, y):\n return (cmb(x + y + 2, x + 1) - 1 + MOD) % MOD\n\n\nr1, c1, r2, c2 = inpl()\n\nMOD = 10**9 + 7\n\nover = [1]\nunder = [1]\nfor i in range(r2 + c2 + 2):\n over.append(over[-1] * (i + 1) % MOD)\n under.append(under[-1] * mod_inv(i + 1, MOD) % MOD)\n\nprint((g(r2, c2) - g(r2, c1 - 1) - g(r1 - 1, c2) + g(r1 - 1, c1 - 1)) % MOD)\n","fail":"def inpl():\n return list(map(int, input().split()))\n\n\ndef cmb(n, r):\n # combination\n if n < r:\n return 0\n r = min(n - r, r)\n if r == 0:\n return 1\n return (over[n] * under[r] * under[n - r]) % MOD\n\n\n# \u4e92\u3044\u306b\u7d20\u306ax, y\u306b\u3064\u3044\u3066\u3001a * x + b * y = 1\u306e\u89e3\u306e\u4e00\u3064\u3092\u6c42\u3081\u308b\u3002\ndef extGCD(x, y):\n r = [1, 0, x]\n w = [0, 1, y]\n # print(r, w)\n while w[2] != 1:\n # print(r, w)\n q = r[2] \/\/ w[2]\n w_tmp = [r[0] - q * w[0], r[1] - q * w[1], r[2] % w[2]]\n r, w = w, w_tmp\n\n return w[:2]\n\n\ndef mod_inv(a, m):\n _, x = extGCD(m, a)\n return (x + m) % m\n\n\ndef g(x, y):\n return (cmb(x + y + 2, x + 1) - 1 + MOD) % MOD\n\n\nr1, c1, r2, c2 = inpl()\n\nMOD = 10**9 + 7\n\nover = [0 for i in range(r2 + c2 + 3)]\nunder = [0 for i in range(r2 + c2 + 3)]\nover[0] = 1\nfor i in range(r2 + c2 + 2):\n over[i + 1] = over[i] * (i + 1) % MOD\n\nunder[r2 + c2 + 2] = mod_inv(over[r2 + c2 + 2], MOD)\nfor i in range(r2 + c2 + 1, 0, -1):\n under[i] = under[i + 1] * (i + 1) % MOD\n\nprint((g(r2, c2) - g(r2, c1 - 1) - g(r1 - 1, c2) + g(r1 - 1, c1 - 1)) % MOD)\n","change":"replace","i1":29,"i2":46,"j1":29,"j2":50,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02783","language":"Python","original_status":"Runtime Error","pass":"H, A = map(int, input().split())\n\nprint(H \/\/ A + min(H % A))\n","fail":"H, A = map(int, input().split())\n\nprint(H \/\/ A + min(H % A, 1))\n","change":"replace","i1":2,"i2":3,"j1":2,"j2":3,"error":"TypeError: 'int' object is not iterable","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02783\/Python\/s363144861.py\", line 3, in \n print(H \/\/ A + min(H % A))\nTypeError: 'int' object is not iterable\n","stdout":null} {"problem_id":"p02783","language":"Python","original_status":"Runtime Error","pass":"h = int(input())\na = int(input())\n\nif h % a == 0:\n print(h \/ a)\nelse:\n print(h \/\/ a + 1)\n","fail":"h, a = map(int, input().split())\n\nif h % a == 0:\n print(h \/\/ a)\nelse:\n print(h \/\/ a + 1)\n","change":"replace","i1":0,"i2":5,"j1":0,"j2":4,"error":"ValueError: invalid literal for int() with base 10: '10 4'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02783\/Python\/s343039066.py\", line 1, in \n h = int(input())\nValueError: invalid literal for int() with base 10: '10 4'\n","stdout":null} {"problem_id":"p02784","language":"Python","original_status":"Runtime Error","pass":"H, N = map(int, input().split())\nattacks = [*map(int, input().split())]\nif sum(attacks) >= H:\n print(\"Yes\")\nelse:\n print(\"No\")\n","fail":"H, N = map(int, input().split())\nattacks = list(map(int, input().split()))\nif sum(attacks) >= H:\n print(\"Yes\")\nelse:\n print(\"No\")\n","change":"replace","i1":1,"i2":2,"j1":1,"j2":2,"error":0,"stderr":null,"stdout":"Yes\n"} {"problem_id":"p02785","language":"Python","original_status":"Runtime Error","pass":"N, K = map(int, input().split())\nH = map(int, input().split())\n\nH.sort(reverse=True)\n\nif K >= N:\n print(0)\nelse:\n print(sum(H[K:]))\n","fail":"N, K = map(int, input().split())\nH = list(map(int, input().split()))\n\nH.sort(reverse=True)\n\nif K >= N:\n print(0)\nelse:\n print(sum(H[K:]))\n","change":"replace","i1":1,"i2":2,"j1":1,"j2":2,"error":"AttributeError: 'map' object has no attribute 'sort'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02785\/Python\/s623070047.py\", line 4, in \n H.sort(reverse=True)\nAttributeError: 'map' object has no attribute 'sort'\n","stdout":null} {"problem_id":"p02785","language":"Python","original_status":"Runtime Error","pass":"s = input().split()\nN = int(s[0])\nK = int(s[1])\n\nH = list(map(int, input().split()))\n\nH_s = sorted(H, reverse=True)\nH_s[:N] = 0\n\nprint(sum(H_s))\n","fail":"s = input().split()\nN = int(s[0])\nK = int(s[1])\n\nH = list(map(int, input().split()))\nH_s = sorted(H, reverse=True)\n\nprint(sum(H_s[K:]))\n","change":"replace","i1":5,"i2":10,"j1":5,"j2":8,"error":"TypeError: can only assign an iterable","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02785\/Python\/s722693756.py\", line 8, in \n H_s[:N] = 0\nTypeError: can only assign an iterable\n","stdout":null} {"problem_id":"p02785","language":"Python","original_status":"Runtime Error","pass":"H, K = map(int, input().split())\nhp = list(int, map(input().split()))\nhp.sort(reverse=True)\nprint(sum(hp[K:]))\n","fail":"H, K = map(int, input().split())\nhp = list(map(int, input().split()))\nhp.sort(reverse=True)\nprint(sum(hp[K:]))\n","change":"replace","i1":1,"i2":2,"j1":1,"j2":2,"error":"TypeError: map() must have at least two arguments.","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02785\/Python\/s611990638.py\", line 2, in \n hp = list(int, map(input().split()))\nTypeError: map() must have at least two arguments.\n","stdout":null} {"problem_id":"p02785","language":"Python","original_status":"Time Limit Exceeded","pass":"from sys import exit\n\nN, K = [int(x) for x in input().split()]\nH = list([int(x) for x in input().split()])\n\nH.sort(reverse=True)\n\nif len(H) <= K:\n print(0)\n exit()\n\nfor _ in range(K):\n H.pop(0)\n\nprint(sum(H))\n","fail":"from sys import exit\n\nN, K = [int(x) for x in input().split()]\nH = list([int(x) for x in input().split()])\n\nif len(H) <= K:\n print(0)\n exit()\n\nH.sort(reverse=True)\nH = H[K:]\n\nprint(sum(H))\n","change":"replace","i1":5,"i2":13,"j1":5,"j2":11,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02786","language":"Python","original_status":"Time Limit Exceeded","pass":"H = int(input())\nn = 0\nmonsters = [H]\nwhile len(monsters) > 0:\n n += 1\n HH = monsters[0] \/\/ 2\n if HH > 0:\n monsters.extend([HH, HH])\n del monsters[0]\n\nprint(n)\n","fail":"H = int(input())\nimport math\n\ns = 0\na = 2\nfor i in range(int(math.log2(H))):\n s += a\n a *= 2\n\nprint(s + 1)\n","change":"replace","i1":1,"i2":11,"j1":1,"j2":10,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02786","language":"Python","original_status":"Time Limit Exceeded","pass":"H = int(input())\nm = 1\nat = 0\nwhile True:\n at += m\n H \/\/= 2\n m *= 2\n if H == 1:\n at += m\n print(at)\n exit()\n","fail":"H = int(input())\nm = 1\nat = 0\nfor i in range(H):\n if H == 1:\n at += m\n print(at)\n exit()\n at += m\n H \/\/= 2\n m *= 2\n","change":"replace","i1":3,"i2":11,"j1":3,"j2":11,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02786","language":"Python","original_status":"Time Limit Exceeded","pass":"# -*- coding: utf-8 -*-\n\nH = int(input())\n\nans = 1\nprev = 1\nwhile True:\n H \/\/= 2\n prev *= 2\n ans += prev\n if H == 1:\n break\n\nprint(ans)\n","fail":"# -*- coding: utf-8 -*-\n\nH = int(input())\n\nans = 1\nprev = 1\nwhile True:\n if H == 1:\n break\n H \/\/= 2\n prev *= 2\n ans += prev\n\nprint(ans)\n","change":"replace","i1":7,"i2":12,"j1":7,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02786","language":"Python","original_status":"Time Limit Exceeded","pass":"H = int(input())\nans = 0\nwhile H > 0:\n if H == 1:\n ans += 1\n else:\n e = H \/\/ 2\n ans += e\n H -= 1\nprint(ans)\n","fail":"H = int(input())\nc = 0\nans = 0\nwhile H > 1:\n H = H \/\/ 2\n c += 1\nfor i in range(c + 1):\n ans += 2**i\nprint(ans)\n","change":"replace","i1":1,"i2":9,"j1":1,"j2":8,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02787","language":"Python","original_status":"Runtime Error","pass":"H, N = map(int, input().split())\nAB = [tuple(map(int, input().split())) for _ in range(N)]\nAB.sort(key=lambda x: x[1])\n\ndp = [0] * (H + 1)\nfor h in range(1, H + 1):\n dp[h] = min([dp[h - a] + b for a, b in AB])\n\nprint(dp[-1])\n","fail":"H, N = map(int, input().split())\nAB = [tuple(map(int, input().split())) for _ in range(N)]\nAB.sort(key=lambda x: x[1])\n\ndp = [0] * (H + 1)\nfor h in range(1, H + 1):\n dp[h] = min([dp[max(h - a, 0)] + b for a, b in AB])\n\nprint(dp[-1])\n","change":"replace","i1":6,"i2":7,"j1":6,"j2":7,"error":"0","stderr":null,"stdout":4.0} {"problem_id":"p02787","language":"Python","original_status":"Time Limit Exceeded","pass":"#!\/usr\/bin\/env python3\n(h, n), *m = [[*map(int, i.split())] for i in open(0)]\ndp = [0] + [10**9] * h\nfor i in range(1, h + 1):\n dp[i] = min(dp[max(i - a, 0)] + b for a, b in m)\nprint(dp[-1])\n","fail":"(h, n), *m = [[*map(int, i.split())] for i in open(0)]\ndp = [0] + [10**9] * h\nfor i in range(1, h + 1):\n for a, b in m:\n dp[i] = min(dp[i], dp[max(i - a, 0)] + b)\nprint(dp[-1])\n","change":"replace","i1":0,"i2":5,"j1":0,"j2":5,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02787","language":"Python","original_status":"Time Limit Exceeded","pass":"def inpl():\n return list(map(int, input().split()))\n\n\nH, N = inpl()\nAB = [inpl() for i in range(N)]\n\n# print(AB)\nans = [float(\"inf\") for _ in range(H + 1)]\nans[0] = 0\n\nfor a, b in AB:\n # print(a, b)\n for i in range(H):\n ni = min(i + a, H)\n # print(i)\n ans[ni] = min(ans[ni], ans[i] + b)\n\nprint(ans[H])\n","fail":"import numpy as np\n\n\ndef inpl():\n return list(map(int, input().split()))\n\n\nH, N = inpl()\nAB = [inpl() for i in range(N)]\n\nA, B = np.array(AB, dtype=np.int64).reshape(N, 2).T\n\ndp = np.zeros(H + 1, dtype=np.int64)\nfor i in range(1, H + 1):\n dp[i] = np.amin(dp[np.maximum(i - A, 0)] + B)\n\nprint(dp[H])\n","change":"replace","i1":0,"i2":19,"j1":0,"j2":17,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02787","language":"Python","original_status":"Time Limit Exceeded","pass":"MAX_LIMIT = 1e30\nH, N = list(map(int, input().split()))\nA, B = [], []\nfor _ in range(N):\n a, b = list(map(int, input().split()))\n A.append(a) # HP\n B.append(b) # power\n\n# dp[i] means minimum power used to reduce HP i\ndp = [MAX_LIMIT] * (H + max(A))\ndp[0] = 0\n\nfor i in range(1, H + max(A)):\n cands = []\n for a, b in zip(A, B):\n if i - a >= 0:\n cands.append(b + dp[i - a])\n if len(cands) == 0:\n dp[i] = MAX_LIMIT # we cannot directly reach this point\n else:\n dp[i] = min(cands)\n\n# print(dp)\nprint(min(dp[H:]))\n","fail":"h, n = map(int, input().split())\nab = [list(map(int, input().split())) for _ in range(n)]\ndp = [0] * (h + max(a for a, b in ab))\nfor i in range(1, h + 1):\n dp[i] = min(dp[i - a] + b for a, b in ab)\nprint(dp[h])\n","change":"replace","i1":0,"i2":24,"j1":0,"j2":6,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02787","language":"Python","original_status":"Runtime Error","pass":"# import itertools\n# import math\nimport numpy as np\n\n\nH, N = map(int, input().split())\nAB = [list(map(int, input().split())) for _ in range(N)]\n\nAB.sort()\n\nans = 0\ndp = np.zeros(H, dtype=int)\nfor a, b in AB:\n ans = max(ans, dp.max() + b)\n np.max(dp[:-a] + b, dp[a:], out=dp[a:])\n\nprint(ans)\n","fail":"from functools import lru_cache\nimport sys\n\nsys.setrecursionlimit(1000000)\n\nH, N = map(int, input().split())\n\nAB = []\nfor i in range(N):\n A, B = map(int, input().split())\n AB.append((A, B))\n\nAB.sort(key=lambda ab: (ab[0] \/ ab[1], -ab[0]), reverse=True)\n\n\n@lru_cache(maxsize=None)\ndef solve(h):\n if h <= 0:\n return 0\n best = float(\"inf\")\n for a, b in AB:\n val = b + solve(h - a)\n if val < best:\n best = val\n else:\n break\n return best\n\n\nprint(solve(H))\n","change":"replace","i1":0,"i2":17,"j1":0,"j2":30,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02787","language":"Python","original_status":"Runtime Error","pass":"def main():\n h, n = map(int, input().split())\n magic_list = []\n\n for _ in range(n):\n a, b = map(int, input().split())\n magic_list.append((a, b))\n\n ans = solve(h, magic_list)\n print(ans)\n\n\ndef solve(h, magic_list):\n # 1-origin\n dp = [0] * (h + 1)\n\n # time O(HN)\n for hp in range(1, h + 1):\n dp[hp] = min(dp[hp - attack] + mp for attack, mp in magic_list)\n\n return dp[h]\n\n\nmain()\n","fail":"def main():\n h, n = map(int, input().split())\n magic_list = []\n\n for _ in range(n):\n a, b = map(int, input().split())\n magic_list.append((a, b))\n\n ans = solve(h, magic_list)\n print(ans)\n\n\ndef solve(h, magic_list):\n # 1-origin\n max_attack = max(magic_list)[0]\n dp = [0] * (h + max_attack)\n\n # time O(HN)\n for hp in range(1, h + 1):\n dp[hp] = min(dp[hp - attack] + mp for attack, mp in magic_list)\n\n return dp[h]\n\n\nmain()\n","change":"replace","i1":14,"i2":15,"j1":14,"j2":16,"error":"0","stderr":null,"stdout":4.0} {"problem_id":"p02787","language":"Python","original_status":"Time Limit Exceeded","pass":"import sys\n\ninput = sys.stdin.readline\nH, N = map(int, input().split())\nmagic = [list(map(int, input().split())) for _ in range(N)]\n\ndp = [0] * (H + 1)\n\nfor i in range(1, H + 1):\n dp[i] = min(dp[max(i - damage, 0)] + cost for damage, cost in magic)\n\nans = dp[H]\n\nprint(ans)\n","fail":"import sys\n\ninput = sys.stdin.readline\nH, N = map(int, input().split())\nmagic = [list(map(int, input().split())) for _ in range(N)]\n\nmax_damage = max(damage for damage, cost in magic)\ndp = [0] * (H + max_damage)\n\nfor i in range(1, H + max_damage):\n dp[i] = min(dp[i - damage] + cost for damage, cost in magic)\n\nans = min(dp[H:])\n\nprint(ans)\n","change":"replace","i1":6,"i2":12,"j1":6,"j2":13,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02787","language":"Python","original_status":"Time Limit Exceeded","pass":"H, N, *AB = map(int, open(0).read().split())\nmagics = [(A, B) for A, B in zip(*[iter(AB)] * 2)]\ndp = [float(\"inf\")] * (H + 1)\ndp[0] = 0\nfor i in range(N):\n A, B = magics[i]\n for h in range(H):\n dp[min(h + A, H)] = min(dp[min(h + A, H)], dp[h] + B)\nprint(dp[-1])\n","fail":"import numpy as np\nfrom numba import njit, i8\n\n\n@njit(i8(i8, i8, i8[:, :]), cache=True)\ndef solve(H, N, magics):\n dp = np.full((H + 1), 1 << 31, dtype=np.int64)\n dp[0] = 0\n for i in range(N):\n A, B = magics[i]\n for h in range(H):\n dp[min(h + A, H)] = min(dp[min(h + A, H)], dp[h] + B)\n return dp[-1]\n\n\nH, N, *AB = map(int, open(0).read().split())\nmagics = np.array([(A, B) for A, B in zip(*[iter(AB)] * 2)], dtype=np.int64)\nprint(solve(H, N, magics))\n","change":"replace","i1":0,"i2":9,"j1":0,"j2":18,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02787","language":"Python","original_status":"Time Limit Exceeded","pass":"h, n = map(int, input().split())\nx = [list(map(int, input().split())) for _ in range(n)]\na, b = x[0]\ndp = [-(-i \/\/ a) * b for i in range(h + 1)]\nfor j in range(1, n):\n a, b = x[j]\n for i in range(h + 1):\n if i >= a:\n dp[i] = min(dp[i], dp[i - a] + b)\n else:\n dp[i] = min(dp[i], b)\nprint(dp[-1])\n","fail":"h, n = map(int, input().split())\nx = [list(map(int, input().split())) for _ in range(n)]\na, b = x[0]\ndp = [-(-i \/\/ a) * b for i in range(h + 1)]\nfor j in range(1, n):\n a, b = x[j]\n for i in range(min(h + 1, a)):\n dp[i] = min(dp[i], b)\n for i in range(a, h + 1):\n dp[i] = min(dp[i], dp[i - a] + b)\nprint(dp[-1])\n","change":"replace","i1":6,"i2":11,"j1":6,"j2":10,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02787","language":"Python","original_status":"Runtime Error","pass":"h, n, *L = map(int, open(0).read().split())\ndp = [0] * (h + 1)\nfor i in range(1, h + 1):\n dp[i] = min(dp[i - a] + b for a, b in zip(*[iter(L)] * 2))\n\nprint(dp[h])\n","fail":"h, n, *L = map(int, open(0).read().split())\ndp = [0] * (h + 99999)\nfor i in range(1, h + 1):\n dp[i] = min(dp[i - a] + b for a, b in zip(*[iter(L)] * 2))\n\nprint(dp[h])\n","change":"replace","i1":1,"i2":2,"j1":1,"j2":2,"error":"0","stderr":null,"stdout":4.0} {"problem_id":"p02787","language":"Python","original_status":"Runtime Error","pass":"import numpy as np\n\n\nh, n = map(int, input().split())\na = np.zeros(n, dtype=int)\nb = np.zeros(n, dtype=int)\nfor i in range(n):\n a[i], b[i] = map(int, input().split())\ndp = np.zeros(10001, dtype=int)\nfor i in range(1, 10001):\n dp[i] = (dp[i - a] + b).min()\nprint(dp[h])\n","fail":"import numpy as np\n\nh, n = map(int, raw_input().split())\na = np.zeros(n, dtype=int)\nb = np.zeros(n, dtype=int)\nfor i in range(n):\n a[i], b[i] = map(int, raw_input().split())\ndp = np.zeros(10001, dtype=int)\nfor i in range(1, 10001):\n dp[i] = (dp[i - a] + b).min()\nprint(dp[h])\n","change":"replace","i1":2,"i2":8,"j1":2,"j2":7,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02787","language":"Python","original_status":"Time Limit Exceeded","pass":"import sys\nimport functools\n\n\ndef inpl():\n return list(map(int, input().split()))\n\n\n@functools.lru_cache(maxsize=None)\ndef solve(h):\n if h <= 0:\n return 0\n\n ret_val = float(\"inf\")\n for a, b in AB:\n ret_val = min(ret_val, b + solve(h - a))\n return ret_val\n\n\nsys.setrecursionlimit(100000)\n\nH, N = inpl()\nAB = [inpl() for i in range(N)]\nAB.sort(key=lambda ab: (ab[0] \/ ab[1], -ab[0]), reverse=True)\n# print(AB)\nprint(solve(H))\n","fail":"import sys\nimport functools\n\n\ndef inpl():\n return list(map(int, input().split()))\n\n\n@functools.lru_cache(maxsize=None)\ndef solve(h):\n if h <= 0:\n return 0\n\n ret_val = float(\"inf\")\n for a, b in AB:\n val = b + solve(h - a)\n if val < ret_val:\n ret_val = val\n else:\n break\n return ret_val\n\n\nsys.setrecursionlimit(100000)\n\nH, N = inpl()\nAB = [inpl() for i in range(N)]\nAB.sort(key=lambda ab: (ab[0] \/ ab[1], -ab[0]), reverse=True)\n# print(AB)\nprint(solve(H))\n","change":"replace","i1":15,"i2":16,"j1":15,"j2":20,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02788","language":"Python","original_status":"Time Limit Exceeded","pass":"N, D, A = map(int, input().split())\nXH = [list(map(int, input().split())) for _ in range(N)]\n\nXH.sort()\nq = []\nt = 0\nresult = 0\nfor x, h in XH:\n while q:\n if x <= q[0][0]:\n break\n t -= q[0][1]\n q.pop(0)\n h -= t\n if h <= 0:\n continue\n c = (h + A - 1) \/\/ A\n result += c\n t += c * A\n q.append((x + 2 * D, c * A))\nprint(result)\n","fail":"from collections import deque\n\nN, D, A = map(int, input().split())\nXH = [list(map(int, input().split())) for _ in range(N)]\n\nXH.sort()\nq = deque()\nt = 0\nresult = 0\nfor x, h in XH:\n while q:\n if x <= q[0][0]:\n break\n t -= q[0][1]\n q.popleft()\n h -= t\n if h <= 0:\n continue\n c = (h + A - 1) \/\/ A\n result += c\n t += c * A\n q.append((x + 2 * D, c * A))\nprint(result)\n","change":"replace","i1":0,"i2":13,"j1":0,"j2":15,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02788","language":"Python","original_status":"Time Limit Exceeded","pass":"def main():\n N, D, A = map(int, input().split())\n\n XHN = []\n for _ in range(N):\n X, H = map(int, input().split())\n XHN.append([X, H, X + 2 * D])\n\n XHN.sort()\n\n q = []\n acc_damege = 0\n ans = 0\n for i in range(N):\n if 0 < XHN[i][1]:\n X, H, bomb_p = XHN[i]\n\n while q:\n acc_x, acc_d = q[0]\n if acc_x < X:\n acc_damege -= acc_d\n del q[0]\n else:\n break\n\n H -= acc_damege\n\n if 0 < H:\n attack_count = H \/\/ -A * -1\n damege = A * attack_count\n ans += attack_count\n XHN[i][1] -= damege\n\n acc_damege += damege\n q.append((bomb_p, damege))\n\n print(ans)\n\n\nmain()\n","fail":"from collections import deque\n\n\ndef main():\n N, D, A = map(int, input().split())\n\n XHN = []\n for _ in range(N):\n X, H = map(int, input().split())\n XHN.append([X, H, X + 2 * D])\n\n XHN.sort()\n\n q = deque()\n acc_damege = 0\n ans = 0\n for i in range(N):\n if 0 < XHN[i][1]:\n X, H, bomb_p = XHN[i]\n\n while q:\n acc_x, acc_d = q[0]\n if acc_x < X:\n acc_damege -= acc_d\n del q[0]\n else:\n break\n\n H -= acc_damege\n\n if 0 < H:\n attack_count = H \/\/ -A * -1\n damege = A * attack_count\n ans += attack_count\n XHN[i][1] -= damege\n\n acc_damege += damege\n q.append((bomb_p, damege))\n\n print(ans)\n\n\nmain()\n","change":"replace","i1":0,"i2":11,"j1":0,"j2":14,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02788","language":"Python","original_status":"Time Limit Exceeded","pass":"n, d, a = map(int, input().split())\nm = [list(map(int, input().split())) for _ in range(n)]\nm.sort()\nif m[0][1] < m[-1][1]:\n for i in range(n):\n m[i][0] = m[i][0] * (-1)\n m.reverse()\nbomb = [0 for _ in range(n)]\nr = 1\nd *= 2\nfor i in range(n):\n while r < n and m[i][0] + d >= m[r][0]:\n r += 1\n bomb[i] = r - 1\nres = 0\nfor i in range(n):\n if m[i][1] > 0:\n tres = (m[i][1] + a - 1) \/\/ a\n res += tres\n dh = tres * a\n for j in range(i, bomb[i] + 1):\n m[j][1] -= dh\nprint(res)\n","fail":"from collections import deque\n\nn, d, a = map(int, input().split())\nm = [list(map(int, input().split())) for _ in range(n)]\nm.sort()\nr = 1\nd *= 2\nq = deque([])\nfor i in range(n):\n while r < n and m[i][0] + d >= m[r][0]:\n r += 1\n m[i].append(r)\n m[i][1] = (m[i][1] + a - 1) \/\/ a\nres = 0\ntdamage = 0\nfor i in range(n):\n while q and q[0][0] <= i:\n minus = q.popleft()\n tdamage -= minus[1]\n m[i][1] -= tdamage\n if m[i][1] > 0:\n res += m[i][1]\n tdamage += m[i][1]\n q.append([m[i][2], m[i][1]])\nprint(res)\n","change":"replace","i1":0,"i2":22,"j1":0,"j2":24,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02788","language":"Python","original_status":"Time Limit Exceeded","pass":"from collections import deque\nimport sys\n\n\nN, D, A = map(int, input().split())\nM = [tuple(map(int, x.split())) for x in sys.stdin.readlines()]\nM.sort()\n\nq = deque()\nqt = deque()\n\nans = 0\nfor x, h in M:\n if len(q) == 0:\n bomb = (h + A - 1) \/\/ A\n q.append((x + 2 * D, bomb))\n ans += bomb\n else:\n while h > 0:\n d, bomb = q.popleft()\n if x <= d:\n h -= bomb * A\n qt.append((d, bomb))\n if h > 0 and len(q) == 0:\n bomb = (h + A - 1) \/\/ A\n h -= bomb * A\n qt.append((x + 2 * D, bomb))\n ans += bomb\n while len(qt) > 0:\n q.appendleft(qt.pop())\n\nprint(ans)\n","fail":"from collections import deque\nimport sys\n\n\nN, D, A = map(int, input().split())\nM = [tuple(map(int, x.split())) for x in sys.stdin.readlines()]\nM.sort()\n\nq = deque()\nqt = deque()\n\nans = 0\ndmg = 0\nfor x, h in M:\n if len(q) == 0:\n bomb = (h + A - 1) \/\/ A\n q.append((x + 2 * D, bomb))\n dmg += bomb * A\n ans += bomb\n else:\n while len(q) > 0:\n d, bomb = q.popleft()\n if d < x:\n dmg -= bomb * A\n else:\n q.appendleft((d, bomb))\n break\n if h > dmg:\n bomb = ((h - dmg) + A - 1) \/\/ A\n q.append((x + 2 * D, bomb))\n dmg += bomb * A\n ans += bomb\n\nprint(ans)\n","change":"replace","i1":12,"i2":30,"j1":12,"j2":32,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02788","language":"Python","original_status":"Time Limit Exceeded","pass":"from heapq import heapify, heappush, heappop\n\nN, D, A = map(int, input().split())\nXH = [tuple(map(int, input().split())) for _ in range(N)]\n\nheap = [(x, h, True) for x, h in XH]\nheapify(heap)\n\nans = 0\nbomb_effect = 0\nwhile heap:\n x, h, monster_flg = heappop(heap)\n if monster_flg:\n tairyoku = h - bomb_effect\n if tairyoku > 0:\n new_bomb = -((-tairyoku) \/\/ A)\n ans += new_bomb\n heappush(heap, (x + 2 * D + 0.5, new_bomb, False))\n bomb_effect += new_bomb * A\n else:\n bomb_effect -= h * A\n\nprint(ans)\n","fail":"N, D, A = map(int, input().split())\nXH = [tuple(map(int, input().split())) for _ in range(N)]\nXH.sort()\n\n\nans = 0\nbomb_effect = 0\nbomb_i = 0\nbombs = []\nfor x, h in XH:\n while (bomb_i < len(bombs)) and (x > bombs[bomb_i][0]):\n bomb_effect -= bombs[bomb_i][1] * A\n bomb_i += 1\n\n tairyoku = h - bomb_effect\n if tairyoku > 0:\n new_bomb = -((-tairyoku) \/\/ A)\n ans += new_bomb\n bombs.append((x + 2 * D + 0.5, new_bomb))\n bomb_effect += new_bomb * A\n\nprint(ans)\n","change":"replace","i1":0,"i2":21,"j1":0,"j2":20,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02788","language":"Python","original_status":"Time Limit Exceeded","pass":"from heapq import heapify, heappop, heappush\nfrom math import ceil\nimport sys\n\ninput = sys.stdin.readline\n\n\ndef main():\n n, d, a = map(int, input().split())\n hp = [list(map(int, input().split())) for _ in range(n)]\n heapify(hp)\n\n ans = 0\n\n while hp:\n left = heappop(hp)\n cnt = ceil(left[1] \/ a)\n li = []\n while hp and hp[0][0] <= left[0] + 2 * d:\n nxt = heappop(hp)\n if nxt[1] - a * cnt > 0:\n li.append([nxt[0], nxt[1] - a * cnt])\n\n for e in li:\n heappush(hp, e)\n\n ans += cnt\n\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"from heapq import heapify, heappush, heappop\nfrom math import ceil\n\nREAL = 0\nUNREAL = 1\n\nn, d, a = map(int, input().split())\nxh = [list(map(int, input().split())) for _ in range(n)]\n\nhp = []\nfor x, h in xh:\n heappush(hp, [x, REAL, h])\n\nbomb_acm = 0\nans = 0\nwhile hp:\n x, r, h = heappop(hp)\n if r == REAL:\n if h > bomb_acm:\n left = h - bomb_acm\n bomb_cnt = ceil(left \/ a)\n hp_dis = a * bomb_cnt\n bomb_acm += hp_dis\n heappush(hp, [x + 2 * d, UNREAL, hp_dis])\n ans += bomb_cnt\n\n else: # r == UNREAL\n bomb_acm -= h\n\nprint(ans)\n","change":"replace","i1":0,"i2":33,"j1":0,"j2":30,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02788","language":"Python","original_status":"Time Limit Exceeded","pass":"from sys import stdin\n\nn, d, a = (int(v) for v in stdin.readline().split())\nmonsters = [(int(v) for v in stdin.readline().split()) for i in range(n)]\n\nmonsters = [[x, (h \/\/ a + 1) if h % a > 0 else (h \/\/ a)] for x, h in monsters]\nmonsters = sorted(monsters)\nbomb_size = 2 * d + 1\nnum_bombs = 0\n\nptr = 0\nwhile ptr < len(monsters):\n while ptr < len(monsters) and monsters[ptr][1] <= 0:\n ptr += 1\n if ptr < len(monsters):\n position = monsters[ptr][0]\n bombs_now = monsters[ptr][1]\n i = ptr\n while i < len(monsters) and monsters[i][0] - position < bomb_size:\n monsters[i][1] -= bombs_now\n i += 1\n num_bombs += bombs_now\n\nprint(num_bombs)\n","fail":"from sys import stdin\nfrom collections import deque\n\nn, d, a = (int(v) for v in stdin.readline().split())\nmonsters = [(int(v) for v in line.split()) for line in stdin.readlines()]\n\nmonsters = [[x, (h \/\/ a + 1) if h % a > 0 else (h \/\/ a)] for x, h in monsters]\nmonsters = sorted(monsters)\nbomb_size = 2 * d + 1\nnum_bombs = 0\n\ncurrent_bombs = 0\nbomb_endpoints = deque()\nbomb_endnumbers = deque()\n\nfor i in range(len(monsters)):\n while len(bomb_endpoints) > 0 and bomb_endpoints[0] <= monsters[i][0]:\n current_bombs -= bomb_endnumbers[0]\n bomb_endpoints.popleft()\n bomb_endnumbers.popleft()\n monsters[i][1] -= current_bombs\n if monsters[i][1] > 0:\n bombs_now = monsters[i][1]\n monsters[i][1] = 0\n num_bombs += bombs_now\n current_bombs += bombs_now\n bomb_endpoints.append(monsters[i][0] + bomb_size)\n bomb_endnumbers.append(bombs_now)\n\nprint(num_bombs)\n","change":"replace","i1":1,"i2":22,"j1":1,"j2":28,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02789","language":"Python","original_status":"Runtime Error","pass":"n, m = map(int, input().split())\n\nif n \/ m == 1:\n print(\"Yes\")\nelse:\n print(\"No\")\n","fail":"n, m = map(int, input().split())\n\nif n == m:\n print(\"Yes\")\nelse:\n print(\"No\")\n","change":"replace","i1":2,"i2":3,"j1":2,"j2":3,"error":0,"stderr":null,"stdout":"Yes\n"} {"problem_id":"p02790","language":"Python","original_status":"Runtime Error","pass":"data = input().split()\n\na = data[0]\nb = data[1]\n\nans = min(a, b) * max(a, b)\n\nprint(ans)\n","fail":"data = input().split()\n\na = data[0]\nb = data[1]\n\nans = min(a, b) * int(max(a, b))\n\nprint(ans)\n","change":"replace","i1":5,"i2":6,"j1":5,"j2":6,"error":"TypeError: can't multiply sequence by non-int of type 'str'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02790\/Python\/s088084103.py\", line 6, in \n ans = min(a, b) * max(a, b)\nTypeError: can't multiply sequence by non-int of type 'str'\n","stdout":null} {"problem_id":"p02791","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nP = list(map(int, input().split()))\nans = 1\n\nfor i in range(1, N):\n if P[i] <= min(P[:i]):\n ans += 1\n\nprint(ans)\n","fail":"N = int(input())\nP = list(map(int, input().split()))\n\n\"\"\"\n\u53c2\u8003\nhttps:\/\/cocoinit23.com\/abc152\/\n\u3059\u3079\u3066\u306e(i, j)\u3092\u8abf\u3079\u3066\u3044\u308b\u3068\u5236\u9650\u6642\u9593\u3092\u8d85\u904e\u3057\u3066\u3057\u307e\u3046\u3002\nlist\u306e2\u3064\u76ee\u306e\u8981\u7d20(index=1)\u304b\u3089\u9806\u306b\u898b\u3066\u3044\u3063\u3066\u3001\u6700\u5c0f\u5024\u304c\u66f4\u65b0\u3055\u308c\u305f\u3089\u89e3\u3092\u30ab\u30a6\u30f3\u30c8\u30a2\u30c3\u30d7\u3059\u308b\u3002\n\u305f\u3060\u3057\u3001\u89e3\u306e\u6700\u5c0f\u5024\u306f\u5e38\u306b1\u3068\u306a\u308b\u306e\u3067\u3001\u89e3\u306e\u521d\u671f\u5024\u306f1\u306b\u3057\u3066\u304a\u304f\u3053\u3068\u3002\n\"\"\"\nans = 1\nmin_p = P[0]\n\nfor i in range(1, N):\n if P[i] <= min_p:\n min_p = P[i]\n ans += 1\n\nprint(ans)\n","change":"replace","i1":2,"i2":6,"j1":2,"j2":16,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02791","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\np = list(map(int, input().split()))\nt = []\nc = 0\nfor i in p:\n t += [i]\n if i <= min(t):\n c += 1\nprint(c)\n","fail":"n = int(input())\np = list(map(int, input().split()))\nt = n\nc = 0\nfor i in range(n):\n t = min(t, p[i])\n if p[i] <= t:\n c += 1\nprint(c)\n","change":"replace","i1":2,"i2":7,"j1":2,"j2":7,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02791","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\np_list = list(map(int, input().split()))\nans = 1\nfor i in range(1, n):\n if all([p_list[i] <= p_list[j] for j in range(i)]):\n ans += 1\nprint(ans)\n","fail":"n = int(input())\np_list = list(map(int, input().split()))\nans = 1\nmin = p_list[0]\nfor i in range(1, n):\n if min >= p_list[i]:\n ans += 1\n min = p_list[i]\nprint(ans)\n","change":"replace","i1":3,"i2":6,"j1":3,"j2":8,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02791","language":"Python","original_status":"Runtime Error","pass":"n = int(input())\np = map(int, input().split())\nm = 1\n\nif n > 1:\n for i, pi in enumerate(p):\n if pi <= i:\n continue\n elif all([pj >= pi for pj in p[:i]]):\n m += 1\n else:\n continue\n\nprint(m)\n","fail":"n = int(input())\np = list(map(int, input().split()))\n\nq = p[0]\np = p[1:]\n\nm = 1\n\nif n > 1:\n for pi in p:\n if q > pi:\n m += 1\n q = pi\n\nprint(m)\n","change":"replace","i1":1,"i2":12,"j1":1,"j2":13,"error":"TypeError: 'map' object is not subscriptable","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02791\/Python\/s560223723.py\", line 9, in \n elif all([pj >= pi for pj in p[:i]]):\nTypeError: 'map' object is not subscriptable\n","stdout":null} {"problem_id":"p02791","language":"Python","original_status":"Time Limit Exceeded","pass":"import numpy as np\n\nN = int(input())\nP = list(map(int, input().split()))\n\nvalue = np.array(P)\n\nac = [v for i, v in enumerate(P) if v == np.minimum.accumulate(P)[i]]\n\nprint(len(ac))\n","fail":"N = int(input())\nP = list(map(int, input().split()))\n\nvalue = 10**9\nans = 0\nfor v in P:\n if v < value:\n ans += 1\n value = v\nprint(ans)\n","change":"replace","i1":0,"i2":10,"j1":0,"j2":10,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02791","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\np = list(map(int, input().split()))\n\nmax0, max1, count = [], 0, 0\nfor i in p:\n max0.append(i)\n max1 = i\n if max1 == 1:\n count += 1\n break\n elif min(max0) >= max1:\n count += 1\nprint(count)\n","fail":"N = int(input())\np = list(map(int, input().split()))\n\nmax0, max1, count = p[0], 0, 0\nfor i in p:\n max0 = min(max0, i)\n max1 = i\n if max1 == 1:\n count += 1\n break\n elif max0 >= max1:\n count += 1\nprint(count)\n","change":"replace","i1":3,"i2":11,"j1":3,"j2":11,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02791","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nP = list(map(int, input().split()))\n\nc = 0\ntry:\n while P:\n p_i = P.pop()\n if p_i <= min(P):\n c += 1\nexcept ValueError:\n print(c + 1)\n","fail":"N = int(input())\nP = map(int, input().split())\n\nm = next(P)\nc = 1\nfor p in P:\n if p <= m:\n m = p\n c += 1\nprint(c)\n","change":"replace","i1":1,"i2":11,"j1":1,"j2":10,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02791","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\np = list(map(int, input().split()))\n# result_list = [0]*n\nresult_count = 0\n\nfor i in range(n):\n for j in range(i):\n if p[i] > p[j]:\n # result_list[i] = 1\n result_count += 1\n break\n\n# print(result_list.count(0))\nprint(n - result_count)\n","fail":"n = int(input())\np = list(map(int, input().split()))\n# result_list = [0]*n\nresult = 1\ncom_val = p[0]\n\nfor i in range(1, n):\n if com_val < p[i]:\n continue\n else:\n result += 1\n com_val = p[i]\n\nprint(result)\n","change":"replace","i1":3,"i2":14,"j1":3,"j2":14,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02791","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nP = list(map(int, input().split()))\nprint(1 + sum([int(P[i] <= min(P[:i])) for i in range(1, N)]))\n","fail":"N = int(input())\nP = list(map(int, input().split()))\nQ = []\nm = 10**17\nfor p in P:\n m = min(m, p)\n Q.append(m)\nc = 0\nfor x, y in zip(P, Q):\n if x <= y:\n c += 1\nprint(c)\n","change":"replace","i1":2,"i2":3,"j1":2,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02791","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\nlst = list(map(int, input().split()))\n\ncnt = 0\ntmp = []\nfor i in range(len(lst)):\n num = lst[i]\n tmp.append(num)\n if num == min(tmp):\n cnt += 1\n\nprint(cnt)\n","fail":"n = int(input())\nlst = list(map(int, input().split()))\n\ncnt = 0\ntmp_min = max(lst)\nfor i in range(len(lst)):\n num = lst[i]\n if num <= tmp_min:\n cnt += 1\n tmp_min = num\n\nprint(cnt)\n","change":"replace","i1":4,"i2":10,"j1":4,"j2":10,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02791","language":"Python","original_status":"Time Limit Exceeded","pass":"#!\/usr\/bin\/env python3\n# -*- coding: utf-8 -*-\n\n\ndef main():\n n = int(input())\n p = list(map(int, input().split()))\n\n count = 0\n for i in range(0, n):\n for j in range(0, i + 1):\n if p[i] > p[j]:\n break\n elif j == i:\n count += 1\n print(count)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"#!\/usr\/bin\/env python3\n# -*- coding: utf-8 -*-\n\n\ndef main():\n n = int(input())\n p = list(map(int, input().split()))\n\n count = 0\n n_min = 0\n for i in range(0, n):\n if i == 0:\n count += 1\n n_min = p[i]\n continue\n if p[i] <= n_min:\n count += 1\n n_min = p[i]\n print(count)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":9,"i2":15,"j1":9,"j2":18,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02791","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nP = [int(x) for x in input().split()]\ncount = 0\ncheck = 0\nfor i in range(N):\n check = 0\n for j in range(i):\n if P[i] > P[j]:\n check = 1\n break\n if check == 0:\n count += 1\n\nprint(count)\n","fail":"N = int(input())\nP = [int(x) for x in input().split()]\ncount = 0\ncheck = 0\nmin = 10**9\nfor i in P:\n check = 0\n if min > i:\n min = i\n if i <= min:\n count += 1\n\nprint(count)\n","change":"replace","i1":4,"i2":11,"j1":4,"j2":10,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02791","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nP = list(map(int, input().split()))\n\nans = 0\nfor i in range(N):\n if i == 0:\n ans += 1\n continue\n\n if P[i] <= min(P[:i]):\n ans += 1\n\nprint(ans)\n","fail":"N = int(input())\nP = list(map(int, input().split()))\n\nans = 0\nn_p = 0\nfor i in range(N):\n if i == 0:\n ans += 1\n n_p = P[0]\n continue\n\n if P[i] <= n_p:\n ans += 1\n\n if n_p > P[i]:\n n_p = P[i]\n\n\nprint(ans)\n","change":"replace","i1":4,"i2":12,"j1":4,"j2":18,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02791","language":"Python","original_status":"Time Limit Exceeded","pass":"import numpy as np\n\nN = int(input())\nA = np.array([int(x) for x in input().split()])\nend_set = set()\ncount = 0\n\nfor a in A:\n if not end_set:\n count += 1\n elif a == min(min(end_set), a):\n count += 1\n end_set.add(a)\n\nprint(count)\n","fail":"N = int(input())\nA = list([int(x) for x in input().split()])\ncount = 0\n\nmin_a = N + 1\n\nfor a in A:\n if a == min(min_a, a):\n count += 1\n min_a = a\n\nprint(count)\n","change":"replace","i1":0,"i2":13,"j1":0,"j2":10,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02791","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\np_n = list(map(int, input().split()))\nans = 1\np_i_1 = [p_n[0]]\nfor i in range(1, n):\n if min(p_i_1) > p_n[i]:\n ans += 1\n p_i_1.append(p_n[i])\nprint(ans)\n","fail":"n = int(input())\np_n = list(map(int, input().split()))\nans = 1\np_i_1 = [p_n[0]]\nm = p_n[0]\nfor i in range(1, n):\n if m > p_n[i]:\n ans += 1\n m = min(m, p_n[i])\n p_i_1.append(p_n[i])\n if m == 1:\n break\nprint(ans)\n","change":"replace","i1":4,"i2":8,"j1":4,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02791","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nP = [int(x) for x in input().split()]\nans = 0\nm = 0\nfor i in range(N):\n for j in range(m, i):\n if P[i] > P[j]:\n m = j\n break\n else:\n ans += 1\nprint(ans)\n","fail":"N = int(input())\nP = [int(x) for x in input().split()]\nmins = [0] * N\nmins[0] = P[0]\nfor n in range(1, N):\n mins[n] = min(P[n], mins[n - 1])\nans = 0\nfor i in range(N):\n if P[i] == mins[i]:\n ans += 1\nprint(ans)\n","change":"replace","i1":2,"i2":10,"j1":2,"j2":9,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02791","language":"Python","original_status":"Time Limit Exceeded","pass":"# -*- coding: utf-8 -*-\n\n\n# \u5165\u529b\u3092\u6574\u6570\u306b\u5909\u63db\u3057\u3066\u53d7\u3051\u53d6\u308b\ndef input_int():\n return int(input())\n\n\n# \u30de\u30a4\u30ca\u30b91\u3057\u305f\u5024\u3092\u8fd4\u5374\ndef int1(x):\n return int(x) - 1\n\n\n# \u534a\u89d2\u30b9\u30da\u30fc\u30b9\u533a\u5207\u308a\u5165\u529b\u3092Int\u306b\u5909\u63db\u3057\u3066Map\u3067\u53d7\u3051\u53d6\u308b\ndef input_to_int_map():\n return map(int, input().split())\n\n\n# \u534a\u89d2\u30b9\u30da\u30fc\u30b9\u533a\u5207\u308a\u5165\u529b\u3092Int\u306b\u5909\u63db\u3057\u3066\u53d7\u3051\u53d6\u308b\ndef input_to_int_tuple():\n return tuple(map(int, input().split()))\n\n\n# \u534a\u89d2\u30b9\u30da\u30fc\u30b9\u533a\u5207\u308a\u5165\u529b\u3092Int\u306b\u5909\u63db\u3057\u3066\u30de\u30a4\u30ca\u30b91\u3057\u305f\u5024\u3092\u53d7\u3051\u53d6\u308b\ndef input_to_int_tuple_minus1():\n return tuple(map(int1, input().split()))\n\n\ndef main():\n n = input_int()\n p = input_to_int_tuple()\n\n cnt = 0\n for i in range(n):\n\n if i == 0 or p[i] <= min(p[:i]):\n cnt += 1\n\n # temp = True\n # for j in range(i):\n # if p[i] > p[j]:\n # temp = False\n # break\n # if temp:\n # cnt += 1\n\n print(cnt)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"# -*- coding: utf-8 -*-\n\n\n# \u5165\u529b\u3092\u6574\u6570\u306b\u5909\u63db\u3057\u3066\u53d7\u3051\u53d6\u308b\ndef input_int():\n return int(input())\n\n\n# \u30de\u30a4\u30ca\u30b91\u3057\u305f\u5024\u3092\u8fd4\u5374\ndef int1(x):\n return int(x) - 1\n\n\n# \u534a\u89d2\u30b9\u30da\u30fc\u30b9\u533a\u5207\u308a\u5165\u529b\u3092Int\u306b\u5909\u63db\u3057\u3066Map\u3067\u53d7\u3051\u53d6\u308b\ndef input_to_int_map():\n return map(int, input().split())\n\n\n# \u534a\u89d2\u30b9\u30da\u30fc\u30b9\u533a\u5207\u308a\u5165\u529b\u3092Int\u306b\u5909\u63db\u3057\u3066\u53d7\u3051\u53d6\u308b\ndef input_to_int_tuple():\n return tuple(map(int, input().split()))\n\n\n# \u534a\u89d2\u30b9\u30da\u30fc\u30b9\u533a\u5207\u308a\u5165\u529b\u3092Int\u306b\u5909\u63db\u3057\u3066\u30de\u30a4\u30ca\u30b91\u3057\u305f\u5024\u3092\u53d7\u3051\u53d6\u308b\ndef input_to_int_tuple_minus1():\n return tuple(map(int1, input().split()))\n\n\ndef main():\n n = input_int()\n p = input_to_int_tuple()\n\n cnt = 0\n pre_min = 10**6\n for i in range(n):\n\n if i == 0 or p[i] <= pre_min:\n cnt += 1\n\n pre_min = min(pre_min, p[i])\n\n # temp = True\n # for j in range(i):\n # if p[i] > p[j]:\n # temp = False\n # break\n # if temp:\n # cnt += 1\n\n print(cnt)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":33,"i2":37,"j1":33,"j2":40,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02791","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nP = list(map(int, input().split()))\n\ncount = 1\nfor i in range(1, N):\n if P[i] <= min(P[:i]):\n count += 1\nprint(count)\n","fail":"N = int(input())\nP = list(map(int, input().split()))\n\ncount = 1\nmini = P[0]\nfor i in range(1, N):\n if mini >= P[i]:\n count += 1\n mini = P[i]\n\nprint(count)\n","change":"replace","i1":4,"i2":7,"j1":4,"j2":10,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02791","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nP = list(map(int, input().split()))\nans = 0\nfor i in range(N):\n for j in range(0, i):\n if P[j] < P[i]:\n break\n else:\n ans += 1\nprint(ans)\n","fail":"N = int(input())\nP = list(map(int, input().split()))\nans = 1\ndp = [0 for i in range(N + 1)]\ndp[0] = P[0] # min\nfor i in range(N - 1):\n if P[i + 1] <= dp[i]:\n ans += 1\n dp[i + 1] = P[i + 1]\n else:\n dp[i + 1] = dp[i]\n\nprint(ans)\n","change":"replace","i1":2,"i2":9,"j1":2,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02791","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\np = [int(x) for x in input().split()]\n\nans = 0\n\nfor i in range(n):\n baes = p[i]\n flag = True\n for j in range(i):\n if p[i] > p[j]:\n flag = False\n break\n\n if flag:\n ans += 1\n\nprint(ans)\n","fail":"n = int(input())\np = [int(x) for x in input().split()]\n\nans = 1\nbase = p[0]\n\nfor i in range(1, n):\n if p[i] < base:\n ans += 1\n base = p[i]\n\nprint(ans)\n","change":"replace","i1":3,"i2":15,"j1":3,"j2":10,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02791","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nP = list(map(int, input().split()))\n\ncnt = 1\n\nfor i in reversed(range(1, N)):\n if P[i] < min(P[:i]):\n cnt += 1\n\nprint(cnt)\n","fail":"N = int(input())\nP = list(map(int, input().split()))\n\ncnt = 1\np_min = P[0]\n\nfor i in range(1, N):\n if P[i] < p_min:\n cnt += 1\n p_min = P[i]\n\nprint(cnt)\n","change":"replace","i1":4,"i2":8,"j1":4,"j2":10,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02791","language":"Python","original_status":"Runtime Error","pass":"N = int(input())\nP = map(int, input().split())\n\nret = 0\ncurrmin = P[0]\nfor i in range(N):\n if P[i] <= currmin:\n currmin = P[i]\n ret += 1\n\nprint(ret)\n","fail":"N = int(input())\nP = list(map(int, input().split()))\n\nret = 0\ncurrmin = P[0]\nfor i in range(N):\n if P[i] <= currmin:\n currmin = P[i]\n ret += 1\n\nprint(ret)\n","change":"replace","i1":1,"i2":2,"j1":1,"j2":2,"error":"TypeError: 'map' object is not subscriptable","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02791\/Python\/s629344950.py\", line 5, in \n currmin = P[0]\nTypeError: 'map' object is not subscriptable\n","stdout":null} {"problem_id":"p02791","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nP = list(map(int, input().split()))\ncnt = 0\nfor n in range(N):\n if n == 0:\n cnt += 1\n else:\n L = P[:n]\n L.sort()\n if P[n] <= L[0]:\n cnt += 1\nprint(cnt)\n","fail":"N = int(input())\nP = list(map(int, input().split()))\ncnt = 0\nres = float(\"Inf\")\nfor n in range(N):\n if P[n] < res:\n res = P[n]\n cnt += 1\nprint(cnt)\n","change":"replace","i1":3,"i2":11,"j1":3,"j2":8,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02791","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nP = list(map(int, input().split()))\ncount = 0\nfor i in range(N):\n for n in range(i + 1):\n if P[n] < P[i]:\n break\n if i == n:\n count += 1\nprint(count)\n","fail":"N = int(input())\nP = list(map(int, input().split()))\nMIN = list()\ncount = 0\nMIN.append(P[0])\nfor i in range(1, N):\n MIN.append(min(MIN[i - 1], P[i]))\nfor i in range(0, N):\n if P[i] <= MIN[i]:\n count += 1\nprint(count)\n","change":"replace","i1":2,"i2":9,"j1":2,"j2":10,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02791","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\np_list = list(map(int, input().split()))\nmin_list = []\nmin_list.append(p_list[0])\nans = 1\n\nfor i in range(1, n):\n if p_list[i] <= min(min_list):\n ans += 1\n min_list.append(p_list[i])\n\nprint(ans)\n","fail":"n = int(input())\np_list = list(map(int, input().split()))\nmin_num = p_list[0]\nans = 1\n\nfor i in range(1, n):\n if p_list[i] <= min_num:\n ans += 1\n min_num = min(min_num, p_list[i])\n\nprint(ans)\n","change":"replace","i1":2,"i2":10,"j1":2,"j2":9,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02791","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\np_li = list(map(int, input().split()))\n\nanswer = 0\nfor i in range(len(p_li)):\n count_flag = True\n for j in range(i):\n if p_li[i] <= p_li[j]:\n continue\n else:\n count_flag = False\n break\n if count_flag:\n answer += 1\n\nprint(answer)\n","fail":"n = int(input())\np_li = list(map(int, input().split()))\n\nanswer = 0\nnow_min = 999999\nfor i in range(len(p_li)):\n if now_min > p_li[i]:\n now_min = p_li[i]\n answer += 1\n\nprint(answer)\n","change":"replace","i1":4,"i2":13,"j1":4,"j2":8,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02791","language":"Python","original_status":"Time Limit Exceeded","pass":"def main():\n N = int(input())\n P = list(map(int, input().split()))\n\n ans = 1\n\n for i in range(1, N):\n tmp = min(P[:i])\n if P[i] <= tmp:\n ans += 1\n\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"def main():\n N = int(input())\n P = list(map(int, input().split()))\n\n ans = 1\n tmp = P[0]\n for i in range(1, N):\n if P[i] == 1:\n print(ans + 1)\n return\n\n tmp = min(tmp, P[i])\n if P[i] <= tmp:\n ans += 1\n\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":5,"i2":8,"j1":5,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02791","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\np = list(map(int, input().split()))\n\nans = 1\nfor i in range(1, n):\n if p[i] <= min(p[:i]):\n ans += 1\n\nprint(ans)\n","fail":"n = int(input())\np = list(map(int, input().split()))\n\nans = 1\nmin = p[0]\nfor i in range(1, n):\n if min > p[i]:\n min = p[i]\n if p[i] <= min:\n ans += 1\n\nprint(ans)\n","change":"replace","i1":4,"i2":6,"j1":4,"j2":9,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02791","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nP = list(map(int, input().split()))\n\nans = 1\nfor i in range(1, N):\n if min(P[:i]) >= P[i]:\n ans += 1\nprint(ans)\n","fail":"N = int(input())\nP = list(map(int, input().split()))\n\n# N = 5\n# P = [4, 2, 5, 1, 3]\n\nans = 0\nmin = 2 * 10**5\nfor i in range(0, N):\n # i = 1\n if min > P[i]:\n min = P[i]\n if P[i] <= min:\n ans += 1\n\nprint(ans)\n","change":"replace","i1":3,"i2":7,"j1":3,"j2":15,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02793","language":"Python","original_status":"Time Limit Exceeded","pass":"import fractions\n\nN = int(input())\nA = list(map(int, input().split()))\nL = A[0]\nfor i in range(1, N):\n L = L * A[i] \/\/ fractions.gcd(L, A[i])\n\nans = 0\nfor i in range(N):\n ans = (ans + L \/\/ A[i]) % 1000000007\n\nprint(ans)\n","fail":"import fractions\n\nN = int(input())\nA = list(map(int, input().split()))\nL = A[0]\nfor i in range(1, N):\n L = L * A[i] \/\/ fractions.gcd(L, A[i])\n\nans = 0\nfor i in range(N):\n ans = ans + L \/\/ A[i] #% 1000000007\n\nprint(ans % 1000000007)\n","change":"replace","i1":10,"i2":13,"j1":10,"j2":13,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02793","language":"Python","original_status":"Time Limit Exceeded","pass":"from collections import defaultdict\n\n\ndef factorize(n: int) -> dict:\n f = defaultdict(int)\n while n % 2 == 0:\n f[2] += 1\n n \/\/= 2\n p = 3\n while p * p <= n:\n while n % p == 0:\n f[p] += 1\n n \/\/= p\n p += 2\n if n != 1:\n f[n] += 1\n return f\n\n\ndef _pow(b, p, mod):\n ret = 1\n while p:\n if p % 2 == 1:\n ret *= b\n ret %= mod\n b **= 2\n p \/\/= 2\n return ret\n\n\nMOD = 10**9 + 7\nn = int(input())\na = tuple(map(int, input().split()))\n\na_fac = []\nlcm_fac = defaultdict(int)\nfor a_i in a:\n a_fac_i = factorize(a_i)\n a_fac.append(a_fac_i)\n for k, v in a_fac_i.items():\n lcm_fac[k] = max(lcm_fac[k], v)\n\n# print(lcm_fac)\nans = 0\nfor a_fac_i in a_fac:\n b_i = 1\n for k, v in lcm_fac.items():\n b_i *= _pow(k, v - a_fac_i[k], MOD)\n b_i %= MOD\n # print(i, a[i], b_i)\n ans += b_i\n ans %= MOD\n\nprint(ans)\n","fail":"from collections import defaultdict\n\n\ndef factorize(n: int) -> dict:\n f = defaultdict(int)\n while n % 2 == 0:\n f[2] += 1\n n \/\/= 2\n p = 3\n while p * p <= n:\n while n % p == 0:\n f[p] += 1\n n \/\/= p\n p += 2\n if n != 1:\n f[n] += 1\n return f\n\n\nMOD = 10**9 + 7\nn = int(input())\na = tuple(map(int, input().split()))\n\nMAX_a = max(a)\niinv = [1] * (MAX_a + 1)\nfor i in range(2, MAX_a + 1):\n iinv[i] = MOD - iinv[MOD % i] * (MOD \/\/ i) % MOD\n\na_fac = []\nlcm_fac = defaultdict(int)\nfor a_i in a:\n a_fac_i = factorize(a_i)\n a_fac.append(a_fac_i)\n for k, v in a_fac_i.items():\n lcm_fac[k] = max(lcm_fac[k], v)\n\nlcm = 1\nfor k, v in lcm_fac.items():\n lcm *= pow(k, v, MOD)\n lcm %= MOD\n\nans = 0\nfor i in range(n):\n ans += lcm * iinv[a[i]]\n ans %= MOD\n\nprint(ans)\n","change":"replace","i1":19,"i2":51,"j1":19,"j2":44,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02793","language":"Python","original_status":"Time Limit Exceeded","pass":"import fractions\nimport functools\n\nMOD = 10**9 + 7\n\nN = int(input())\nA = [int(i) for i in input().split()]\n\n\ndef lcm(a, b):\n gcd = fractions.gcd(a, b)\n return (a * b) \/\/ gcd\n\n\nLCM = functools.reduce(lcm, A)\nans = sum([(LCM \/\/ a) % MOD for a in A]) % MOD\n\nprint(ans)\n","fail":"import functools\nimport fractions\n\nMOD = 10**9 + 7\nN = int(input())\nA = [int(i) for i in input().split()]\n\nL = functools.reduce(lambda a, b: a \/\/ fractions.gcd(a, b) * b, A) % MOD\nans = 0\n\nfor a in A:\n ans += L * pow(a, MOD - 2, MOD)\n ans %= MOD\n\nprint(ans)\n","change":"replace","i1":0,"i2":16,"j1":0,"j2":13,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02793","language":"Python","original_status":"Runtime Error","pass":"def lcm(a, b):\n from math import gcd\n\n return a \/\/ gcd(a, b) * b\n\n\ndef main():\n _ = int(input())\n a = list(map(int, input().split()))\n x = 1\n\n for e in a:\n x = lcm(x, e)\n\n ans = 0\n for e in a:\n ans += x \/\/ e\n\n print(ans % int(1e9 + 7))\n\n\nmain()\n","fail":"def lcm(a, b):\n from fractions import gcd\n\n return a \/\/ gcd(a, b) * b\n\n\ndef main():\n _ = int(input())\n a = list(map(int, input().split()))\n x = 1\n\n for e in a:\n x = lcm(x, e)\n\n ans = 0\n for e in a:\n ans += x \/\/ e\n\n print(ans % int(1e9 + 7))\n\n\nmain()\n","change":"replace","i1":1,"i2":2,"j1":1,"j2":2,"error":"0","stderr":null,"stdout":13.0} {"problem_id":"p02794","language":"Python","original_status":"Time Limit Exceeded","pass":"from itertools import combinations\nimport sys\n\ninput = sys.stdin.buffer.readline\n\nn = int(input())\ngraph = [[] for _ in range(n + 1)]\nfor _ in range(n - 1):\n a, b = map(int, input().split())\n graph[a].append(b)\n graph[b].append(a)\n# LCA\u304c\u5fc5\u8981\u305d\u3046\n# \u6163\u308c\u306a\u3044\u3051\u3069doubling\u3057\u3066\u307f\u308b\uff1f\n# \u5b9f\u884c\u6642\u9593\u306b\u4f59\u88d5\u304c\u3042\u308b\u3057\u3001\u6bce\u56deDFS\u3057\u3066\u3044\u3044\u6c17\u304c\u3057\u3066\u304d\u305f\u3002\n# \u901a\u3063\u305f\u8fba\u3092(a,b)\u306e\u5f62\u3067set\u306b\u6253\u3061\u8fbc\u3093\u3067\u5168\u90e8\u767d\u306b\u306a\u308b\u5834\u5408\u306e\u6570\u3092\u8abf\u3079\u308b\u65b9\u91dd\n\n\ndef dfs(s, g):\n kouho = set()\n par = [-1] * (n + 1)\n depth = [0] * (n + 1)\n stack = []\n stack.append(s)\n while stack:\n v = stack.pop()\n if v == g:\n break\n d = depth[v]\n for u in graph[v]:\n if u == par[v]:\n continue\n par[u] = v\n depth[u] = d + 1\n stack.append(u)\n # \u7d4c\u8def\u5fa9\u5143\n p = g\n q = par[g]\n while q > 0:\n kouho.add((min(p, q), max(p, q)))\n p = q\n q = par[q]\n return kouho\n\n\nm = int(input())\nsets = [[] for _ in range(m)]\nfor i in range(m):\n u, v = map(int, input().split())\n sets[i] = dfs(u, v)\nans = 0\nfor i in range(1, m + 1):\n kumiawase = list(combinations(range(m), i))\n for kumi in kumiawase:\n temp = set()\n for j in range(i):\n temp |= sets[kumi[j]]\n num = len(list(temp))\n ans += (-1) ** (i + 1) * (pow(2, n - 1) - pow(2, n - 1 - num))\n\nprint(ans)\n","fail":"from itertools import combinations\nimport sys\n\nread = sys.stdin.buffer.read\nreadline = sys.stdin.buffer.readline\nreadlines = sys.stdin.buffer.readlines\n\n\nn = int(readline())\nAB = list(list(map(int, readline().split())) for _ in range(n - 1))\nm = int(readline())\nUV = list(list(map(int, readline().split())) for _ in range(m))\n\ngraph = [[] for _ in range(n + 1)]\nfor i, (a, b) in enumerate(AB):\n graph[a].append((b, i))\n graph[b].append((a, i))\n\n\ndef dfs(s, g):\n kouho = 0\n par = [(0, 0)] * (n + 1)\n stack = []\n stack.append(s)\n while stack:\n v = stack.pop()\n if v == g:\n break\n for u, i in graph[v]:\n if u == par[v][0]:\n continue\n par[u] = (v, i)\n stack.append(u)\n # \u7d4c\u8def\u5fa9\u5143\n p = g\n q, i = par[p]\n while q > 0:\n kouho |= 1 << i\n p = q\n q, i = par[q]\n return kouho\n\n\ndef popcnt(n):\n c = (n & 0x5555555555555555) + ((n >> 1) & 0x5555555555555555)\n c = (c & 0x3333333333333333) + ((c >> 2) & 0x3333333333333333)\n c = (c & 0x0F0F0F0F0F0F0F0F) + ((c >> 4) & 0x0F0F0F0F0F0F0F0F)\n c = (c & 0x00FF00FF00FF00FF) + ((c >> 8) & 0x00FF00FF00FF00FF)\n c = (c & 0x0000FFFF0000FFFF) + ((c >> 16) & 0x0000FFFF0000FFFF)\n c = (c & 0x00000000FFFFFFFF) + ((c >> 32) & 0x00000000FFFFFFFF)\n return c\n\n\nsets = [0 for _ in range(m)]\n\nfor idx, (u, v) in enumerate(UV):\n sets[idx] = dfs(u, v)\nans = 0\nfor i in range(1, m + 1):\n kumiawase = list(combinations(range(m), i))\n for kumi in kumiawase:\n temp = 0\n for j in range(i):\n temp |= sets[kumi[j]]\n num = popcnt(temp)\n ans += (-1) ** (i + 1) * (pow(2, n - 1) - pow(2, n - 1 - num))\n\nprint(ans)\n","change":"replace","i1":3,"i2":57,"j1":3,"j2":65,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02796","language":"Python","original_status":"Time Limit Exceeded","pass":"import heapq\n\nn = int(input())\nXL = [tuple(map(int, input().split())) for _ in range(n)]\n\nblocked = [0] * n\ntotal = 0\nfor i in range(n):\n ax, al = XL[i]\n for j in range(i + 1, n):\n bx, bl = XL[j]\n if ax - al < bx - bl < ax + al or ax - al < bx + bl < ax + al:\n blocked[i] -= 1\n blocked[j] -= 1\n total += 1\ncount = 0\nheapq.heapify(blocked)\nwhile total > 0:\n total += heapq.heappop(blocked)\n count += 1\n\nprint(n - count)\n","fail":"n = int(input())\nLR = [None] * n\nfor i in range(n):\n x, l = map(int, input().split())\n LR[i] = (x - l, x + l)\nLR.sort(key=lambda lr: lr[1])\ncount = 1\ncur = LR[0][1]\nfor l, r in LR[1:]:\n if cur <= l:\n count += 1\n cur = r\nprint(count)\n","change":"replace","i1":0,"i2":22,"j1":0,"j2":13,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02796","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nR = sorted([list(map(int, input().split())) for i in range(N)])\nT = []\nfor i in range(N):\n T.append([R[i][0] + R[i][1], R[i][0] - R[i][1]])\nT.sort()\nwhile len(T) - 1 > 0:\n t = T.pop(0)\n i = 1\n while len(T) and t[0] > T[0][1]:\n N -= 1\n i += 1\n T.pop(0)\nprint(N)\n","fail":"N = int(input())\nX = [list(map(int, input().split())) for i in range(N)]\nLR = [[x[0] - x[1], x[0] + x[1]] for x in X]\nLR.sort(key=lambda x: x[1])\n\nA = 1\nright = LR[0][1]\nfor i in range(1, N):\n if right <= LR[i][0]:\n A += 1\n right = LR[i][1]\nprint(A)\n","change":"replace","i1":1,"i2":14,"j1":1,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02796","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nR = [list(map(int, input().split())) for i in range(N)]\nT = [[R[i][0] + R[i][1], R[i][0] - R[i][1]] for i in range(N)]\nT.sort()\nwhile len(T) - 1 > 0:\n t = T.pop(0)\n i = 1\n while len(T) and t[0] > T[0][1]:\n N -= 1\n i += 1\n T.pop(0)\nprint(N)\n","fail":"N = int(input())\nR = sorted([list(map(int, input().split())) for i in range(N)])\nT = []\nfor i in range(N):\n T.append([R[i][0] + R[i][1], R[i][0] - R[i][1]])\nT.sort(reverse=True)\nwhile len(T) - 1 > 0:\n t = T.pop()\n i = 1\n while len(T) and t[0] > T[-1][1]:\n N -= 1\n i += 1\n T.pop()\nprint(N)\n","change":"replace","i1":1,"i2":11,"j1":1,"j2":13,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02797","language":"Python","original_status":"Runtime Error","pass":"from sys import stdin\n\nN, K, S = [int(x) for x in stdin.readline().rstrip().split()]\n\nans = [S] * K\nn = (N - K) \/\/ (S - 1)\nans.extend([S + 1] * (N - K))\n\nprint(*ans)\n","fail":"from sys import stdin\n\nN, K, S = [int(x) for x in stdin.readline().rstrip().split()]\n\nans = [S] * K\nif S == 10**9:\n ans.extend([1] * (N - K))\nelse:\n ans.extend([S + 1] * (N - K))\n\nprint(*ans)\n","change":"replace","i1":5,"i2":7,"j1":5,"j2":9,"error":"WA","stderr":null,"stdout":"3 3 4 4\n"} {"problem_id":"p02797","language":"Python","original_status":"Runtime Error","pass":"from itertools import repeat\n\nn, k, s = map(int, input().split())\nprint(*repeat(s, k), *repeat((s + 1) % 10**9, n - k))\n","fail":"n, k, s = map(int, input().split())\nprint(*[s] * k + [(s + 1) % 10**9] * (n - k))\n","change":"replace","i1":0,"i2":4,"j1":0,"j2":2,"error":"WA","stderr":null,"stdout":"3 3 4 4\n"} {"problem_id":"p02798","language":"Python","original_status":"Time Limit Exceeded","pass":"def iter_bit(k, LIMIT):\n v = (1 << k) - 1\n\n while v < LIMIT:\n yield v\n x = v & -v\n y = v + x\n v = (v & ~y) \/\/ x >> 1 | y\n\n\ndef solve(n, cards):\n dp = [{} for _ in range(1 << n)]\n dp[-1][0] = 0\n LIMIT = 1 << n\n\n for d in range(n):\n for state in iter_bit(n - d, LIMIT):\n scores = dp[state]\n k = state\n curr = 0\n while k:\n b = k & -k\n i = b.bit_length() - 1\n num = cards[i][(d - i) % 2]\n next_dp = dp[state ^ b]\n for score, left_num in scores.items():\n if left_num > num:\n continue\n ns = score + curr\n if ns not in next_dp or next_dp[ns] > num:\n next_dp[ns] = num\n k ^= b\n curr += 1\n\n if len(dp[0]) > 0:\n return min(dp[0].keys())\n else:\n return -1\n\n\nn = int(input())\naaa = list(map(int, input().split()))\nbbb = list(map(int, input().split()))\ncards = list(zip(aaa, bbb))\nprint(solve(n, cards))\n","fail":"def iter_bit(k, LIMIT):\n v = (1 << k) - 1\n\n while v < LIMIT:\n yield v\n x = v & -v\n y = v + x\n v = (v & ~y) \/\/ x >> 1 | y\n\n\ndef solve(n, cards):\n dp = [{} for _ in range(1 << n)]\n dp[-1][0] = 0\n LIMIT = 1 << n\n\n for d in range(n):\n for state in iter_bit(n - d, LIMIT):\n scores = dp[state]\n k = state\n curr = 0\n while k:\n b = k & -k\n i = b.bit_length() - 1\n num = cards[i][(d - i) % 2]\n next_dp = dp[state ^ b]\n for left_num, score in scores.items():\n if left_num > num:\n continue\n ns = score + curr\n if num not in next_dp or next_dp[num] > ns:\n next_dp[num] = ns\n k ^= b\n curr += 1\n\n if len(dp[0]) > 0:\n return min(dp[0].values())\n else:\n return -1\n\n\nn = int(input())\naaa = list(map(int, input().split()))\nbbb = list(map(int, input().split()))\ncards = list(zip(aaa, bbb))\nprint(solve(n, cards))\n","change":"replace","i1":25,"i2":36,"j1":25,"j2":36,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02801","language":"Python","original_status":"Runtime Error","pass":"import sys\n\nargs = sys.argv\n\na = \"abcdefghijklmnopqrstuvwxyz\"\n\nc = args[1]\nidx = a.index(c)\nprint(a[idx + 1])\n","fail":"import sys\n\nargs = sys.argv\n\na = \"abcdefghijklmnopqrstuvwxyz\"\n\nc = input()\nidx = a.index(c)\nprint(a[idx + 1])\n","change":"replace","i1":6,"i2":7,"j1":6,"j2":7,"error":"IndexError: list index out of range","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02801\/Python\/s556171083.py\", line 7, in \n c = args[1]\nIndexError: list index out of range\n","stdout":null} {"problem_id":"p02801","language":"Python","original_status":"Runtime Error","pass":"import string\n\nAL = string.lowercase\n\nC = input()\nidx = AL.find(C)\nidy = (idx + 1) % 26\nprint(AL[idy])\n","fail":"import string\n\nAL = string.ascii_lowercase\n\nC = input()\nidx = AL.find(C)\nidy = (idx + 1) % 26\nprint(AL[idy])\n","change":"replace","i1":2,"i2":3,"j1":2,"j2":3,"error":"AttributeError: module 'string' has no attribute 'lowercase'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02801\/Python\/s068085135.py\", line 3, in \n AL = string.lowercase\nAttributeError: module 'string' has no attribute 'lowercase'\n","stdout":null} {"problem_id":"p02801","language":"Python","original_status":"Runtime Error","pass":"c = input()\ns = \"abcdefghijklmnopqrstuvwxyz\"\nflg = True\nfor i in range(len(s) + 1):\n if c == s[i] and c != \"z\":\n print(s[i + 1])\n flg = False\n elif c == \"z\":\n print(\"a\")\n flg = False\n","fail":"c = input()\ns = \"abcdefghijklmnopqrstuvwxyz\"\nflg = True\nfor i in range(len(s) + 1):\n if c == s[i] and c != \"z\":\n print(s[i + 1])\n break\n elif c == \"z\":\n print(\"a\")\n break\n","change":"replace","i1":6,"i2":10,"j1":6,"j2":10,"error":"IndexError: string index out of range","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02801\/Python\/s621913033.py\", line 5, in \n if c == s[i] and c != \"z\":\nIndexError: string index out of range\n","stdout":"b\n"} {"problem_id":"p02801","language":"Python","original_status":"Runtime Error","pass":"#!\/usr\/bin\/env python\n# -*- coding: utf-8 -*-\n\n\ndef resolve():\n n, m = map(int, input().split())\n\n if n == m:\n print(\"Yes\")\n else:\n print(\"No\")\n\n\nif __name__ == \"__main__\":\n resolve()\n","fail":"#!\/usr\/bin\/env python\n# -*- coding: utf-8 -*-\n\n\ndef resolve():\n c = input()\n\n print(chr(ord(c) + 1))\n\n\nif __name__ == \"__main__\":\n resolve()\n","change":"replace","i1":5,"i2":11,"j1":5,"j2":8,"error":"ValueError: invalid literal for int() with base 10: 'a'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02801\/Python\/s953923794.py\", line 15, in \n resolve()\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02801\/Python\/s953923794.py\", line 6, in resolve\n n, m = map(int, input().split())\nValueError: invalid literal for int() with base 10: 'a'\n","stdout":null} {"problem_id":"p02802","language":"Python","original_status":"Time Limit Exceeded","pass":"N, M = map(int, input().split())\ncorrect = []\nmissed = [0 for _ in range(N)]\npenalty = 0\n\nfor _ in range(M):\n p, s = input().split()\n p = int(p)\n\n if s == \"AC\" and p not in correct:\n correct.append(p)\n penalty += missed[p - 1]\n elif s == \"WA\" and p not in correct:\n missed[p - 1] += 1\n\nprint(len(correct), penalty)\n","fail":"N, M = map(int, input().split())\ncorrect = [0 for _ in range(N)]\nmissed = [0 for _ in range(N)]\npenalty = 0\nans = 0\nfor _ in range(M):\n p, s = input().split()\n p = int(p)\n\n if s == \"AC\" and correct[p - 1] == 0:\n correct[p - 1] = 1\n penalty += missed[p - 1]\n elif s == \"WA\" and correct[p - 1] == 0:\n missed[p - 1] += 1\n\nprint(sum(correct), penalty)\n","change":"replace","i1":1,"i2":16,"j1":1,"j2":16,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02802","language":"Python","original_status":"Runtime Error","pass":"n, m = map(int, input().split())\ntable = {}\nac = 0\npena_arr = [0 for _ in range(m + 1)]\nfor _ in range(n):\n a, b = input().split()\n a = int(a)\n if a not in table and b == \"AC\":\n ac += 1\n table[a] = True\n elif a not in table and b == \"WA\":\n pena_arr[a] += 1\npena = 0\nfor i in range(1, m + 1):\n if pena_arr[i] > 0 and i in table:\n pena += pena_arr[i]\nprint(ac, pena)\n","fail":"n, m = map(int, input().split())\ntable = {}\nac = 0\npena = 0\npena_arr = [0 for _ in range(n + 1)]\nfor _ in range(m):\n a, b = input().split()\n a = int(a)\n if a in table:\n continue\n if b == \"AC\":\n ac += 1\n table[a] = True\n elif b == \"WA\":\n pena_arr[a] += 1\npena = 0\nfor i in range(1, n + 1):\n if pena_arr[i] > 0 and i in table:\n pena += pena_arr[i]\nprint(ac, pena)\n","change":"replace","i1":3,"i2":14,"j1":3,"j2":17,"error":"WA","stderr":null,"stdout":"1 1\n"} {"problem_id":"p02802","language":"Python","original_status":"Runtime Error","pass":"n, m = map(int, input().split())\n\nscores = [[0, False] for _ in range(n)]\n\nfor _ in range(m):\n p, S = input().split()\n p = int(p)\n\n if scores[p][1]:\n continue\n\n if S == \"AC\":\n scores[p][1] = True\n continue\n\n if S == \"WA\":\n scores[p][0] += 1\n\nscore = pena = 0\nfor count, ac in scores:\n if ac:\n score += 1\n pena += count\n\nprint(score, pena)\n","fail":"n, m = map(int, input().split())\n\nscores = [[0, False] for _ in range(n + 1)]\n\nfor _ in range(m):\n p, S = input().split()\n p = int(p)\n\n if scores[p][1]:\n continue\n\n if S == \"AC\":\n scores[p][1] = True\n continue\n\n if S == \"WA\":\n scores[p][0] += 1\n\nscore = pena = 0\nfor count, ac in scores:\n if ac:\n score += 1\n pena += count\n\nprint(score, pena)\n","change":"replace","i1":2,"i2":3,"j1":2,"j2":3,"error":"IndexError: list index out of range","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02802\/Python\/s650750562.py\", line 9, in \n if scores[p][1]:\nIndexError: list index out of range\n","stdout":null} {"problem_id":"p02802","language":"Python","original_status":"Runtime Error","pass":"N, M = map(int, input().split())\naccepted = [0] * N\npenalties = [0] * N\nfor _ in range(M):\n p, ac = input().split()\n p, ac = int(p), ac == \"AC\"\n accepted[p] |= ac\n penalties[p] += not accepted[p]\nprint(sum(accepted), sum(p for ac, p in zip(accepted, penalties) if ac))\n","fail":"N, M = map(int, input().split())\naccepted = [0] * N\npenalties = [0] * N\nfor _ in range(M):\n p, ac = input().split()\n p, ac = int(p) - 1, ac == \"AC\"\n accepted[p] |= ac\n penalties[p] += not accepted[p]\nprint(sum(accepted), sum(p for ac, p in zip(accepted, penalties) if ac))\n","change":"replace","i1":5,"i2":6,"j1":5,"j2":6,"error":"IndexError: list index out of range","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02802\/Python\/s182965476.py\", line 7, in \n accepted[p] |= ac\nIndexError: list index out of range\n","stdout":null} {"problem_id":"p02802","language":"Python","original_status":"Runtime Error","pass":"import numpy as np\n\nn, m = map(int, input().split())\nis_ac = np.zeros(n, dtype=int)\nwc_count = np.zeros(n, dtype=int)\n\nfor _ in range(m):\n p, s = input().split()\n p = int(p)\n if is_ac[p - 1] == 0:\n if s == \"WA\":\n wc_count[p - 1] += 1\n else:\n is_ac[p - 1] = 1\nprint(is_ac.sum(), wc_count[is_ac].sum())\n","fail":"import numpy as np\n\nn, m = map(int, input().split())\nis_ac = np.zeros(n, dtype=bool)\nwc_count = np.zeros(n, dtype=int)\n\nfor _ in range(m):\n p, s = input().split()\n p = int(p)\n if not is_ac[p - 1]:\n if s == \"WA\":\n wc_count[p - 1] += 1\n else:\n is_ac[p - 1] = True\nprint(is_ac.sum(), wc_count[is_ac].sum())\n","change":"replace","i1":3,"i2":14,"j1":3,"j2":14,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02802","language":"Python","original_status":"Runtime Error","pass":"def main(n, m, p_s):\n st = [False for _ in range(n)]\n ac, wa = 0, 0\n\n for p, s in p_s:\n if st[p - 1]:\n continue\n\n if s == \"AC\":\n ac += 1\n st[p - 1] = True\n if s == \"WA\":\n wa += 1\n\n print(ac, wa)\n\n\nif __name__ == \"__main__\":\n n, m = map(int, input().split())\n p_s = [list(map(int, input().split())) for _ in range(m)]\n\n main(n, m, p_s)\n","fail":"def main(n: int, m: int, p_s: list):\n bool_ac = [False for _ in range(n)]\n count_wa = [0 for _ in range(n)]\n ac, wa = 0, 0\n\n for p, s in p_s:\n p = int(p)\n\n if bool_ac[p - 1]:\n continue\n\n if s == \"AC\":\n bool_ac[p - 1] = True\n wa += count_wa[p - 1]\n ac += 1\n elif s == \"WA\":\n count_wa[p - 1] += 1\n\n print(ac, wa)\n\n\nif __name__ == \"__main__\":\n n, m = map(int, input().split())\n p_s = [input().split() for _ in range(m)]\n\n main(n, m, p_s)\n","change":"replace","i1":0,"i2":20,"j1":0,"j2":24,"error":"ValueError: invalid literal for int() with base 10: 'WA'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02802\/Python\/s345841239.py\", line 20, in \n p_s = [list(map(int, input().split())) for _ in range(m)]\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02802\/Python\/s345841239.py\", line 20, in \n p_s = [list(map(int, input().split())) for _ in range(m)]\nValueError: invalid literal for int() with base 10: 'WA'\n","stdout":null} {"problem_id":"p02803","language":"Python","original_status":"Runtime Error","pass":"from collections import deque\n\nH, W = map(int, input().split())\n\nH += 2\nW += 2\n\ngrid = \"#\" * W\nfor _ in range(H - 2):\n grid += \"#\" + input().split()\ngrid += \"#\" * W\n\n\ndef bfs(start):\n INF = 10 * 9\n dist = [INF] * (H * W)\n dist[start] = 0\n q = deque([start])\n while q:\n v = q.popleft()\n dv = dist[v]\n for move in (-1, 1, W, -W):\n # next place\n w = v + move\n # wall or not\n if grid[w] == \"#\":\n continue\n\n dw = dv + 1\n if dw >= dist[w]:\n continue\n dist[w] = dw\n q.append(w)\n\n return max(x for x in dist if x < INF)\n\n\nanswer = max(bfs(v) for v in range(H * W) if grid[v] != \"#\")\nprint(answer)\n","fail":"from collections import deque\n\nH, W = map(int, input().split())\n\nH += 2\nW += 2\n\ngrid = \"#\" * W\nfor _ in range(H - 2):\n grid += \"#\" + input() + \"#\"\ngrid += \"#\" * W\n\n\ndef bfs(start):\n INF = 10**9\n dist = [INF] * (H * W)\n dist[start] = 0\n q = deque([start])\n while q:\n v = q.popleft()\n dv = dist[v]\n for move in (-1, 1, W, -W):\n # next place\n w = v + move\n # wall or not\n if grid[w] == \"#\":\n continue\n\n dw = dv + 1\n if dw >= dist[w]:\n continue\n dist[w] = dw\n q.append(w)\n\n return max(x for x in dist if x < INF)\n\n\nanswer = max(bfs(v) for v in range(H * W) if grid[v] != \"#\")\nprint(answer)\n","change":"replace","i1":9,"i2":15,"j1":9,"j2":15,"error":"TypeError: can only concatenate str (not \"list\") to str","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02803\/Python\/s560031032.py\", line 10, in \n grid += \"#\" + input().split()\nTypeError: can only concatenate str (not \"list\") to str\n","stdout":null} {"problem_id":"p02803","language":"Python","original_status":"Time Limit Exceeded","pass":"from collections import deque\nimport itertools\nimport copy\n\nH, W = map(int, input().split())\nS = [list(input()) for _ in range(H)]\n\n\ndef bfs(maze, s, g):\n q = deque()\n q.append((s, 0))\n\n maze[s[0]][s[1]] = \"#\"\n\n while len(q) > 0:\n p, depth = q.popleft()\n\n if p == g:\n return depth\n\n # ikerutoko\n next_pos = []\n if 0 <= p[0] - 1 < H and maze[p[0] - 1][p[1]] != \"#\":\n next_pos.append((p[0] - 1, p[1]))\n if 0 <= p[0] + 1 < H and maze[p[0] + 1][p[1]] != \"#\":\n next_pos.append((p[0] + 1, p[1]))\n if 0 <= p[1] - 1 < W and maze[p[0]][p[1] - 1] != \"#\":\n next_pos.append((p[0], p[1] - 1))\n if 0 <= p[1] + 1 < W and maze[p[0]][p[1] + 1] != \"#\":\n next_pos.append((p[0], p[1] + 1))\n\n # print(next_pos, q)\n\n for pos in next_pos:\n maze[pos[0]][pos[1]] = \"#\"\n q.append((pos, depth + 1))\n\n return -1\n\n\nkaisuu = 0\nfor s in itertools.product(range(H), range(W)):\n for g in itertools.product(range(H), range(W)):\n if s == g or S[s[0]][s[1]] == \"#\" or S[g[0]][g[1]] == \"#\":\n continue\n\n maze = copy.deepcopy(S)\n k = bfs(maze, s, g)\n kaisuu = max(kaisuu, k)\n\nprint(kaisuu)\n","fail":"from collections import deque\nimport copy\n\n\nH, W = map(int, input().split())\nS = [list(input()) for i in range(H)]\n\n\ndef bfs(maze, start):\n q = deque()\n q.append((start, 0))\n\n max_depth = 0\n\n while len(q) > 0:\n p, depth = q.popleft()\n\n if p[0] < 0 or H <= p[0]:\n continue\n if p[1] < 0 or W <= p[1]:\n continue\n if maze[p[0]][p[1]] == \"#\":\n continue\n\n maze[p[0]][p[1]] = \"#\"\n max_depth = depth\n\n next_pos = [\n (p[0] - 1, p[1]),\n (p[0] + 1, p[1]),\n (p[0], p[1] - 1),\n (p[0], p[1] + 1),\n ]\n\n for pos in next_pos:\n q.append((pos, depth + 1))\n\n return max_depth\n\n\ndepth = 0\nfor h in range(H):\n for w in range(W):\n maze = copy.deepcopy(S)\n depth = max(depth, bfs(maze, (h, w)))\n\nprint(depth)\n","change":"replace","i1":1,"i2":51,"j1":1,"j2":47,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02803","language":"Python","original_status":"Runtime Error","pass":"from scipy.sparse.csgraph import dijkstra, csgraph_from_dense\nimport numpy as np\n\nH, W = map(int, input().split())\nS = [input() for _ in range(H)]\n\nv_id_dict = {}\ndista = np.ones((20, 20)) * np.inf\n\nfor i in range(H):\n for j in range(W):\n if S[i][j] == \".\":\n v_id_dict[i, j] = len(v_id_dict)\n\n if (i > 0) and (S[i - 1][j] == \".\"):\n dista[v_id_dict[(i, j)], v_id_dict[(i - 1, j)]] = 1\n\n if (j > 0) and (S[i][j - 1] == \".\"):\n dista[v_id_dict[(i, j)], v_id_dict[(i, j - 1)]] = 1\n\ndist_mat = dijkstra(\n csgraph_from_dense(dista[: len(v_id_dict), : len(v_id_dict)]),\n directed=False,\n unweighted=False,\n)\n\nprint(int(dist_mat.max()))\n","fail":"from scipy.sparse.csgraph import dijkstra, csgraph_from_dense\nimport numpy as np\n\nH, W = map(int, input().split())\nS = [input() for _ in range(H)]\n\nv_id_dict = {}\ndista = np.ones((400, 400)) * np.inf\n\nfor i in range(H):\n for j in range(W):\n if S[i][j] == \".\":\n v_id_dict[i, j] = len(v_id_dict)\n\n if (i > 0) and (S[i - 1][j] == \".\"):\n dista[v_id_dict[(i, j)], v_id_dict[(i - 1, j)]] = 1\n\n if (j > 0) and (S[i][j - 1] == \".\"):\n dista[v_id_dict[(i, j)], v_id_dict[(i, j - 1)]] = 1\n\ndist_mat = dijkstra(\n csgraph_from_dense(dista[: len(v_id_dict), : len(v_id_dict)]),\n directed=False,\n unweighted=False,\n)\n\nprint(int(dist_mat.max()))\n","change":"replace","i1":7,"i2":8,"j1":7,"j2":8,"error":"ModuleNotFoundError: No module named 'scipy'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02803\/Python\/s307435936.py\", line 1, in \n from scipy.sparse.csgraph import dijkstra, csgraph_from_dense\nModuleNotFoundError: No module named 'scipy'\n","stdout":null} {"problem_id":"p02803","language":"Python","original_status":"Time Limit Exceeded","pass":"from copy import deepcopy\nfrom collections import deque\n\n# \u6700\u77ed\u306b\u3059\u308b\n# 0\u56de\u4ee5\u4e0a\u3067\u305f\u3069\u308a\u7740\u3051\u308b\u306e\u3067\u30b9\u30bf\u30fc\u30c8=\u30b4\u30fc\u30eb\u306e\u3053\u3068\u304c\u3042\u308b \u3075\u3056\u3051\u3093\u306a\nh, w = map(int, input().split())\ntable = [[] for _ in range(h)]\nfor i in range(h):\n table[i] = list(input())\n\n\ndef bfs(y, x, t):\n steps = [0, 1, 0, -1, 0]\n queue = deque([[y, x]])\n arr = []\n while len(queue) > 0:\n cur_y, cur_x = queue.popleft()\n for i in range(4):\n next_y, next_x = cur_y + steps[i], cur_x + steps[i + 1]\n if 0 <= next_y < h and 0 <= next_x < w:\n if t[next_y][next_x] == \"G\":\n arr.append(t[cur_y][cur_x])\n continue\n if t[next_y][next_x] == \".\":\n t[next_y][next_x] = t[cur_y][cur_x] + 1\n queue.append([next_y, next_x])\n\n return 0 if len(arr) == 0 else min(arr) + 1\n\n\nans = 0\nfor sy in range(h):\n for sx in range(w):\n # table[sy][sx]\u3092\u30b9\u30bf\u30fc\u30c8\u5730\u70b9\u3068\u3059\u308b\n if table[sy][sx] != \".\":\n continue\n for gy in range(h):\n for gx in range(w):\n if sy == gy and sx == gx:\n continue\n if table[gy][gx] == \".\":\n mytable = deepcopy(table)\n mytable[sy][sx] = 0\n mytable[gy][gx] = \"G\"\n # ans = min(ans, bfs(sy, sx, mytable))\n ret = bfs(sy, sx, mytable)\n ans = max(ans, ret)\n\nprint(ans)\n","fail":"from copy import deepcopy\nfrom collections import deque\n\n# \u6700\u77ed\u306b\u3059\u308b\n# 0\u56de\u4ee5\u4e0a\u3067\u305f\u3069\u308a\u7740\u3051\u308b\u306e\u3067\u30b9\u30bf\u30fc\u30c8=\u30b4\u30fc\u30eb\u306e\u3053\u3068\u304c\u3042\u308b \u3075\u3056\u3051\u3093\u306a\nh, w = map(int, input().split())\ntable = [[] for _ in range(h)]\nfor i in range(h):\n table[i] = list(input())\n\n\ndef bfs(y, x, t):\n steps = [0, 1, 0, -1, 0]\n queue = deque([[y, x]])\n ret = 0\n while len(queue) > 0:\n cur_y, cur_x = queue.popleft()\n for i in range(4):\n next_y, next_x = cur_y + steps[i], cur_x + steps[i + 1]\n if 0 <= next_y < h and 0 <= next_x < w:\n if t[next_y][next_x] == \".\":\n t[next_y][next_x] = t[cur_y][cur_x] + 1\n ret = max(ret, t[next_y][next_x])\n queue.append([next_y, next_x])\n\n return ret\n\n\nans = 0\nfor sy in range(h):\n for sx in range(w):\n # table[sy][sx]\u3092\u30b9\u30bf\u30fc\u30c8\u5730\u70b9\u3068\u3059\u308b\n if table[sy][sx] != \".\":\n continue\n mytable = deepcopy(table)\n mytable[sy][sx] = 0\n ret = bfs(sy, sx, mytable)\n ans = max(ans, ret)\n\nprint(ans)\n","change":"replace","i1":14,"i2":47,"j1":14,"j2":38,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02804","language":"Python","original_status":"Runtime Error","pass":"MOD = 10**9 + 7\n\nN, K = [int(i) for i in input().split()]\nA = [int(i) for i in input().split()]\nA.sort()\nA_r = list(reversed(A))\nfactorial = {0: 1, 1: 1}\nfor i in range(2, N + 1):\n factorial[i] = factorial[i - 1] * i\n\nans = 0\nfor i, j in zip(A, A_r):\n if N < K:\n break\n C = (factorial[N - 1] \/ factorial[K - 1]) \/ factorial[N - K]\n ans += (j - i) * C\n ans %= MOD\n N -= 1\nans = int(ans % MOD)\nprint(ans)\n","fail":"N, K = [int(i) for i in input().split()]\nA = [int(i) for i in input().split()]\nA.sort()\nMOD = 10**9 + 7\n\n\ndef combination(mod=MOD):\n fact = [1] * (N + 1)\n inv_fact = [1] * (N + 1)\n r = 1\n for i in range(1, N + 1):\n fact[i] = r = r * i % mod\n inv_fact[N] = r = pow(fact[N], mod - 2, mod)\n for i in range(N, 0, -1):\n inv_fact[i - 1] = r = r * i % mod\n\n def _wrapper(n, k):\n nonlocal fact, inv_fact, mod\n if n == 0 or k == 0:\n return 1\n return fact[n] * inv_fact[k] * inv_fact[n - k] % mod\n\n return _wrapper\n\n\ndef main():\n if K == 1:\n print(0)\n exit()\n comb = combination()\n sum_max = 0\n sum_min = 0\n for i, A_i in enumerate(A):\n if i >= K - 1:\n sum_max += comb(i, K - 1) * A_i % MOD\n if N - i >= K:\n sum_min += comb(N - i - 1, K - 1) * A_i % MOD\n ans = (sum_max - sum_min) % MOD\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":0,"i2":20,"j1":0,"j2":43,"error":0,"stderr":null,"stdout":11} {"problem_id":"p02807","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\nx = list(map(int, input().split()))\nmod = 10**9 + 7\nX = []\nfor i in range(n - 1):\n X.append(x[i + 1] - x[i])\nl, left = 1, [1]\nfor i in range(1, n - 1):\n l *= i\n l %= mod\n left.append(l)\nr, right = 1, [1]\nfor i in range(n - 1, 1, -1):\n r *= i % mod\n right.append(r)\nright.reverse()\nf, flst = 0, []\n\nfor i, j in zip(left, right):\n f += i * j % mod\n f %= mod\n flst.append(f)\ns = 0\nfor i, j in zip(X, flst):\n s += i * j % mod\nprint(s % mod)\n","fail":"# https:\/\/atcoder.jp\/contests\/dwacon6th-prelims\/submissions\/9426910\n\n\ndef solve():\n MOD = 10**9 + 7\n\n N = int(input())\n xs = list(map(int, input().split()))\n\n ds = []\n for i in range(N - 1):\n d = xs[i + 1] - xs[i]\n ds.append(d)\n\n nums = [1, 1]\n num = 1\n for i in range(2, N - 1):\n num *= i\n num %= MOD\n nums.append(num)\n\n ms = [N - 1]\n m = N - 1\n for i in reversed(range(2, N - 1)):\n m *= i\n m %= MOD\n ms.append(m)\n ms.reverse()\n ms.append(1)\n\n ks = []\n k = 0\n for num, m in zip(nums, ms):\n k += num * m % MOD\n k %= MOD\n ks.append(k)\n\n ans = 0\n for d, k in zip(ds, ks):\n ans += d * k % MOD\n ans %= MOD\n\n print(ans)\n\n\nsolve()\n","change":"replace","i1":0,"i2":26,"j1":0,"j2":46,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02811","language":"Python","original_status":"Runtime Error","pass":"import itertools\n\nN = int(input())\nP = tuple(map(int, input().split()))\nQ = tuple(map(int, input().split()))\npermutation = list(itertools.permutations([x for x in range(1, N + 1)]))\n\na = permutation.index(P) + 1\nb = permutation.index(Q) + 1\nprint(abs(a - b))\n","fail":"K, X = map(int, input().split())\nprint(\"Yes\" if K * 500 >= X else \"No\")\n","change":"replace","i1":0,"i2":10,"j1":0,"j2":2,"error":"ValueError: invalid literal for int() with base 10: '2 900'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02811\/Python\/s360744826.py\", line 3, in \n N = int(input())\nValueError: invalid literal for int() with base 10: '2 900'\n","stdout":null} {"problem_id":"p02811","language":"Python","original_status":"Runtime Error","pass":"K = int(input(\"Enter k: \"))\nX = int(input(\"Enter x: \"))\n\nif K * 500 >= X:\n print(\"Yes\")\nelse:\n print(\"No\")\n","fail":"K, X = map(int, input().split())\n\nif K * 500 >= X:\n print(\"Yes\")\nelse:\n print(\"No\")\n","change":"replace","i1":0,"i2":2,"j1":0,"j2":1,"error":"ValueError: invalid literal for int() with base 10: '2 900'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02811\/Python\/s761507450.py\", line 1, in \n K = int(input(\"Enter k: \"))\nValueError: invalid literal for int() with base 10: '2 900'\n","stdout":"Enter k: "} {"problem_id":"p02811","language":"Python","original_status":"Runtime Error","pass":"if __name__ == \"__main__\":\n x = int(input())\n m, n = map(int, input().split())\n if m * 500 >= n:\n print(\"Yes\")\n else:\n print(\"No\")\n","fail":"if __name__ == \"__main__\":\n m, n = map(int, input().split())\n if m * 500 >= n:\n print(\"Yes\")\n else:\n print(\"No\")\n","change":"delete","i1":1,"i2":2,"j1":1,"j2":1,"error":"ValueError: invalid literal for int() with base 10: '2 900'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02811\/Python\/s384378340.py\", line 2, in \n x = int(input())\nValueError: invalid literal for int() with base 10: '2 900'\n","stdout":null} {"problem_id":"p02812","language":"Python","original_status":"Runtime Error","pass":"n = int(input())\ns = input()\nans = 0\nfor i in range(n):\n if s[i] == \"A\" and s[i + 1] == \"B\" and s[i + 2] == \"C\":\n ans += 1\nprint(ans)\n","fail":"n = int(input())\ns = input()\nans = 0\nfor i in range(n):\n if s[i : i + 3] == \"ABC\":\n ans += 1\nprint(ans)\n","change":"replace","i1":4,"i2":5,"j1":4,"j2":5,"error":0,"stderr":null,"stdout":2} {"problem_id":"p02812","language":"Python","original_status":"Runtime Error","pass":"N = int(input())\nS = input()\n\nans = 0\ni = 0\nwhile i < N:\n if S[i] == \"A\":\n i += 1\n if S[i] == \"B\":\n i += 1\n if S[i] == \"C\":\n ans += 1\n else:\n i += 1\n else:\n i += 1\n else:\n i += 1\n\nprint(ans)\n","fail":"N = int(input())\nS = input()\n\nans = 0\nfor i in range(N):\n if S[i : i + 3] == \"ABC\":\n ans += 1\n\nprint(ans)\n","change":"replace","i1":4,"i2":18,"j1":4,"j2":7,"error":0,"stderr":null,"stdout":2} {"problem_id":"p02812","language":"Python","original_status":"Runtime Error","pass":"N = int(input())\nS = input()\ncount = 0\nfor i in range(N):\n if S[i] == \"A\" and S[i + 1] == \"B\" and S[i + 2] == \"C\":\n count += 1\nprint(count)\n","fail":"N = int(input())\nS = input()\ncount = 0\nfor i in range(N):\n try:\n if S[i] == \"A\" and S[i + 1] == \"B\" and S[i + 2] == \"C\":\n count += 1\n except IndexError:\n break\nprint(count)\n","change":"replace","i1":4,"i2":6,"j1":4,"j2":9,"error":0,"stderr":null,"stdout":2} {"problem_id":"p02813","language":"Python","original_status":"Runtime Error","pass":"# ABC150C - Count Order\nfrom itertools import permutations\n\n\ndef main():\n N, *PQ = map(int, open(0).read().split())\n P, Q = PQ[:N], PQ[N:]\n perms = list(permutations(range(1, N + 1), N))\n ans = abs(perms.index(P) - perms.index(Q))\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"# ABC150C - Count Order\nfrom itertools import permutations\n\n\ndef main():\n N = int(input())\n P = tuple(map(int, input().split()))\n Q = tuple(map(int, input().split()))\n perms = list(permutations(range(1, N + 1)))\n ans = abs(perms.index(P) - perms.index(Q))\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":5,"i2":8,"j1":5,"j2":9,"error":"ValueError: [1, 3, 2] is not in list","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02813\/Python\/s593478625.py\", line 14, in \n main()\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02813\/Python\/s593478625.py\", line 9, in main\n ans = abs(perms.index(P) - perms.index(Q))\nValueError: [1, 3, 2] is not in list\n","stdout":null} {"problem_id":"p02813","language":"Python","original_status":"Runtime Error","pass":"from scipy.special import perm\n\nn = int(input())\np = list(map(int, input().split()))\nq = list(map(int, input().split()))\nper = perm(n - 1, n - 1, exact=True)\nr = 0\nr2 = 0\nfor k in range(1, n)[::-1]:\n t = p[0]\n c = sum([t > x for x in p])\n r += per * c\n p.remove(t)\n t = q[0]\n c = sum([t > x for x in q])\n r2 += per * c\n q.remove(t)\n per = int(per \/ k)\n\nprint(int(abs(r - r2)))\n","fail":"import math\n\nn = int(input())\np = list(map(int, input().split()))\nq = list(map(int, input().split()))\nper = math.factorial(n - 1)\nr = 0\nr2 = 0\nfor k in range(1, n)[::-1]:\n t = p[0]\n c = sum([t > x for x in p])\n r += per * c\n p.remove(t)\n t = q[0]\n c = sum([t > x for x in q])\n r2 += per * c\n q.remove(t)\n per = int(per \/ k)\n\nprint(int(abs(r - r2)))\n","change":"replace","i1":0,"i2":6,"j1":0,"j2":6,"error":"ModuleNotFoundError: No module named 'scipy'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02813\/Python\/s340291207.py\", line 1, in \n from scipy.special import perm\nModuleNotFoundError: No module named 'scipy'\n","stdout":null} {"problem_id":"p02813","language":"Python","original_status":"Runtime Error","pass":"# ABC150C - Count Order\nfrom itertools import permutations\n\n\ndef main():\n N, *PQ = map(int, open(0).read().split())\n P, Q = PQ[:N], PQ[N:]\n perms = list(permutations(range(1, N + 1)))\n ans = abs(perms.index(P) - perms.index(Q))\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"# ABC150C - Count Order\nfrom itertools import permutations\n\n\ndef main():\n N = int(input())\n P = tuple(map(int, input().split()))\n Q = tuple(map(int, input().split()))\n perms = tuple(permutations(range(1, N + 1)))\n ans = abs(perms.index(P) - perms.index(Q))\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":5,"i2":8,"j1":5,"j2":9,"error":"ValueError: [1, 3, 2] is not in list","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02813\/Python\/s713702771.py\", line 14, in \n main()\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02813\/Python\/s713702771.py\", line 9, in main\n ans = abs(perms.index(P) - perms.index(Q))\nValueError: [1, 3, 2] is not in list\n","stdout":null} {"problem_id":"p02814","language":"Python","original_status":"Time Limit Exceeded","pass":"def GCD(a: int, b: int) -> int:\n return a if b == 0 else GCD(b, a % b)\n\n\ndef LCM(a: int, b: int) -> int:\n return a * b \/\/ GCD(a, b)\n\n\nn, m = map(int, input().split())\na = list(map(lambda x: int(x) \/\/ 2, input().split()))\n\na_lcm = a[0]\nfor i in range(1, n):\n a_lcm = LCM(a_lcm, a[i])\n\nflag = True\nfor i in range(n):\n if (a_lcm \/\/ a[i]) % 2 == 0:\n flag = False\n break\n\nif flag:\n ans = ((m \/\/ a_lcm) + 1) \/\/ 2\nelse:\n ans = 0\nprint(ans)\n","fail":"def GCD(a: int, b: int) -> int:\n return a if b == 0 else GCD(b, a % b)\n\n\ndef LCM(a: int, b: int) -> int:\n return a * b \/\/ GCD(a, b)\n\n\nn, m = map(int, input().split())\na = list(map(lambda x: int(x) \/\/ 2, input().split()))\n\na_lcm = a[0]\nfor i in range(1, n):\n a_lcm = LCM(a_lcm, a[i])\n if a_lcm > m:\n break\n\nif a_lcm <= m:\n flag = True\n for i in range(n):\n if (a_lcm \/\/ a[i]) % 2 == 0:\n flag = False\n break\n\n if flag:\n ans = ((m \/\/ a_lcm) + 1) \/\/ 2\n else:\n ans = 0\nelse:\n ans = 0\nprint(ans)\n","change":"replace","i1":14,"i2":23,"j1":14,"j2":28,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02814","language":"Python","original_status":"Runtime Error","pass":"import sys\nimport math\n\nn, m = map(int, input().split())\na = list(map(int, input().split()))\n\ncur = a[0]\nfor x in a[1:]:\n g = math.gcd(cur, x)\n if (cur \/\/ 2) % g != (x \/\/ 2) % g:\n print(0)\n sys.exit(0)\n else:\n cur = cur \/\/ g * x\n if cur > m * 2:\n print(0)\n sys.exit(0)\n\nprint((m + cur \/\/ 2) \/\/ cur)\n","fail":"import sys\n\n\ndef gcd(x, y):\n if x % y == 0:\n return y\n return gcd(y, x % y)\n\n\nn, m = map(int, input().split())\na = list(map(int, input().split()))\n\ncur = a[0]\nfor x in a[1:]:\n g = gcd(cur, x)\n if (cur \/\/ 2) % g != (x \/\/ 2) % g:\n print(0)\n sys.exit(0)\n else:\n cur = cur \/\/ g * x\n if cur > m * 2:\n print(0)\n sys.exit(0)\n\nprint((m + cur \/\/ 2) \/\/ cur)\n","change":"replace","i1":1,"i2":9,"j1":1,"j2":15,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p02814","language":"Python","original_status":"Runtime Error","pass":"from fractions import gcd\nfrom functools import reduce\nimport sys\n\n\ndef lcm_base(x, y):\n return (x * y) \/\/ gcd(x, y)\n\n\ndef lcm_list(numbers):\n return reduce(lcm_base, numbers, 1)\n\n\nn, m = map(int, input().split())\nA = list(map(int, input().split()))\n\nmax_value = 2 * m\n\nif len(A) > 1:\n lcm = lcm_list(A)\nelse:\n lcm = A[0]\n\nif any((lcm \/ a) % 2 != 1 for a in A):\n print(\"0\")\n sys.exit(0)\n\nmax_product = max_value \/\/ lcm\nprint((max_product + 1) \/\/ 2)\n","fail":"from fractions import gcd\nfrom functools import reduce\nimport sys\n\n\ndef lcm_base(x, y):\n return (x * y) \/\/ gcd(x, y)\n\n\ndef lcm_list(numbers, maxvalue):\n first = 1\n second = 1\n for i in numbers:\n second = i\n lcm_result = lcm_base(first, second)\n if lcm_result > max_value:\n return -1\n first = lcm_result\n return lcm_result\n\n\nn, m = map(int, input().split())\nA = list(map(int, input().split()))\n\nmax_value = 2 * m\n\nlcm = lcm_list(A, 2 * m)\nif lcm == -1:\n print(\"0\")\n sys.exit(0)\n\nif any((lcm \/ a) % 2 != 1 for a in A):\n print(\"0\")\n sys.exit(0)\n\nmax_product = max_value \/\/ lcm\nprint((max_product + 1) \/\/ 2)\n","change":"replace","i1":9,"i2":22,"j1":9,"j2":30,"error":"ImportError: cannot import name 'gcd' from 'fractions' (\/usr\/lib\/python3.10\/fractions.py)","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02814\/Python\/s018417487.py\", line 1, in \n from fractions import gcd\nImportError: cannot import name 'gcd' from 'fractions' (\/usr\/lib\/python3.10\/fractions.py)\n","stdout":null} {"problem_id":"p02814","language":"Python","original_status":"Time Limit Exceeded","pass":"from sys import stdin\nimport fractions\n\nN, M = [int(x) for x in stdin.readline().rstrip().split()]\nA = [int(x) \/\/ 2 for x in stdin.readline().rstrip().split()]\nans = 0\ng = 1\n\nfor i in range(len(A)):\n g = g * A[i] \/\/ fractions.gcd(g % A[i], A[i])\n\nfor i in range(len(A)):\n if (g \/\/ A[i]) % 2 == 0:\n print(0)\n exit()\n\nans = M \/\/ g\nif ans % 2 == 0:\n print(ans \/\/ 2)\nelse:\n print((ans + 1) \/\/ 2)\n","fail":"from sys import stdin\nimport fractions\n\nN, M = [int(x) for x in stdin.readline().rstrip().split()]\nA = [int(x) \/\/ 2 for x in stdin.readline().rstrip().split()]\nans = 0\ng = 1\n\nfor i in range(len(A)):\n g = g * A[i] \/\/ fractions.gcd(g % A[i], A[i])\n if g > M:\n print(0)\n exit()\n\nfor i in range(len(A)):\n if (g \/\/ A[i]) % 2 == 0:\n print(0)\n exit()\n\nans = M \/\/ g\nif ans % 2 == 0:\n print(ans \/\/ 2)\nelse:\n print((ans + 1) \/\/ 2)\n","change":"insert","i1":10,"i2":10,"j1":10,"j2":13,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02814","language":"Python","original_status":"Runtime Error","pass":"import math\n\n\ndef f(x):\n res = 0\n while x % 2 == 0:\n x \/= 2\n res += 1\n return res\n\n\ndef lcm(a, b):\n return a * b \/\/ math.gcd(a, b)\n\n\nN, M = [int(i) for i in input().split()]\nA = [int(i) for i in input().split()]\n\n\n# a -> a'\nfor i in range(N):\n A[i] = A[i] \/\/ 2\n\n# a' -> a''\nt = f(A[0])\nfor i in range(N):\n if f(A[i]) != t:\n print(0)\n exit()\n A[i] >>= t # A[i] \/= 2^t\nM >>= t\n\nL = 1\nfor i in range(N):\n L = lcm(L, A[i])\n if L > M:\n print(0)\n exit()\n\nM \/= L\nans = math.ceil(M \/ 2)\nprint(ans)\n","fail":"from fractions import gcd\nfrom functools import reduce\n\nN, M = [int(i) for i in input().split()]\nA = [int(i) for i in input().split()]\n\nA = [i >> 1 for i in A]\n\n\ndef applied_lcm(x, y):\n g = gcd(x, y)\n x \/\/= g\n y \/\/= g\n if x % 2 == 0 or y % 2 == 0:\n return 0\n n = x * y * g\n if n >> 10**9:\n return 0\n\n return n\n\n\np = reduce(applied_lcm, A)\nif p == 0:\n ans = 0\nelse:\n ans = (M \/\/ p) - (M \/\/ (p + p))\nprint(ans)\n","change":"replace","i1":0,"i2":41,"j1":0,"j2":27,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p02814","language":"Python","original_status":"Time Limit Exceeded","pass":"from fractions import gcd\nfrom functools import reduce\n\n\ndef inpl():\n return list(map(int, input().split()))\n\n\ndef lcm_base(x, y):\n return (x * y) \/\/ gcd(x, y)\n\n\ndef lcm(*numbers):\n return reduce(lcm_base, numbers, 1)\n\n\ndef lcm_list(numbers):\n return reduce(lcm_base, numbers, 1)\n\n\ndef count2(i, t=0):\n if i % 2 == 0:\n return count2(i \/\/ 2, t + 1)\n else:\n return t\n\n\nN, M = inpl()\nA = inpl()\nA = [a \/\/ 2 for a in A]\n\nall_lcm = lcm_list(A)\nc_2 = count2(A[0])\nfor a in A:\n if c_2 != count2(a):\n print(0)\n exit()\n\nprint(((M \/\/ all_lcm) + 1) \/\/ 2)\n","fail":"from fractions import gcd\nfrom functools import reduce\n\n\ndef inpl():\n return list(map(int, input().split()))\n\n\ndef lcm_base(x, y):\n return (x * y) \/\/ gcd(x, y)\n\n\ndef lcm(*numbers):\n return reduce(lcm_base, numbers, 1)\n\n\ndef lcm_list(numbers):\n return reduce(lcm_base, numbers, 1)\n\n\ndef count2(i):\n t = 2\n ret = 1\n while i % t == 0:\n t *= 2\n ret += 1\n return ret - 1\n\n\nN, M = inpl()\nA = inpl()\nA = [a \/\/ 2 for a in A]\n\nall_lcm = 1\nc2 = count2(A[0])\nfor a in A:\n all_lcm = lcm(all_lcm, a)\n if count2(a) != c2:\n print(0)\n exit()\n\nprint(((M \/\/ all_lcm) + 1) \/\/ 2)\n","change":"replace","i1":20,"i2":35,"j1":20,"j2":38,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02816","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = list(map(int, input().split()))\nb = list(map(int, input().split()))\nc = [0] * n\nd = [0] * (2 * n - 1)\nfor i in range(n - 1):\n c[i] = b[i] ^ b[i + 1]\n d[i] = a[i] ^ a[i + 1]\nc[n - 1] = b[0] ^ b[-1]\nd[n - 1] = a[0] ^ a[-1]\nfor i in range(n - 1):\n d[n + i] = d[i]\nt = [0] * (n + 1)\nt[0] = -1\nj = -1\nfor i in range(n):\n while j >= 0 and c[i] != c[j]:\n j = t[j]\n j += 1\n t[i + 1] = j\nm = 0\nans = []\nwhile m < n:\n for i in range(n):\n if c[i] != d[m + i]:\n m += i - t[i]\n if i > 0:\n i = t[i]\n break\n else:\n ans.append(m)\n m = m + n - t[n]\n i = t[n]\nfor k in ans:\n print(k, a[k] ^ b[0])\n","fail":"n = int(input())\na = list(map(int, input().split()))\nb = list(map(int, input().split()))\nc = [0] * n\nd = [0] * (2 * n - 1)\nfor i in range(n - 1):\n c[i] = b[i] ^ b[i + 1]\n d[i] = a[i] ^ a[i + 1]\nc[n - 1] = b[0] ^ b[-1]\nd[n - 1] = a[0] ^ a[-1]\nfor i in range(n - 1):\n d[n + i] = d[i]\nt = [0] * (n + 1)\nt[0] = -1\nj = -1\nfor i in range(n):\n while j >= 0 and c[i] != c[j]:\n j = t[j]\n j += 1\n t[i + 1] = j\nm = 0\ni = 0\nans = []\nwhile m < n:\n if c[i] == d[m + i]:\n i += 1\n if i == n:\n ans.append(m)\n m += i - t[i]\n i = t[i]\n else:\n m += i - t[i]\n if i > 0:\n i = t[i]\nfor k in ans:\n print(k, a[k] ^ b[0])\n","change":"replace","i1":21,"i2":33,"j1":21,"j2":34,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02817","language":"Python","original_status":"Runtime Error","pass":"In = list(map(int, input().split()))\nsin = set(In)\nprint(\"Yes\" if len(sin) == 2 else \"No\")\n","fail":"S, T = input().split()\nprint(T + S)\n","change":"replace","i1":0,"i2":3,"j1":0,"j2":2,"error":"ValueError: invalid literal for int() with base 10: 'oder'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02817\/Python\/s961214447.py\", line 1, in \n In = list(map(int, input().split()))\nValueError: invalid literal for int() with base 10: 'oder'\n","stdout":null} {"problem_id":"p02817","language":"Python","original_status":"Runtime Error","pass":"s, t = map(int, input().split())\nprint(s + t)\n","fail":"s, t = input().split()\nprint(t + s)\n","change":"replace","i1":0,"i2":2,"j1":0,"j2":2,"error":"ValueError: invalid literal for int() with base 10: 'oder'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02817\/Python\/s795282831.py\", line 1, in \n s, t = map(int, input().split())\nValueError: invalid literal for int() with base 10: 'oder'\n","stdout":null} {"problem_id":"p02817","language":"Python","original_status":"Runtime Error","pass":"s, t = list(input().split().rstrip())\nprint(t + s)\n","fail":"s, t = input().rstrip().split()\nprint(t + s)\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"AttributeError: 'list' object has no attribute 'rstrip'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02817\/Python\/s248204703.py\", line 1, in \n s, t = list(input().split().rstrip())\nAttributeError: 'list' object has no attribute 'rstrip'\n","stdout":null} {"problem_id":"p02817","language":"Python","original_status":"Runtime Error","pass":"S = input()\nT = input()\nprint(T + S)\n","fail":"s, t = input().split()\nans = t + s\nprint(ans)\n","change":"replace","i1":0,"i2":3,"j1":0,"j2":3,"error":"EOFError: EOF when reading a line","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02817\/Python\/s790047642.py\", line 2, in \n T = input()\nEOFError: EOF when reading a line\n","stdout":null} {"problem_id":"p02817","language":"Python","original_status":"Runtime Error","pass":"s, t = input()\nprint(s + t)\n","fail":"s, t = map(str, input().split())\nprint(t + s)\n","change":"replace","i1":0,"i2":2,"j1":0,"j2":2,"error":"ValueError: too many values to unpack (expected 2)","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02817\/Python\/s530679524.py\", line 1, in \n s, t = input()\nValueError: too many values to unpack (expected 2)\n","stdout":null} {"problem_id":"p02818","language":"Python","original_status":"Time Limit Exceeded","pass":"A, B, K = map(int, input().split())\n\nfor _ in range(K):\n if A > 0:\n A -= 1\n elif B > 0:\n B -= 1\n else:\n continue\nprint(A, B)\n","fail":"A, B, K = map(int, input().split())\n\nC = max(0, A - K)\nK -= A - C\nprint(C, max(0, B - K))\n","change":"replace","i1":2,"i2":10,"j1":2,"j2":5,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02818","language":"Python","original_status":"Runtime Error","pass":"a, b, k = (int(i) for i in input().split())\ntakahashi = a - k\naoki = b + takahashi if takahashi < 0 else b\nprint(f\"{max(takahashi, 0)} {max(aoki, 0)}\")\n","fail":"a, b, k = (int(i) for i in input().split())\ntakahashi = a - k\naoki = b + takahashi if takahashi < 0 else b\nprint(\"{} {}\".format(max(takahashi, 0), max(aoki, 0)))\n","change":"replace","i1":3,"i2":4,"j1":3,"j2":4,"error":"0","stderr":null,"stdout":"0 2\n"} {"problem_id":"p02818","language":"Python","original_status":"Time Limit Exceeded","pass":"a, b, k = map(int, input().split())\nfor _ in range(k):\n if a >= 1:\n a -= 1\n elif b >= 1:\n b -= 1\nprint(a, b)\n","fail":"a, b, k = map(int, input().split())\nif k >= a:\n b -= k - a\n a = 0\nelse:\n a -= k\nprint(max(a, 0), max(b, 0))\n","change":"replace","i1":1,"i2":7,"j1":1,"j2":7,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02818","language":"Python","original_status":"Time Limit Exceeded","pass":"import sys\n\nA, B, K = [int(num) for num in input().split()]\n\nif A + B == K:\n print(0, 0)\n sys.exit(0)\n\nif K > A:\n K = K - A\n A = 0\n\nwhile K:\n if A > 0:\n A -= 1\n K -= 1\n continue\n if B > 0:\n B -= 1\n K -= 1\n continue\nprint(A, B)\n","fail":"import sys\n\nA, B, K = [int(num) for num in input().split()]\n\nif A + B <= K:\n A = 0\n B = 0\n print(A, B)\n sys.exit(0)\n\nif A > K:\n A = A - K\n print(A, B)\n sys.exit(0)\nelse:\n K = K - A\n A = 0\n\nif B > K:\n B = B - K\n print(A, B)\n sys.exit(0)\nelse:\n B = 0\n print(A, B)\n","change":"replace","i1":4,"i2":22,"j1":4,"j2":25,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02818","language":"Python","original_status":"Time Limit Exceeded","pass":"a, b, k = map(int, input().split())\n\nfor _ in range(k):\n if a >= 1:\n a -= 1\n elif b >= 1:\n b -= 1\n\nprint(a, b, sep=\" \")\n","fail":"a, b, k = map(int, input().split())\n\n# TE\u3060\u3063\u305f\n# for _ in range(k):\n# if a >= 1:\n# a -= 1\n# elif b >= 1:\n# b -= 1\n\nans_a = 0\nans_b = 0\n\nif a >= k:\n ans_a = a - k\n ans_b = b\nelse:\n ans_a = 0\n if b >= (k - a):\n ans_b = b - (k - a)\n else:\n ans_b = 0\n\nprint(ans_a, ans_b, sep=\" \")\n","change":"replace","i1":2,"i2":9,"j1":2,"j2":23,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02818","language":"Python","original_status":"Runtime Error","pass":"A, B, K = map(int, input().split())\na = max(0, A - K)\nif K - A > 0:\n b = max(0, B - K + A)\nprint(a, b)\n","fail":"A, B, K = map(int, input().split())\na = max(0, A - K)\nb = B\nif K - A > 0:\n b = max(0, B - K + A)\nprint(a, b)\n","change":"insert","i1":2,"i2":2,"j1":2,"j2":3,"error":"0","stderr":null,"stdout":"0 2\n"} {"problem_id":"p02818","language":"Python","original_status":"Runtime Error","pass":"a, b, k = input().split()\nprint(max(a - k, 0), b - max(k - a, 0))\n","fail":"a, b, k = map(int, input().split())\nprint(max(a - k, 0), max(b - max(k - a, 0), 0))\n","change":"replace","i1":0,"i2":2,"j1":0,"j2":2,"error":"TypeError: unsupported operand type(s) for -: 'str' and 'str'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02818\/Python\/s417489568.py\", line 2, in \n print(max(a - k, 0), b - max(k - a, 0))\nTypeError: unsupported operand type(s) for -: 'str' and 'str'\n","stdout":null} {"problem_id":"p02819","language":"Python","original_status":"Time Limit Exceeded","pass":"x = int(input())\n\nwhile True:\n if x % 2 == 0:\n x += 1\n continue\n i = 1\n while i * i <= x:\n if x % i == 0:\n break\n i += 1\n else:\n print(x)\n exit()\n x += 1\n","fail":"x = int(input())\nwhile True:\n i = 2\n while i * i <= x:\n if x % i == 0:\n break\n i += 1\n else:\n print(x)\n exit()\n x += 1\n","change":"replace","i1":1,"i2":7,"j1":1,"j2":3,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02819","language":"Python","original_status":"Runtime Error","pass":"from sympy import sieve\n\nx = int(input())\n\nwhile True:\n if x in sieve:\n print(x)\n break\n x += 1\n","fail":"import math\n\nx = int(input())\n\n\ndef is_prime(x):\n if x < 2:\n return False # 2\u672a\u6e80\u306b\u7d20\u6570\u306f\u306a\u3044\n if x == 2 or x == 3 or x == 5:\n return True # 2,3,5\u306f\u7d20\u6570\n if x % 2 == 0 or x % 3 == 0 or x % 5 == 0:\n return False # 2,3,5\u306e\u500d\u6570\u306f\u5408\u6210\u6570\n\n # \u305f\u3081\u3057\u5272\u308a: \u7591\u4f3c\u7d20\u6570(2\u3067\u30823\u3067\u30825\u3067\u3082\u5272\u308a\u5207\u308c\u306a\u3044\u6570\u5b57)\u3067\u6b21\u3005\u306b\u5272\u3063\u3066\u3044\u304f\n prime = 7\n step = 4\n while prime <= math.sqrt(x):\n if x % prime == 0:\n return False\n\n prime += step\n step = 6 - step\n\n return True\n\n\nwhile True:\n if is_prime(x):\n print(x)\n break\n x += 1\n","change":"replace","i1":0,"i2":6,"j1":0,"j2":28,"error":"0","stderr":null,"stdout":23.0} {"problem_id":"p02819","language":"Python","original_status":"Runtime Error","pass":"import sympy\n\nn = int(input())\n\nif sympy.isprime(n):\n print(n)\nelse:\n res = sympy.nextprime(n, 1)\n print(res)\n","fail":"import math\n\nn = int(input())\n\n\ndef prime_checker(n):\n dest = int(math.sqrt(n))\n for i in range(2, dest):\n if n % i == 0:\n return False\n return True\n\n\nwhile True:\n if prime_checker(n):\n print(n)\n break\n n += 1\n","change":"replace","i1":0,"i2":9,"j1":0,"j2":18,"error":"0","stderr":null,"stdout":23.0} {"problem_id":"p02819","language":"Python","original_status":"Time Limit Exceeded","pass":"x = int(input())\nnums = [i for i in range(2, 100004)]\nwhile nums:\n primal = nums.pop(0)\n if primal >= x:\n print(primal)\n break\n nums = [num for num in nums if num % primal != 0]\n","fail":"import sys\n\nx = int(input())\nnums = [i for i in range(1, 100004, 2)]\ndel nums[0]\nif x == 2:\n print(2)\n sys.exit()\nwhile nums:\n primal = nums.pop(0)\n if primal >= x:\n print(primal)\n break\n nums = [num for num in nums if num % primal != 0]\n","change":"replace","i1":0,"i2":2,"j1":0,"j2":8,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02819","language":"Python","original_status":"Time Limit Exceeded","pass":"import math\n\nx = int(input())\n\nprimes = []\n\nfor n in range(2, 10000000000, 2):\n f = True\n mp = math.ceil(math.sqrt(n))\n for p in primes:\n if p > mp:\n break\n if n % p == 0:\n f = False\n break\n if f:\n primes.append(n)\n if n >= x:\n print(n)\n exit(0)\n","fail":"import math\n\nx = int(input())\n\nprimes = []\n\nif x == 2:\n print(2)\n exit(0)\n\nfor n in range(3, 10000000000, 2):\n f = True\n mp = math.ceil(math.sqrt(n))\n for p in primes:\n if p > mp:\n break\n if n % p == 0:\n f = False\n break\n if f:\n primes.append(n)\n if n >= x:\n print(n)\n exit(0)\n","change":"replace","i1":6,"i2":7,"j1":6,"j2":11,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02819","language":"Python","original_status":"Time Limit Exceeded","pass":"import sys\n\nx = int(input())\nnums = [i for i in range(1, 100004, 2)]\ndel nums[0]\nif x == 2:\n print(2)\n sys.exit()\nwhile nums:\n primal = nums.pop(0)\n if primal >= x:\n print(primal)\n break\n nums = [num for num in nums if num % primal != 0]\n","fail":"def check_primal(num):\n \"\"\"\u7d20\u6570\u3060\u3063\u305f\u30890\u3092\u3001\u9055\u3063\u305f\u30891\u3092\u8fd4\u3059\"\"\"\n for mod in range(2, int(num**0.5 + 1)):\n if num % mod == 0:\n return 1\n return 0\n\n\nx = int(input())\n\nfor i in range(x, 100004):\n if check_primal(i) == 0:\n print(i)\n break\n","change":"replace","i1":0,"i2":14,"j1":0,"j2":14,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02819","language":"Python","original_status":"Runtime Error","pass":"# import math\nimport fractions\n\nn = int(input())\n\n\ndef prime(n):\n if n == 1:\n n += 1\n while True:\n flag = 0\n for k in range(2, int(fractions.sqrt(n)) + 1):\n if n % k == 0:\n flag = 1\n break\n if flag == 0:\n return n\n n += 1\n\n\nans = prime(n)\nprint(ans)\n","fail":"n = int(input())\n\n\ndef prime(n):\n if n == 1:\n n += 1\n while True:\n flag = 0\n for k in range(2, int(n**0.5) + 1):\n if n % k == 0:\n flag = 1\n break\n if flag == 0:\n return n\n n += 1\n\n\nans = prime(n)\nprint(ans)\n","change":"replace","i1":0,"i2":12,"j1":0,"j2":9,"error":"AttributeError: module 'fractions' has no attribute 'sqrt'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02819\/Python\/s955323601.py\", line 21, in \n ans = prime(n)\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02819\/Python\/s955323601.py\", line 12, in prime\n for k in range(2, int(fractions.sqrt(n)) + 1):\nAttributeError: module 'fractions' has no attribute 'sqrt'\n","stdout":null} {"problem_id":"p02819","language":"Python","original_status":"Time Limit Exceeded","pass":"def factors(n):\n return [i for i in range(2, n) if n % i == 0]\n\n\nX = int(input())\n\nprime_l = factors(X)\nwhile True:\n for i in prime_l:\n if X % i == 0:\n break\n prime_l.append(X)\n X += 1\nprint(X)\n","fail":"import random\n\n\ndef is_prime3(q, k=50):\n q = abs(q)\n if q == 2:\n return True\n if q < 2 or q & 1 == 0:\n return False\n\n # n-1=2^s*d\u3068\u3057\uff08\u4f46\u3057a\u306f\u6574\u6570\u3001d\u306f\u5947\u6570)\u3001d\u3092\u6c42\u3081\u308b\n d = (q - 1) >> 1\n while d & 1 == 0:\n d >>= 1\n\n # \u5224\u5b9a\u3092k\u56de\u7e70\u308a\u8fd4\u3059\n for i in range(k):\n a = random.randint(1, q - 1)\n t = d\n y = pow(a, t, q)\n # [0,s-1]\u306e\u7bc4\u56f2\u3059\u3079\u3066\u3092\u30c1\u30a7\u30c3\u30af\n while t != q - 1 and y != 1 and y != q - 1:\n y = pow(y, 2, q)\n t <<= 1\n if y != q - 1 and t & 1 == 0:\n return False\n return True\n\n\nX = int(input())\n\nwhile not is_prime3(X):\n X += 1\n\nprint(X)\n","change":"replace","i1":0,"i2":13,"j1":0,"j2":34,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02819","language":"Python","original_status":"Runtime Error","pass":"import sympy\n\npg = sympy.primerange(2, 100001)\n\nx = int(input())\n\nfor p in pg:\n if p >= x:\n print(p)\n break\n","fail":"import math\n\nx = int(input())\n\n\ndef is_prime(n):\n if n < 2:\n return False\n if n % 2 == 0 and n > 2:\n return False\n return all(n % i for i in range(3, int(math.sqrt(n)) + 1, 2))\n\n\nfor n in range(100005):\n if n >= x and is_prime(n):\n print(n)\n break\n","change":"replace","i1":0,"i2":9,"j1":0,"j2":16,"error":"0","stderr":null,"stdout":23.0} {"problem_id":"p02819","language":"Python","original_status":"Runtime Error","pass":"# ABC149C - Next Prime\ndef is_prime_miller_rabin(n: int) -> bool:\n \"\"\"Miller\u2013Rabin primality test in O(k log^3 n).\n https:\/\/twitter.com\/kiri8128\/status\/1241033090773860353\n https:\/\/www.wikiwand.com\/en\/Miller%E2%80%93Rabin_primality_test\n \"\"\"\n # cut out small primes and 87% of composite numbers.\n if n < 2:\n return False\n elif n in {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67}:\n return True\n elif (\n n % 2 == 0\n or n % 3 == 0\n or n % 5 == 0\n or n % 7 == 0\n or n % 11 == 0\n or n % 13 == 0\n or n % 17 == 0\n or n % 19 == 0\n or n % 23 == 0\n or n % 29 == 0\n or n % 31 == 0\n or n % 37 == 0\n or n % 41 == 0\n or n % 43 == 0\n or n % 47 == 0\n or n % 53 == 0\n or n % 59 == 0\n or n % 61 == 0\n or n % 67 == 0\n ):\n return False\n\n # find the most suitable witnesses for n\n if n < 2_047:\n witnesses = [2]\n elif n < 1_373_653:\n witnesses = [2, 3]\n elif n < 9_080_191:\n witnesses = [31, 73]\n elif n < 25_326_001:\n witnesses = [2, 3, 5]\n elif n < 3_215_031_751:\n witnesses = [2, 3, 5, 7]\n elif n < 4_759_123_141:\n witnesses = [2, 7, 61]\n elif n < 1_122_004_669_633:\n witnesses = [2, 13, 23, 1662803]\n elif n < 2_152_302_898_747:\n witnesses = [2, 3, 5, 7, 11]\n elif n < 3_474_749_660_383:\n witnesses = [2, 3, 5, 7, 11, 13]\n elif n < 341_550_071_728_321:\n witnesses = [2, 3, 5, 7, 11, 13, 17]\n elif n < 3_825_123_056_546_413_051:\n witnesses = [2, 3, 5, 7, 11, 13, 17, 19, 23]\n elif n < 318_665_857_834_031_151_167_461:\n witnesses = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37]\n else: # precisely, n < 3_317_044_064_679_887_385_961_981 (3.3 * 10^24)\n witnesses = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41]\n\n d = n - 1\n d = d \/\/ (d & -d)\n\n for a in witnesses:\n y = pow(a, d, n)\n if y == 1:\n continue\n t = d\n while y != n - 1:\n y = (y * y) % n\n if y == 1 or t == n - 1:\n return False\n t <<= 1\n return True\n\n\ndef main():\n N = int(input())\n if N != 2 and N % 2 == 0:\n N += 1\n while not is_prime_miller_rabin(N):\n N += 2\n print(N)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"# ABC149C - Next Prime\ndef is_prime_miller_rabin(n: int) -> bool:\n \"\"\"Miller\u2013Rabin primality test in O(k log^3 n).\n https:\/\/twitter.com\/kiri8128\/status\/1241033090773860353\n https:\/\/www.wikiwand.com\/en\/Miller%E2%80%93Rabinprimalitytest\n \"\"\"\n # cut out small primes and 87% of composite numbers.\n if n < 2:\n return False\n elif n in {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67}:\n return True\n elif (\n n % 2 == 0\n or n % 3 == 0\n or n % 5 == 0\n or n % 7 == 0\n or n % 11 == 0\n or n % 13 == 0\n or n % 17 == 0\n or n % 19 == 0\n or n % 23 == 0\n or n % 29 == 0\n or n % 31 == 0\n or n % 37 == 0\n or n % 41 == 0\n or n % 43 == 0\n or n % 47 == 0\n or n % 53 == 0\n or n % 59 == 0\n or n % 61 == 0\n or n % 67 == 0\n ):\n return False\n\n # find the most suitable witnesses for n\n if n < 2047:\n witnesses = [2]\n elif n < 1373653:\n witnesses = [2, 3]\n elif n < 9080191:\n witnesses = [31, 73]\n elif n < 25326001:\n witnesses = [2, 3, 5]\n elif n < 3215031751:\n witnesses = [2, 3, 5, 7]\n elif n < 4759123141:\n witnesses = [2, 7, 61]\n elif n < 1122004669633:\n witnesses = [2, 13, 23, 1662803]\n elif n < 2152302898747:\n witnesses = [2, 3, 5, 7, 11]\n elif n < 3474749660383:\n witnesses = [2, 3, 5, 7, 11, 13]\n elif n < 341550071728321:\n witnesses = [2, 3, 5, 7, 11, 13, 17]\n elif n < 3825123056546413051:\n witnesses = [2, 3, 5, 7, 11, 13, 17, 19, 23]\n elif n < 318665857834031151167461:\n witnesses = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37]\n else: # precisely, n < 3317044064679887385961981 (3.3 * 10^24)\n witnesses = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41]\n\n d = n - 1\n d = d \/\/ (d & -d)\n\n for a in witnesses:\n y = pow(a, d, n)\n if y == 1:\n continue\n t = d\n while y != n - 1:\n y = (y * y) % n\n if y == 1 or t == n - 1:\n return False\n t <<= 1\n return True\n\n\ndef main():\n N = int(input())\n if N != 2 and N % 2 == 0:\n N += 1\n while not is_prime_miller_rabin(N):\n N += 2\n print(N)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":4,"i2":60,"j1":4,"j2":60,"error":"0","stderr":null,"stdout":23.0} {"problem_id":"p02821","language":"Python","original_status":"Runtime Error","pass":"from itertools import accumulate\n\nN, M = map(int, input().split())\nA = list(map(int, input().split()))\n\nA.sort(reverse=True)\nd = [0] * (A[0] * 2 + 1)\nfor i in range(N):\n d[A[i]] += 1\nd = list(accumulate(d[::-1]))[::-1]\nb = list(accumulate(A))\n\nleft = 0\nright = A[0] * 2 + 1\nwhile right - left > 1:\n mid = (left + right) \/\/ 2\n m = 0\n for i in range(N):\n m += d[max(0, mid - A[i])]\n if m >= M:\n left = mid\n else:\n right = mid\n\nans = 0\nm = 0\nfor i in range(N):\n t = min(d[max(0, left - A[i])], M - m)\n ans += b[t] + A[i] * t\n m += t\nprint(ans)\n","fail":"from itertools import accumulate\n\nN, M = map(int, input().split())\nA = list(map(int, input().split()))\n\nA.sort(reverse=True)\nd = [0] * (A[0] * 2 + 1)\nfor i in range(N):\n d[A[i]] += 1\nd = list(accumulate(d[::-1]))[::-1]\nS = list(accumulate([0] + A))\n\nleft = 0\nright = A[0] * 2 + 1\nwhile right - left > 1:\n mid = (left + right) \/\/ 2\n m = 0\n for i in range(N):\n m += d[max(0, mid - A[i])]\n if m >= M:\n left = mid\n else:\n right = mid\n\nans = 0\nm = 0\nfor i in range(N):\n t = min(d[max(0, right - A[i])], M - m)\n ans += S[t] + A[i] * t\n m += t\nans += left * (M - m)\nprint(ans)\n","change":"replace","i1":10,"i2":30,"j1":10,"j2":31,"error":"WA","stderr":null,"stdout":356.0} {"problem_id":"p02821","language":"Python","original_status":"Time Limit Exceeded","pass":"N, M = map(int, input().split())\nA = list(map(int, input().split()))\n\nc = [ai + aj for ai in A for aj in A]\nc.sort()\n\nans = sum(c[-M:])\nprint(ans)\n","fail":"from numpy.fft import rfft, irfft\nimport numpy as np\nfrom bisect import bisect_left, bisect_right\n\nN, M = map(int, input().split())\nA = list(map(int, input().split()))\n\na = np.zeros(2**18)\nfor Ai in A:\n a[Ai] += 1\n\nfa = rfft(a)\na2 = irfft(fa**2)\na2 = np.round(a2).astype(np.int)\n\ncum_a2 = np.cumsum(a2)\n\nindex = bisect_left(cum_a2, N**2 - M)\neli = cum_a2[index] - (N**2 - M)\n\na2[index] -= eli\n\nans = sum(A) * 2 * N - (a2[: index + 1] * np.arange(index + 1)).sum()\nprint(ans)\n","change":"replace","i1":0,"i2":7,"j1":0,"j2":23,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02821","language":"Python","original_status":"Runtime Error","pass":"n, m = map(int, input().split())\na = sorted(list(map(int, input().split())), reverse=True)\ns = a[0]\nt = 0\nj = 1\nret = 0\nfor i in range(n):\n s -= a[i]\n ret += a[i] * 2\n m -= 1\n while j < n and (i >= n - 1 or a[i + 1] + a[i + 1] <= a[i] + a[j]):\n if m < i * 2:\n for k in range(i):\n if m > 0:\n ret += a[j] + a[k]\n m -= 1\n if m > 0:\n ret += a[j] + a[k]\n m -= 1\n else:\n ret += a[j] * i * 2 + t * 2\n m -= i * 2\n s += a[j]\n j += 1\n num = (j - i - 1) * 2\n if m <= num:\n for k in range(i + 1, j):\n if m > 0:\n ret += a[i] + a[k]\n m -= 1\n if m > 0:\n ret += a[i] + a[k]\n m -= 1\n break\n m -= num\n ret += s * 2 + a[i] * num\n t += a[i]\n print(a, m, num, s, i, j, ret)\nprint(ret)\n","fail":"n, m = map(int, input().split())\na = sorted(list(map(int, input().split())), reverse=True)\ns = [0]\nfor ai in a:\n s.append(ai + s[-1])\n\n\ndef count(x, accum=False):\n ret = 0\n for ai in a:\n lo, hi = -1, n\n while hi - lo > 1:\n mid = (lo + hi) \/\/ 2\n if ai + a[mid] >= x:\n lo = mid\n else:\n hi = mid\n ret += ai * hi + s[hi] if accum else hi\n return ret\n\n\nlo, hi = 0, 1000000000\nwhile hi - lo > 1:\n mid = (lo + hi) \/\/ 2\n if count(mid) >= m:\n lo = mid\n else:\n hi = mid\n\nprint(count(lo, accum=True) - (count(lo) - m) * lo)\n","change":"replace","i1":2,"i2":39,"j1":2,"j2":30,"error":"0","stderr":null,"stdout":202.0} {"problem_id":"p02823","language":"Python","original_status":"Runtime Error","pass":"import numpy as np\n\nN, A, B = map(int, input().split())\nab_max = np.amax(np.array([A, B]))\nab_min = np.amin(np.array([A, B]))\n\nif (A - B) % 2 == 0:\n print(int((ab_max - ab_min) \/ 2))\nelse:\n print(int(np.amin([(ab_max - 1), (N - ab_min)])))\n","fail":"import numpy as np\nfrom decimal import Decimal\n\nN, A, B = map(Decimal, input().split())\nab_max = np.amax(np.array([A, B]))\nab_min = np.amin(np.array([A, B]))\n\nif (A - B) % 2 == 0:\n print(int((ab_max - ab_min) \/ 2))\nelse:\n print(int(np.amin([ab_min - 1, N - ab_max]) + (ab_max - ab_min + 1) \/ 2))\n","change":"replace","i1":1,"i2":10,"j1":1,"j2":11,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02825","language":"Python","original_status":"Runtime Error","pass":"n, m, v, p = map(int, input().split())\na = list(map(int, input().split()))\na.sort()\n\n\ndef check(x):\n if x > n - p:\n return True\n\n for i in range(x + 1, n - p + 1):\n if a[x] + m < a[i]:\n return False\n\n if v - x - p > 0:\n cnt = 0\n for i in range(x + 1, n - p + 1):\n cnt += min((a[x] + m) - a[i], m)\n\n if (cnt \/\/ (v - x - p)) >= m:\n return True\n else:\n return False\n else:\n return True\n\n\nlb = -1 # False\nub = n - 1 # True\nwhile ub - lb > 1:\n mid = (ub + lb) \/\/ 2\n if check(mid):\n ub = mid\n else:\n lb = mid\n\n# print(a)\n# print(lb, ub)\nans = n - ub\nprint(ans)\n","fail":"n = int(input())\n\n\ndef make3board(x):\n # 3x3\u306e\u30af\u30a9\u30ea\u30c6\u30a3\u30fc2\u306e\u6577\u304d\u8a70\u3081\u65b9\n # aab\n # d.b\n # dcc\n m = x \/\/ 3\n base = [\"aab\", \"d.b\", \"dcc\"]\n board = []\n for i in range(m):\n sl = \"...\" * i\n sr = \"...\" * (m - 1 - i)\n for bj in base:\n board.append(sl + bj + sr)\n return board\n\n\ndef make4board(x):\n # 4x4\u306e\u30af\u30a9\u30ea\u30c6\u30a3\u30fc3\u306e\u6577\u304d\u8a70\u3081\u65b9\n # aagh\n # bbgh\n # cdee\n # cdff\n m = x \/\/ 4\n base = [\"aagh\", \"bbgh\", \"cdee\", \"cdff\"]\n board = []\n for i in range(m):\n sl = \"....\" * i\n sr = \"....\" * (m - 1 - i)\n for bj in base:\n board.append(sl + bj + sr)\n return board\n\n\ndef make5board(x):\n # 5x5\u306e\u30af\u30a9\u30ea\u30c6\u30a3\u30fc3\u306e\u6577\u304d\u8a70\u3081\u65b9\n # aadde\n # bbg.e\n # ccgff\n # ..abc\n # ..abc\n m = x \/\/ 5\n base = [\"aadde\", \"bbg.e\", \"ccgff\", \"..abc\", \"..abc\"]\n board = []\n for i in range(m):\n sl = \".....\" * i\n sr = \".....\" * (m - 1 - i)\n for bj in base:\n board.append(sl + bj + sr)\n return board\n\n\ndef make7board(x):\n # 7x7\u306e\u30af\u30a9\u30ea\u30c6\u30a3\u30fc3\u306e\u6577\u304d\u8a70\u3081\u65b9\n # aabbcc.\n # dd.dd.c\n # ..d..dc\n # ..d..db\n # dd.dd.b\n # ..d..da\n # ..d..da\n m = x \/\/ 7\n base = [\"aabbcc.\", \"dd.dd.c\", \"..d..dc\", \"..d..db\", \"dd.dd.b\", \"..d..da\", \"..d..da\"]\n return board\n\n\ndef concat_board(board1, board2):\n # \u30af\u30a9\u30ea\u30c6\u30a3\u30fc\u304c\u540c\u3058\uff12\u3064\u306eboard\u3092\u5bfe\u89d2\u7dda\u4e0a\u306b\u914d\u7f6e\u3057\u3066\u7e4b\u3050\n # A..\n # .BB\n # .BB\n x, y = len(board1), len(board2)\n board = []\n sr = \".\" * y\n board += [board1[i] + sr for i in range(x)]\n sl = \".\" * x\n board += [sl + board2[i] for i in range(y)]\n return board\n\n\nboard = []\nif n % 3 == 0:\n board = make3board(n)\nelif n % 4 == 0:\n board = make4board(n)\nelif n % 5 == 0:\n board = make5board(n)\nelif n == 7 or n == 11:\n board7 = [\n \"aabbcc.\",\n \"dd.dd.c\",\n \"..d..dc\",\n \"..d..db\",\n \"dd.dd.b\",\n \"..d..da\",\n \"..d..da\",\n ]\n board = concat_board(board7, make4board(n - 7))\nelse:\n for x in range(4, n, 4):\n y = n - x\n if y % 5 == 0:\n board = concat_board(make4board(x), make5board(y))\n break\n\nif len(board) != 0:\n print(*board, sep=\"\\\\n\")\nelse:\n print(-1)\n","change":"replace","i1":0,"i2":39,"j1":0,"j2":111,"error":"ValueError: not enough values to unpack (expected 4, got 1)","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02825\/Python\/s793394062.py\", line 1, in \n n, m, v, p = map(int, input().split())\nValueError: not enough values to unpack (expected 4, got 1)\n","stdout":null} {"problem_id":"p02829","language":"Python","original_status":"Runtime Error","pass":"a, b = map(int, input().split())\nans = 6 - (a + b)\nprint(ans)\n","fail":"a = int(input())\nb = int(input())\nprint(6 - a - b)\n","change":"replace","i1":0,"i2":3,"j1":0,"j2":3,"error":"ValueError: not enough values to unpack (expected 2, got 1)","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02829\/Python\/s996128891.py\", line 1, in \n a, b = map(int, input().split())\nValueError: not enough values to unpack (expected 2, got 1)\n","stdout":null} {"problem_id":"p02829","language":"Python","original_status":"Runtime Error","pass":"def main():\n A = input()\n B = input()\n\n if A == \"1\" and B == \"2\":\n ans = 3\n elif A == \"2\" and B == \"3\":\n ans = 1\n elif A == \"3\" and B == \"1\":\n ans = 2\n\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"def main():\n A = int(input())\n B = int(input())\n\n ans = 6 - A - B\n\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":1,"i2":10,"j1":1,"j2":5,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p02829","language":"Python","original_status":"Runtime Error","pass":"a, b = map(int, input().split())\nprint(6 - a - b)\n","fail":"a = int(input())\nb = int(input())\nprint(6 - a - b)\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":2,"error":"ValueError: not enough values to unpack (expected 2, got 1)","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02829\/Python\/s060375473.py\", line 1, in \n a, b = map(int, input().split())\nValueError: not enough values to unpack (expected 2, got 1)\n","stdout":null} {"problem_id":"p02830","language":"Python","original_status":"Runtime Error","pass":"n = int(input())\ns, t = [int(input()) for i in range(2)]\nout = \"\"\nfor i in range(n):\n out += s[i] + t[i]\nprint(out)\n","fail":"n = int(input())\ns, t = input().split()\nout = \"\"\nfor i in range(n):\n out += s[i] + t[i]\nprint(out)\n","change":"replace","i1":1,"i2":2,"j1":1,"j2":2,"error":"ValueError: invalid literal for int() with base 10: 'ip cc'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02830\/Python\/s669050732.py\", line 2, in \n s, t = [int(input()) for i in range(2)]\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02830\/Python\/s669050732.py\", line 2, in \n s, t = [int(input()) for i in range(2)]\nValueError: invalid literal for int() with base 10: 'ip cc'\n","stdout":null} {"problem_id":"p02831","language":"Python","original_status":"Runtime Error","pass":"import math\n\n\ndef main():\n A, B = map(int, input().split())\n\n print(A * B \/\/ math.gcd(A, B))\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"import fractions\n\n\ndef main():\n A, B = map(int, input().split())\n\n print(A * B \/\/ fractions.gcd(A, B))\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":0,"i2":7,"j1":0,"j2":7,"error":"0","stderr":null,"stdout":6.0} {"problem_id":"p02831","language":"Python","original_status":"Runtime Error","pass":"import numpy as np\n\na, b = map(int, input().split())\n\nprint(np.lcm(a, b))\n","fail":"a, b = map(int, input().split())\n\n\ndef gcd(x, y):\n while y:\n x, y = y, x % y\n return x\n\n\ndef lcm(x, y):\n return (x * y) \/\/ gcd(x, y)\n\n\nprint(lcm(a, b))\n","change":"replace","i1":0,"i2":5,"j1":0,"j2":14,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02831","language":"Python","original_status":"Runtime Error","pass":"# C - Snack\n\nfrom math import gcd\n\nA, B = map(int, input().split())\nprint(A * B \/\/ gcd(A, B))\n","fail":"# C - Snack\n\nfrom fractions import gcd\n\nA, B = map(int, input().split())\nprint(A * B \/\/ gcd(A, B))\n","change":"replace","i1":2,"i2":3,"j1":2,"j2":3,"error":"0","stderr":null,"stdout":6.0} {"problem_id":"p02831","language":"Python","original_status":"Runtime Error","pass":"import math\n\n\ndef lcm(x, y):\n return (x * y) \/\/ math.gcd(x, y)\n\n\nab = input()\na = int(ab.split(\" \")[0])\nb = int(ab.split(\" \")[1])\n\nprint(lcm(a, b))\n","fail":"import fractions\n\n\ndef lcm(x, y):\n return (x * y) \/\/ fractions.gcd(x, y)\n\n\nab = input()\na = int(ab.split(\" \")[0])\nb = int(ab.split(\" \")[1])\n\nprint(lcm(a, b))\n","change":"replace","i1":0,"i2":5,"j1":0,"j2":5,"error":"0","stderr":null,"stdout":6.0} {"problem_id":"p02831","language":"Python","original_status":"Runtime Error","pass":"import math\n\na, b = map(int, input().split())\n\nprint((a * b) \/\/ math.gcd(a, b))\n","fail":"import fractions\n\na, b = map(int, input().split())\n\nprint((a * b) \/\/ fractions.gcd(a, b))\n","change":"replace","i1":0,"i2":5,"j1":0,"j2":5,"error":"0","stderr":null,"stdout":6.0} {"problem_id":"p02831","language":"Python","original_status":"Runtime Error","pass":"import math\n\nA, B = map(int, input().split())\n\n\ndef lcm(x, y):\n return (x * y) \/\/ math.gcd(x, y)\n\n\nprint(lcm(A, B))\n","fail":"from fractions import gcd\n\nA, B = map(int, input().split())\n\n\ndef lcm(x, y):\n return (x * y) \/\/ gcd(x, y)\n\n\nprint(lcm(A, B))\n","change":"replace","i1":0,"i2":7,"j1":0,"j2":7,"error":"0","stderr":null,"stdout":6.0} {"problem_id":"p02831","language":"Python","original_status":"Runtime Error","pass":"import math\n\na, b = map(int, input().split())\n\nprint((a * b) \/\/ math.gcd(a, b))\n","fail":"import fractions\n\na, b = map(int, input().split())\n\nprint((a * b) \/\/ fractions.gcd(a, b))\n","change":"replace","i1":0,"i2":5,"j1":0,"j2":5,"error":"0","stderr":null,"stdout":6.0} {"problem_id":"p02831","language":"Python","original_status":"Runtime Error","pass":"import numpy as np\n\nA, B = [int(i) for i in input().split()]\n\nprint(np.lcm(A, B))\n","fail":"import fractions\n\nA, B = [int(i) for i in input().split()]\n\nprint(int(A * B \/ fractions.gcd(A, B)))\n","change":"replace","i1":0,"i2":5,"j1":0,"j2":5,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02831","language":"Python","original_status":"Runtime Error","pass":"import math\n\na, b = map(int, input().split())\nprint(a \/ math.gcd(a, b) * b)\n","fail":"import fractions\n\na, b = map(int, input().split())\nprint(a \/\/ fractions.gcd(a, b) * b)\n","change":"replace","i1":0,"i2":4,"j1":0,"j2":4,"error":"WA","stderr":null,"stdout":6.0} {"problem_id":"p02831","language":"Python","original_status":"Runtime Error","pass":"from math import gcd\n\na, b = tuple(map(int, input().split()))\nprint(int(a * b \/ gcd(a, b)))\n","fail":"from fractions import gcd\n\na, b = tuple(map(int, input().split()))\nprint(int(a * b \/ gcd(a, b)))\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"0","stderr":null,"stdout":6.0} {"problem_id":"p02831","language":"Python","original_status":"Runtime Error","pass":"import math\n\nA, B = map(int, input().split())\nprint(A * B \/\/ math.gcd(A, B))\n","fail":"import fractions\n\nA, B = map(int, input().split())\nprint(A * B \/\/ fractions.gcd(A, B))\n","change":"replace","i1":0,"i2":4,"j1":0,"j2":4,"error":"0","stderr":null,"stdout":6.0} {"problem_id":"p02831","language":"Python","original_status":"Runtime Error","pass":"import math\n\nA, B = map(int, input().split())\n\nprint(int(A * B \/ math.gcd(A, B)))\n","fail":"import fractions\n\nA, B = map(int, input().split())\n\nprint(int(A * B \/ fractions.gcd(A, B)))\n","change":"replace","i1":0,"i2":5,"j1":0,"j2":5,"error":"0","stderr":null,"stdout":6.0} {"problem_id":"p02831","language":"Python","original_status":"Runtime Error","pass":"import math\n\na, b = list(map(int, input().split()))\n\nans = int(a * b \/ math.gcd(a, b))\n\nprint(ans)\n","fail":"def calc_gcd(a, b):\n r = a % b\n while r != 0:\n a = b\n b = r\n r = a % b\n\n return b\n\n\na, b = list(map(int, input().split()))\n\nif a < b:\n tmp = a\n a = b\n b = tmp\n\ngcd = calc_gcd(a, b)\nans = int(a * b \/ gcd)\n\nprint(ans)\n","change":"replace","i1":0,"i2":5,"j1":0,"j2":19,"error":"0","stderr":null,"stdout":6.0} {"problem_id":"p02831","language":"Python","original_status":"Runtime Error","pass":"import math\n\ndata = input().split()\nval = [int(n) for n in data]\n\nres = val[0] * val[1] \/ math.gcd(val[0], val[1])\n\nprint(res)\n","fail":"import fractions\n\ndata = input().split()\nval = [int(n) for n in data]\n\nres = val[0] * val[1] \/ fractions.gcd(val[0], val[1])\n\nprint(int(res))\n","change":"replace","i1":0,"i2":8,"j1":0,"j2":8,"error":"WA","stderr":null,"stdout":6.0} {"problem_id":"p02831","language":"Python","original_status":"Time Limit Exceeded","pass":"num_list = [int(i) for i in input().split()]\n\nresult = 0\n\nmax = num_list[0] * num_list[1]\nfor i in range(1, max + 1):\n amari_1 = i % num_list[0]\n amari_2 = i % num_list[1]\n if amari_1 == 0 and amari_2 == 0:\n result = i\n break\n\nprint(result)\n","fail":"num_list = [int(i) for i in input().split()]\n\nresult = 0\n\nif num_list[0] < num_list[1]:\n A = num_list[0]\n B = num_list[1]\nelse:\n A = num_list[1]\n B = num_list[0]\n\nwhile True:\n amari = A % B\n if amari == 0:\n break\n A = B\n B = amari\n\n# \u6700\u5927\u516c\u7d04\u6570 B\n\n# \u6700\u5c0f\u516c\u500d\u6570\nresult = num_list[0] * num_list[1] \/\/ B\n\nprint(result)\n","change":"replace","i1":4,"i2":11,"j1":4,"j2":22,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02831","language":"Python","original_status":"Runtime Error","pass":"import math\n\na, b = map(int, input().split())\n\nk = math.gcd(a, b)\n\nans = (a * b) \/\/ k\n\nprint(ans)\n","fail":"import fractions\n\na, b = map(int, input().split())\n\nk = fractions.gcd(a, b)\n\nans = (a * b) \/\/ k\n\nprint(ans)\n","change":"replace","i1":0,"i2":5,"j1":0,"j2":5,"error":"0","stderr":null,"stdout":6.0} {"problem_id":"p02831","language":"Python","original_status":"Runtime Error","pass":"import math\n\nif __name__ == \"__main__\":\n A, B = input().split()\n A = int(A)\n B = int(B)\n ret = (A * B) \/\/ math.gcd(A, B)\n print(ret)\n","fail":"import fractions\n\nif __name__ == \"__main__\":\n A, B = input().split()\n A = int(A)\n B = int(B)\n ret = (A * B) \/\/ fractions.gcd(A, B)\n print(ret)\n","change":"replace","i1":0,"i2":7,"j1":0,"j2":7,"error":"0","stderr":null,"stdout":6.0} {"problem_id":"p02831","language":"Python","original_status":"Runtime Error","pass":"from sys import stdin\nimport fractions\n\na = int(stdin.readline().rstrip())\nb = int(stdin.readline().rstrip())\n\nprint(a * b \/\/ fractions.gcd(a, b))\n","fail":"import fractions\n\na, b = map(int, input().split())\n\nprint(a * b \/\/ fractions.gcd(a, b))\n","change":"replace","i1":0,"i2":5,"j1":0,"j2":3,"error":"ValueError: invalid literal for int() with base 10: '2 3'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02831\/Python\/s722500141.py\", line 4, in \n a = int(stdin.readline().rstrip())\nValueError: invalid literal for int() with base 10: '2 3'\n","stdout":null} {"problem_id":"p02831","language":"Python","original_status":"Runtime Error","pass":"import numpy as np\n\na, b = map(int, input().split())\n\nprint(int((a * b) \/ np.gcd(a, b)))\n","fail":"import fractions\n\na, b = map(int, input().split())\n\nprint(int((a * b) \/ fractions.gcd(a, b)))\n","change":"replace","i1":0,"i2":5,"j1":0,"j2":5,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02831","language":"Python","original_status":"Runtime Error","pass":"from sys import stdin\nimport math\n\n# A = int(stdin.readline().rstrip())\nA, B = [int(x) for x in stdin.readline().rstrip().split()]\n# print(A, B)\n\nif A < B:\n A, B = B, A\n\nprint((A * B) \/\/ math.gcd(A, B))\n","fail":"from sys import stdin\nimport fractions\n\nA, B = [int(x) for x in stdin.readline().rstrip().split()]\n\nprint((A * B) \/\/ fractions.gcd(A, B))\n","change":"replace","i1":1,"i2":11,"j1":1,"j2":6,"error":"0","stderr":null,"stdout":6.0} {"problem_id":"p02831","language":"Python","original_status":"Runtime Error","pass":"import math\n\na, b = map(int, input().split())\nt = math.gcd(a, b)\nprint(a \/\/ t * b)\n","fail":"from fractions import gcd\n\na, b = map(int, input().split())\nt = gcd(a, b)\nprint(a \/\/ t * b)\n","change":"replace","i1":0,"i2":4,"j1":0,"j2":4,"error":"0","stderr":null,"stdout":6.0} {"problem_id":"p02831","language":"Python","original_status":"Runtime Error","pass":"import math\n\na, b = map(int, input().split())\n\nans = a * b \/\/ math.gcd(a, b)\nprint(ans)\n","fail":"import fractions\n\na, b = map(int, input().split())\n\nans = a * b \/\/ fractions.gcd(a, b)\nprint(ans)\n","change":"replace","i1":0,"i2":5,"j1":0,"j2":5,"error":"0","stderr":null,"stdout":6.0} {"problem_id":"p02831","language":"Python","original_status":"Runtime Error","pass":"import math\n\na, b = [int(x.strip()) for x in input().split()]\nprint((a * b) \/\/ math.gcd(a, b))\n","fail":"# -*- coding: utf-8 -*-\n\n\ndef gcd(m, n):\n r = m % n\n return gcd(n, r) if r else n\n\n\ndef lcm(x, y):\n return (x * y) \/\/ gcd(x, y)\n\n\ndef sol(a, b):\n return (a * b) \/\/ gcd(a, b)\n\n\na, b = list(map(int, input().split()))\nprint(sol(a, b))\n","change":"replace","i1":0,"i2":4,"j1":0,"j2":18,"error":"0","stderr":null,"stdout":6.0} {"problem_id":"p02831","language":"Python","original_status":"Runtime Error","pass":"import fraction\n\nA, B = map(int, input().split())\n\nprint(A * B \/\/ fraction.gcd(A, B))\n","fail":"import fractions\n\nA, B = map(int, input().split())\n\nprint(A * B \/\/ fractions.gcd(A, B))\n","change":"replace","i1":0,"i2":5,"j1":0,"j2":5,"error":"ModuleNotFoundError: No module named 'fraction'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02831\/Python\/s216243162.py\", line 1, in \n import fraction\nModuleNotFoundError: No module named 'fraction'\n","stdout":null} {"problem_id":"p02831","language":"Python","original_status":"Runtime Error","pass":"import math\n\nx, y = map(int, input().split())\nprint((x * y) \/\/ math.gcd(x, y))\n","fail":"import fractions\n\nx, y = map(int, input().split())\nprint((x * y) \/\/ fractions.gcd(x, y))\n","change":"replace","i1":0,"i2":4,"j1":0,"j2":4,"error":"0","stderr":null,"stdout":6.0} {"problem_id":"p02831","language":"Python","original_status":"Runtime Error","pass":"import math\n\na, b = map(int, input().split())\n\nprint((a * b) \/\/ math.gcd(a, b))\n","fail":"# import math\nimport fractions\n\na, b = map(int, input().split())\n\nprint((a * b) \/\/ fractions.gcd(a, b))\n","change":"replace","i1":0,"i2":5,"j1":0,"j2":6,"error":"0","stderr":null,"stdout":6.0} {"problem_id":"p02831","language":"Python","original_status":"Runtime Error","pass":"# from fractions import gcd\nfrom math import gcd\n\na, b = map(int, input().split())\nprint(a * b \/\/ gcd(a, b))\nexit(0)\n","fail":"from fractions import gcd\n\n# from math import gcd\n\na, b = map(int, input().split())\nprint(a * b \/\/ gcd(a, b))\nexit(0)\n","change":"replace","i1":0,"i2":2,"j1":0,"j2":3,"error":"0","stderr":null,"stdout":6.0} {"problem_id":"p02831","language":"Python","original_status":"Runtime Error","pass":"import math\n\nA, B = map(int, input().split())\n\n\ndef get_lcm(a, b):\n return (a * b) \/\/ math.gcd(a, b)\n\n\nprint(get_lcm(A, B))\n","fail":"import fractions\n\nA, B = map(int, input().split())\n\n\ndef get_lcm(a, b):\n return (a * b) \/\/ fractions.gcd(a, b)\n\n\nprint(get_lcm(A, B))\n","change":"replace","i1":0,"i2":7,"j1":0,"j2":7,"error":"0","stderr":null,"stdout":6.0} {"problem_id":"p02831","language":"Python","original_status":"Runtime Error","pass":"import math\n\n# \u6700\u5c0f\u516c\u500d\u6570lcm\uff08 least common multiple\uff09\u3092\u8fd4\u3059\u95a2\u6570\u306f\u7528\u610f\u3055\u308c\u3066\u3044\u306a\u3044\n# \u304c\u3001lcm(a, b) = a * b \/ gcd(a, b)\u3067\u6c42\u3081\u3089\u308c\u308b\n\nA, B = map(int, input().split())\nans = A * B \/\/ math.gcd(A, B)\nprint(ans)\n","fail":"import fractions\n\n# \u6700\u5c0f\u516c\u500d\u6570lcm\uff08 least common multiple\uff09\u3092\u8fd4\u3059\u95a2\u6570\u306f\u7528\u610f\u3055\u308c\u3066\u3044\u306a\u3044\n# \u304c\u3001lcm(a, b) = a * b \/ gcd(a, b)\u3067\u6c42\u3081\u3089\u308c\u308b\n\nA, B = map(int, input().split())\nans = A * B \/\/ fractions.gcd(A, B)\nprint(ans)\n","change":"replace","i1":0,"i2":7,"j1":0,"j2":7,"error":"0","stderr":null,"stdout":6.0} {"problem_id":"p02831","language":"Python","original_status":"Runtime Error","pass":"import math\n\nA, B = [int(n) for n in input().split()]\n\nprint(int((A * B) \/ math.gcd(A, B)))\n","fail":"import fractions\n\nA, B = [int(n) for n in input().split()]\n\nprint(A * B \/\/ fractions.gcd(A, B))\n","change":"replace","i1":0,"i2":5,"j1":0,"j2":5,"error":"0","stderr":null,"stdout":6.0} {"problem_id":"p02831","language":"Python","original_status":"Runtime Error","pass":"import math\n\nN = input().split()\n\nA = int(N[0])\nB = int(N[1])\n\nlcm = int(A * B \/ math.gcd(A, B))\n\nprint(lcm)\n","fail":"from fractions import gcd\n\nN = input().split()\n\nA = int(N[0])\nB = int(N[1])\n\nlcm = int(A * B \/ gcd(A, B))\n\nprint(lcm)\n","change":"replace","i1":0,"i2":8,"j1":0,"j2":8,"error":"0","stderr":null,"stdout":6.0} {"problem_id":"p02831","language":"Python","original_status":"Runtime Error","pass":"import fractions\n\na, b = map(int, input().split())\n\nprint(int(a * b \/ fractions.gcd(a * b)))\n","fail":"import fractions\n\na, b = map(int, input().split())\n\nprint(a * b \/\/ fractions.gcd(a, b))\n","change":"replace","i1":4,"i2":5,"j1":4,"j2":5,"error":"AttributeError: module 'fractions' has no attribute 'gcd'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02831\/Python\/s463768606.py\", line 5, in \n print(int(a * b \/ fractions.gcd(a * b)))\nAttributeError: module 'fractions' has no attribute 'gcd'\n","stdout":null} {"problem_id":"p02831","language":"Python","original_status":"Runtime Error","pass":"import functions\n\nX = [int(x) for x in input().split()]\n\nv = functions.gcd(X[0], X[1])\nj = X[0] \/ v\np = int(X[1] * j)\n\nprint(p)\n","fail":"import fractions\n\nX = [int(x) for x in input().split()]\n\nv = fractions.gcd(X[0], X[1])\nj = X[0] \/ v\np = int(X[1] * j)\n\nprint(p)\n","change":"replace","i1":0,"i2":5,"j1":0,"j2":5,"error":"ModuleNotFoundError: No module named 'functions'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02831\/Python\/s715572091.py\", line 1, in \n import functions\nModuleNotFoundError: No module named 'functions'\n","stdout":null} {"problem_id":"p02831","language":"Python","original_status":"Runtime Error","pass":"import math\n\n\ndef lcm(x, y):\n return (x * y) \/\/ math.gcd(x, y)\n\n\na, b = map(int, input().split())\n\nprint(lcm(a, b))\n","fail":"import fractions\n\n\ndef lcm(x, y):\n return (x * y) \/\/ fractions.gcd(x, y)\n\n\na, b = map(int, input().split())\n\nprint(lcm(a, b))\n","change":"replace","i1":0,"i2":5,"j1":0,"j2":5,"error":"0","stderr":null,"stdout":6.0} {"problem_id":"p02831","language":"Python","original_status":"Runtime Error","pass":"import math as ma\n\n\ndef lcm(x, y):\n return (x * y) \/\/ ma.gcd(x, y)\n\n\na, b = map(int, input().split())\n\nprint(lcm(a, b))\n","fail":"import fractions\n\n\ndef lcm(x, y):\n return (x * y) \/\/ fractions.gcd(x, y)\n\n\na, b = map(int, input().split())\n\nprint(lcm(a, b))\n","change":"replace","i1":0,"i2":5,"j1":0,"j2":5,"error":"0","stderr":null,"stdout":6.0} {"problem_id":"p02831","language":"Python","original_status":"Runtime Error","pass":"import math\n\n\ndef lcm(x, y):\n return (x * y) \/\/ math.gcd(x, y)\n\n\nA, B = map(int, input().split())\n\nprint(lcm(A, B))\n","fail":"import fractions\n\n\ndef lcm(x, y):\n return (x * y) \/\/ fractions.gcd(x, y)\n\n\nA, B = map(int, input().split())\n\nprint(lcm(A, B))\n","change":"replace","i1":0,"i2":5,"j1":0,"j2":5,"error":"0","stderr":null,"stdout":6.0} {"problem_id":"p02831","language":"Python","original_status":"Runtime Error","pass":"import math\n\nA, B = map(int, input().split())\n\nprint(A * B \/\/ math.gcd(A, B))\n","fail":"A, B = map(int, input().split())\n\n\ndef gcd(a, b):\n if b == 0:\n return a\n return gcd(b, a % b)\n\n\nprint(A * B \/\/ gcd(A, B))\n","change":"replace","i1":0,"i2":5,"j1":0,"j2":10,"error":"0","stderr":null,"stdout":6.0} {"problem_id":"p02831","language":"Python","original_status":"Runtime Error","pass":"import math\n\nA, B = map(int, input().split())\n\nprint(A * B \/\/ math.gcd(A, B))\n","fail":"import fractions as f\n\nA, B = map(int, input().split())\n\nprint(A * B \/\/ f.gcd(A, B))\n","change":"replace","i1":0,"i2":5,"j1":0,"j2":5,"error":"0","stderr":null,"stdout":6.0} {"problem_id":"p02831","language":"Python","original_status":"Runtime Error","pass":"import math\n\na, b = map(int, input().split())\n\nprint(a * b \/\/ math.gcd(a, b))\n","fail":"# import math\n\na, b = map(int, input().split())\n\n# print(a * b \/\/ math.gcd(a, b))\n\n\ndef gcd(a, b):\n while b != 0:\n a, b = b, a % b\n return a\n\n\ndef lcm(a, b):\n return a * b \/\/ gcd(a, b)\n\n\nprint(lcm(a, b))\n","change":"replace","i1":0,"i2":5,"j1":0,"j2":18,"error":"0","stderr":null,"stdout":6.0} {"problem_id":"p02831","language":"Python","original_status":"Runtime Error","pass":"#!\/usr\/local\/bin python\n# -*- coding: utf-8 -*-\n#\n# ~\/PycharmProjects\/atcoder\/C-Snack.py\n#\nimport math\n\na, b = map(int, input().split())\nans = int(a * b \/ math.gcd(a, b))\nprint(ans)\n","fail":"#!\/usr\/local\/bin python\n# -*- coding: utf-8 -*-\n#\n# ~\/PycharmProjects\/atcoder\/C-Snack.py\n#\nfrom fractions import gcd\n\na, b = map(int, input().split())\nans = int(a * b \/\/ gcd(a, b))\nprint(ans)\n","change":"replace","i1":5,"i2":9,"j1":5,"j2":9,"error":"0","stderr":null,"stdout":6.0} {"problem_id":"p02831","language":"Python","original_status":"Runtime Error","pass":"# \u6700\u5c0f\u516c\u500d\u6570\nimport math\n\na, b = map(int, input().split())\n\n\ndef lcm(x, y):\n return (x * y) \/\/ math.gcd(x, y)\n\n\nprint(lcm(a, b))\n","fail":"# \u6700\u5c0f\u516c\u500d\u6570\nimport fractions\n\na, b = map(int, input().split())\n\n\ndef lcm(x, y):\n return (x * y) \/\/ fractions.gcd(x, y)\n\n\nprint(lcm(a, b))\n","change":"replace","i1":1,"i2":8,"j1":1,"j2":8,"error":"0","stderr":null,"stdout":6.0} {"problem_id":"p02831","language":"Python","original_status":"Runtime Error","pass":"import math\n\na, b = map(int, input().split())\n\nprint(a * b \/\/ math.gcd(a, b))\n","fail":"import fractions\n\na, b = map(int, input().split())\n\nprint(a * b \/\/ fractions.gcd(a, b))\n","change":"replace","i1":0,"i2":5,"j1":0,"j2":5,"error":"0","stderr":null,"stdout":6.0} {"problem_id":"p02831","language":"Python","original_status":"Runtime Error","pass":"import math\n\nA, B = map(int, input().split())\n\n\ndef lcm(x, y):\n return (x * y) \/\/ math.gcd(x, y)\n\n\nprint(lcm(A, B))\n","fail":"import math\n\nA, B = map(int, input().split())\n\n\ndef gcd(a, b):\n while b:\n a, b = b, a % b\n return a\n\n\n# a,b\u306e\u6700\u5c0f\u516c\u500d\u6570\n\n\ndef lcm(a, b):\n return a * b \/\/ gcd(a, b)\n\n\nprint(lcm(A, B))\n","change":"replace","i1":5,"i2":7,"j1":5,"j2":16,"error":"0","stderr":null,"stdout":6.0} {"problem_id":"p02832","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\na = list(map(int, input().split()))\nnm = 1\nans = 0\nwhile a:\n x = a.pop(0)\n if x == nm:\n nm += 1\n else:\n ans += 1\n\nif ans == N:\n print(-1)\nelse:\n print(ans)\n","fail":"N = int(input())\na = list(map(int, input().split()))\nnm = 1\nans = 0\nfor i in range(N):\n x = a[i]\n if x == nm:\n nm += 1\n else:\n ans += 1\n\nif ans == N:\n print(-1)\nelse:\n print(ans)\n","change":"replace","i1":4,"i2":6,"j1":4,"j2":6,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02832","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = list(map(int, input().split()))\n\nlength = len(A)\nhead = 0\ni = 1\n\nwhile True:\n if i in A:\n head = A.index(i)\n A = A[head:]\n i += 1\n else:\n break\n\nif i == 1:\n print(-1)\nelse:\n print(length - i + 1)\n","fail":"N = int(input())\nA = list(map(int, input().split()))\n\nlength = len(A)\nfind_next = 1\n\nfor i in range(N):\n if A[i] == find_next:\n find_next += 1\n\nif find_next == 1:\n print(-1)\nelse:\n print(length - find_next + 1)\n","change":"replace","i1":4,"i2":19,"j1":4,"j2":14,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02832","language":"Python","original_status":"Time Limit Exceeded","pass":"def main(n: int, a: list):\n ans = 0\n\n i = 1\n\n if 1 not in a:\n print(-1)\n return\n\n while len(a) > 0:\n if a[0] != i:\n a.pop(0)\n ans += 1\n continue\n i += 1\n a.pop(0)\n\n print(ans)\n\n\nif __name__ == \"__main__\":\n n = int(input())\n a = list(map(int, input().split()))\n\n main(n, a)\n","fail":"def main(n: int, a: list):\n ans = 0\n\n i = 1\n\n if 1 not in set(a):\n print(-1)\n return\n\n for _a in a:\n if _a != i:\n ans += 1\n else:\n i += 1\n\n print(ans)\n\n\nif __name__ == \"__main__\":\n n = int(input())\n a = list(map(int, input().split()))\n\n main(n, a)\n","change":"replace","i1":5,"i2":16,"j1":5,"j2":14,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02832","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\na = list(map(int, input().split()))\nremain = 1 # \u6b8b\u3059\u6574\u6570\nindex = 0\n\nif remain not in a:\n print(-1)\n exit()\n\nwhile remain in a[index:]:\n index = a[index:].index(remain)\n remain += 1\n\nprint(N - remain + 1)\n","fail":"N = int(input())\na = list(map(int, input().split()))\n\nnow = 1\nfor ai in a:\n if ai == now:\n now += 1\n\nif now == 1:\n print(-1)\nelse:\n print(N - now + 1)\n","change":"replace","i1":2,"i2":14,"j1":2,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02832","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\nlst = list(map(int, input().split()))\ni, j = 0, 1\nwhile i < len(lst):\n if lst[i] != j:\n lst.pop(i)\n else:\n i += 1\n j += 1\n\nif not lst:\n print(-1)\nelse:\n print(n - len(lst))\n","fail":"n = int(input())\nlst = list(map(int, input().split()))\ni = 1\nfor j in lst:\n if i == j:\n i += 1\n\nprint(-1 if i == 1 else n - i + 1)\n","change":"replace","i1":2,"i2":14,"j1":2,"j2":8,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02832","language":"Python","original_status":"Runtime Error","pass":"N = int(input())\nalist = list(map(int, input().split()))\nleft = 0\nfor i in range(1, N + 1):\n try:\n old_left = left\n left = alist[left:].index(i)\n p = left + old_left\n except ValueError:\n print(i, p)\n if i == 1:\n print(-1)\n else:\n print(N - i + (N - p))\n break\nelse:\n print(0)\n","fail":"N = int(input())\nalist = list(map(int, input().split()))\nnow = 1\nfor a in alist:\n if a == now:\n now += 1\nif now == 1:\n print(-1)\nelse:\n print(N - now + 1)\n","change":"replace","i1":2,"i2":17,"j1":2,"j2":10,"error":"WA","stderr":null,"stdout":"3 2\n1\n"} {"problem_id":"p02832","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = tuple(map(int, input().split()))\npos = 0\nj = 1\n\nwhile True:\n for i, data in enumerate(a[pos:]):\n if data == j:\n pos += i + 1\n j += 1\n break\n else:\n print((-1, n - j + 1)[j != 1])\n break\n","fail":"n = int(input())\nj = 1\n\nfor i in map(int, input().split()):\n if i == j:\n j += 1\n\nprint((-1, n - j + 1)[j != 1])\n","change":"replace","i1":1,"i2":14,"j1":1,"j2":8,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02832","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = list(map(int, input().split()))\n\nans = 0\ni = 0\nwhile i < len(A):\n if (i + 1) == A[i]:\n i += 1\n else:\n A.pop(i)\n ans += 1\n\nif A:\n print(ans)\nelse:\n print(-1)\n","fail":"N = int(input())\nA = list(map(int, input().split()))\n\nans = 0\nnum = 1\nfor a in A:\n if a == num:\n num += 1\n else:\n ans += 1\n\nif ans == N:\n ans = -1\n\nprint(ans)\n","change":"replace","i1":4,"i2":16,"j1":4,"j2":15,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02832","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\na = list(map(int, input().split()))\nans = 0\ni = 1\nj = 0\nwhile j < N:\n if i not in a[j:]:\n ans += N - j\n break\n nj = a[j:].index(i)\n ans += nj - j\n i += 1\n j = nj + 1\nif i == 1:\n print(-1)\nelse:\n print(ans)\n","fail":"N = int(input())\na = list(map(int, input().split()))\nans = 0\nx = 1\nfor i in a:\n if i == x:\n x += 1\n else:\n ans += 1\nif x == 1:\n print(-1)\nelse:\n print(ans)\n","change":"replace","i1":3,"i2":14,"j1":3,"j2":10,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02832","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nlist_a = list(map(int, input().split()))\n\ni = 1\nwhile True:\n if i in list_a:\n index = list_a.index(i)\n list_a = list_a[index:]\n i += 1\n else:\n break\n\nprint(N - (i - 1) if i != 1 else -1)\n","fail":"N = int(input())\nlist_a = list(map(int, input().split()))\n\ncount = 1\nfor i in list_a:\n if i == count:\n count += 1\n\nprint(N - (count - 1) if count != 1 else -1)\n","change":"replace","i1":3,"i2":13,"j1":3,"j2":9,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02833","language":"Python","original_status":"Runtime Error","pass":"import math\n\n\ndef main():\n N = int(input())\n\n if N % 2 == 0:\n B = N \/\/ 2\n n = math.floor(math.log(B) \/ math.log(5))\n\n ans = 0\n for i in range(1, n + 1):\n ans += B \/\/ (5**i)\n\n else:\n ans = 0\n\n print(int(ans))\n\n\nmain()\n","fail":"import math\n\n\ndef main():\n N = int(input())\n\n if N == 0 or N == 1:\n ans = 0\n\n elif N % 2 == 0:\n B = N \/\/ 2\n n = math.floor(math.log(B) \/ math.log(5))\n\n ans = 0\n for i in range(1, n + 1):\n ans += B \/\/ (5**i)\n\n else:\n ans = 0\n\n print(int(ans))\n\n\nmain()\n","change":"replace","i1":6,"i2":7,"j1":6,"j2":10,"error":0,"stderr":null,"stdout":1} {"problem_id":"p02833","language":"Python","original_status":"Runtime Error","pass":"N = int(input())\n\nif N % 2 != 0:\n print(0)\n\nelse:\n count = N \/\/ 10\n for j in range(1, 50):\n count += N \/\/ ((5**j) * 10)\n\nprint(count)\n","fail":"N = int(input())\n\nif N % 2 != 0:\n print(0)\nelse:\n count = N \/\/ 10\n for j in range(1, 50):\n count += N \/\/ ((5**j) * 10)\n print(count)\n","change":"replace","i1":4,"i2":11,"j1":4,"j2":9,"error":0,"stderr":null,"stdout":1} {"problem_id":"p02834","language":"Python","original_status":"Runtime Error","pass":"from collections import deque\n\n\ndef nearlist(N, LIST): # \u96a3\u63a5\u30ea\u30b9\u30c8\n NEAR = [set() for _ in range(N)]\n for a, b in LIST:\n NEAR[a - 1].add(b - 1)\n NEAR[b - 1].add(a - 1)\n return NEAR\n\n\ndef bfs(NEAR, S, N): # \u5e45\u512a\u5148\u63a2\u7d22 # \u30ad\u30e5\u30fc\n dist = [-1 for _ in range(N)] # \u524d\u51e6\u7406\n dist[S] = 0\n que, frag = deque([S]), set([S])\n\n while len(que) > 0:\n q = que.popleft()\n for i in NEAR[q]: # \u79fb\u52d5\u5148\u306e\u5019\u88dc\n if i in frag: # \u51e6\u7406\u6e08\u307f\u304b\u5426\u304b\n continue\n dist[i] = dist[q] + 1\n que.append(i), frag.add(i)\n return dist\n\n\nn, u, v = map(int, input().split())\nab = [list(map(int, input().split())) for _ in range(n - 1)]\n\nnear = nearlist(n, ab)\ntkdist, akdist = bfs(near, u - 1, n), bfs(near, v - 1, n)\n\nnode = [i for i in range(n) if tkdist[i] <= akdist[i]]\nans = max(akdist[i] for i in node)\nprint(ans[0] - 1)\n","fail":"from collections import deque\n\n\ndef nearlist(N, LIST): # \u96a3\u63a5\u30ea\u30b9\u30c8\n NEAR = [set() for _ in range(N)]\n for a, b in LIST:\n NEAR[a - 1].add(b - 1)\n NEAR[b - 1].add(a - 1)\n return NEAR\n\n\ndef bfs(NEAR, S, N): # \u5e45\u512a\u5148\u63a2\u7d22 # \u30ad\u30e5\u30fc\n dist = [-1 for _ in range(N)] # \u524d\u51e6\u7406\n dist[S] = 0\n que, frag = deque([S]), set([S])\n\n while len(que) > 0:\n q = que.popleft()\n for i in NEAR[q]: # \u79fb\u52d5\u5148\u306e\u5019\u88dc\n if i in frag: # \u51e6\u7406\u6e08\u307f\u304b\u5426\u304b\n continue\n dist[i] = dist[q] + 1\n que.append(i), frag.add(i)\n return dist\n\n\nn, u, v = map(int, input().split())\nab = [list(map(int, input().split())) for _ in range(n - 1)]\n\nnear = nearlist(n, ab)\ntkdist, akdist = bfs(near, u - 1, n), bfs(near, v - 1, n)\n\nnode = [i for i in range(n) if tkdist[i] <= akdist[i]]\nans = max(akdist[i] for i in node)\nprint(ans - 1)\n","change":"replace","i1":34,"i2":35,"j1":34,"j2":35,"error":"TypeError: 'int' object is not subscriptable","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02834\/Python\/s347111194.py\", line 35, in \n print(ans[0] - 1)\nTypeError: 'int' object is not subscriptable\n","stdout":null} {"problem_id":"p02834","language":"Python","original_status":"Runtime Error","pass":"import sys\n\n\ndef dfs(v, parent, depth):\n parents[v] = parent\n self_depths[v] = depth\n sd = 0\n for u in links[v]:\n if u == parent:\n continue\n res = dfs(u, v, depth + 1)\n sd = max(sd, res + 1)\n\n subtree_depths[v] = sd\n return sd\n\n\ndef solve(u, v):\n ans = 0\n catch = self_depths[u] \/\/ 2\n while self_depths[u] > catch:\n ans = max(ans, self_depths[u] + subtree_depths[u] - 1)\n u = parents[u]\n return ans\n\n\nn, u, v = map(int, input().split())\nu -= 1\nv -= 1\nlinks = [set() for _ in range(n)]\nfor line in sys.stdin:\n a, b = map(int, line.split())\n a -= 1\n b -= 1\n links[a].add(b)\n links[b].add(a)\n\nparents = [-1] * n\nself_depths = [0] * n\nsubtree_depths = [0] * n\ndfs(v, -1, 0)\n# print(parents)\n# print(self_depths)\n# print(subtree_depths)\nprint(solve(u, v))\n","fail":"import sys\n\nsys.setrecursionlimit(10**5)\n\n\ndef dfs(v, parent, depth):\n parents[v] = parent\n self_depths[v] = depth\n sd = 0\n for u in links[v]:\n if u == parent:\n continue\n res = dfs(u, v, depth + 1)\n sd = max(sd, res + 1)\n\n subtree_depths[v] = sd\n return sd\n\n\ndef solve(u):\n ans = 0\n catch = self_depths[u] \/\/ 2\n while self_depths[u] > catch:\n ans = max(ans, self_depths[u] + subtree_depths[u] - 1)\n u = parents[u]\n return ans\n\n\nn, u, v = map(int, input().split())\nu -= 1\nv -= 1\nlinks = [set() for _ in range(n)]\nfor line in sys.stdin:\n a, b = map(int, line.split())\n a -= 1\n b -= 1\n links[a].add(b)\n links[b].add(a)\n\nparents = [-1] * n\nself_depths = [0] * n\nsubtree_depths = [0] * n\ndfs(v, -1, 0)\n# print(parents)\n# print(self_depths)\n# print(subtree_depths)\nprint(solve(u))\n","change":"replace","i1":1,"i2":45,"j1":1,"j2":47,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p02834","language":"Python","original_status":"Runtime Error","pass":"n, u, v = map(int, input().split())\n# \u3088\u308a\u305f\u304b\u306f\u3057\u304f\u3093\u304c\u65e9\u304f\u8fbf\u308a\u7740\u3051\u308b\u8449\u306e\u3046\u3061\u3001\u9752\u6728\u541b\u304b\u3089\u6700\u3082\u9060\u3044\u3067\nu -= 1\nv -= 1\n\ng = [[] for _ in range(n)]\nfor _ in range(n - 1):\n a, b = map(lambda x: int(x) - 1, input().split())\n g[a].append(b)\n g[b].append(a)\n\nINF = 1 << 30\nt = [INF] * n\na = [INF] * n\n\nt[u] = 0\na[v] = 0\n\n\ndef dfs(v, p, d):\n for nv in g[v]:\n if nv == p:\n continue\n if d[nv] == INF:\n d[nv] = d[v] + 1\n dfs(nv, v, d)\n\n\ndfs(u, -1, t)\ndfs(v, -1, a)\n\nans = 0\nfor i in range(n):\n if t[i] < a[i]:\n ans = max(ans, a[i] - 1)\nprint(ans)\n","fail":"import sys\n\nsys.setrecursionlimit(10**6)\n\nn, u, v = map(int, input().split())\n# \u3088\u308a\u305f\u304b\u306f\u3057\u304f\u3093\u304c\u65e9\u304f\u8fbf\u308a\u7740\u3051\u308b\u8449\u306e\u3046\u3061\u3001\u9752\u6728\u541b\u304b\u3089\u6700\u3082\u9060\u3044\u3067\nu -= 1\nv -= 1\n\ng = [[] for _ in range(n)]\nfor _ in range(n - 1):\n a, b = map(lambda x: int(x) - 1, input().split())\n g[a].append(b)\n g[b].append(a)\n\nINF = 1 << 30\nt = [INF] * n\na = [INF] * n\n\nt[u] = 0\na[v] = 0\n\n\ndef dfs(v, p, d):\n for nv in g[v]:\n if nv == p:\n continue\n if d[nv] == INF:\n d[nv] = d[v] + 1\n dfs(nv, v, d)\n\n\ndfs(u, -1, t)\ndfs(v, -1, a)\n\nans = 0\nfor i in range(n):\n if t[i] < a[i]:\n ans = max(ans, a[i] - 1)\nprint(ans)\n","change":"insert","i1":0,"i2":0,"j1":0,"j2":4,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p02834","language":"Python","original_status":"Runtime Error","pass":"# nlogn\u306e\u5b9f\u88c5\u3002\u99c4\u76ee\u3002\nimport numpy as np\nfrom scipy.sparse.csgraph import dijkstra\n\n\ndef calc(d):\n if d == 1 or d == 0:\n return 0\n else:\n return int(d - 1)\n\n\ndelta = []\nn, u, v = map(int, input().split())\nGn = np.full((n, n), float(\"inf\"))\nfor i in range(n - 1):\n a, b = map(int, input().split())\n a = a - 1\n b = b - 1\n Gn[a][b] = 1\n Gn[b][a] = 1\n Gn[i][i] = 0\nminimum_u = dijkstra(Gn, indices=u - 1)\nminimum_v = dijkstra(Gn, indices=v - 1)\nfor i in range(n):\n if minimum_v[i] - minimum_u[i] > 0 and i != u - 1 and i != v - 1:\n delta.append([i, minimum_v[i]])\nif delta != []:\n delta_sorted = sorted(delta, key=lambda x: x[1])\n p = delta_sorted[-1][0]\n d = int(minimum_v[p])\n print(calc(d))\nelse:\n print(calc(minimum_u[v - 1]))\n","fail":"# \u5199\u7d4c\nimport sys\n\nread = sys.stdin.buffer.read\nreadline = sys.stdin.buffer.readline\nreadlines = sys.stdin.buffer.readlines\n\nn, u, v = map(int, readline().split())\nm = map(int, read().split())\nAB = zip(m, m)\n\ngraph = [[] for _ in range(n + 1)]\nfor a, b in AB:\n graph[a].append(b)\n graph[b].append(a)\n\n\ndef dfs(v):\n dist = [-1] * (n + 1)\n # \u521d\u671f\u5316\n stack = [v]\n # \u521d\u671f\u4f4d\u7f6e\u3092\u8a18\u61b6\n dist[v] = 0\n # \u521d\u671f\u4f4d\u7f6e\u306e\u8ddd\u96e2\u30920\u306b\n while stack:\n # stack\u306e\u4e2d\u8eab\u304c\u306a\u304f\u306a\u308b\u307e\u3067\u9811\u5f35\u308b\n v = stack.pop()\n # stack\u304b\u30891\u3064\u8981\u7d20\u3092\u53d6\u308a\u51fa\u3059\n dw = dist[v] + 1\n # \u305d\u306e\u8981\u7d20\u306e\u5468\u308a\u3092\u8003\u3048\u308b\u306e\u3067\u3001\u8ddd\u96e2\u3068\u3057\u3066\u306f\u305d\u306e\u8981\u7d20\u306e\u8ddd\u96e2\u306b1\u3092\u52a0\u3048\u305f\u3082\u306e\u3092\u8003\u3048\u308b\n for w in graph[v]:\n # \u8003\u3048\u3066\u3044\u308b\u8981\u7d20\u306b\u5bfe\u3057\u3066\u96a3\u63a5\u3057\u3066\u3044\u308b\u70b9\u306b\u5bfe\u3057\u3066\n if dist[w] >= 0:\n # \u3082\u3057\u4eca\u307e\u3067\u8a2a\u308c\u305f\u3053\u3068\u304c\u3042\u3063\u305f\u3089\u7121\u8996\n continue\n dist[w] = dw\n # \u8a2a\u308c\u305f\u3053\u3068\u304c\u306a\u304b\u3063\u305f\u3089\u8ddd\u96e2\u3092\u66f4\u65b0\n stack.append(w)\n # \u8a2a\u308c\u305f\u3053\u3068\u304c\u306a\u3044\u3068\u3053\u308d\u3060\u3063\u305f\u3089stack\u306b\u8a2a\u308c\u308b\u70b9\u30ea\u30b9\u30c8\u3068\u3057\u3066\u4fdd\u5b58\n return dist\n\n\nanswer = 0\ndu, dv = dfs(u), dfs(v)\nfor u, v in zip(du[1:], dv[1:]):\n if v - u > 0:\n x = v - 1\n if answer < x:\n answer = x\nprint(answer)\n","change":"replace","i1":0,"i2":34,"j1":0,"j2":50,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02834","language":"Python","original_status":"Time Limit Exceeded","pass":"n, U, V = map(int, input().split())\nab = [list(map(int, input().split())) for _ in range(n - 1)]\nU -= 1\nV -= 1\n\ng = [[] for _ in range(n)]\nfor a, b in ab:\n a -= 1\n b -= 1\n g[a].append(b)\n g[b].append(a)\n\nWHITE = 0\nGRAY = 1\nBLACK = 2\n\n\ndef dfs(s):\n color = [WHITE] * n\n d = [-1] * n\n f = [-1] * n\n p = [-1] * n\n t = 0\n stack = [s]\n color[s] = GRAY\n d[s] = t\n t += 1\n while stack:\n u = stack[-1]\n for v in g[u]:\n if color[v] == WHITE:\n color[v] = GRAY\n d[v] = t\n p[v] = u\n t += 1\n stack.append(v)\n break\n else:\n color[u] = BLACK\n f[u] = t\n t -= 1\n stack.pop()\n\n return d\n\n\ndv = dfs(V)\n\ndu = dfs(U)\n\nans = 0\nfor due, dve in zip(du, dv):\n if dve > due:\n ans = max(ans, dve - 1)\n\nprint(ans)\n","fail":"from collections import deque\n\n\ndef bfs(s):\n d = [-1] * n\n p = [-1] * n\n dq = deque([s])\n d[s] = 0\n\n while dq:\n u = dq.popleft()\n for v in adj[u]:\n if d[v] == -1:\n d[v] = d[u] + 1\n p[v] = u\n dq.append(v)\n\n return d, p\n\n\nn, takahashi, aoki = map(int, input().split())\ntakahashi -= 1\naoki -= 1\nab = [list(map(int, input().split())) for _ in range(n - 1)]\n\nadj = [[] for _ in range(n)]\nfor a, b in ab:\n a -= 1\n b -= 1\n adj[a].append(b)\n adj[b].append(a)\n\ndepth, par = bfs(takahashi)\naoki_move = depth[aoki] \/\/ 2 + 1\nroot = aoki\nfor _ in range(aoki_move):\n child = root\n root = par[root]\n\nadj[child].remove(root)\nadj[root].remove(child)\n\ndepth2, par2 = bfs(root)\n\naoki_move += max(depth2) - 1\nprint(aoki_move)\n","change":"replace","i1":0,"i2":56,"j1":0,"j2":46,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02835","language":"Python","original_status":"Runtime Error","pass":"A1 = input()\nA2 = input()\nA3 = input()\n","fail":"a, b, c = map(int, input().split())\nif a + b + c >= 22:\n print(\"bust\")\nelse:\n print(\"win\")\n","change":"replace","i1":0,"i2":3,"j1":0,"j2":5,"error":"EOFError: EOF when reading a line","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02835\/Python\/s614017612.py\", line 2, in \n A2 = input()\nEOFError: EOF when reading a line\n","stdout":null} {"problem_id":"p02835","language":"Python","original_status":"Runtime Error","pass":"a, b, c = map(int, input().split())\n\nprint(\"win\" if sum((a, b, c)) < 21 else \"bust\")\na, b, c = map(int, input().split())\n\nprint(\"win\" if sum((a, b, c)) < 22 else \"bust\")\n","fail":"a, b, c = map(int, input().split())\n\nprint(\"win\" if sum((a, b, c)) < 22 else \"bust\")\n","change":"delete","i1":0,"i2":3,"j1":0,"j2":0,"error":"EOFError: EOF when reading a line","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02835\/Python\/s003175429.py\", line 4, in \n a, b, c = map(int, input().split())\nEOFError: EOF when reading a line\n","stdout":"bust\n"} {"problem_id":"p02835","language":"Python","original_status":"Runtime Error","pass":"str = [int(input()) for i in range(3)]\ninput_sum = sum(str)\nif input_sum >= 22:\n print(\"true\")\nelse:\n print(\"win\")\n","fail":"str = [int(i) for i in input().split(\" \")]\ninput_sum = sum(str)\nif input_sum >= 22:\n print(\"bust\")\nelse:\n print(\"win\")\n","change":"replace","i1":0,"i2":4,"j1":0,"j2":4,"error":"ValueError: invalid literal for int() with base 10: '5 7 9'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02835\/Python\/s364545802.py\", line 1, in \n str = [int(input()) for i in range(3)]\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02835\/Python\/s364545802.py\", line 1, in \n str = [int(input()) for i in range(3)]\nValueError: invalid literal for int() with base 10: '5 7 9'\n","stdout":null} {"problem_id":"p02835","language":"Python","original_status":"Runtime Error","pass":"A1 = int(input())\nA2 = int(input())\nA3 = int(input())\nif A1 + A2 + A3 >= 22:\n print(\"burst\")\nelse:\n print(\"win\")\n","fail":"[A1, A2, A3] = list(map(int, input().split()))\nif A1 + A2 + A3 >= 22:\n print(\"bust\")\nelse:\n print(\"win\")\n","change":"replace","i1":0,"i2":5,"j1":0,"j2":3,"error":"ValueError: invalid literal for int() with base 10: '5 7 9'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02835\/Python\/s212671316.py\", line 1, in \n A1 = int(input())\nValueError: invalid literal for int() with base 10: '5 7 9'\n","stdout":null} {"problem_id":"p02835","language":"Python","original_status":"Runtime Error","pass":"array = map(int, input().split())\nprint(f'{ \"bust\" if sum(array) >= 22 else \"win\"}')\n","fail":"array = map(int, input().split())\nif sum(array) >= 22:\n print(\"bust\")\nelse:\n print(\"win\")\n","change":"replace","i1":1,"i2":2,"j1":1,"j2":5,"error":"0","stderr":null,"stdout":"win\n"} {"problem_id":"p02837","language":"Python","original_status":"Runtime Error","pass":"N = int(input())\nS = []\nfor _ in range(N):\n s = list(input())\n s.sort()\n # s = ''.join(s)\n S.append(s)\n\nans = 0\nfor i in range(N):\n for j in range(i + 1, N):\n for k in range(10):\n a = S[i]\n b = S[j]\n if a[k] != b[k]:\n break\n else:\n ans += 1\nprint(ans)\n","fail":"N = int(input())\n\nXY = []\nfor _ in range(N):\n A = int(input())\n tmp = []\n for _ in range(A):\n x, y = map(int, input().split())\n tmp.append((x - 1, y))\n XY.append(tmp)\n\n\ndef judge(bit):\n for i in range(N):\n if not (bit & (1 << i)):\n continue\n for x, y in XY[i]:\n if y == 1 and (not (bit & (1 << x))):\n return False\n if y == 0 and (bit & (1 << x)):\n return False\n return True\n\n\nans = 0\nfor bit in range(1 << N):\n if judge(bit):\n # print('bit', bit, bin(bit))\n cnt = 0\n for i in range(N):\n if bit & (1 << i):\n cnt += 1\n ans = max(ans, cnt)\nprint(ans)\n","change":"replace","i1":1,"i2":18,"j1":1,"j2":33,"error":"IndexError: list index out of range","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02837\/Python\/s690218686.py\", line 15, in \n if a[k] != b[k]:\nIndexError: list index out of range\n","stdout":null} {"problem_id":"p02838","language":"Python","original_status":"Time Limit Exceeded","pass":"#!\/usr\/bin\/env python3\nn, *a = map(int, open(0).read().split())\nb = [0] * 60\nans = 0\nfor i in range(n):\n for j in range(60):\n ans += 2**j * (i - b[j] if a[i] >> j & 1 else b[j])\n ans %= 10**9 + 7\n for j in range(len(bin(a[i])) - 2):\n b[j] += a[i] >> j & 1\nprint(ans)\n","fail":"#!\/usr\/bin\/env python3\nn, *a = map(int, open(0).read().split())\nb = [0] * 60\nans = 0\nfor i in range(n):\n for j in range(60):\n ans += (i - b[j] if a[i] >> j & 1 else b[j]) << j\n ans %= 10**9 + 7\n for j in range(60):\n b[j] += a[i] >> j & 1\nprint(ans)\n","change":"replace","i1":6,"i2":9,"j1":6,"j2":9,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02838","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\ns = list(map(int, input().split()))\nmod = 10**9 + 7\nm = len(bin(max(s))) - 2\np = [0] * m\nq = [0] * m\n\nfor i in s:\n for j in range(m):\n if (i >> j) & 1 == 1:\n p[j] += 1\n else:\n q[j] += 1\n\nres = 0\nr = 1\nfor k in range(m):\n res += p[k] * q[k] % mod * r\n res %= mod\n r = r * 2 % mod\nprint(res)\n","fail":"import numpy as np\n\nn = int(input())\ns = np.array(input().split(), np.int64)\nmod = 10**9 + 7\n\nres = 0\npo2 = 1\nfor i in range(61):\n bit = (s >> i) & 1\n x = np.count_nonzero(bit)\n y = n - x\n res += x * y % mod * po2\n res %= mod\n po2 *= 2 % mod\nprint(res)\n","change":"replace","i1":0,"i2":20,"j1":0,"j2":15,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02838","language":"Python","original_status":"Time Limit Exceeded","pass":"from itertools import combinations\n\nn = int(input())\na = list(map(int, input().split()))\n\ntotal = 0\nfor pat in combinations(range(n), 2):\n total += a[pat[0]] ^ a[pat[1]]\nprint(total % (10**9 + 7))\n","fail":"n = int(input())\na = list(map(int, input().split()))\n\nmod = 10**9 + 7\n\nans = 0\nfor i in range(61):\n zero = 0\n one = 0\n for ai in a:\n if ai >> i & 1:\n one += 1\n else:\n zero += 1\n ans += zero * one * 2**i\n ans %= mod\n\nprint(ans)\n","change":"replace","i1":0,"i2":9,"j1":0,"j2":18,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02838","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = [int(_) for _ in input().split()]\nmod = 10**9 + 7\nans = 0\nfor b in range(60):\n M = sum((a >> b) & 1 for a in A)\n ans += 2**b * M * (N - M)\n ans %= mod\nprint(ans)\n","fail":"import numpy as np\n\nN = int(input())\nA = np.array([int(_) for _ in input().split()], dtype=np.int64)\nmod = 10**9 + 7\nans = 0\nfor b in range(60):\n B = (A >> b) & 1\n M = np.count_nonzero(B)\n ans += 2**b * M * (N - M)\n ans %= mod\nprint(ans)\n","change":"replace","i1":0,"i2":6,"j1":0,"j2":9,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02838","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = list(map(int, input().split()))\nMOD = 1_000_000_007\n\nans = 0\ntwo_exp = 1\nfor i in range(60):\n one_cnt = 0\n zero_cnt = 0\n for a in A:\n if a >> i & 1:\n one_cnt += 1\n else:\n zero_cnt += 1\n ans += one_cnt * zero_cnt * two_exp\n ans %= MOD\n two_exp <<= 1\n two_exp %= MOD\nprint(ans)\n","fail":"import numpy as np\n\n\ndef solve():\n ans = 0\n mask = 1\n for i in range(60):\n one_cnt = np.sum(A >> i & 1)\n tmp = one_cnt * (N - one_cnt)\n tmp %= MOD\n ans += tmp * mask\n ans %= MOD\n mask <<= 1\n mask %= MOD\n return ans\n\n\nN, *A = map(int, open(0).read().split())\nA = np.array(A, dtype=np.int64)\nMOD = 1_000_000_007\nprint(solve())\n","change":"replace","i1":0,"i2":19,"j1":0,"j2":21,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02838","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = list(map(int, input().split()))\n\nmod = 10**9 + 7\n\nans = 0\nfor i in range(0, N - 1):\n for j in range(i + 1, N):\n # print(bin(A[i] ^ A[j]))\n # ans += int(bin(A[i] ^ A[j]), 0)\n ans += A[i] ^ A[j]\n ans %= mod\nprint(ans)\n","fail":"import sys\nimport numpy as np\n\ninput = sys.stdin.buffer.readline\nN = int(input())\nA = np.array(list(map(int, input().split())))\n\nMOD = 10**9 + 7\n\nanswer = 0\nfor n in range(63):\n B = (A >> n) & 1\n x = np.count_nonzero(B)\n y = N - x\n x *= y\n for _ in range(n):\n x = x * 2 % MOD\n answer += x\nanswer %= MOD\nprint(answer)\n","change":"replace","i1":0,"i2":13,"j1":0,"j2":20,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02838","language":"Python","original_status":"Time Limit Exceeded","pass":"MOD = 10**9 + 7\nN = int(input())\nA = list(map(int, input().split()))\n\nans = 0\nfor i in range(N - 1):\n for j in range(i + 1, N):\n ans += A[i] ^ A[j]\n ans %= MOD\nprint(ans)\n","fail":"MOD = 10**9 + 7\nN = int(input())\nA = list(map(int, input().split()))\n\nans = 0\nm = 1\nfor i in range(60):\n bits = sum((a & m for a in A))\n bits \/\/= m\n ans += bits * (N - bits) * m\n ans %= MOD\n m <<= 1\nprint(ans % MOD)\n","change":"replace","i1":5,"i2":10,"j1":5,"j2":13,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02839","language":"Python","original_status":"Time Limit Exceeded","pass":"def main():\n # import sys\n # readline = sys.stdin.readline\n # readlines = sys.stdin.readlines\n H, W = map(int, input().split())\n A = [list(map(int, input().split())) for _ in range(H)]\n B = [list(map(int, input().split())) for _ in range(H)]\n grid = [[0] * W for _ in range(H)]\n for i in range(H):\n for j in range(W):\n grid[i][j] = abs(A[i][j] - B[i][j])\n\n dp = [[set() for _ in range(W)] for _ in range(H)]\n dp[0][0].add(grid[0][0])\n\n for i in range(H):\n for j in range(W):\n for k in dp[i][j]:\n if i < H - 1:\n nk = grid[i + 1][j]\n dp[i + 1][j].add(k + nk)\n dp[i + 1][j].add(abs(k - nk))\n if j < W - 1:\n nk = grid[i][j + 1]\n dp[i][j + 1].add(k + nk)\n dp[i][j + 1].add(abs(k - nk))\n\n print(min(dp[-1][-1]))\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"def main():\n # import sys\n # readline = sys.stdin.readline\n # readlines = sys.stdin.readlines\n H, W = map(int, input().split())\n A = [list(map(int, input().split())) for _ in range(H)]\n B = [list(map(int, input().split())) for _ in range(H)]\n M = 0\n grid = [[0] * W for _ in range(H)]\n for i in range(H):\n for j in range(W):\n m = abs(A[i][j] - B[i][j])\n grid[i][j] = m\n M = max(M, m)\n\n L = (H + W) * M\n dp = [[[0] * (L + 1) for _ in range(W)] for _ in range(H)]\n dp[0][0][grid[0][0]] = 1\n\n for i in range(H):\n for j in range(W):\n for k in range(L + 1):\n if dp[i][j][k] == 1:\n if i < H - 1:\n nk = grid[i + 1][j]\n dp[i + 1][j][k + nk] |= 1\n dp[i + 1][j][abs(k - nk)] |= 1\n if j < W - 1:\n nk = grid[i][j + 1]\n dp[i][j + 1][k + nk] |= 1\n dp[i][j + 1][abs(k - nk)] |= 1\n\n for k in range(L + 1):\n if dp[-1][-1][k] == 1:\n print(k)\n break\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":7,"i2":28,"j1":7,"j2":36,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02839","language":"Python","original_status":"Time Limit Exceeded","pass":"H, W = map(int, input().split())\n\nA = [list(map(int, input().split())) for _ in range(H)]\nB = [list(map(int, input().split())) for _ in range(H)]\nDiff = [[False] * (W + 1) for _ in range(H + 1)]\nM = 0\nfor i in range(H):\n for j in range(W):\n m = abs(A[i][j] - B[i][j])\n Diff[i][j] = m\n M += m\n\ndp = [[[0] * (M + 1) for _ in range(W + 1)] for _ in range(H + 1)]\ndp[0][0][Diff[0][0]] = 1\n\nfor i in range(0, H):\n for j in range(0, W):\n for k in range(M + 1):\n if dp[i][j][k]:\n dp[i + 1][j][k + Diff[i + 1][j]] |= True\n dp[i + 1][j][abs(k - Diff[i + 1][j])] |= True\n dp[i][j + 1][k + Diff[i][j + 1]] |= True\n dp[i][j + 1][abs(k - Diff[i][j + 1])] |= True\n\nfor k in range(M + 1):\n if dp[H - 1][W - 1][k] == 1:\n ans = k\n break\n\nprint(ans)\n","fail":"H, W = map(int, input().split())\n\nA = [list(map(int, input().split())) for _ in range(H)]\nB = [list(map(int, input().split())) for _ in range(H)]\nDiff = [[0] * (W + 1) for _ in range(H + 1)]\nM = 0\nfor i in range(H):\n for j in range(W):\n m = abs(A[i][j] - B[i][j])\n Diff[i][j] = m\n M += m\n\ndp = [[0] * (W + 1) for _ in range(H + 1)]\ndp[0][0] |= 1 << Diff[i][j]\n\nfor i in range(0, H):\n for j in range(0, W):\n here = dp[i][j]\n s = Diff[i][j]\n ni = 0\n nj = 0\n ni |= here << s\n nj |= here << s\n ni |= here >> s\n nj |= here >> s\n ex = 0\n for k in range(1, s + 1):\n if (here >> k) & 1:\n ex |= 1 << (s - k)\n ni |= ex\n nj |= ex\n dp[i + 1][j] |= ni\n dp[i][j + 1] |= nj\n\na = dp[H - 1][W - 1]\nans = 0\nfor k in range(M + 1):\n if (a >> k) & 1:\n ans = k\n break\n\nprint(k)\n","change":"replace","i1":4,"i2":30,"j1":4,"j2":42,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02839","language":"Python","original_status":"Time Limit Exceeded","pass":"from collections import defaultdict\n\nH, W = map(int, input().split())\nA = [list(map(int, input().split())) for i in range(H)]\nB = [list(map(int, input().split())) for i in range(H)]\n\ndp = defaultdict(set)\ndp[(0, 0)].add(abs(A[0][0] - B[0][0]))\nfor i in range(H):\n for j in range(W):\n d = abs(A[i][j] - B[i][j])\n if i > 0:\n for k in dp[(i - 1, j)]:\n dp[(i, j)].add(abs(k + d))\n dp[(i, j)].add(abs(k - d))\n if j > 0:\n for k in dp[(i, j - 1)]:\n dp[(i, j)].add(abs(k + d))\n dp[(i, j)].add(abs(k - d))\nprint(min(dp[(H - 1, W - 1)]))\n","fail":"H, W = map(int, input().split())\nA = [list(map(int, input().split())) for i in range(H)]\nB = [list(map(int, input().split())) for i in range(H)]\n\ndp = [[0] * W for i in range(H)]\ndp[0][0] = 1 << (abs(A[0][0] - B[0][0]) + 6400)\nfor i in range(H):\n for j in range(W):\n d = abs(A[i][j] - B[i][j])\n if i > 0:\n dp[i][j] |= dp[i - 1][j] << d | dp[i - 1][j] >> d\n if j > 0:\n dp[i][j] |= dp[i][j - 1] << d | dp[i][j - 1] >> d\nans = 0\nres = dp[H - 1][W - 1] >> 6400\nwhile res & 1 == 0:\n res >>= 1\n ans += 1\nprint(ans)\n","change":"replace","i1":0,"i2":20,"j1":0,"j2":19,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02839","language":"Python","original_status":"Time Limit Exceeded","pass":"import numpy as np\n\nh, w = list(map(int, input().split()))\n\nfield = [[None] * w for _ in range(h)]\naaa = [list(map(int, input().split())) for _ in range(h)]\nbbb = [list(map(int, input().split())) for _ in range(h)]\naaa = np.array(aaa, dtype=np.int64)\nbbb = np.array(bbb, dtype=np.int64)\ndiff = abs(aaa - bbb)\n\noffset = 15000\ncan = np.zeros(30001, dtype=np.int64)\ncan[diff[0][0] + offset] = 1\nfield[0][0] = can\n\n\ndef merge_new_can(d, can, prev_can):\n if d == 0:\n can |= prev_can\n else:\n can[d:] |= prev_can[:-d]\n can[:-d] |= prev_can[d:]\n\n\nfor j in range(1, w):\n d = diff[0][j]\n prev_can = field[0][j - 1]\n can = np.zeros(30001, dtype=np.int64)\n merge_new_can(d, can, prev_can)\n field[0][j] = can\n\nfor i in range(1, h):\n d = diff[i][0]\n prev_can = field[i - 1][0]\n can = np.zeros(30001, dtype=np.int64)\n merge_new_can(d, can, prev_can)\n field[i][0] = can\n\nfor i in range(1, h):\n for j in range(1, w):\n d = diff[i][j]\n can = np.zeros(30001, dtype=np.int64)\n prev_can1 = field[i][j - 1]\n prev_can2 = field[i - 1][j]\n merge_new_can(d, can, prev_can1)\n merge_new_can(d, can, prev_can2)\n field[i][j] = can\n\ngoal = field[-1][-1]\ngoal[15001:] |= goal[:15000][::-1]\ngoal = goal[15000:]\nprint(np.argmax(goal))\n","fail":"import numpy as np\n\nh, w = list(map(int, input().split()))\n\naaa = [list(map(int, input().split())) for _ in range(h)]\nbbb = [list(map(int, input().split())) for _ in range(h)]\naaa = np.array(aaa, dtype=np.int8)\nbbb = np.array(bbb, dtype=np.int8)\ndiff = abs(aaa - bbb)\n\n\ndef merge_new_can(d, can, prev_can):\n if d == 0:\n can |= prev_can\n else:\n can[d:] |= prev_can[:-d]\n can[:-d] |= prev_can[d:]\n\n\nprev_row = [None] * w\n\ncan = np.zeros(25601, dtype=np.int8)\ncan[diff[0][0] + 12800] = 1\nprev_row[0] = can\n\nfor j in range(1, w):\n d = diff[0][j]\n can = np.zeros(25601, dtype=np.int8)\n prev_can = prev_row[j - 1]\n merge_new_can(d, can, prev_can)\n prev_row[j] = can\n\nfor i in range(1, h):\n curr_row = [None] * w\n\n d = diff[i][0]\n prev_can = prev_row[0]\n can = np.zeros(25601, dtype=np.int8)\n merge_new_can(d, can, prev_can)\n curr_row[0] = can\n\n for j in range(1, w):\n d = diff[i][j]\n can = np.zeros(25601, dtype=np.int8)\n prev_can1 = prev_row[j]\n prev_can2 = curr_row[j - 1]\n merge_new_can(d, can, prev_can1)\n merge_new_can(d, can, prev_can2)\n curr_row[j] = can\n\n prev_row = curr_row\n\ngoal = prev_row[-1]\ngoal[12801:] |= goal[:12800][::-1]\ngoal = goal[12800:]\nprint(np.argmax(goal))\n","change":"replace","i1":4,"i2":52,"j1":4,"j2":55,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02840","language":"Python","original_status":"Runtime Error","pass":"from fractions import gcd\nfrom itertools import accumulate\n\nn, x, d = map(int, input().split())\ng = gcd(x, d)\nback_k = d \/\/ g\noffset = x \/\/ g\n\nmin_memo = [0] + list(accumulate(range(n)))\nmax_memo = [0] + list(accumulate(range(n - 1, -1, -1)))\n\nans = 0\nfor k in range(n + 1):\n min_acc = min_memo[k]\n max_acc = max_memo[k]\n\n if k < back_k:\n ans += max_acc - min_acc + 1\n continue\n\n back_max = max_memo[k - back_k] - offset\n ans += max_acc - max(min_acc - 1, back_max)\n\nprint(ans)\n","fail":"from fractions import gcd\nfrom itertools import accumulate\n\nn, x, d = map(int, input().split())\n\nif d == 0:\n if x == 0:\n print(1)\n else:\n print(n + 1)\n exit()\nelif d < 0:\n x, d = -x, -d\n\ng = gcd(x, d)\nback_k = d \/\/ g\noffset = x \/\/ g\n\nlowers = [0] + list(accumulate(range(n)))\nuppers = [0] + list(accumulate(range(n - 1, -1, -1)))\nmin_memo = [10**18] * min(n + 1, back_k)\nmax_memo = [-(10**18)] * min(n + 1, back_k)\n# print(n, x, d, g, back_k, offset)\n# print(lowers)\n# print(uppers)\n\nans = 0\nfor k in range(n + 1):\n min_acc = lowers[k]\n max_acc = uppers[k]\n\n if k < back_k:\n min_memo[k] = min_acc - offset\n max_memo[k] = max_acc - offset\n ans += max_acc - min_acc + 1\n # print(k, ans, min_acc, max_acc, max_acc - min_acc + 1)\n continue\n\n kk = k % back_k\n back_min = min_memo[kk]\n back_max = max_memo[kk]\n\n if back_max < min_acc or max_acc < back_min:\n min_memo[kk] = min_acc - offset\n max_memo[kk] = max_acc - offset\n ans += max_acc - min_acc + 1\n else:\n current = max_acc - min_acc + 1\n duplicated = min(max_acc, back_max) - max(min_acc, back_min) + 1\n ans += current - duplicated\n min_memo[kk] = min(min_acc, back_min) - offset\n max_memo[kk] = max(max_acc, back_max) - offset\n\n # print(k, ans, min_acc, max_acc, back_min, back_max)\n\nprint(ans)\n","change":"replace","i1":4,"i2":22,"j1":4,"j2":54,"error":"ImportError: cannot import name 'gcd' from 'fractions' (\/usr\/lib\/python3.10\/fractions.py)","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02840\/Python\/s943701643.py\", line 1, in \n from fractions import gcd\nImportError: cannot import name 'gcd' from 'fractions' (\/usr\/lib\/python3.10\/fractions.py)\n","stdout":null} {"problem_id":"p02841","language":"Python","original_status":"Runtime Error","pass":"M1 = int(input())\nD1 = int(input())\nM2 = int(input())\nD2 = int(input())\n\nif D2 == 1:\n print(1)\nelse:\n print(0)\n","fail":"date_entry_1 = input()\nM1, D1 = map(int, date_entry_1.split(\" \"))\ndate_entry_2 = input()\nM2, D2 = map(int, date_entry_2.split(\" \"))\n\nif D2 == 1:\n print(1)\nelse:\n print(0)\n","change":"replace","i1":0,"i2":4,"j1":0,"j2":4,"error":"ValueError: invalid literal for int() with base 10: '11 16'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02841\/Python\/s700613660.py\", line 1, in \n M1 = int(input())\nValueError: invalid literal for int() with base 10: '11 16'\n","stdout":null} {"problem_id":"p02841","language":"Python","original_status":"Runtime Error","pass":"m1, d1 = map(int, input().split())\nm2, d2 = map(int, input().split())\n\nif m1 != m2:\n print(\"1\")\n exit(1)\n\nprint(\"0\")\n","fail":"m1, d1 = map(int, input().split())\nm2, d2 = map(int, input().split())\n\nif m1 != m2:\n print(\"1\")\nelse:\n print(\"0\")\n","change":"replace","i1":5,"i2":8,"j1":5,"j2":7,"error":"0","stderr":null,"stdout":0.0} {"problem_id":"p02842","language":"Python","original_status":"Runtime Error","pass":"N = int(input())\nfor x in range(1, 50_000):\n if int(x * 1.08) == N:\n print(x)\n exit()\nprint(\":(\")\n","fail":"N = int(input())\nfor x in range(1, 50000):\n if int(x * 1.08) == N:\n print(x)\n exit()\nprint(\":(\")\n","change":"replace","i1":1,"i2":2,"j1":1,"j2":2,"error":0,"stderr":null,"stdout":400} {"problem_id":"p02843","language":"Python","original_status":"Runtime Error","pass":"n = input()\nnum = int(n[0:-2])\nyen = int(n[-2::])\nif num * 5 >= yen:\n print(1)\nelse:\n print(0)\n","fail":"n = input()\nif len(n) >= 3:\n num = int(n[0:-2])\n yen = int(n[-2::])\n if num * 5 >= yen:\n print(1)\n else:\n print(0)\nelse:\n print(0)\n","change":"replace","i1":1,"i2":5,"j1":1,"j2":8,"error":"0","stderr":null,"stdout":1.0} {"problem_id":"p02843","language":"Python","original_status":"Runtime Error","pass":"x = input()\nn = int(x[0]) * 5\nk = int(x[1:3])\nif k <= n:\n print(1)\nelse:\n print(0)\n","fail":"x = int(input())\nans = 0\nif x < 100:\n ans = 0\nelse:\n n = (x \/\/ 100) * 5\n k = x % 100\n if k <= n:\n ans = 1\n else:\n ans = 0\n\nprint(ans)\n","change":"replace","i1":0,"i2":7,"j1":0,"j2":13,"error":"0","stderr":null,"stdout":1.0} {"problem_id":"p02843","language":"Python","original_status":"Runtime Error","pass":"x = input()\nk = int(x[0:-2])\nx = int(x[-2:])\n\nk -= x \/ 5\nif x % 5 == 0 and k >= 0:\n print(1)\nelif k > 0:\n print(1)\nelse:\n print(0)\n","fail":"x = input()\nif len(x) < 3:\n print(0)\n exit()\nk = int(x[0:-2])\nx = int(x[-2:])\n\nk -= x \/ 5\nif x % 5 == 0 and k >= 0:\n print(1)\nelif k > 0:\n print(1)\nelse:\n print(0)\n","change":"insert","i1":1,"i2":1,"j1":1,"j2":4,"error":"0","stderr":null,"stdout":1.0} {"problem_id":"p02843","language":"Python","original_status":"Runtime Error","pass":"X = int(input())\n\ndp = [0] * (100000)\ndp[0] = 1\n\nfor i in range(X + 1):\n if dp[i] == 1:\n for j in range(6):\n dp[i + 100 + j] = 1\n if i + 100 + j == X:\n print(1)\n exit()\nprint(0)\n","fail":"X = int(input())\n\ndp = [0] * (100200)\ndp[0] = 1\n\nfor i in range(X + 1):\n if dp[i] == 1:\n for j in range(6):\n dp[i + 100 + j] = 1\n if i + 100 + j == X:\n print(1)\n exit()\nprint(0)\n","change":"replace","i1":2,"i2":3,"j1":2,"j2":3,"error":"0","stderr":null,"stdout":1.0} {"problem_id":"p02843","language":"Python","original_status":"Time Limit Exceeded","pass":"x = int(input())\n\nnum = set()\nfor a in range(20):\n for b in range(20):\n for c in range(20):\n for d in range(20):\n for e in range(20):\n for f in range(20):\n num.add(\n 100 * a + 101 * b + 102 * c + 103 * d + 104 * e + 105 * f\n )\n\n# print(1 if x in num else 0)\nif x < 100 or x > 2000:\n print(1)\nelif x in num:\n print(1)\nelse:\n print(0)\n","fail":"x = int(input())\ndp = [0] * 100010\ndp[100] = 1\ndp[101] = 1\ndp[102] = 1\ndp[103] = 1\ndp[104] = 1\ndp[105] = 1\n\nfor i in range(106, 100010):\n if (\n dp[i - 100]\n or dp[i - 101]\n or dp[i - 102]\n or dp[i - 103]\n or dp[i - 104]\n or dp[i - 105]\n ):\n dp[i] = 1\n\nprint(1 if dp[x] else 0)\n","change":"replace","i1":1,"i2":20,"j1":1,"j2":21,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02843","language":"Python","original_status":"Time Limit Exceeded","pass":"# C - 100 to 105\nfrom collections import defaultdict\n\n\ndef main():\n X = int(input())\n items = tuple(range(100, 106))\n dp = defaultdict(bool)\n dp[0] = True\n while max(dp.keys()) < X:\n for possible_price in tuple(dp.keys()):\n for item in items:\n dp[possible_price + item] = True\n print(int(X in dp))\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"# C - 100 to 105\ndef main():\n X = int(input())\n check = lambda x: x * 100 <= X <= x * 105\n is_possible = any(check(i) for i in range(X))\n print(int(is_possible))\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":1,"i2":14,"j1":1,"j2":6,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02843","language":"Python","original_status":"Runtime Error","pass":"from itertools import combinations_with_replacement\n\nX = list(input())\ntmp = X\nnum = int(\"\".join(tmp))\n\nX.pop()\nX.pop()\nX = int(\"\".join(X))\n\nfood = [100, 101, 102, 103, 104, 105, 106]\n\nfor i in combinations_with_replacement(food, X):\n if sum(i) == num:\n print(1)\n exit()\n\nprint(0)\n","fail":"from itertools import combinations_with_replacement\n\nX = list(input())\ntmp = X\nnum = int(\"\".join(tmp))\n\nif num < 100:\n print(0)\n exit()\n\nX.pop()\nX.pop()\nX = int(\"\".join(X))\n\nfood = [100, 101, 102, 103, 104, 105]\n\nfor i in combinations_with_replacement(food, X):\n if sum(i) == num:\n print(1)\n exit()\n\nprint(0)\n","change":"replace","i1":6,"i2":11,"j1":6,"j2":15,"error":"0","stderr":null,"stdout":1.0} {"problem_id":"p02844","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\nS = input()\n\nans = 0\nfor i in range(1000):\n pin = str(i).zfill(3)\n\n ind = 0\n for s in S:\n if pin[ind] == s:\n ind += 1\n if ind >= 3:\n ans += 1\n break\n\nprint(ans)\n","fail":"from collections import defaultdict\n\nn = int(input())\nS = input()\n\nd = defaultdict(list)\nfor i, s in enumerate(S):\n d[s].append(i)\n\nans = 0\nfor p in range(1000):\n p1, p2, p3 = str(p).zfill(3)\n\n i0 = -1\n for i in d[p1]:\n if i > i0:\n i1 = i\n break\n else:\n continue\n\n for i in d[p2]:\n if i > i1:\n i2 = i\n break\n else:\n continue\n\n for i in d[p3]:\n if i > i2:\n ans += 1\n break\n\n\nprint(ans)\n","change":"replace","i1":0,"i2":15,"j1":0,"j2":34,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02844","language":"Python","original_status":"Time Limit Exceeded","pass":"def password():\n for i in range(10):\n for j in range(10):\n for k in range(10):\n yield [str(i), str(j), str(k)]\n\n\nn = int(input())\ns = input()\n\nans = 0\nfor perm in password():\n j = 0\n for i in range(n):\n if perm[j] == s[i]:\n j += 1\n if j >= len(perm):\n break\n if j >= len(perm):\n ans += 1\n\nprint(ans)\n","fail":"def password():\n for i in range(10):\n for j in range(10):\n for k in range(10):\n yield [str(i), str(j), str(k)]\n\n\nn = int(input())\ns = input()\n\nans = 0\nfor perm in password():\n if perm[0] in s:\n a = s.find(perm[0])\n if perm[1] in s[a + 1 :]:\n b = s[a + 1 :].find(perm[1])\n if perm[2] in s[a + 1 :][b + 1 :]:\n ans += 1\n\nprint(ans)\n","change":"replace","i1":12,"i2":20,"j1":12,"j2":18,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02844","language":"Python","original_status":"Time Limit Exceeded","pass":"from itertools import product\n\nn = int(input())\ns = input()\n\ncnt = 0\nfor num in product(range(10), repeat=3):\n i = 0\n for e in s:\n if str(num[i]) == e:\n i += 1\n if i == 3:\n break\n\n if i == 3:\n cnt += 1\n\nprint(cnt)\n","fail":"from itertools import product\n\nn = int(input())\ns = input()\nnums = [str(i) for i in range(10)]\n\ncnt = 0\nfor num in product(nums, repeat=3):\n i = 0\n for e in s:\n if num[i] == e:\n i += 1\n if i == 3:\n break\n\n if i == 3:\n cnt += 1\n\nprint(cnt)\n","change":"replace","i1":4,"i2":10,"j1":4,"j2":11,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02844","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nS = input()\nans = 0\nfor i in range(1000):\n T = str(i).zfill(3)\n j = 0\n for c in S:\n if c == T[j]:\n j += 1\n if j > 2:\n ans += 1\n break\nprint(ans)\n","fail":"N = int(input())\nS = input()\nans = 0\nd = [set() for _ in range(3)]\nfor i in range(N - 2):\n if S[i] in d[0]:\n continue\n d[0].add(S[i])\n for j in range(i + 1, N - 1):\n if S[i] + S[j] in d[1]:\n continue\n d[1].add(S[i] + S[j])\n for k in range(j + 1, N):\n if S[i] + S[j] + S[k] in d[2]:\n continue\n d[2].add(S[i] + S[j] + S[k])\n ans += 1\nprint(ans)\n","change":"replace","i1":3,"i2":12,"j1":3,"j2":17,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02844","language":"Python","original_status":"Time Limit Exceeded","pass":"import itertools\nimport collections\n\nn = int(input())\ns = input()\n\ncomb = list(itertools.combinations(list(s), 3))\n\nprint(len(collections.Counter(comb)))\n","fail":"import itertools\nimport collections\n\nn = int(input())\ns = input()\n\npassword_l = [str(i).zfill(3) for i in range(1000)]\n\nc = 0\nfor password in password_l:\n idx = 0\n ok = 0\n while idx != n:\n if s[idx] == password[ok]:\n ok += 1\n\n if ok == 3:\n c += 1\n break\n\n idx += 1\n\nprint(c)\n","change":"replace","i1":6,"i2":9,"j1":6,"j2":23,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02844","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\ns = input()\n\npin = [str(i).zfill(3) for i in range(1000)]\n\nans = 0\nfor i in pin:\n c = 0\n for j in s:\n if j == i[c]:\n c += 1\n if c == 3:\n ans += 1\n break\nprint(ans)\n","fail":"n = int(input())\ns = input()\n\npins = [str(i).zfill(3) for i in range(1000)]\n\nans = 0\nfor pin in pins:\n index = -1\n for c in pin:\n index = s.find(c, index + 1)\n if index < 0:\n break\n if index > 0:\n ans += 1\n\nprint(ans)\n","change":"replace","i1":3,"i2":14,"j1":3,"j2":15,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02844","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\ns = input()\npattern = [tuple(s[:3])]\nfor c in s[3:]:\n for i in range(len(pattern)):\n p1, p2, p3 = pattern[i]\n if (p1, p2, c) not in pattern:\n pattern.append((p1, p2, c))\n if (p1, p3, c) not in pattern:\n pattern.append((p1, p3, c))\n if (p2, p3, c) not in pattern:\n pattern.append((p2, p3, c))\nprint(len(pattern))\n","fail":"n = int(input())\ns = input()\ncnt = 0\n\nfor i in range(1000):\n p = str(i).zfill(3)\n p1 = s.find(p[0])\n if p1 == -1:\n continue\n p2 = s.find(p[1], p1 + 1)\n if p2 == -1:\n continue\n p3 = s.find(p[2], p2 + 1)\n if p3 == -1:\n continue\n cnt += 1\nprint(cnt)\n","change":"replace","i1":2,"i2":13,"j1":2,"j2":17,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02844","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\ns = input()\n\nans = 0\nfor i in range(1000):\n p = str(i).zfill(3)\n p_index = 0\n for j in range(n):\n if p[p_index] == s[j]:\n p_index += 1\n if p_index == 3:\n break\n if p_index == 3:\n ans += 1\n\nprint(ans)\n","fail":"n = int(input())\ns = input()\n\nans = 0\n# 000 \uff5e\u3000999 \u304cs\u304b\u3089\u4f5c\u6210\u3067\u304d\u308b\u304b\u78ba\u8a8d\u3057\u3066\u3044\u304f\nfor i in range(1000):\n p = str(i).zfill(3)\n\n s_index_100 = s.find(p[2])\n if s_index_100 == -1:\n continue\n\n s_index_10 = s.find(p[1], s_index_100 + 1)\n if s_index_10 == -1:\n continue\n\n s_index_1 = s.find(p[0], s_index_10 + 1)\n if s_index_1 == -1:\n continue\n ans += 1\n\nprint(ans)\n","change":"replace","i1":4,"i2":14,"j1":4,"j2":20,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02844","language":"Python","original_status":"Time Limit Exceeded","pass":"n, s = int(input()), str(input())\n\nnum1, num2, num3 = set([]), set([]), set([])\nfor i in range(n):\n if s[i] in num1:\n continue\n num1.add(s[i])\n for j in range(i + 1, n):\n for k in range(j + 1, n):\n num3.add(s[i] + s[j] + s[k])\nprint(len(num3))\n","fail":"n, s = int(input()), str(input())\n\nnum1, num2, num3 = set(), set(), set()\nfor i in range(n):\n if s[i] in num1:\n continue\n num1.add(s[i])\n for j in range(i + 1, n):\n tmp2 = s[i] + s[j]\n if tmp2 in num2:\n continue\n num2.add(tmp2)\n for k in range(j + 1, n):\n num3.add(tmp2 + s[k])\nprint(len(num3))\n","change":"replace","i1":2,"i2":10,"j1":2,"j2":14,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02844","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nS = input()\n\nans = 0\n\nfor i in range(1000):\n t = str(i).zfill(3)\n t_index = 0\n for s_index in range(N):\n if S[s_index] == t[t_index]:\n t_index += 1\n if t_index == 3:\n break\n if t_index == 3:\n ans += 1\nprint(ans)\n","fail":"N = int(input())\nS = tuple(map(int, input()))\n\nans = 0\n\nfor i in range(10):\n if i in S[: N - 2]:\n i_index = S.index(i)\n for j in range(10):\n if j in S[i_index + 1 : N - 1]:\n j_index = i_index + S[i_index + 1 : N - 1].index(j) + 1\n for k in range(10):\n if k in S[j_index + 1 :]:\n ans += 1\nprint(ans)\n","change":"replace","i1":1,"i2":15,"j1":1,"j2":14,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02844","language":"Python","original_status":"Time Limit Exceeded","pass":"import itertools\n\nn = int(input())\nlis = tuple(input())\n\nans = tuple(itertools.combinations(lis, 3))\n\nresult = []\nfor line in ans:\n if line not in result:\n result.append(line)\nprint(len(result))\n","fail":"n = int(input())\ns = input()\n\ndp1 = [[0 for i in range(10)] for _ in range(n + 1)]\ndp2 = [[0 for i in range(100)] for _ in range(n + 1)]\ndp3 = [[0 for i in range(1000)] for _ in range(n + 1)]\n\nfor i in range(n):\n dp1[i + 1][int(s[i])] = 1\n for j in range(10):\n if dp1[i][j]:\n dp2[i + 1][j * 10 + int(s[i])] = 1\n dp1[i + 1][j] = 1\n for j in range(100):\n if dp2[i][j]:\n dp3[i + 1][j * 10 + int(s[i])] = 1\n dp2[i + 1][j] = 1\n for j in range(1000):\n if dp3[i][j]:\n dp3[i + 1][j] = 1\n\nprint(sum(dp3[n]))\n","change":"replace","i1":0,"i2":12,"j1":0,"j2":22,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02844","language":"Python","original_status":"Time Limit Exceeded","pass":"import itertools\n\nn = int(input())\ns = list(input())\n\np = list(itertools.combinations(s, 3))\np = set(p)\n\nprint(len(p))\n","fail":"import itertools\n\nn = int(input())\ns = list(input())\n\nans = 0\n\n\nfor i in range(10):\n for j in range(10):\n for k in range(10):\n flag1 = 0\n flag2 = 0\n\n for l in range(n):\n if flag1 == 0 and s[l] == str(i):\n flag1 = 1\n continue\n\n if flag1 == 1 and flag2 == 0 and s[l] == str(j):\n flag2 = 1\n continue\n\n if flag1 == 1 and flag2 == 1 and s[l] == str(k):\n ans += 1\n break\n\nprint(ans)\n","change":"replace","i1":5,"i2":9,"j1":5,"j2":28,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02844","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nS = input()\n\ns = []\nfor i in range(N):\n for j in range(i + 1, N):\n for k in range(j + 1, N):\n c = S[i] + S[j] + S[k]\n if c in s:\n continue\n else:\n s.append(c)\n\nprint(len(s))\n","fail":"N = int(input())\nS = input()\n\nans = 0\nl1 = []\nfor i in range(N):\n l2 = []\n if S[i] in l1:\n continue\n else:\n l1.append(S[i])\n for j in range(i + 1, N):\n if S[j] in l2:\n continue\n else:\n l2.append(S[j])\n s = S[j + 1 :]\n ans += len(set(s))\n\nprint(ans)\n","change":"replace","i1":3,"i2":14,"j1":3,"j2":20,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02844","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nS = input()\nans = 0\n\nfor i in range(10):\n for j in range(10):\n for k in range(10):\n hit = 0\n for c in S:\n c_ = int(c)\n if hit == 0 and c_ == i:\n hit += 1\n elif hit == 1 and c_ == j:\n hit += 1\n elif hit == 2 and c_ == k:\n ans += 1\n break\nprint(ans)\n","fail":"N = int(input())\nS = input()\nans = 0\n\nfor i in range(10):\n ind_i = S.find(str(i))\n if ind_i != -1:\n S2 = S[ind_i + 1 :]\n for j in range(10):\n ind_j = S2.find(str(j))\n if ind_j != -1:\n S3 = S2[ind_j + 1 :]\n for k in range(10):\n cnt_k = S3.count(str(k))\n if cnt_k > 0:\n ans += 1\n\n\nprint(ans)\n","change":"replace","i1":5,"i2":17,"j1":5,"j2":18,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02844","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\ns = input()\nlst = [str(a) + str(b) + str(c) for a in range(10) for b in range(10) for c in range(10)]\n\ncount = 0\nfor num in lst:\n pos = 0\n for tmp in s:\n if num[pos] == tmp:\n pos += 1\n if pos == 3:\n count += 1\n break\nprint(count)\n","fail":"n = int(input())\ns = input()\nlst = [\"{:03}\".format(i) for i in range(1000)]\ncount = 0\nfor num in lst:\n pos = 0\n np = num[pos]\n for tmp in s:\n if np == tmp:\n if pos == 2:\n count += 1\n break\n pos += 1\n np = num[pos]\nprint(count)\n","change":"replace","i1":2,"i2":13,"j1":2,"j2":14,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02844","language":"Python","original_status":"Time Limit Exceeded","pass":"# 000~999\u3067\u6c7a\u3081\u6253\u3061\u3057\u3066\u6570\u3048\u308b\nn = int(input())\ns = input()\nans = 0\n\nfor i in range(0, 1000):\n t = format(i, \"0>3\")\n idx = 0\n for c in s:\n if c == t[idx]:\n idx += 1\n if idx == 3:\n ans += 1\n break\n\nprint(ans)\n","fail":"# 000~999\u3067\u6c7a\u3081\u6253\u3061\u3057\u3066\u6570\u3048\u308b\n# TLE\u306b\u306a\u308b\u3093\u3060\u3051\u3069\u3053\u308c\u305d\u3093\u306a\u306b\u91cd\u3044\u304b\uff1f\uff1f\uff1f\uff1f\uff1f\n\nn = int(input())\ns = input()\nans = 0\n\nfor i in range(0, 1000):\n t = format(i, \"0>3\")\n idx = 0\n for c in s:\n if c == t[idx]:\n idx += 1\n if idx == 3:\n ans += 1\n break\n\nprint(ans)\n","change":"insert","i1":1,"i2":1,"j1":1,"j2":3,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02844","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\nT = tuple(map(int, input()))\nans = 0\nfor i in range(0, 1000):\n a = i \/\/ 100\n b = (i \/\/ 10) % 10\n c = i % 10\n flag1 = False\n flag2 = False\n flag3 = False\n for t in T:\n if flag2:\n if t == c:\n flag3 = True\n break\n if flag1:\n if t == b:\n flag2 = True\n continue\n if t == a:\n flag1 = True\n\n if flag3:\n ans += 1\nprint(ans)\n","fail":"def main():\n n = int(input())\n T = tuple(map(int, input()))\n ans = 0\n for i in range(0, 1000):\n a = i \/\/ 100\n b = (i \/\/ 10) % 10\n c = i % 10\n flag1 = False\n flag2 = False\n flag3 = False\n for t in T:\n if flag2:\n if t == c:\n flag3 = True\n break\n if flag1:\n if t == b:\n flag2 = True\n continue\n if t == a:\n flag1 = True\n\n if flag3:\n ans += 1\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":0,"i2":25,"j1":0,"j2":30,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02844","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\ns = input()\n\nans = 0\nfor a in range(10):\n ai = 0\n while ai < n:\n if s[ai] == str(a):\n break\n else:\n ai += 1\n if ai == n:\n continue\n for b in range(10):\n bi = ai + 1\n while bi < n:\n if s[bi] == str(b):\n break\n else:\n bi += 1\n if bi == n:\n continue\n for c in range(10):\n ci = bi + 1\n while ci < n:\n if s[ci] == str(c):\n break\n else:\n ci += 1\n if ci == n:\n continue\n else:\n ans += 1\n\nprint(ans)\nexit(0)\n","fail":"n = int(input())\ns = input()\n\nt = [set() for _ in range(n)]\nt[-1] = {int(s[-1])}\n\nfor i in range(1, n):\n base = t[n - i].copy()\n base.add(int(s[n - i - 1]))\n t[n - i - 1] = base\n\nans = 0\nfor a in range(10):\n ai = 0\n\n if a not in t[ai]:\n continue\n\n while ai < n:\n if s[ai] == str(a):\n break\n else:\n ai += 1\n if ai >= n - 2:\n continue\n for b in range(10):\n bi = ai + 1\n\n if b not in t[bi]:\n continue\n\n while bi < n:\n if s[bi] == str(b):\n break\n else:\n bi += 1\n if bi >= n - 1:\n continue\n for c in range(10):\n ci = bi + 1\n\n if c not in t[ci]:\n continue\n\n while ci < n:\n if s[ci] == str(c):\n break\n else:\n ci += 1\n if ci == n:\n continue\n else:\n ans += 1\n\nprint(ans)\nexit(0)\n\n\nx = int(input())\ndp = [False for _ in range(x + 1)]\ndp[0] = True\nfor item in [100, 101, 102, 103, 104, 105]:\n for i in range(x + 1):\n if i - item >= 0:\n if dp[i - item]:\n dp[i] = True\n\nprint(1 if dp[x] else 0)\nexit(0)\n","change":"replace","i1":2,"i2":36,"j1":2,"j2":69,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02844","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\ns = map(int, input())\n\ndp = tuple([0] * 1000 for _ in range(4))\ndp[0][0] = 1\n# dp[x][int(str)]:=x\u6587\u5b57\u306estr\u306f\u69cb\u6210\u53ef\u80fd\u304b\uff1f0\/1\n\nfor x in s:\n for k in range(2, -1, -1):\n for incomplete_key in range(100):\n dp[k + 1][incomplete_key * 10 + x] |= dp[k][incomplete_key]\n\nprint(sum(dp[3]))\n\n# dp\n","fail":"n = int(input())\ns = map(int, input())\n\ndp = tuple([0] * 1000 for _ in range(4))\ndp[0][0] = 1\n# dp[x][int(str)]:=x\u6587\u5b57\u306estr\u306f\u69cb\u6210\u53ef\u80fd\u304b\uff1f0\/1\n\nfor x in s:\n for incomplete_key in range(100):\n dp[3][incomplete_key * 10 + x] |= dp[2][incomplete_key]\n for incomplete_key in range(10):\n dp[2][incomplete_key * 10 + x] |= dp[1][incomplete_key]\n dp[1][x] = 1\n\nprint(sum(dp[3]))\n\n# dp\n","change":"replace","i1":8,"i2":11,"j1":8,"j2":13,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02844","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nS = input()\n\nans = set()\nfor i in range(N - 2):\n for j in range(i + 1, N - 1):\n for k in range(j + 1, N):\n ans.add(S[i] + S[j] + S[k])\n\nprint(len(ans))\n","fail":"N = int(input())\nS = input()\n\nans = set()\nfor i in range(10):\n i_index = S.find(str(i))\n if i_index == -1:\n continue\n for j in range(10):\n j_index = S.find(str(j), i_index + 1)\n if j_index == -1:\n continue\n for k in range(10):\n k_index = S.find(str(k), j_index + 1)\n if k_index == -1:\n continue\n ans.add(\"{}{}{}\".format(i, j, k))\n\nprint(len(ans))\n","change":"replace","i1":4,"i2":8,"j1":4,"j2":17,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02844","language":"Python","original_status":"Time Limit Exceeded","pass":"name = set()\nn = int(input())\ns = input()\n\nfor x in range(n - 2):\n for y in range(x + 1, n - 1):\n for z in range(y + 1, n):\n name.add(int(s[x] + s[y] + s[z]))\n\nprint(len(name))\n","fail":"ans = 0\nn = int(input())\ns = input()\n\nfor x in range(10):\n if s.find(str(x)) > -1:\n tmp = s[s.find(str(x)) + 1 :]\n for y in range(10):\n if tmp.find(str(y)) > -1:\n tmp2 = tmp[tmp.find(str(y)) + 1 :]\n for z in range(10):\n if tmp2.find(str(z)) > -1:\n ans += 1\n\nprint(ans)\n","change":"replace","i1":0,"i2":10,"j1":0,"j2":15,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02844","language":"Python","original_status":"Time Limit Exceeded","pass":"from collections import Counter\nfrom itertools import combinations\n\nN = int(input())\nS = input()\n\ns = []\ncounter = Counter()\nfor c in S:\n if counter[c] > 3:\n continue\n s.append(c)\n\nprint(len(set(combinations(s, r=3))))\n","fail":"N = int(input())\nS = input()\n\ncount = 0\nfor i in range(1000):\n password = \"{:03}\".format(i)\n s = S\n for j in range(3):\n index = s.find(password[j])\n if index == -1:\n break\n s = s[index + 1 :]\n else:\n count += 1\n\nprint(count)\n","change":"replace","i1":0,"i2":14,"j1":0,"j2":16,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02844","language":"Python","original_status":"Runtime Error","pass":"N = int(input())\nS = input()\n\nans = 0\nfor i in range(10):\n for j in range(10):\n for k in range(10):\n fi = S.find(S[i])\n fj = S.find(S[j])\n fk = S.find(S[k])\n if fi >= 0 and fj >= 0 and fk >= 0 and fi < fj and fj < fk:\n ans += 1\n\nprint(ans)\n","fail":"N = int(input())\nS = input()\n\nans = 0\nfor i in range(10):\n for j in range(10):\n for k in range(10):\n fi = S.find(str(i))\n if fi < 0:\n continue\n fj = S[fi + 1 :].find(str(j))\n if fj < 0:\n continue\n fk = S[fi + fj + 2 :].find(str(k))\n if fk < 0:\n continue\n ans += 1\n\nprint(ans)\n","change":"replace","i1":7,"i2":12,"j1":7,"j2":17,"error":"IndexError: string index out of range","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02844\/Python\/s291909677.py\", line 10, in \n fk = S.find(S[k])\nIndexError: string index out of range\n","stdout":null} {"problem_id":"p02844","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\ns = str(input())\n\nres = 0\nfor i in range(1000):\n t = str(i).zfill(3)\n pos = 0\n for j in s:\n if t[pos] == j:\n pos += 1\n if pos == 3:\n res += 1\n break\n\nprint(res)\n","fail":"def main():\n n = int(input())\n s = str(input())\n\n res = 0\n for i in range(1000):\n t = str(i).zfill(3)\n pos = 0\n for j in s:\n if t[pos] == j:\n pos += 1\n if pos == 3:\n res += 1\n break\n print(res)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":0,"i2":15,"j1":0,"j2":19,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02844","language":"Python","original_status":"Time Limit Exceeded","pass":"#!\/usr\/bin\/env python3\nimport itertools\n\nN = int(input().split()[0])\nS = input()\n\nindex_list = [i for i in range(N)]\np_list = []\n\nfor pattern in itertools.combinations(index_list, 3):\n a, b, c = list(sorted(list(pattern)))\n\n s = S[a] + S[b] + S[c]\n p_list.append(s)\n\nans = len(set(p_list))\n\nprint(ans)\n","fail":"import collections\nimport copy\n\nN = int(input().split()[0])\nS = input()\n\ncounter = collections.Counter(S)\ntotal = 0\ndone_list = []\n\nfor i, ch in enumerate(S[::-1]): # 3 * 10 ** 4\n if ch in done_list:\n counter[ch] = counter[ch] - 1\n if counter[ch] < 1:\n del counter[ch]\n continue\n sub_done_list = []\n counter[ch] = counter[ch] - 1\n if counter[ch] < 1:\n del counter[ch]\n sub_counter = copy.copy(counter)\n\n for ch_2 in S[N - (i + 1) - 1 :: -1]: # 3 * 10 ** 4\n if ch_2 in sub_done_list:\n sub_counter[ch_2] = sub_counter[ch_2] - 1\n if sub_counter[ch_2] < 1:\n del sub_counter[ch_2]\n continue\n sub_done_list.append(ch_2)\n sub_counter[ch_2] = sub_counter[ch_2] - 1\n if sub_counter[ch_2] < 1:\n del sub_counter[ch_2]\n total += len(sub_counter.keys())\n\n done_list.append(ch)\n\nans = total\n\nprint(ans)\n","change":"replace","i1":0,"i2":16,"j1":0,"j2":37,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02845","language":"Python","original_status":"Runtime Error","pass":"N = int(input())\nAlist = list(map(int, input().split()))\nabc = [0, 0, 0]\nans = 1\nfor i in range(N):\n A = Alist[i]\n ans = (ans * abc.count(A)) % (10**9 + 7)\n abc[abc.index(A)] += 1\n\nprint(ans)\n","fail":"N = int(input())\nAlist = list(map(int, input().split()))\nnums = [0, 0, 0]\nans = 1\nfor i in range(N):\n try:\n A = Alist[i]\n ans = (ans * nums.count(A)) % (10**9 + 7)\n nums[nums.index(A)] += 1\n except:\n print(0)\n break\nelse:\n print(ans)\n","change":"replace","i1":2,"i2":10,"j1":2,"j2":14,"error":0,"stderr":null,"stdout":3} {"problem_id":"p02845","language":"Python","original_status":"Runtime Error","pass":"import sys\n\nreadline = sys.stdin.buffer.readline\nn = int(readline())\nA = map(int, readline().split())\nmod = 1000000007\n\ncaps = [0] * 3\nans = 1\nfor a in A:\n ans *= caps.count(a)\n caps[caps.index(a)] += 1\n ans %= mod\nprint(ans)\n","fail":"import sys\n\nreadline = sys.stdin.buffer.readline\nn = int(readline())\nA = map(int, readline().split())\nmod = 1000000007\n\ncaps = [0] * 3\nans = 1\nfor a in A:\n ans *= caps.count(a)\n # caps[caps.index(a)] += 1\n for i in range(3):\n if caps[i] == a:\n caps[i] += 1\n break\n ans %= mod\nprint(ans)\n","change":"replace","i1":11,"i2":12,"j1":11,"j2":16,"error":0,"stderr":null,"stdout":3} {"problem_id":"p02845","language":"Python","original_status":"Runtime Error","pass":"n = int(input())\na = list(map(int, input().split()))\nmod = 10**9 + 7\n\nans = 1\ncnt = [0, 0, 0]\nfor i in a:\n ans *= cnt.count(i)\n cnt[cnt.index(i)] += 1\n ans %= mod\nprint(ans)\n","fail":"n = int(input())\na = list(map(int, input().split()))\nmod = 10**9 + 7\n\nans = 1\ncnt = [0, 0, 0]\nfor i in a:\n ans *= cnt.count(i)\n for j in range(3):\n if cnt[j] == i:\n cnt[j] += 1\n break\n ans %= mod\nprint(ans)\n","change":"replace","i1":8,"i2":9,"j1":8,"j2":12,"error":0,"stderr":null,"stdout":3} {"problem_id":"p02845","language":"Python","original_status":"Runtime Error","pass":"MOD = 1000000007\n\nn = int(input())\nA = list(map(int, input().split()))\n\nvec = [0, 0, 0]\nnum = 1\n\nfor a in A:\n idx = [i for i, x in enumerate(vec) if x == a]\n num = (num * len(idx)) % MOD\n vec[idx[0]] += 1\n\nprint(num)\n","fail":"MOD = 1000000007\n\nn = int(input())\nA = list(map(int, input().split()))\n\nvec = [0, 0, 0]\nnum = 1\n\nfor a in A:\n idx = [i for i, x in enumerate(vec) if x == a]\n if len(idx) == 0:\n print(0)\n exit()\n num = (num * len(idx)) % MOD\n vec[idx[0]] += 1\n\nprint(num)\n","change":"insert","i1":10,"i2":10,"j1":10,"j2":13,"error":0,"stderr":null,"stdout":3} {"problem_id":"p02845","language":"Python","original_status":"Runtime Error","pass":"# \u306a\u305c\u304b\u9014\u4e2d\u304b\u3089RE\u306a\u308b...\nn = int(input())\ns = list(map(int, input().split()))\ncolor = 0 # appeared_zero (0~2)\nans = 1\nMOD = 1000000007\ncur = [-1, -1, -1]\nfor c in s:\n if c == 0:\n cur[color] = 0\n color += 1\n ans %= MOD\n else:\n x = cur.count(c - 1)\n ans *= x\n ans %= MOD\n if c - 1 in cur:\n idx = cur.index(c - 1)\n cur[idx] += 1\n else:\n print(\"????????????\")\n exit()\nans *= 3 if color == 0 else 3 if color == 1 else 6\nans %= MOD\nprint(ans)\n","fail":"# \u306a\u3093\u304b\u96d1\u306b\u66f8\u3044\u305f\u3089\u30b5\u30f3\u30d7\u30eb3\u901a\u3063\u305f\u3057\u3053\u308c\u3067\u3088\u3055\u305d\u3046\n# \u306a\u3093\u304b\u3057\u3089\u3093\u3051\u30692\u30b1\u30fc\u30b9\u3067WA\u306a\u308b\nn = int(input())\na = list(map(int, input().split()))\nmod = 10**9 + 7\nans = 1\nd = [0] * (n + 10)\nd[0] = 3\nfor i in range(n):\n ans *= d[a[i]]\n d[a[i]] -= 1\n d[a[i] + 1] += 1\n ans %= mod\nprint(ans)\n","change":"replace","i1":0,"i2":24,"j1":0,"j2":13,"error":0,"stderr":null,"stdout":3} {"problem_id":"p02845","language":"Python","original_status":"Runtime Error","pass":"N = int(input())\n\nnum_list = list(map(int, input().split()))\n\nhats = [0, 0, 0]\n\n\nans = 1\n\nfor i in range(N):\n same_color = num_list[i]\n cand_num = hats.count(same_color)\n ans *= cand_num\n ans = ans % 1000000007\n hats[hats.index(same_color)] += 1\n\nprint(ans)\n","fail":"N = int(input())\n\nnum_list = list(map(int, input().split()))\n\nhats = [0, 0, 0]\n\n\nans = 1\n\nfor i in range(N):\n same_color = num_list[i]\n if same_color not in hats:\n print(0)\n break\n cand_num = hats.count(same_color)\n ans *= cand_num\n ans = ans % 1000000007\n hats[hats.index(same_color)] += 1\nelse:\n print(ans)\n","change":"replace","i1":11,"i2":17,"j1":11,"j2":20,"error":0,"stderr":null,"stdout":3} {"problem_id":"p02845","language":"Python","original_status":"Runtime Error","pass":"n = int(input())\nA = list(map(int, input().split()))\n\nrgb = [0, 0, 0]\nans = 1\nfor a in A:\n ans = (ans * rgb.count(a)) % 1000000007\n idx = rgb.index(a)\n rgb[idx] += 1\n\nprint(ans)\n","fail":"n = int(input())\nA = list(map(int, input().split()))\n\nrgb = [0, 0, 0]\nans = 1\nfor a in A:\n if a not in rgb:\n print(0)\n break\n ans = (ans * rgb.count(a)) % 1000000007\n idx = rgb.index(a)\n rgb[idx] += 1\nelse:\n print(ans)\n","change":"replace","i1":6,"i2":11,"j1":6,"j2":14,"error":0,"stderr":null,"stdout":3} {"problem_id":"p02846","language":"Python","original_status":"Runtime Error","pass":"import math\n\nT1, T2 = map(int, input().split())\nA1, A2 = map(int, input().split())\nB1, B2 = map(int, input().split())\n\nif (A1 - B1) * T1 + (A2 - B2) * T2 == 0:\n print(\"infinity\")\nelse:\n D1, D2 = (A1 - B1) * T1, (A2 - B2) * T2\n if (D1 > 0) == (D1 + D2 > 0):\n print(0)\n else:\n print(1 + 2 * math.floor(abs(D1) \/ (abs(D1 + D2) - 1)) + (D1 % D2 == 0))\n","fail":"import math\n\nT1, T2 = map(int, input().split())\nA1, A2 = map(int, input().split())\nB1, B2 = map(int, input().split())\n\nif (A1 - B1) * T1 + (A2 - B2) * T2 == 0:\n print(\"infinity\")\nelse:\n D, D1 = (A1 - B1) * T1 + (A2 - B2) * T2, (A1 - B1) * T1\n if (D1 > 0) == (D > 0):\n print(0)\n else:\n if D1 % D == 0:\n print(2 * math.floor(-D1 \/ D))\n else:\n print(2 * math.floor(-D1 \/ D) + 1)\n","change":"replace","i1":9,"i2":14,"j1":9,"j2":17,"error":0,"stderr":null,"stdout":1} {"problem_id":"p02847","language":"Python","original_status":"Runtime Error","pass":"W = [\"SUM\", \"MON\", \"TUE\", \"WED\", \"THU\", \"FRI\", \"SAT\"]\nS = input()\nprint(len(W) - W.index(S))\n","fail":"W = [\"SUN\", \"MON\", \"TUE\", \"WED\", \"THU\", \"FRI\", \"SAT\"]\nS = input()\nprint(len(W) - W.index(S))\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":0,"stderr":null,"stdout":1} {"problem_id":"p02848","language":"Python","original_status":"Runtime Error","pass":"N = int(input())\nS = input()\nans = \"\"\na = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n\nfor i in range(len(S)):\n if a.index(S[i]) + N > 26:\n ans += a[a.index(S[i]) + N - 26]\n else:\n ans += a[a.index(S[i]) + N]\n\nprint(ans)\n","fail":"N = int(input())\nS = input()\nans = \"\"\na = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n\nfor i in range(len(S)):\n if a.index(S[i]) + N > 25:\n ans += a[a.index(S[i]) + N - 26]\n else:\n ans += a[a.index(S[i]) + N]\n\nprint(ans)\n","change":"replace","i1":6,"i2":7,"j1":6,"j2":7,"error":"IndexError: string index out of range","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02848\/Python\/s484935538.py\", line 10, in \n ans += a[a.index(S[i]) + N]\nIndexError: string index out of range\n","stdout":null} {"problem_id":"p02848","language":"Python","original_status":"Runtime Error","pass":"n = int(input())\ns = input()\n\na = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\" * 2\nans = \"\"\nfor i in s:\n ans[i] = a.index(a.index(s[i]) + n)\nprint(ans)\n","fail":"n = int(input())\ns = input()\n\na = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\nans = \"\"\nfor i in s:\n ans += a[(int(a.index(i)) + n) % 26]\nprint(ans)\n","change":"replace","i1":3,"i2":7,"j1":3,"j2":7,"error":"TypeError: string indices must be integers","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02848\/Python\/s045183440.py\", line 7, in \n ans[i] = a.index(a.index(s[i]) + n)\nTypeError: string indices must be integers\n","stdout":null} {"problem_id":"p02848","language":"Python","original_status":"Runtime Error","pass":"def main(n: int, s: str):\n ans = \"\"\n for _s in s:\n ans += ascii[(ascii.index(_s) + n) % 26]\n\n print(ans)\n\n\nif __name__ == \"__main__\":\n n = int(input())\n s = input()\n\n main(n, s)\n","fail":"from string import ascii_uppercase as ascii\n\n\ndef main(n: int, s: str):\n ans = \"\"\n for _s in s:\n ans += ascii[(ascii.index(_s) + n) % 26]\n\n print(ans)\n\n\nif __name__ == \"__main__\":\n n = int(input())\n s = input()\n\n main(n, s)\n","change":"insert","i1":0,"i2":0,"j1":0,"j2":3,"error":"AttributeError: 'builtin_function_or_method' object has no attribute 'index'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02848\/Python\/s884988719.py\", line 13, in \n main(n, s)\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02848\/Python\/s884988719.py\", line 4, in main\n ans += ascii[(ascii.index(_s) + n) % 26]\nAttributeError: 'builtin_function_or_method' object has no attribute 'index'\n","stdout":null} {"problem_id":"p02850","language":"Python","original_status":"Runtime Error","pass":"n = int(input())\nki = [[] for _ in range(n)]\nfor i in range(n - 1):\n a, b = map(int, input().split())\n a -= 1\n b -= 1\n ki[a].append([b, i])\nans = [-1] * (n - 1)\n\n\n# print(ki)\n\n\ndef d(index, color):\n cnt = 1\n for (t, jid) in ki[index]:\n if cnt == color:\n cnt += 1\n ans[jid] = cnt\n d(t, cnt)\n cnt += 1\n\n\nd(0, 0)\nprint(max(ans))\nfor i in ans:\n print(i)\n","fail":"import sys\n\nsys.setrecursionlimit(10**7)\n\nn = int(input())\nki = [[] for _ in range(n)]\nfor i in range(n - 1):\n a, b = map(int, input().split())\n a -= 1\n b -= 1\n ki[a].append([b, i])\nans = [-1] * (n - 1)\n\n\n# print(ki)\n\n\ndef d(index, color):\n cnt = 1\n for (t, jid) in ki[index]:\n if cnt == color:\n cnt += 1\n ans[jid] = cnt\n d(t, cnt)\n cnt += 1\n\n\nd(0, 0)\nprint(max(ans))\nfor i in ans:\n print(i)\n","change":"insert","i1":0,"i2":0,"j1":0,"j2":4,"error":"0","stderr":null,"stdout":"2\n1\n2\n"} {"problem_id":"p02850","language":"Python","original_status":"Time Limit Exceeded","pass":"#!\/usr\/bin\/env pypy3\n\nimport itertools\n\n\nUNDEF = 0\n\n\ndef mex(s):\n for i in itertools.count(1):\n if i not in s:\n return i\n\n\ndef color_edges(n, edges):\n adj_list = [set() for _ in range(n)]\n for i, (a, b) in enumerate(edges):\n adj_list[a].add(i)\n adj_list[b].add(i)\n colors = [UNDEF for _ in range(n - 1)]\n for v in range(n):\n adj_es = adj_list[v]\n num_adj = len(adj_es)\n cur_cols = set(colors[i] for i in adj_es if colors[i] != UNDEF)\n new_cols = set()\n while len(cur_cols) < num_adj:\n nc = mex(cur_cols)\n cur_cols.add(nc)\n new_cols.add(nc)\n for u in adj_es:\n if colors[u] == UNDEF:\n colors[u] = new_cols.pop()\n return max(colors), colors\n\n\ndef main():\n n = int(input())\n edges = []\n for _ in range(n - 1):\n a, b = (int(z) - 1 for z in input().split())\n edges.append((a, b))\n k, cs = color_edges(n, edges)\n print(k)\n print(*cs, sep=\"\\\\n\")\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"#!\/usr\/bin\/env pypy3\n\nimport itertools\n\n\nUNDEF = 0\n\n\ndef color_edges(n, edges):\n adj_list = [set() for _ in range(n)]\n for i, (a, b) in enumerate(edges):\n adj_list[a].add(i)\n adj_list[b].add(i)\n colors = [UNDEF] * (n - 1)\n for v in range(n):\n adj_es = adj_list[v]\n num_adj = len(adj_es)\n cur_cols = set(colors[i] for i in adj_es if colors[i] != UNDEF)\n new_cols = set()\n for i in itertools.count(1):\n if len(cur_cols) + len(new_cols) >= num_adj:\n break\n elif i not in cur_cols:\n new_cols.add(i)\n for u in adj_es:\n if colors[u] == UNDEF:\n colors[u] = new_cols.pop()\n return max(colors), colors\n\n\ndef main():\n n = int(input())\n edges = []\n for _ in range(n - 1):\n a, b = (int(z) - 1 for z in input().split())\n edges.append((a, b))\n k, cs = color_edges(n, edges)\n print(k)\n print(*cs, sep=\"\\\\n\")\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":8,"i2":29,"j1":8,"j2":24,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02850","language":"Python","original_status":"Time Limit Exceeded","pass":"from collections import deque\n\nN, *AB = map(int, open(0).read().split())\n\nE = [set() for _ in range(N + 1)]\nfor i, (a, b) in enumerate(zip(*[iter(AB)] * 2)):\n E[a].add((b, i))\n E[b].add((a, i))\n\nK = max(len(e) for e in E)\nA = [0] * (N - 1)\nQ = deque([(-1, 1)])\nS = {c for c in range(1, K + 1)}\nwhile Q:\n p, v = Q.popleft()\n C = S - {p}\n for u, i in E[v]:\n E[u].remove((v, i))\n c = C.pop()\n Q.append((c, u))\n A[i] = c\n\nprint(K)\nfor a in A:\n print(a)\n","fail":"from collections import deque\n\nN, *AB = map(int, open(0).read().split())\n\nE = [set() for _ in range(N + 1)]\nfor i, (a, b) in enumerate(zip(*[iter(AB)] * 2)):\n E[a].add((b, i))\n E[b].add((a, i))\n\nK = max(len(e) for e in E)\nA = [0] * (N - 1)\nQ = deque([(-1, 1)])\nwhile Q:\n p, v = Q.popleft()\n c = 0\n for u, i in E[v]:\n E[u].remove((v, i))\n c += 1 + (c + 1 == p)\n Q.append((c, u))\n A[i] = c\n\nprint(K)\nfor a in A:\n print(a)\n","change":"replace","i1":12,"i2":19,"j1":12,"j2":18,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02851","language":"Python","original_status":"Runtime Error","pass":"from collections import Counter, deque\n\nN, K = map(int, input().split())\nA = list(map(int, input().split()))\nINF = 10**18\n\ncnt = Counter()\ncnt[0] = 1\nque = deque([-INF] * (K - 1) + [0])\nsumR = 0\nans = 0\nfor right, a in enumerate(A, start=1):\n cnt[que.popleft()] -= 1\n sumR = (a + sumR) % K\n D = (sumR - right) % K\n ans += cnt[D]\n cnt[D] += 1\n que.append(D)\nprint(ans)\n","fail":"from collections import Counter, deque\n\nN, K = map(int, input().split())\nA = list(map(int, input().split()))\nINF = 10**18\n\ncnt = Counter()\ncnt[0] = 1\nque = deque([0])\nsumR = 0\nans = 0\nfor right, a in enumerate(A, start=1):\n if len(que) >= K:\n cnt[que.popleft()] -= 1\n sumR = (a + sumR) % K\n D = (sumR - right) % K\n ans += cnt[D]\n cnt[D] += 1\n que.append(D)\nprint(ans)\n","change":"replace","i1":8,"i2":13,"j1":8,"j2":14,"error":"0","stderr":null,"stdout":4.0} {"problem_id":"p02851","language":"Python","original_status":"Time Limit Exceeded","pass":"n, k = map(int, input().split())\na = list(map(int, input().split()))\nr = 0\ns = {0: [0]}\nfor i in range(n):\n r = (r + a[i] - 1) % k\n s[r] = s.get(r, []) + [i + 1]\nret = 0\nfor key in s:\n a = s[key]\n en = 0\n for st in range(len(a)):\n while en < len(a) and a[en] - a[st] < k:\n en += 1\n ret += en - st - 1\nprint(ret)\n","fail":"n, k = map(int, input().split())\na = list(map(int, input().split()))\nr = 0\ns = {0: [0]}\nfor i in range(n):\n r = (r + a[i] - 1) % k\n if r in s:\n s[r].append(i + 1)\n else:\n s[r] = [i + 1]\nret = 0\nfor key in s:\n a = s[key]\n en = 0\n for st in range(len(a)):\n while en < len(a) and a[en] - a[st] < k:\n en += 1\n ret += en - st - 1\nprint(ret)\n","change":"replace","i1":6,"i2":7,"j1":6,"j2":10,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02852","language":"Python","original_status":"Time Limit Exceeded","pass":"n, m = map(int, input().split())\ns = input()\ns = s[::-1]\nif s[0] == \"1\":\n print(-1)\n exit()\npre = [-1] * (n + 1)\nstack = [0]\nwhile stack:\n now = stack.pop()\n if now == n:\n break\n for i in range(1, m + 1):\n tsugi = now + i\n if tsugi > n:\n continue\n if s[tsugi] == \"1\":\n continue\n pre[tsugi] = now\n stack.append(tsugi)\nelse:\n print(-1)\n exit()\nato = n\nmae = pre[n]\nans = []\nwhile mae >= 0:\n ans.append(ato - mae)\n ato = mae\n mae = pre[ato]\nprint(*ans, sep=\" \")\n","fail":"n, m = map(int, input().split())\ns = input()\nout_s = \"1\" * (m)\nif out_s in s:\n print(-1)\n exit()\ns = s[::-1]\nif s[0] == \"1\":\n print(-1)\n exit()\npre = [-1] * (n + 1)\nstack = [0]\nwhile stack:\n now = stack.pop()\n if now == n:\n break\n for i in range(1, m + 1):\n tsugi = now + i\n if tsugi > n:\n continue\n if s[tsugi] == \"1\":\n continue\n pre[tsugi] = now\n stack.append(tsugi)\nelse:\n print(-1)\n exit()\nato = n\nmae = pre[n]\nans = []\nwhile mae >= 0:\n ans.append(ato - mae)\n ato = mae\n mae = pre[ato]\nprint(*ans, sep=\" \")\n","change":"insert","i1":2,"i2":2,"j1":2,"j2":6,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02852","language":"Python","original_status":"Time Limit Exceeded","pass":"from collections import deque\n\nN, M = map(int, input().split())\nS = input()[::-1]\n\nstack = deque([[0, M + 1]])\nnow = 0\nwhile stack:\n now, d = stack.pop()\n d -= 1\n if not d:\n continue\n if now + d >= N:\n stack.append([now, d - (now + d - N)])\n print(*map(lambda s: s[1], reversed(stack)))\n quit()\n stack.append([now, d])\n if S[now + d] == \"0\":\n stack.append([now + d, M + 1])\nprint(-1)\n","fail":"N, M = map(int, input().split())\nS = list(map(int, reversed(input())))\nnow = 0\nans = []\nwhile now + M < N:\n last = now\n now += M\n while S[now]:\n now -= 1\n if last == now:\n print(-1)\n break\n ans.append(now - last)\nelse:\n print(*reversed(ans + [N - now]))\n","change":"replace","i1":0,"i2":20,"j1":0,"j2":15,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02852","language":"Python","original_status":"Runtime Error","pass":"N, M = map(int, input().split())\nS = input()\nS = S[::-1]\n\ndp = [-1] * (N + 1)\ndp[0] = 0\n\npos = 0\nwhile pos < N:\n\n p = pos\n update = False\n\n for i in range(1, M + 1):\n if p + i > N:\n break\n if S[p + i] == \"1\":\n continue\n update = True\n pos = p + i\n dp[pos] = dp[p] + 1\n\n if not update:\n break\n\nif dp[N] == -1:\n print(-1)\n exit()\n\ndp = dp[::-1]\nnum = dp[0]\nans = []\npos = 0\n\nwhile num > 0:\n for i in range(1, M + 1):\n if dp[pos + i] == num - 1:\n num -= 1\n pos += i\n ans.append(str(i))\n\nans = \" \".join(ans)\nprint(ans)\n","fail":"N, M = map(int, input().split())\nS = input()\nS = S[::-1]\n\ndp = [-1] * (N + 1)\ndp[0] = 0\n\npos = 0\nwhile pos < N:\n\n p = pos\n update = False\n\n for i in range(1, M + 1):\n if p + i > N:\n break\n if S[p + i] == \"0\":\n update = True\n pos = p + i\n dp[pos] = dp[p] + 1\n\n if not update:\n break\n\nif dp[N] == -1:\n print(-1)\n exit()\n\ndp = dp[::-1]\nnum = dp[0]\nans = []\npos = 0\n\nwhile num > 0:\n for i in range(1, M + 1):\n if dp[pos + i] == num - 1:\n num -= 1\n pos += i\n ans.append(str(i))\n break\n\nans = \" \".join(ans)\nprint(ans)\n","change":"replace","i1":16,"i2":40,"j1":16,"j2":40,"error":"0","stderr":null,"stdout":"1 3 2 3\n"} {"problem_id":"p02853","language":"Python","original_status":"Runtime Error","pass":"x, y = map(int, input().split())\nans = 0\nif x <= 3:\n ans += 400_000 - x * 100_000\nif y <= 3:\n ans += 400_000 - y * 100_000\nif x == y == 1:\n ans += 400_000\nprint(ans)\n","fail":"x, y = map(int, input().split())\nans = 0\nif x <= 3:\n ans += 400000 - x * 100000\nif y <= 3:\n ans += 400000 - y * 100000\nif x == y == 1:\n ans += 400000\nprint(ans)\n","change":"replace","i1":3,"i2":8,"j1":3,"j2":8,"error":0,"stderr":null,"stdout":1000000} {"problem_id":"p02853","language":"Python","original_status":"Runtime Error","pass":"def main(x: int, y: int):\n award: int = 0\n\n if (x and y) == 1:\n award += 400000\n\n for i in [x, y]:\n if i == 1:\n award += 300000\n elif i == 2:\n award += 200000\n elif i == 3:\n award += 100000\n\n print(award)\n\n\nif __name__ == \"__main__\":\n x, y = map(int, input().split())\n\n main(x, y)\n","fail":"def main(x: int, y: int):\n award = 0\n\n if x == y == 1:\n award += 400000\n\n for i in [x, y]:\n if i == 1:\n award += 300000\n elif i == 2:\n award += 200000\n elif i == 3:\n award += 100000\n\n print(award)\n\n\nif __name__ == \"__main__\":\n x, y = map(int, input().split())\n\n main(x, y)\n","change":"replace","i1":1,"i2":4,"j1":1,"j2":4,"error":0,"stderr":null,"stdout":1000000} {"problem_id":"p02854","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = list(map(int, input().split()))\ntmp = 0\nkey = 0\nfor i in range(n):\n if tmp + a[i] >= sum(a) \/ 2:\n key = i\n break\n tmp += a[i]\n\nans = abs(sum(a[0:key]) - sum(a[key::]))\ntmp = 0\nkey = 0\nfor i in range(n):\n tmp += a[i]\n if tmp >= sum(a) \/ 2:\n key = i + 1\n break\n\nans = min(abs(sum(a[0:key]) - sum(a[key::])), ans)\nprint(ans)\n","fail":"n = int(input())\na = list(map(int, input().split()))\ntmp = 0\nkey = 0\nSUMA = sum(a)\n\nfor i in range(n):\n if tmp + a[i] >= SUMA \/ 2:\n key = i\n break\n tmp += a[i]\n\nans = abs(sum(a[0:key]) - sum(a[key::]))\ntmp = 0\nkey += 1\nans = min(abs(sum(a[0:key]) - sum(a[key::])), ans)\nprint(ans)\n","change":"replace","i1":4,"i2":19,"j1":4,"j2":15,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02854","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = list(map(int, input().split()))\nsumA = sum(A)\n\nans, sumA2 = abs(sum(A) - 0), 0\nfor i in range(N):\n sumA2 += A[i]\n ans = min(ans, abs(sum(A) - sumA2 * 2))\n\nprint(ans)\n","fail":"N = int(input())\nA = list(map(int, input().split()))\nL, R, sumL_R = 0, N - 1, A[0] - A[N - 1]\n\nwhile R - L > 1:\n if sumL_R < 0:\n L += 1\n sumL_R += A[L]\n else:\n R -= 1\n sumL_R -= A[R]\nprint(abs(sumL_R))\n","change":"replace","i1":2,"i2":10,"j1":2,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02854","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\nA = list(map(int, input().split()))\n\nans = 10**11\n\nfor i in range(n):\n if abs(sum(A[:i]) - sum(A[i:])) < ans:\n ans = abs(sum(A[:i]) - sum(A[i:]))\n\nprint(ans)\n","fail":"n = int(input())\nA = list(map(int, input().split()))\n\nans = 10**11\nsum_A = sum(A)\nl = 0\n\nfor a in A:\n l += a\n if abs(l - (sum_A - l)) < ans:\n ans = abs(l - (sum_A - l))\n\nprint(ans)\n","change":"replace","i1":4,"i2":8,"j1":4,"j2":11,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02854","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nsticks = list(map(int, input().split()))\ndiffMin = sum(sticks)\nfor i in range(len(sticks)):\n diff = abs(sum(sticks[:i]) - sum(sticks[i:]))\n if diff < diffMin:\n diffMin = diff\nprint(diffMin)\n","fail":"N = int(input())\nsticks = list(map(int, input().split()))\nsticksSum = sum(sticks)\ndiffMin = sum(sticks)\nplusSticks = 0\nfor i in range(len(sticks)):\n plusSticks += sticks[i]\n diffMin = min(diffMin, abs(2 * plusSticks - sticksSum))\nprint(diffMin)\n","change":"replace","i1":2,"i2":7,"j1":2,"j2":8,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02854","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = tuple(map(int, input().split(\" \")))\nd = {i: (sum(A[:i]), sum(A[i:])) for i in range(N)}\n\nprint(min(abs(value[0] - value[1]) for key, value in d.items()))\n","fail":"N = int(input())\nA = tuple(map(int, input().split(\" \")))\n\nS = sum(A)\nans = S\ns = 0\nfor i in range(N):\n s += A[i]\n ans = min(ans, abs(s - (S - s)))\nprint(ans)\n","change":"replace","i1":2,"i2":5,"j1":2,"j2":10,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02854","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = list(map(int, input().split()))\nm = 0\ns = []\nfor i in range(len(a)):\n m += a[i]\n s.append(abs(sum(a) - m * 2))\nprint(min(s))\n","fail":"n = int(input())\na = list(map(int, input().split()))\nm = 0\ns = []\nsuma = sum(a)\nfor i in range(len(a)):\n m += a[i]\n s.append(abs(suma - m * 2))\nprint(min(s))\n","change":"replace","i1":4,"i2":7,"j1":4,"j2":8,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02854","language":"Python","original_status":"Runtime Error","pass":"from itertools import accumulate\n\nN = int(input())\nA = list([int(x) for x in input().split()])\n\ncount = 0\nwhile True:\n # \u4e2d\u5fc3\u306b\u6700\u3082\u8fd1\u3044\u70b9\u3092\u63a2\u3059\n ironbar = list(accumulate(A))\n center = sum(A) \/\/ 2\n\n i = 0\n j = len(A) - 1\n\n while i + 1 < j:\n check = ironbar[(i + j) \/\/ 2]\n if check < center:\n i = (i + j) \/\/ 2\n elif check > center:\n j = (i + j) \/\/ 2\n else:\n print(count)\n exit()\n\n if check > center:\n A[j] -= 1\n else:\n A[j] += 1\n\n count += 1\n","fail":"from itertools import accumulate\n\nN = int(input())\nA = list([int(x) for x in input().split()])\n\ncount = 0\nironbar = list(accumulate(A))\n\nmin_value = ironbar[-1]\nfor i in range(N):\n bet = abs(ironbar[i] - (ironbar[-1] - ironbar[i]))\n\n if min_value > bet:\n min_value = bet\n else:\n print(min_value)\n exit()\n","change":"replace","i1":6,"i2":30,"j1":6,"j2":17,"error":"0","stderr":null,"stdout":3.0} {"problem_id":"p02854","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = list(map(int, input().split()))\nx = 2020202020\nfor i in range(1, n):\n x = min(x, abs(sum(a[:i]) - sum(a[i:])))\nprint(x)\n","fail":"n = int(input())\na = list(map(int, input().split()))\nx = 0\ny = sum(a)\nans = 2020202020\nfor i in range(n - 1):\n x += a[i]\n y -= a[i]\n ans = min(ans, abs(x - y))\nprint(ans)\n","change":"replace","i1":2,"i2":6,"j1":2,"j2":10,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02854","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\narr = list(map(int, input().split()))\nmin_delta = sum(arr)\nfor i in range(1, N):\n min_delta = min(abs(sum(arr[:i]) - sum(arr[i:])), min_delta)\n\nprint(min_delta)\n","fail":"N = int(input())\narr = list(map(int, input().split()))\nfirst = 0\nsecond = sum(arr)\nmin_delta = second - first\nfor i in range(N):\n first += arr[i]\n second -= arr[i]\n min_delta = min(abs(second - first), min_delta)\n\nprint(min_delta)\n","change":"replace","i1":2,"i2":5,"j1":2,"j2":9,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02859","language":"Python","original_status":"Runtime Error","pass":"r = input()\nans = r * r\nprint(ans)\n","fail":"r = int(input())\nans = r * r\nprint(ans)\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"TypeError: can't multiply sequence by non-int of type 'str'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02859\/Python\/s972374104.py\", line 2, in \n ans = r * r\nTypeError: can't multiply sequence by non-int of type 'str'\n","stdout":null} {"problem_id":"p02859","language":"Python","original_status":"Runtime Error","pass":"r = input()\nprint(r**2)\n","fail":"r = int(input())\nprint(r**2)\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"TypeError: unsupported operand type(s) for ** or pow(): 'str' and 'int'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02859\/Python\/s447174511.py\", line 2, in \n print(r**2)\nTypeError: unsupported operand type(s) for ** or pow(): 'str' and 'int'\n","stdout":null} {"problem_id":"p02859","language":"Python","original_status":"Runtime Error","pass":"r = int(input)\nprint(r**2)\n","fail":"r = int(input())\nprint(r**2)\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"TypeError: int() argument must be a string, a bytes-like object or a real number, not 'builtin_function_or_method'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02859\/Python\/s774524260.py\", line 1, in \n r = int(input)\nTypeError: int() argument must be a string, a bytes-like object or a real number, not 'builtin_function_or_method'\n","stdout":null} {"problem_id":"p02859","language":"Python","original_status":"Runtime Error","pass":"r = int(input().split())\nprint(r * r)\n","fail":"r = int(input().strip())\nprint(r * r)\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"TypeError: int() argument must be a string, a bytes-like object or a real number, not 'list'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02859\/Python\/s880229188.py\", line 1, in \n r = int(input().split())\nTypeError: int() argument must be a string, a bytes-like object or a real number, not 'list'\n","stdout":null} {"problem_id":"p02859","language":"Python","original_status":"Runtime Error","pass":"r = int(input)\n\nprint(int(r**2))\n","fail":"r = int(input())\n\nprint(int(r**2))\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"TypeError: int() argument must be a string, a bytes-like object or a real number, not 'builtin_function_or_method'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02859\/Python\/s021145542.py\", line 1, in \n r = int(input)\nTypeError: int() argument must be a string, a bytes-like object or a real number, not 'builtin_function_or_method'\n","stdout":null} {"problem_id":"p02859","language":"Python","original_status":"Runtime Error","pass":"N = input()\nprint(N**2)\n","fail":"N = int(input())\nprint(N**2)\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"TypeError: unsupported operand type(s) for ** or pow(): 'str' and 'int'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02859\/Python\/s490869549.py\", line 2, in \n print(N**2)\nTypeError: unsupported operand type(s) for ** or pow(): 'str' and 'int'\n","stdout":null} {"problem_id":"p02860","language":"Python","original_status":"Runtime Error","pass":"import sys\n\n\ndef main():\n N = int(input())\n S = input()\n if N % 2 == 1:\n print(\"No\")\n sys.exit()\n n = N \/ 2\n yesno = \"Yes\" if S[:n] == S[n:] else \"No\"\n print(yesno)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"def main():\n N = int(input())\n S = input()\n if N % 2 == 1:\n print(\"No\")\n quit()\n n = N \/\/ 2\n yesno = \"Yes\" if S[:n] == S[n:] else \"No\"\n print(yesno)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":0,"i2":10,"j1":0,"j2":7,"error":"TypeError: slice indices must be integers or None or have an __index__ method","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02860\/Python\/s888782335.py\", line 16, in \n main()\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02860\/Python\/s888782335.py\", line 11, in main\n yesno = \"Yes\" if S[:n] == S[n:] else \"No\"\nTypeError: slice indices must be integers or None or have an __index__ method\n","stdout":null} {"problem_id":"p02860","language":"Python","original_status":"Runtime Error","pass":"n = int(input())\ns = input()\nans = \"No\"\nif n % 2 == 0:\n ans = \"Yes\"\n for i in range(n \/ 2):\n if s[i] != s[n \/ 2 + i]:\n ans = \"No\"\n break\nprint(ans)\n","fail":"n = int(input())\ns = input()\nans = \"No\"\nif n % 2 == 0:\n ans = \"Yes\"\n for i in range(n \/\/ 2):\n if s[i] != s[n \/\/ 2 + i]:\n ans = \"No\"\n break\nprint(ans)\n","change":"replace","i1":5,"i2":7,"j1":5,"j2":7,"error":"TypeError: 'float' object cannot be interpreted as an integer","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02860\/Python\/s022164402.py\", line 6, in \n for i in range(n \/ 2):\nTypeError: 'float' object cannot be interpreted as an integer\n","stdout":null} {"problem_id":"p02860","language":"Python","original_status":"Runtime Error","pass":"N = int(input())\nS = int(input())\nif N % 2 != 0:\n print(\"No\")\nelse:\n arr = list(S)\n s_len = len(arr) \/\/ 2\n if arr[s_len:] == arr[:s_len]:\n print(\"Yes\")\n else:\n print(\"No\")\n","fail":"N = int(input())\nS = input()\nif N % 2 != 0:\n print(\"No\")\nelse:\n arr = list(S)\n s_len = len(arr) \/\/ 2\n if arr[s_len:] == arr[:s_len]:\n print(\"Yes\")\n else:\n print(\"No\")\n","change":"replace","i1":1,"i2":2,"j1":1,"j2":2,"error":"ValueError: invalid literal for int() with base 10: 'abcabc'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02860\/Python\/s186953339.py\", line 2, in \n S = int(input())\nValueError: invalid literal for int() with base 10: 'abcabc'\n","stdout":null} {"problem_id":"p02861","language":"Python","original_status":"Runtime Error","pass":"import sys\nimport math\nfrom typing import List, Tuple\n\n\ndef len(lhs: Tuple[int, int], rhs: Tuple[int, int]):\n return math.sqrt((lhs[0] - rhs[0]) ** 2 + (lhs[1] - rhs[1]) ** 2)\n\n\ndef solve(n: int, cities: List[Tuple[int, int]]):\n sum = 0\n for i1, city1 in enumerate(cities):\n for i2, city2 in enumerate(cities):\n if i1 != i2:\n sum += len(city1, city2)\n return sum \/ n\n\n\ndef main():\n inputs = list(sys.stdin)\n n = int(inputs.pop(0))\n cities = [[int(n) for n in s.split(\" \")] for s in inputs]\n print(solve(n, cities))\n\n\nmain()\n","fail":"import sys\nimport math\n\n\ndef len(lhs, rhs):\n return math.sqrt((lhs[0] - rhs[0]) ** 2 + (lhs[1] - rhs[1]) ** 2)\n\n\ndef solve(n: int, cities):\n sum = 0\n for i1, city1 in enumerate(cities):\n for i2, city2 in enumerate(cities):\n if i1 != i2:\n sum += len(city1, city2)\n return sum \/ n\n\n\ndef main():\n inputs = list(sys.stdin)\n n = int(inputs.pop(0))\n cities = [[int(n) for n in s.split(\" \")] for s in inputs]\n print(solve(n, cities))\n\n\nmain()\n","change":"replace","i1":2,"i2":10,"j1":2,"j2":9,"error":"WA","stderr":null,"stdout":2.2761423749} {"problem_id":"p02861","language":"Python","original_status":"Runtime Error","pass":"from itertools import permutations\n\nimport numpy as np\n\nN = int(input())\n\nxys = []\nfor _ in range(N):\n xys.append(list(map(int, input().split())))\n\ncombs = np.array(list(permutations(xys, N)))\nret = np.array(\n [np.linalg.norm(combs[:, i] - combs[:, i + 1], axis=1) for i in range(N - 1)]\n).sum() \/ len(combs)\n\nprint(f\"{ret:.10f}\")\n","fail":"from itertools import permutations\n\nimport numpy as np\n\nN = int(input())\n\nxys = []\nfor _ in range(N):\n xys.append(list(map(int, input().split())))\n\ncombs = np.array(list(permutations(xys, N)))\nret = np.array(\n [np.linalg.norm(combs[:, i] - combs[:, i + 1], axis=1) for i in range(N - 1)]\n).sum() \/ len(combs)\n\nprint(\"{:.10f}\".format(ret))\n","change":"replace","i1":15,"i2":16,"j1":15,"j2":16,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02861","language":"Python","original_status":"Time Limit Exceeded","pass":"import numpy as np\nimport itertools\n\nn = int(input())\n\nroute = [np.array(list(map(int, input().split()))) for _ in range(n)]\nresults = []\nfor v in itertools.permutations(route, r=n):\n distance = 0\n for start, goal in zip(v[:-1], v[1:]):\n distance += np.linalg.norm(goal - start)\n results.append(distance)\nprint(np.mean(results))\n","fail":"import itertools\n\nn = int(input())\n\nroute = [list(map(int, input().split())) for _ in range(n)]\nresults = []\nfor v in itertools.permutations(route, r=n):\n distance = 0\n for i in range(n - 1):\n start, goal = v[i], v[i + 1]\n distance += ((goal[0] - start[0]) ** 2 + (goal[1] - start[1]) ** 2) ** 0.5\n results.append(distance)\nprint(sum(results) \/ len(results))\n","change":"replace","i1":0,"i2":13,"j1":0,"j2":13,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02862","language":"Python","original_status":"Runtime Error","pass":"m = 10**9 + 7\nX, Y = map(int, input().split())\nt = [[0] * (X + 2) for i in range(Y + 2)]\nfor i in range(Y):\n for j in range(X):\n t[i + 1][j + 2] += t[i][j] + 1\n t[i + 2][j + 1] += t[i][j] + 1\n t[i + 1][j + 2] %= m\n t[i + 2][j + 1] %= m\n\nprint(t[Y - 1][X - 1])\n","fail":"def gcd1(a, b):\n def calc(a, b, first, second):\n if a < b:\n a, b = b, a\n r = a % b\n q = -(a - r) \/\/ b\n if r == 0:\n return b, second\n # first += q * second\n first = [x + q * y for (x, y) in zip(first, second)]\n return calc(r, b, second, first)\n\n first = [1, 0]\n second = [0, 1]\n return calc(a, b, first, second)\n\n\ndef mod_inv(n, mod):\n table = gcd1(n, mod)\n inv = table[1][1]\n if inv < 0:\n inv += mod\n return inv\n\n\ndef cmb(n, r, mod):\n ans = 1\n for i in range(r):\n ans = (ans * n) % mod\n n -= 1\n ans1 = 1\n for i in range(1, r + 1):\n ans1 = (ans1 * i) % mod\n return ans * mod_inv(ans1, mod)\n\n\ndef main():\n m = 10**9 + 7\n X, Y = map(int, input().split())\n XY = X + Y\n min_xy = XY \/\/ 3\n max_xy = XY - min_xy\n if XY % 3 != 0:\n print(0)\n return\n if X < min_xy or X > max_xy or Y < min_xy or Y > max_xy:\n print(0)\n return\n index_x = X - min_xy\n index_y = Y - min_xy\n # print(index_x, index_y)\n ans = cmb(min_xy, index_x, m)\n print(ans % m)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":0,"i2":11,"j1":0,"j2":57,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p02862","language":"Python","original_status":"Time Limit Exceeded","pass":"import sys\n\n\ndef extgcd(a, b):\n r = [1, 0, a]\n w = [0, 1, b]\n while w[2] != 1:\n q = r[2] \/\/ w[2]\n r2 = w\n w2 = [r[0] - q * w[0], r[1] - q * w[1], r[2] - q * w[2]]\n r = r2\n w = w2\n return [w[0], w[1]]\n\n\ndef mod_inv(a, m):\n x = extgcd(a, m)[0]\n return (m + x % m) % m\n\n\ndef main():\n X, Y = map(int, input().split())\n C = 10**9 + 7\n\n if (X + Y) % 3 != 0:\n print(0)\n sys.exit()\n cnt = [0, 0]\n if Y \/ X >= 1:\n (i, j) = (1, 2)\n cnt[0] += 1\n else:\n (i, j) = (2, 1)\n cnt[1] += 1\n\n while (i, j) != (X, Y):\n if Y * i > X * j:\n i += 1\n j += 2\n cnt[0] += 1\n else:\n i += 2\n j += 1\n cnt[1] += 1\n\n ans = 1\n for i in range(1, sum(cnt) + 1):\n ans *= i\n ans %= C\n for i in range(1, cnt[0] + 1):\n ans *= mod_inv(i, C)\n ans %= C\n for i in range(1, cnt[1] + 1):\n ans *= mod_inv(i, C)\n ans %= C\n\n print(ans)\n\n\nmain()\n","fail":"import sys\n\n\ndef extgcd(a, b):\n r = [1, 0, a]\n w = [0, 1, b]\n while w[2] != 1:\n q = r[2] \/\/ w[2]\n r2 = w\n w2 = [r[0] - q * w[0], r[1] - q * w[1], r[2] - q * w[2]]\n r = r2\n w = w2\n return [w[0], w[1]]\n\n\ndef mod_inv(a, m):\n x = extgcd(a, m)[0]\n return (m + x % m) % m\n\n\ndef main():\n X, Y = map(int, input().split())\n C = 10**9 + 7\n\n if (X + Y) % 3 != 0:\n print(0)\n sys.exit()\n\n cnt = [0, 0]\n cnt[0] = (2 * X - Y) \/\/ 3\n cnt[1] = (-X + 2 * Y) \/\/ 3\n\n if cnt[0] < 0 or cnt[1] < 0:\n print(0)\n sys.exit()\n\n ans = 1\n for i in range(1, sum(cnt) + 1):\n ans *= i\n ans %= C\n for i in range(1, cnt[0] + 1):\n ans *= mod_inv(i, C)\n ans %= C\n for i in range(1, cnt[1] + 1):\n ans *= mod_inv(i, C)\n ans %= C\n\n print(ans)\n\n\nmain()\n","change":"replace","i1":27,"i2":44,"j1":27,"j2":35,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02862","language":"Python","original_status":"Time Limit Exceeded","pass":"MOD = 10**9 + 7\nMAX = 7 * 10**5\nfact = [1] * (MAX + 1)\nfinv = [1] * (MAX + 1)\nfor i in range(2, MAX + 1):\n fact[i] = fact[i - 1] * i % MOD\n finv[i] = pow(fact[i], MOD - 2, MOD)\n\n\ndef comb(n: int, k: int) -> int:\n if n < k or n < 0 or k < 0:\n return 0\n return (fact[n] * finv[k] % MOD) * finv[n - k] % MOD\n\n\nx, y = map(int, input().split())\na = 2 * y - x\nb = 2 * x - y\n\nif a < 0 or b < 0:\n ans = 0\nelif a % 3 != 0 or b % 3 != 0:\n ans = 0\nelse:\n a \/\/= 3\n b \/\/= 3\n print(a, b)\n ans = comb(a + b, a)\n\nprint(ans)\n","fail":"MOD = 10**9 + 7\n\n\ndef comb(n, k, MOD):\n if n < k or n < 0 or k < 0:\n return 0\n k = min(k, n - k)\n if k == 0:\n return 1\n iinv = [1] * (k + 1)\n ans = n\n for i in range(2, k + 1):\n iinv[i] = MOD - iinv[MOD % i] * (MOD \/\/ i) % MOD\n ans *= (n + 1 - i) * iinv[i] % MOD\n ans %= MOD\n return ans\n\n\nx, y = map(int, input().split())\na = 2 * y - x\nb = 2 * x - y\n\nif a < 0 or b < 0:\n ans = 0\nelif a % 3 != 0 or b % 3 != 0:\n ans = 0\nelse:\n a \/\/= 3\n b \/\/= 3\n # print(a, b)\n ans = comb(a + b, a, MOD)\n\nprint(ans)\n","change":"replace","i1":1,"i2":28,"j1":1,"j2":31,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02863","language":"Python","original_status":"Time Limit Exceeded","pass":"def solve(n, t, ab_list):\n ab_list_s = sorted(ab_list, key=lambda x: x[0])\n res = 0\n dp = [0] * t\n for i in range(n):\n for s in range(t - 1, -1, -1):\n if dp[s] > 0 or s == 0:\n u = s + ab_list_s[i][0]\n r = dp[s] + ab_list_s[i][1]\n if u >= t:\n res = max(res, r)\n else:\n dp[u] = max(dp[u], r)\n return max(res, max(dp))\n\n\ndef main():\n n, t = map(int, input().split())\n ab_list = []\n for _ in range(n):\n a, b = map(int, input().split())\n ab_list.append([a, b])\n res = solve(n, t, ab_list)\n print(res)\n\n\ndef test():\n assert solve(2, 60, [[10, 10], [100, 100]]) == 110\n assert solve(3, 60, [[10, 10], [10, 20], [10, 30]]) == 60\n assert solve(3, 60, [[30, 10], [30, 20], [30, 30]]) == 50\n\n\nif __name__ == \"__main__\":\n test()\n main()\n","fail":"def solve(n, t, ab_list):\n ab_list_s = sorted(ab_list, key=lambda x: x[0])\n res = 0\n dp = [0] * t\n for i in range(n):\n for s in range(t - 1, -1, -1):\n if dp[s] > 0 or s == 0:\n u = s + ab_list_s[i][0]\n r = dp[s] + ab_list_s[i][1]\n if u >= t:\n res = max(res, r)\n else:\n dp[u] = max(dp[u], r)\n return max(res, max(dp))\n\n\ndef main():\n n, t = map(int, input().split())\n ab_list = []\n for _ in range(n):\n a, b = map(int, input().split())\n ab_list.append([a, b])\n res = solve(n, t, ab_list)\n print(res)\n\n\ndef test():\n assert solve(2, 60, [[10, 10], [100, 100]]) == 110\n assert solve(3, 60, [[10, 10], [10, 20], [10, 30]]) == 60\n assert solve(3, 60, [[30, 10], [30, 20], [30, 30]]) == 50\n\n\nif __name__ == \"__main__\":\n # test()\n main()\n","change":"replace","i1":33,"i2":34,"j1":33,"j2":34,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02863","language":"Python","original_status":"Time Limit Exceeded","pass":"N, T = map(int, input().split())\nitems = [tuple(map(int, input().split())) for _ in range(N)]\n\nitems.sort()\n\nans = 0\ndp = {0: 0}\nfor wi, vi in items:\n for w, v in dp.items():\n if w < T:\n v2 = v + vi\n if v2 > ans:\n ans = v2\n\n for w, v in list(dp.items()):\n w2 = w + wi\n if w2 <= T:\n v2 = v + vi\n if w2 in dp:\n if v2 > dp[w2]:\n dp[w2] = v2\n else:\n dp[w2] = v2\n\nv2 = max(dp.values())\nans = max(ans, v2)\n\nprint(ans)\n","fail":"import sys\n\ninput = sys.stdin.readline\n\n\ndef solve():\n N, T = map(int, input().split())\n items = [tuple(map(int, input().split())) for _ in range(N)]\n\n items.sort()\n\n capW = T - 1\n dp = [0] * (capW + 1)\n ans = 0\n for wi, vi in items:\n ans = max(ans, dp[-1] + vi)\n for w in reversed(range(wi, capW + 1)):\n v0 = dp[w - wi] + vi\n if v0 > dp[w]:\n dp[w] = v0\n\n print(ans)\n\n\nsolve()\n","change":"replace","i1":0,"i2":28,"j1":0,"j2":25,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02863","language":"Python","original_status":"Time Limit Exceeded","pass":"import sys\nfrom collections import defaultdict\n\nn, t = map(int, input().split())\nknapsack = defaultdict(lambda: 0)\nknapsack[0] = 0\ntmp_ans = 0\ncuisines = [tuple(map(int, line.split())) for line in sys.stdin]\ncuisines.sort()\nfor a, b in cuisines:\n for time, satisfied in list(knapsack.items()):\n if time + a >= t:\n tmp_ans = max(tmp_ans, satisfied + b)\n continue\n knapsack[time + a] = max(knapsack[time + a], satisfied + b)\n\nprint(max(tmp_ans, max(knapsack.values())))\n","fail":"import sys\n\nimport numpy as np\n\nn, t = map(int, input().split())\nknapsack = np.zeros(t, dtype=np.int64)\ncuisines = [tuple(map(int, line.split())) for line in sys.stdin]\ncuisines.sort()\ntmp_ans = 0\nfor a, b in cuisines:\n tmp_ans = max(tmp_ans, knapsack.max() + b)\n knapsack[a:] = np.maximum(knapsack[a:], knapsack[:-a] + b)\n\nprint(max(tmp_ans, knapsack.max()))\n","change":"replace","i1":1,"i2":17,"j1":1,"j2":14,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02863","language":"Python","original_status":"Time Limit Exceeded","pass":"def solve():\n import sys\n\n input = sys.stdin.readline\n\n n, t = map(int, input().split()) # t - 1\u307e\u3067\u6ce8\u6587OK\n ab = tuple(tuple(map(int, input().split())) for _ in range(n))\n\n ret = 0\n for last_dish, (_, last_b) in enumerate(ab):\n dp = [0] * t\n # dp[\u76bfID][\u6642\u9593] = \u6700\u5927\u304a\u3044\u3057\u3055\n # dp[T-1] + \u6b8b\u308a\u3067\u4e00\u756a\u7f8e\u5473\u3057\u3044\u3082\u306e\n # \u5148\u306b\u3069\u306e\u76bf\u3092\u6700\u5f8c\u306b\u98df\u3079\u308b\u304b\u6c7a\u3081\u3066\u304a\u3044\u3066\u3001\u305d\u308c\u4ee5\u5916\u3067dp\n # 3000\u56dedp\n\n for dish, (a, b) in enumerate(ab):\n if dish == last_dish:\n continue\n for t_ in range(t - 1, a - 1, -1):\n dp[t_] = max(dp[t_], dp[t_ - a] + b)\n ret = max(ret, max(dp) + last_b)\n return ret\n\n\nprint(solve())\n","fail":"def solve():\n from collections import namedtuple\n import sys\n\n input = sys.stdin.readline\n Dish = namedtuple(\"Dish\", \"idx cost pt\")\n\n n, t = map(int, input().split())\n dishes = []\n for idx in range(1, n + 1):\n cost, pt = map(int, input().split())\n dishes.append(Dish(idx=idx, cost=cost, pt=pt))\n\n dp_ht = [[0] * t for _ in range(n + 2)] # head->tail\n dp_th = [[0] * t for _ in range(n + 2)] # tail->head\n # dp[\u6ce8\u6587\u53ef\u80fd\u306a\u7bc4\u56f2\u306e\u7aef][\u5b8c\u98df\u306b\u304b\u304b\u308b\u7dcf\u6642\u9593]:= \u7f8e\u5473\u3057\u3055\u306e\u6700\u5927\u5024\n\n for dish in dishes:\n for cost_ in range(t):\n if cost_ >= dish.cost:\n dp_ht[dish.idx][cost_] = max(\n dp_ht[dish.idx - 1][cost_],\n dp_ht[dish.idx - 1][cost_ - dish.cost] + dish.pt,\n )\n else:\n dp_ht[dish.idx][cost_] = dp_ht[dish.idx - 1][cost_]\n\n for dish in reversed(dishes):\n for cost_ in range(t):\n if cost_ >= dish.cost:\n dp_th[dish.idx][cost_] = max(\n dp_th[dish.idx + 1][cost_],\n dp_th[dish.idx + 1][cost_ - dish.cost] + dish.pt,\n )\n else:\n dp_th[dish.idx][cost_] = dp_th[dish.idx + 1][cost_]\n\n ret = 0\n for last_dish in dishes:\n for cost_ in range(t):\n ret = max(\n ret,\n dp_ht[last_dish.idx - 1][cost_]\n + dp_th[last_dish.idx + 1][t - 1 - cost_]\n + last_dish.pt,\n )\n return ret\n\n\nprint(solve())\n","change":"replace","i1":1,"i2":22,"j1":1,"j2":46,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02863","language":"Python","original_status":"Time Limit Exceeded","pass":"N, T = map(int, input().split())\nAB = [list(map(int, input().split())) for _ in range(N)]\n\ndp = [-1] * (T + 3000)\ndp[0] = 0\nfor a, b in sorted(AB):\n for j in range(T - 1, -1, -1):\n if dp[j] == -1:\n continue\n if dp[j] + b > dp[j + a]:\n dp[j + a] = dp[j] + b\nprint(max(dp))\n","fail":"def main():\n N, T = map(int, input().split())\n AB = [list(map(int, input().split())) for _ in range(N)]\n\n dp = [-1] * (T + 3000)\n dp[0] = 0\n for a, b in sorted(AB):\n for j in range(T - 1, -1, -1):\n if dp[j] == -1:\n continue\n if dp[j] + b > dp[j + a]:\n dp[j + a] = dp[j] + b\n print(max(dp))\n\n\nmain()\n","change":"replace","i1":0,"i2":12,"j1":0,"j2":16,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02863","language":"Python","original_status":"Time Limit Exceeded","pass":"N, T = map(int, input().split())\nAB = [list(map(int, input().split())) for _ in range(N)]\n\ndp = [-1] * (T + 3000)\ndp[0] = 0\nc = 0\nfor a, b in sorted(AB):\n for j in range(c, -1, -1):\n if dp[j] == -1:\n continue\n t = dp[j] + b\n if dp[j + a] < t:\n dp[j + a] = t\n c = min(c + a, T - 1)\nprint(max(dp))\n","fail":"def main():\n N, T = map(int, input().split())\n AB = [list(map(int, input().split())) for _ in range(N)]\n\n dp = [-1] * (T + 3000)\n dp[0] = 0\n c = 0\n for a, b in sorted(AB):\n for j in range(c, -1, -1):\n if dp[j] == -1:\n continue\n t = dp[j] + b\n if dp[j + a] < t:\n dp[j + a] = t\n c = min(c + a, T - 1)\n print(max(dp))\n\n\nmain()\n","change":"replace","i1":0,"i2":15,"j1":0,"j2":19,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02863","language":"Python","original_status":"Runtime Error","pass":"n, t = map(int, input().split())\nx = [list(map(int, input().split())) for _ in range(n)]\na_max = max([y[1] for y in x])\n\ndp_pre = [0 for j in range(t + a_max)]\ndp = [0 for j in range(t + a_max)]\nfor ai, bi in x:\n for j in range(ai):\n dp[j] = dp_pre[j]\n for j in range(ai, t + ai):\n dp[j] = max(dp_pre[j], dp_pre[j - ai] + bi)\n for j in range(t + ai, t + a_max):\n dp[j] = dp_pre[j]\n dp_pre, dp = dp, dp_pre\nprint(max(dp_pre))\n","fail":"n, t = map(int, input().split())\nx = [list(map(int, input().split())) for _ in range(n)]\nx.sort()\na_max = x[-1][0]\n\ndp_pre = [0 for j in range(t + a_max)]\ndp = [0 for j in range(t + a_max)]\nfor ai, bi in x:\n for j in range(ai):\n dp[j] = dp_pre[j]\n for j in range(ai, t + ai):\n dp[j] = max(dp_pre[j], dp_pre[j - ai] + bi)\n for j in range(t + ai, t + a_max):\n dp[j] = dp_pre[j]\n dp_pre, dp = dp, dp_pre\nprint(max(dp_pre))\n","change":"replace","i1":2,"i2":3,"j1":2,"j2":4,"error":"0","stderr":null,"stdout":110.0} {"problem_id":"p02863","language":"Python","original_status":"Time Limit Exceeded","pass":"import copy\n\n\ndef main():\n n, t = map(int, input().split())\n f = [list(map(int, input().split())) for _ in range(n)]\n dp = [0 for i in range(t)]\n ls = [[] for i in range(t)]\n for i in range(n):\n for j in range(t - 1, -1, -1):\n if j - f[i][0] >= 0 and dp[j - f[i][0]] + f[i][1] > dp[j]:\n dp[j] = dp[j - f[i][0]] + f[i][1]\n ls[j] = copy.copy(ls[j - f[i][0]]) + [i]\n res = dp[t - 1]\n ll = ls[t - 1]\n fff = [0 for _ in range(n)]\n for sll in ll:\n fff[sll] = 1\n ff = [f[i][1] for i in range(n) if fff[i] == 0]\n if ff:\n return res + max(ff)\n else:\n return res\n\n\nprint(main())\n","fail":"def main():\n n, t = map(int, input().split())\n f = [list(map(int, input().split())) for _ in range(n)]\n dp1 = [[0 for i in range(t)] for j in range(n + 1)]\n dp2 = [[0 for i in range(t)] for j in range(n + 1)]\n for i in range(n):\n for j in range(t - 1, -1, -1):\n if j - f[i][0] >= 0:\n dp1[i + 1][j] = max(dp1[i][j - f[i][0]] + f[i][1], dp1[i][j])\n else:\n dp1[i + 1][j] = dp1[i][j]\n for i in range(n):\n for j in range(t - 1, -1, -1):\n if j - f[n - 1 - i][0] >= 0:\n dp2[i + 1][j] = max(\n dp2[i][j - f[n - 1 - i][0]] + f[n - 1 - i][1], dp2[i][j]\n )\n else:\n dp2[i + 1][j] = dp2[i][j]\n\n res = 0\n for i in range(n):\n for j in range(t):\n res = max(res, dp1[i][j] + f[i][1] + dp2[n - 1 - i][t - 1 - j])\n\n return res\n\n\nprint(main())\n","change":"replace","i1":0,"i2":23,"j1":0,"j2":26,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02866","language":"Python","original_status":"Runtime Error","pass":"LARGE = 998244353\n\n\ndef solve(n, d_list):\n cnt = [0] * (max(d_list) + 1)\n for i in range(n):\n cnt[d_list[i]] += 1\n if cnt[0] != 1 or d_list[0] != 0:\n return 0\n res = 1\n for i in range(max(d_list)):\n res *= pow(cnt[i], cnt[i + 1], LARGE)\n res %= LARGE\n return res\n\n\ndef main():\n n = int(input())\n d_list = list(map(int(input())))\n res = solve(n, d_list)\n print(res)\n\n\ndef test():\n assert solve(4, [0, 1, 1, 2]) == 2\n assert solve(4, [1, 1, 1, 1]) == 0\n assert solve(7, [0, 3, 2, 1, 2, 2, 1]) == 24\n\n\nif __name__ == \"__main__\":\n test()\n main()\n","fail":"LARGE = 998244353\n\n\ndef solve(n, d_list):\n cnt = [0] * (max(d_list) + 1)\n for i in range(n):\n cnt[d_list[i]] += 1\n if cnt[0] != 1 or d_list[0] != 0:\n return 0\n res = 1\n for i in range(max(d_list)):\n res *= pow(cnt[i], cnt[i + 1], LARGE)\n res %= LARGE\n return res\n\n\ndef main():\n n = int(input())\n d_list = list(map(int, input().split()))\n res = solve(n, d_list)\n print(res)\n\n\ndef test():\n assert solve(4, [0, 1, 1, 2]) == 2\n assert solve(4, [1, 1, 1, 1]) == 0\n assert solve(7, [0, 3, 2, 1, 2, 2, 1]) == 24\n\n\nif __name__ == \"__main__\":\n test()\n main()\n","change":"replace","i1":18,"i2":19,"j1":18,"j2":19,"error":"ValueError: invalid literal for int() with base 10: '0 1 1 2'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02866\/Python\/s784122479.py\", line 32, in \n main()\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02866\/Python\/s784122479.py\", line 19, in main\n d_list = list(map(int(input())))\nValueError: invalid literal for int() with base 10: '0 1 1 2'\n","stdout":null} {"problem_id":"p02873","language":"Python","original_status":"Time Limit Exceeded","pass":"from itertools import takewhile, islice\n\n\nS = input()\ntotal = 0\nfor idx in range(len(S) + 1):\n left = sum(1 for _ in takewhile(lambda x: x == \"<\", reversed(S[:idx])))\n right = sum(1 for _ in takewhile(lambda x: x == \">\", islice(S, idx, None)))\n total += max((left, right))\nprint(total)\n","fail":"S = input()\nA = [0 for _ in range(len(S) + 1)]\n\nfor idx in range(len(S)):\n if S[idx] == \"<\":\n A[idx + 1] = max(A[idx + 1], A[idx] + 1)\n\nfor idx in reversed(range(len(S))):\n if S[idx] == \">\":\n A[idx] = max(A[idx], A[idx + 1] + 1)\n\nprint(sum(A))\n","change":"replace","i1":0,"i2":10,"j1":0,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02874","language":"Python","original_status":"Runtime Error","pass":"#!\/usr\/bin\/env python3\nn = int(input())\np = sorted(list(map(int, input().split())) for _ in range(n))\n\nlmax = n - 1\nrmin = 0\nfor i in range(n):\n if p[i][1] <= p[rmin][1]:\n rmin = i\n\nans = 0\n\n# same(lmax, rmin)\ndmax = 0\nfor i in range(n):\n if i == lmax or i == rmin:\n continue\n if p[i][1] - p[i][0] > p[dmax][1] - p[dmax][0]:\n dmax = i\n d1 = max(0, p[rmin][1] - p[lmax][0] + 1)\n d2 = max(0, p[dmax][1] - p[dmax][0] + 1)\nans = max(ans, d1 + d2)\n\n# !same(lmax, rmin)\nm = lmax\nfor i in range(rmin, lmax)[::-1]:\n if p[i + 1][1] < p[m][1]:\n m = i + 1\n d1 = max(0, p[rmin][1] - p[i][0] + 1)\n d2 = max(0, p[m][1] - p[lmax][0] + 1)\n ans = max(ans, d1 + d2)\n\nprint(ans)\n","fail":"#!\/usr\/bin\/env python3\nn = int(input())\np = sorted(list(map(int, input().split())) for _ in range(n))\n\nlmax = n - 1\nrmin = 0\nfor i in range(n):\n if p[i][1] <= p[rmin][1]:\n rmin = i\n\nans = 0\n\n# same(lmax, rmin)\ndmax = 0\nfor i in range(n):\n if i == lmax or i == rmin:\n continue\n if p[i][1] - p[i][0] > p[dmax][1] - p[dmax][0]:\n dmax = i\nd1 = max(0, p[rmin][1] - p[lmax][0] + 1)\nd2 = max(0, p[dmax][1] - p[dmax][0] + 1)\nans = max(ans, d1 + d2)\n\n# !same(lmax, rmin)\nm = lmax\nfor i in range(rmin, lmax)[::-1]:\n if p[i + 1][1] < p[m][1]:\n m = i + 1\n d1 = max(0, p[rmin][1] - p[i][0] + 1)\n d2 = max(0, p[m][1] - p[lmax][0] + 1)\n ans = max(ans, d1 + d2)\n\nprint(ans)\n","change":"replace","i1":19,"i2":21,"j1":19,"j2":21,"error":0,"stderr":null,"stdout":6} {"problem_id":"p02875","language":"Python","original_status":"Time Limit Exceeded","pass":"def prepare(n, MOD):\n f = 1\n for m in range(1, n + 1):\n f *= m\n f %= MOD\n fn = f\n\n inv = pow(f, MOD - 2, MOD)\n invs = [1] * (n + 1)\n invs[n] = inv\n for m in range(n, 1, -1):\n inv *= m\n inv %= MOD\n invs[m - 1] = inv\n\n return fn, invs\n\n\nn = int(input())\nMOD = 998244353\nfn, invs = prepare(n, MOD)\nans = pow(3, n, MOD)\nimpossible = 0\nfor i in range(n \/\/ 2):\n tmp = fn * invs[i] * invs[n - i] % MOD * pow(2, i, MOD)\n impossible = (impossible + 2 * tmp) % MOD\nprint((ans - impossible) % MOD)\n","fail":"def prepare(n, MOD):\n f = 1\n for m in range(1, n + 1):\n f *= m\n f %= MOD\n fn = f\n\n inv = pow(f, MOD - 2, MOD)\n invs = [1] * (n + 1)\n invs[n] = inv\n for m in range(n, 1, -1):\n inv *= m\n inv %= MOD\n invs[m - 1] = inv\n\n return fn, invs\n\n\nn = int(input())\nMOD = 998244353\nfn, invs = prepare(n, MOD)\nans = pow(3, n, MOD)\nimpossible = 0\nmul = 2\nfor i in range(n \/\/ 2):\n tmp = fn * invs[i] * invs[n - i] % MOD * mul\n impossible = (impossible + tmp) % MOD\n mul = mul * 2 % MOD\nprint((ans - impossible) % MOD)\n","change":"replace","i1":23,"i2":26,"j1":23,"j2":28,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02879","language":"Python","original_status":"Runtime Error","pass":"a, b = map(int, input())\nif a >= 10 or b >= 10:\n print(int(a * b))\n\nelse:\n print(-1)\n","fail":"a, b = map(int, input().split())\n\nif max(a, b) <= 9:\n print(a * b)\nelse:\n print(-1)\n","change":"replace","i1":0,"i2":4,"j1":0,"j2":4,"error":"ValueError: invalid literal for int() with base 10: ' '","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02879\/Python\/s484894451.py\", line 1, in \n a, b = map(int, input())\nValueError: invalid literal for int() with base 10: ' '\n","stdout":null} {"problem_id":"p02879","language":"Python","original_status":"Runtime Error","pass":"S = list(input())\nif len(S) > 3:\n print(int(S[0]) * int(S[1]))\nelse:\n print(-1)\n","fail":"S = list(input())\nif len(S) < 4:\n print(int(S[0]) * int(S[-1]))\nelse:\n print(-1)\n","change":"replace","i1":1,"i2":3,"j1":1,"j2":3,"error":"WA","stderr":null,"stdout":-1.0} {"problem_id":"p02879","language":"Python","original_status":"Runtime Error","pass":"a, b = map(int, input())\n\nif 1 <= a <= 9 or 1 <= b <= 9:\n print(a * b)\nelse:\n print(-1)\n","fail":"a, b = map(int, input().split())\n\nif a >= 10 or b >= 10:\n print(-1)\n exit()\nprint(a * b)\n","change":"replace","i1":0,"i2":6,"j1":0,"j2":6,"error":"ValueError: invalid literal for int() with base 10: ' '","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02879\/Python\/s534078557.py\", line 1, in \n a, b = map(int, input())\nValueError: invalid literal for int() with base 10: ' '\n","stdout":null} {"problem_id":"p02879","language":"Python","original_status":"Runtime Error","pass":"a = int(input())\nb = int(input())\n\nif a >= 10 or b >= 10:\n print(-1)\nelse:\n print(a * b)\n","fail":"a, b = map(int, input().split())\n\nif a >= 10 or b >= 10:\n print(-1)\nelse:\n print(a * b)\n","change":"replace","i1":0,"i2":2,"j1":0,"j2":1,"error":"ValueError: invalid literal for int() with base 10: '2 5'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02879\/Python\/s727358727.py\", line 1, in \n a = int(input())\nValueError: invalid literal for int() with base 10: '2 5'\n","stdout":null} {"problem_id":"p02880","language":"Python","original_status":"Runtime Error","pass":"n = int(input())\nif n > 81:\n print(\"No\")\nelse:\n is_ok = False\n for x in range(1, 10):\n if n % x == 0 and n \/\/ x <= 9:\n is_ok = True\n break\n\nif is_ok:\n print(\"Yes\")\nelse:\n print(\"No\")\n","fail":"n = int(input())\nif n > 81:\n print(\"No\")\nelse:\n is_ok = False\n for x in range(1, 10):\n if n % x == 0 and n \/\/ x <= 9:\n is_ok = True\n break\n if is_ok:\n print(\"Yes\")\n else:\n print(\"No\")\n","change":"replace","i1":9,"i2":14,"j1":9,"j2":13,"error":"0","stderr":null,"stdout":"Yes\n"} {"problem_id":"p02880","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\nlist = list(range(9, 1, -1))\nans = 0\nflag = 1\n\nif n > 1:\n while n > 1:\n for i in list:\n if n % i == 0:\n n = n \/ i\n ans += 1\n flag = 0\n break\n\n if flag == 1:\n ans = 0\n break\nelif n == 1:\n ans = 2\n\nif 0 < ans <= 2:\n print(\"Yes\")\nelse:\n print(\"No\")\n","fail":"n = int(input())\nlist = list(range(9, 1, -1))\nans = 0\n\nif n > 1:\n while n > 1:\n flag = 1\n for i in list:\n if n % i == 0:\n n = n \/ i\n ans += 1\n flag = 0\n break\n\n if flag == 1:\n ans = 0\n break\nelif n == 1:\n ans = 2\n\nif 0 < ans <= 2:\n print(\"Yes\")\nelse:\n print(\"No\")\n","change":"replace","i1":3,"i2":7,"j1":3,"j2":7,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02881","language":"Python","original_status":"Runtime Error","pass":"#!\/usr\/bin\/env python3\nimport sys\nfrom sympy.ntheory import factorint\nimport numpy as np\n\n\ndef solve(N: int):\n\n fct = factorint(N)\n\n fct_list = []\n for key, item in zip(fct.keys(), fct.values()):\n fct_list += [key] * item\n\n result = 1e12\n\n if len(fct_list) == 2:\n x = fct_list[0]\n y = fct_list[1]\n print(x - 1 + y - 1)\n elif len(fct_list) == 1:\n x = fct_list[0]\n y = 1\n print(x - 1 + y - 1)\n\n else:\n for i in range(1, len(fct_list) - 1):\n\n x = np.prod(fct_list[: i + 1])\n y = np.prod(fct_list[i + 1 :])\n\n result = min(result, x - 1 + y - 1)\n print(result)\n return\n\n\ndef main():\n def iterate_tokens():\n for line in sys.stdin:\n for word in line.split():\n yield word\n\n tokens = iterate_tokens()\n N = int(next(tokens)) # type: int\n solve(N)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"#!\/usr\/bin\/env python3\nimport sys\nimport numpy as np\n\n\ndef solve(N: int):\n result_list = []\n for i in range(1, int(np.sqrt(N)) + 1):\n if N % i == 0:\n result_list.append(i - 1 + N \/\/ i - 1)\n else:\n pass\n print(min(result_list))\n return\n\n\ndef main():\n def iterate_tokens():\n for line in sys.stdin:\n for word in line.split():\n yield word\n\n tokens = iterate_tokens()\n N = int(next(tokens)) # type: int\n solve(N)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":2,"i2":33,"j1":2,"j2":13,"error":"ImportError: libgfortran-040039e1.so.5.0.0: failed to map segment from shared object","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/.venv\/lib\/python3.10\/site-packages\/numpy\/core\/__init__.py\", line 23, in \n from . import multiarray\n File \"\/home\/alex\/Documents\/bug-detection\/.venv\/lib\/python3.10\/site-packages\/numpy\/core\/multiarray.py\", line 10, in \n from . import overrides\n File \"\/home\/alex\/Documents\/bug-detection\/.venv\/lib\/python3.10\/site-packages\/numpy\/core\/overrides.py\", line 8, in \n from numpy.core._multiarray_umath import (\nImportError: libgfortran-040039e1.so.5.0.0: failed to map segment from shared object\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02881\/Python\/s328405909.py\", line 4, in \n import numpy as np\n File \"\/home\/alex\/Documents\/bug-detection\/.venv\/lib\/python3.10\/site-packages\/numpy\/__init__.py\", line 139, in \n from . import core\n File \"\/home\/alex\/Documents\/bug-detection\/.venv\/lib\/python3.10\/site-packages\/numpy\/core\/__init__.py\", line 49, in \n raise ImportError(msg)\nImportError: \n\nIMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!\n\nImporting the numpy C-extensions failed. This error can happen for\nmany reasons, often due to issues with your setup or how NumPy was\ninstalled.\n\nWe have compiled some common reasons and troubleshooting tips at:\n\n https:\/\/numpy.org\/devdocs\/user\/troubleshooting-importerror.html\n\nPlease note and check the following:\n\n * The Python version is: Python3.10 from \"\/home\/alex\/Documents\/bug-detection\/.venv\/bin\/python3\"\n * The NumPy version is: \"1.25.1\"\n\nand make sure that they are the versions you expect.\nPlease carefully study the documentation linked above for further help.\n\nOriginal error was: libgfortran-040039e1.so.5.0.0: failed to map segment from shared object\n\n","stdout":null} {"problem_id":"p02881","language":"Python","original_status":"Runtime Error","pass":"N = int(input())\nret = []\nfor i in range(1, N):\n for j in range(i, N):\n if i * j == N:\n ret.append(i + j - 2)\nprint(min(ret))\n","fail":"from math import sqrt\n\nN = int(input())\n\nfor i in range(int(sqrt(N) + 1), -1, -1):\n if N % i == 0:\n print((i - 1) + (N \/\/ i - 1))\n break\n","change":"replace","i1":0,"i2":7,"j1":0,"j2":8,"error":"0","stderr":null,"stdout":5.0} {"problem_id":"p02883","language":"Python","original_status":"Time Limit Exceeded","pass":"def is_good(mid, key):\n return sum(max(0, a - mid \/\/ f) for a, f in zip(A, F)) <= key\n\n\ndef binary_search(bad, good, key):\n while good - bad > 1:\n mid = (bad + good) \/\/ 2\n if is_good(mid, key):\n good = mid\n else:\n bad = mid\n return good\n\n\nN, K = map(int, input().split())\nA = list(map(int, input().split()))\nF = list(map(int, input().split()))\nA.sort()\nF.sort(reverse=True)\nA_sum = sum(A)\nans = binary_search(-1, max(a * f for a, f in zip(A, F)), K)\nprint(ans)\n","fail":"import numpy as np\n\n\ndef is_good(mid, key):\n return A_sum - np.minimum(A, mid \/\/ F).sum() <= key\n\n\ndef binary_search(bad, good, key):\n while good - bad > 1:\n mid = (bad + good) \/\/ 2\n if is_good(mid, key):\n good = mid\n else:\n bad = mid\n return good\n\n\nN, K = map(int, input().split())\nA = np.array(input().split(), dtype=np.int64)\nF = np.array(input().split(), dtype=np.int64)\nA.sort()\nF[::-1].sort()\nA_sum = A.sum()\nans = binary_search(-1, np.max(A * F), K)\nprint(ans)\n","change":"replace","i1":0,"i2":21,"j1":0,"j2":24,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02883","language":"Python","original_status":"Time Limit Exceeded","pass":"from heapq import heappush, heappushpop, heappop\n\nN, K = map(int, input().split())\nA = list(map(lambda x: -int(x), input().split()))\nF = list(map(int, input().split()))\nA.sort()\nF.sort()\n\n\nhq = []\nfor a, f in zip(A, F):\n heappush(hq, (a * f, f))\n\nc, f = heappop(hq)\nwhile K > 0:\n c += f\n K -= 1\n c, f = heappushpop(hq, (c, f))\n\nprint(-c)\n","fail":"N, K = map(int, input().split())\nA = list(map(int, input().split()))\nF = list(map(int, input().split()))\nA.sort(reverse=True)\nF.sort()\n\nC = [None] * N\nfor i, (a, f) in enumerate(zip(A, F)):\n C[i] = (a * f, f)\n\n\ndef solve(x):\n global K, N\n t = 0\n for c, f in C:\n temp = ((c - x) + f - 1) \/\/ f\n t += max(0, temp)\n if t > K:\n result = False\n break\n else:\n result = True\n return result\n\n\nok = A[0] * F[N - 1]\nng = -1\nwhile abs(ok - ng) > 1:\n mid = (ok + ng) \/\/ 2\n if solve(mid):\n ok = mid\n else:\n ng = mid\n\n\nprint(ok)\n","change":"replace","i1":0,"i2":20,"j1":0,"j2":36,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02883","language":"Python","original_status":"Time Limit Exceeded","pass":"#!\/usr\/bin\/env python3\n\n\ndef is_ok(mid, K, A, F):\n used = 0\n for a, f in zip(A, F):\n upper = int(mid \/ f)\n if upper < a:\n used += a - upper\n if K < used:\n return False\n return True\n\n\ndef main():\n N, K = input_line(int, int)\n A = input_line([int])\n F = input_line([int])\n A.sort()\n F.sort(reverse=True)\n\n ng = -1\n ok = int(1e12)\n while ok - ng > 1:\n mid = (ng + ok) \/\/ 2\n if is_ok(mid, K, A, F):\n ok = mid\n else:\n ng = mid\n print(ok)\n\n\ndef input_line(*types):\n if isinstance(types[0], list):\n return list(map(types[0][0], input().split()))\n elif len(types) == 1:\n return types[0](input())\n else:\n return [t(x) for t, x in zip(types, input().split())]\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"#!\/usr\/bin\/env python3\nimport numpy as np\n\n\ndef is_ok(mid, K, A, F):\n return np.maximum(A - mid \/\/ F, 0).sum() <= K\n\n\ndef main():\n N, K = input_line(int, int)\n A = input_line([int])\n F = input_line([int])\n A = np.array(sorted(A))\n F = np.array(sorted(F, reverse=True))\n\n ng = -1\n ok = int(1e12)\n while ok - ng > 1:\n mid = (ng + ok) \/\/ 2\n if is_ok(mid, K, A, F):\n ok = mid\n else:\n ng = mid\n print(ok)\n\n\ndef input_line(*types):\n if isinstance(types[0], list):\n return [types[0][0](x) for x in input().split()]\n elif len(types) == 1:\n return types[0](input())\n else:\n return [t(x) for t, x in zip(types, input().split())]\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":1,"i2":35,"j1":1,"j2":29,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02883","language":"Python","original_status":"Time Limit Exceeded","pass":"def is_ok(x, A, F):\n trainings = 0\n for i in range(N):\n t = A[i] - x \/\/ F[i]\n if t > 0:\n trainings += t\n return trainings <= K\n\n\nN, K = map(int, input().split())\nA = list(map(int, input().split()))\nF = list(map(int, input().split()))\n\nA.sort()\nF.sort(reverse=True)\n\nng = -1\nok = A[-1] * F[0]\nwhile ok - ng > 1:\n m = ng + (ok - ng) \/\/ 2\n if is_ok(m, A, F):\n ok = m\n else:\n ng = m\nprint(ok)\n","fail":"def is_ok(x):\n trainings = 0\n for i in range(N):\n t = A[i] - x \/\/ F[i]\n if t > 0:\n trainings += t\n return trainings <= K\n\n\nN, K = map(int, input().split())\nA = list(map(int, input().split()))\nF = list(map(int, input().split()))\n\nA.sort()\nF.sort(reverse=True)\n\nng = -1\nok = A[-1] * F[0]\nwhile ok - ng > 1:\n m = ng + (ok - ng) \/\/ 2\n if is_ok(m):\n ok = m\n else:\n ng = m\nprint(ok)\n","change":"replace","i1":0,"i2":21,"j1":0,"j2":21,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02884","language":"Python","original_status":"Time Limit Exceeded","pass":"import sys\n\nimport numpy as np\n\nn, m = map(int, input().split())\nlinks = [[] for _ in range(n)]\nfor line in sys.stdin:\n s, t = map(int, line.split())\n s -= 1\n t -= 1\n links[s].append(t)\n\nnot_omitted = np.zeros(n, dtype=np.float64)\nfor j in range(n - 2, -1, -1):\n exp = not_omitted[links[j]]\n not_omitted[j] = exp.mean() + 1\n\nans = not_omitted[0]\n\nfor i in range(n - 1):\n expected = not_omitted.copy()\n\n exp = expected[links[i]]\n if exp.size == 1:\n expected[i] = exp.mean() + 1\n else:\n expected[i] = (exp.sum() - exp.max()) \/ (exp.size - 1) + 1\n\n for j in range(i - 1, -1, -1):\n exp = expected[links[j]]\n expected[j] = exp.mean() + 1\n\n ans = min(ans, expected[0])\n\nprint(ans)\n","fail":"import sys\n\nn, m = map(int, input().split())\nlinks = [set() for _ in range(n)]\ncounts = [0] * n\nfor line in sys.stdin:\n s, t = map(int, line.split())\n s -= 1\n t -= 1\n links[s].add(t)\n counts[s] += 1\n\nnot_omitted = [0.0] * n\nexp_get = not_omitted.__getitem__\nfor j in range(n - 2, -1, -1):\n not_omitted[j] = sum(map(exp_get, links[j])) \/ counts[j] + 1\n\nans = 1e6\n\nfor i in range(n - 1):\n expected = [0.0] * n\n expected[i + 1 :] = not_omitted[i + 1 :]\n e_get = expected.__getitem__\n\n if counts[i] == 1:\n expected[i] = sum(map(e_get, links[i])) \/ counts[i] + 1\n else:\n exp = list(map(e_get, links[i]))\n expected[i] = (sum(exp) - max(exp)) \/ (counts[i] - 1) + 1\n\n for j in range(i - 1, -1, -1):\n expected[j] = sum(map(e_get, links[j])) \/ counts[j] + 1\n\n ans = min(ans, expected[0])\n\nprint(ans)\n","change":"replace","i1":2,"i2":31,"j1":2,"j2":32,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02885","language":"Python","original_status":"Runtime Error","pass":"A = int(input())\nB = int(input())\n\nremain = max(0, A - B * 2)\n\nprint(remain)\n","fail":"data = input().split()\nA = int(data[0])\nB = int(data[1])\n\nremain = max(0, A - B * 2)\n\nprint(remain)\n","change":"replace","i1":0,"i2":2,"j1":0,"j2":3,"error":"ValueError: invalid literal for int() with base 10: '12 4'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02885\/Python\/s165633108.py\", line 1, in \n A = int(input())\nValueError: invalid literal for int() with base 10: '12 4'\n","stdout":null} {"problem_id":"p02885","language":"Python","original_status":"Runtime Error","pass":"a = int(input())\nb = int(input())\n\nif a > b * 2:\n print(a - b * 2)\nelse:\n print(0)\n","fail":"list = input().split()\n\na = int(list[0])\nb = int(list[1])\n\nif a > b * 2:\n print(a - b * 2)\nelse:\n print(0)\n","change":"replace","i1":0,"i2":2,"j1":0,"j2":4,"error":"ValueError: invalid literal for int() with base 10: '12 4'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02885\/Python\/s894876689.py\", line 1, in \n a = int(input())\nValueError: invalid literal for int() with base 10: '12 4'\n","stdout":null} {"problem_id":"p02885","language":"Python","original_status":"Runtime Error","pass":"a = int(input())\nb = int(input())\n\nans = a \/\/ (b * 2)\n\nif ans <= 0:\n ans = 0\n\nprint(ans)\n","fail":"a, b = map(int, input().split())\nans = a - (b * 2)\n\nif ans <= 0:\n ans = 0\n\nprint(ans)\n","change":"replace","i1":0,"i2":4,"j1":0,"j2":2,"error":"ValueError: invalid literal for int() with base 10: '12 4'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02885\/Python\/s927098253.py\", line 1, in \n a = int(input())\nValueError: invalid literal for int() with base 10: '12 4'\n","stdout":null} {"problem_id":"p02887","language":"Python","original_status":"Runtime Error","pass":"N, *D = map(int, open(0).read().split())\n\nans = 0\nfor i in range(N):\n for j in range(i + 1, N):\n ans += D[i] * D[j]\n\nprint(ans)\n","fail":"from itertools import groupby\n\nN = int(input())\nS = input()\n\nG = [len(tuple(v)) for k, v in groupby(S)]\nprint(len(G))\n","change":"replace","i1":0,"i2":8,"j1":0,"j2":7,"error":"ValueError: invalid literal for int() with base 10: 'aabbbbaaca'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02887\/Python\/s984716346.py\", line 1, in \n N, *D = map(int, open(0).read().split())\nValueError: invalid literal for int() with base 10: 'aabbbbaaca'\n","stdout":null} {"problem_id":"p02887","language":"Python","original_status":"Runtime Error","pass":"#!\/usr\/bin\/env python3\nimport sys\nimport re\n\n\ndef solve(N: int, S: str):\n result = 0\n for s in set(S):\n regex = re.compile(f\"{s}+\")\n # print(regex.findall(S))\n result += len(regex.findall(S))\n print(result)\n\n return\n\n\ndef main():\n def iterate_tokens():\n for line in sys.stdin:\n for word in line.split():\n yield word\n\n tokens = iterate_tokens()\n N = int(next(tokens)) # type: int\n S = next(tokens) # type: str\n solve(N, S)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"#!\/usr\/bin\/env python3\nimport sys\nimport re\n\n\ndef solve(N: int, S: str):\n result = 0\n for s in set(S):\n regex = re.compile(s + \"+\")\n # print(regex.findall(S))\n result += len(regex.findall(S))\n print(result)\n\n return\n\n\ndef main():\n def iterate_tokens():\n for line in sys.stdin:\n for word in line.split():\n yield word\n\n tokens = iterate_tokens()\n N = int(next(tokens)) # type: int\n S = next(tokens) # type: str\n solve(N, S)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":8,"i2":9,"j1":8,"j2":9,"error":"0","stderr":null,"stdout":5.0} {"problem_id":"p02888","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nL = sorted(map(int, input().split()))\nans = 0\nfor i in range(N - 2):\n for j in range(i + 1, N - 1):\n for k in range(j + 1, N):\n if L[k] < L[i] + L[j]:\n ans += 1\nprint(ans)\n","fail":"import bisect\n\nN = int(input())\nL = sorted(map(int, input().split()))\nans = 0\nfor i in range(N - 2):\n for j in range(i + 1, N - 1):\n k = bisect.bisect_left(L, L[i] + L[j])\n if k > j:\n ans += k - j - 1\nprint(ans)\n","change":"replace","i1":0,"i2":8,"j1":0,"j2":10,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02888","language":"Python","original_status":"Time Limit Exceeded","pass":"#!\/usr\/bin\/env python3\nimport bisect\n\n\nN = int(input().split()[0])\nl_list = list(map(int, input().split()))\nl_list = sorted(l_list)\np_list = []\n\nfor a_i, a in enumerate(l_list):\n for b_i, b in enumerate(l_list):\n if a_i == b_i:\n continue\n\n c_kouho = a + b\n c_i = bisect.bisect_left(l_list, c_kouho)\n p_list += [\n sorted([a, b, c])\n for c_i, c in enumerate(l_list[: c_i + 1])\n if c_i != a_i and c_i != b_i and abs(b - c) < a < b + c\n ]\n\np_list = [\"{}_{}_{}\".format(p[0], p[1], p[2]) for p in p_list]\nans = len(set(p_list))\n\nprint(ans)\n","fail":"#!\/usr\/bin\/env python3\nimport bisect\n\n\nN = int(input().split()[0])\nl_list = list(map(int, input().split()))\nl_list = sorted(l_list)\ntotal = 0\n\nfor a_i, a in enumerate(l_list):\n # \u4e00\u756a\u9577\u3044\u8fba\u3092\u56fa\u5b9a\n for b_i, b in enumerate(l_list[:a_i]):\n # 2\u756a\u76ee\u306b\u9577\u3044\u8fba\u3092\u56fa\u5b9a\n c_i = bisect.bisect_right(l_list, abs(a - b))\n total += max(b_i - c_i, 0)\n\nans = total\nprint(ans)\n","change":"replace","i1":7,"i2":25,"j1":7,"j2":17,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02888","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\nL = list(map(int, input().split()))\nL.sort()\nans = 0\nfor i in range(n - 2):\n a = L[i]\n for j in range(i + 1, n - 1):\n b = L[j]\n for k in range(j + 1, n):\n c = L[k]\n if c >= a + b:\n break\n ans += 1\nprint(ans)\n","fail":"n = int(input())\nL = list(map(int, input().split()))\nL.sort()\nans = 0\nfor i in range(n - 2):\n a = L[i]\n k = i\n for j in range(i + 1, n - 1):\n b = L[j]\n while k < n and L[k] < a + b:\n k += 1\n ans += k - (j + 1)\nprint(ans)\n","change":"replace","i1":6,"i2":13,"j1":6,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02888","language":"Python","original_status":"Time Limit Exceeded","pass":"from itertools import combinations\n\n\nN = int(input())\nL = list(map(int, input().split()))\nL.sort()\n\nans = 0\nfor a, b, c in combinations(L, 3):\n if c < a + b:\n ans += 1\n\nprint(ans)\n","fail":"from bisect import bisect_left, bisect_right\n\nN = int(input())\nL = list(map(int, input().split()))\nL.sort()\n\nans = 0\nfor i in range(N):\n for j in range(i + 1, N):\n ans += bisect_left(L, L[i] + L[j]) - j - 1\n\nprint(ans)\n","change":"replace","i1":0,"i2":11,"j1":0,"j2":10,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02888","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\n\nL = list(sorted(map(int, input().split()), key=lambda x: -x))\n\nret = 0\n\n\ndef is_ok(a, b, c):\n return a < b + c and b < a + c and c < a + b\n\n\nfor i in range(N - 2):\n for j in range(i + 1, N - 1):\n p = j + 1\n q = N + 1\n while q - p > 2:\n k = (p + q) \/\/ 2\n if is_ok(L[i], L[j], L[k]):\n p = k\n else:\n q = k\n\n if is_ok(L[i], L[j], L[p]):\n ret += p - j\n\nprint(ret)\n","fail":"from bisect import bisect_left\n\nN = int(input())\nL = list(sorted(map(int, input().split())))\n\nres = 0\n\nfor i in range(N):\n for j in range(i + 1, N):\n k = bisect_left(L, L[i] + L[j])\n\n res += k - j - 1\n\nprint(res)\n","change":"replace","i1":0,"i2":26,"j1":0,"j2":14,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02888","language":"Python","original_status":"Time Limit Exceeded","pass":"from sys import stdin\n\nN = int(stdin.readline().rstrip())\nL = [int(x) for x in stdin.readline().rstrip().split()]\nans = 0\nL.sort()\n\nfor i in range(2, N):\n for j in range(1, i):\n for k in range(j):\n if L[j] + L[k] > L[i]:\n ans += 1\n\nprint(ans)\n","fail":"from sys import stdin\nimport bisect\n\nN = int(stdin.readline().rstrip())\nL = [int(x) for x in stdin.readline().rstrip().split()]\nans = 0\nL.sort()\nfor i in range(1, N):\n for j in range(i):\n ans += max(bisect.bisect_left(L, L[i] + L[j]) - i - 1, 0)\n\nprint(ans)\n","change":"replace","i1":1,"i2":12,"j1":1,"j2":10,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02888","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nL = list(map(int, input().split()))\nL.sort()\ncnt = 0\nfor i in range(N - 2):\n for j in range(i + 1, N - 1):\n left = j\n right = N\n v = L[i] + L[j]\n while right - left > 1:\n mid = (left + right) \/\/ 2\n if L[mid] < v:\n left = mid\n else:\n right = mid\n cnt += left - j\nprint(cnt)\n","fail":"import bisect\n\nN = int(input())\nL = sorted(list(map(int, input().split())))\ncnt = 0\nfor i in range(N - 2):\n for j in range(i + 1, N - 1):\n a = L[i]\n b = L[j]\n v = bisect.bisect_left(L, a + b)\n cnt += v - j - 1\nprint(cnt)\n","change":"replace","i1":0,"i2":16,"j1":0,"j2":11,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02888","language":"Python","original_status":"Time Limit Exceeded","pass":"import bisect\n\nN = int(input())\nL = list(map(int, input().split()))\nassert len(L) == N\n\nL.sort()\n\nn = 0\n\n# Choose two edges\nfor i in range(N):\n for j in range(i + 1, N):\n a = L[i] + L[j]\n k = bisect.bisect_left(L, a, lo=j + 1)\n # assert all(v < a for v in L[:k]) and all(v >= a for v in L[k:])\n # the number of candidates of the third edge\n n += k - (j + 1)\n\nprint(n)\n","fail":"import bisect\n\nN = int(input())\nL = list(map(int, input().split()))\nassert len(L) == N\n\nL.sort()\n\nn = 0\n# Choose two edges\nfor i in range(N):\n for j in range(i + 1, N):\n a = L[i] + L[j]\n k = bisect.bisect_left(L, a, lo=j + 1)\n # assert all(v < a for v in L[:k]) and all(v >= a for v in L[k:])\n # the number of candidates of the third edge\n n += k - (j + 1)\n\nprint(n)\n","change":"delete","i1":9,"i2":10,"j1":9,"j2":9,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02888","language":"Python","original_status":"Time Limit Exceeded","pass":"import collections\n\nN = int(input())\nL = [int(i) for i in input().split()]\nc = collections.Counter(L)\n\nans = 0\nfor i in c:\n for j in c:\n for k in c:\n if i + j <= k or j + k <= i or k + i <= j or i > j or j > k:\n continue\n if i == j and j == k:\n ans += c[i] * (c[i] - 1) * (c[i] - 2) \/ 6\n elif i == j:\n ans += c[k] * c[i] * (c[i] - 1) \/ 2\n elif j == k:\n ans += c[i] * c[j] * (c[j] - 1) \/ 2\n elif i == k:\n ans += c[j] * c[i] * (c[i] - 1) \/ 2\n else:\n ans += c[i] * c[j] * c[k]\nprint(int(ans))\n","fail":"import collections\n\nN = int(input())\nL = [int(i) for i in input().split()]\nM = max(L)\nc = collections.Counter(L)\nli = [c[i] for i in range(M + 1)]\n\nans = 0\nfor i in range(1, M + 1):\n for j in range(i, M + 1):\n if i == j:\n ans += int(li[i] * (li[i] - 1) * (li[i] - 2) \/ 6)\n ans += int(sum(li[j + 1 : min(M + 1, i + j)]) * li[i] * (li[i] - 1) \/ 2)\n else:\n ans += int(li[i] * li[j] * (li[j] - 1) \/ 2)\n ans += li[i] * li[j] * sum(li[j + 1 : min(M + 1, i + j)])\nprint(int(ans))\n","change":"replace","i1":4,"i2":22,"j1":4,"j2":17,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02888","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nL = list(map(int, input().split()))\nL.sort()\nans = 0\nfor i in range(N - 2):\n for j in range(i + 1, N - 1):\n for k in range(j + 1, N):\n if L[i] + L[j] <= L[k]:\n break\n ans += 1\nprint(ans)\n","fail":"import bisect\n\nN = int(input())\nL = list(map(int, input().split()))\nL.sort()\nans = 0\nfor i in range(N - 2):\n for j in range(i + 1, N - 1):\n index = bisect.bisect_left(L, L[i] + L[j])\n ans += max(0, index - j - 1)\nprint(ans)\n","change":"replace","i1":0,"i2":10,"j1":0,"j2":10,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02888","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nLs = list(map(int, input().split()))\n\nLs.sort()\nS = 0\nfor i in range(N - 2):\n A = Ls[i]\n for j in range(i + 1, N - 1):\n B = Ls[j]\n for k in range(j + 1, N):\n C = Ls[k]\n if A + B <= C:\n break\n else:\n S += 1\nprint(S)\n","fail":"import bisect\n\nN = int(input())\nLs = list(map(int, input().split()))\n\nLs.sort()\nS = 0\nfor i in range(N - 2):\n A = Ls[i]\n for j in range(i + 1, N - 1):\n B = Ls[j]\n k = bisect.bisect_left(Ls, A + B, j + 1)\n S += k - j - 1\nprint(S)\n","change":"replace","i1":0,"i2":15,"j1":0,"j2":13,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02888","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\nL = list(map(int, input().split()))\nL.sort()\nans = 0\nfor i in range(n - 2):\n a = L[i]\n for j in range(i + 1, n - 1):\n b = L[j]\n for k in range(j + 1, n):\n c = L[k]\n if c < a + b:\n ans += 1\n else:\n break\nprint(ans)\n","fail":"import bisect\n\nn = int(input())\nL = list(map(int, input().split()))\nL.sort()\nans = 0\nfor i in range(n - 2):\n a = L[i]\n for j in range(i + 1, n - 1):\n b = L[j]\n k = bisect.bisect_left(L[j + 1 :], a + b)\n ans += k\nprint(ans)\n","change":"replace","i1":0,"i2":14,"j1":0,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02888","language":"Python","original_status":"Time Limit Exceeded","pass":"from bisect import bisect_left\nfrom functools import lru_cache\n\nn = int(input())\nlll = list(map(int, input().split()))\nlll.sort()\nans = 0\n\n\n@lru_cache()\ndef bisect_left_cache(x):\n return bisect_left(lll, x)\n\n\nfor i in range(n - 2):\n li = lll[i]\n for j in range(i + 1, n - 1):\n k = bisect_left_cache(li + lll[j])\n ans += k - j - 1\nprint(ans)\n","fail":"from bisect import bisect_left\n\nn = int(input())\nlll = list(map(int, input().split()))\nlll.sort()\nans = 0\n\n\ndef get_bisect_left():\n cache = {}\n\n def _f(x):\n if x in cache:\n return cache[x]\n cache[x] = bisect_left(lll, x)\n return cache[x]\n\n return _f\n\n\nbisect_left_cache = get_bisect_left()\n\nfor i in range(n - 2):\n li = lll[i]\n for j in range(i + 1, n - 1):\n k = bisect_left_cache(li + lll[j])\n ans += k - j - 1\nprint(ans)\n","change":"replace","i1":1,"i2":13,"j1":1,"j2":21,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02888","language":"Python","original_status":"Time Limit Exceeded","pass":"import itertools\n\n\ndef main():\n _ = int(input())\n L = list(map(int, input().split()))\n\n comb = itertools.combinations(L, 3)\n\n ans = 0\n dp = []\n for v in comb:\n if dp.__contains__(sum(v)):\n ans += 1\n elif v[0] < v[1] + v[2] and v[1] < v[2] + v[0] and v[2] < v[0] + v[1]:\n ans += 1\n dp.append(sum(v))\n\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"import bisect\n\n\ndef main():\n N = int(input())\n L = list(map(int, input().split()))\n L.sort()\n\n ans = 0\n for i in range(N - 2):\n for j in range(i + 1, N - 1):\n index = bisect.bisect_left(L, L[i] + L[j]) - j - 1\n ans += index\n\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":0,"i2":17,"j1":0,"j2":13,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02888","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\nli = list(map(int, input().split()))\n\nans = 0\nfor i in range(n - 2):\n for j in range(i + 1, n - 1):\n for k in range(j + 1, n):\n if li[i] < li[j] + li[k] and li[j] < li[k] + li[i] and li[k] < li[i] + li[j]:\n # print(li[i], li[j], li[k])\n ans += 1\n\nprint(ans)\n","fail":"import bisect\n\nn = int(input())\nli = sorted(list(map(int, input().split())))\nans = 0\nfor i in range(n - 2):\n for j in range(i + 1, n - 1):\n ans += bisect.bisect_left(li, li[i] + li[j]) - j - 1\nprint(ans)\n","change":"replace","i1":0,"i2":11,"j1":0,"j2":8,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02888","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nL = sorted(list(map(int, input().split())))\nans = 0\nfor i in range(N):\n for j in range(i + 1, N):\n for k in range(j + 1, N):\n if L[i] < L[j] + L[k] and L[j] < L[k] + L[i] and L[k] < L[i] + L[j]:\n ans += 1\nprint(ans)\n","fail":"from bisect import bisect_left\n\nn = int(input())\nl = sorted(list(map(int, input().split())))\nans = 0\n\n# a 1:\n mid = (l + r) \/\/ 2\n if predicate(mid):\n r = mid\n else:\n l = mid\n\n return r\n\n\nfor k in range(1, n + 1):\n print(bisec(n + 1, 0, lambda x: x * k <= ax[min(x, max_take)]))\n","change":"replace","i1":1,"i2":22,"j1":1,"j2":48,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02891","language":"Python","original_status":"Runtime Error","pass":"from itertools import groupby\n\ns = input()\nk = int(input())\na = [sum(1 for _ in g) for _, g in groupby(s)]\nif s[0] == s[-1]:\n a[0] += a.pop()\nprint(sum(x \/\/ 2 for x in a) * k)\n","fail":"from itertools import groupby\n\ns = input()\nk = int(input())\na = [sum(1 for _ in g) for _, g in groupby(s)]\nif len(a) == 1:\n print(len(s) * k \/\/ 2)\nelse:\n x, y = a[0], a[-1]\n b = (x + y) \/\/ 2 if s[0] == s[-1] else x \/\/ 2 + y \/\/ 2\n print(x \/\/ 2 + y \/\/ 2 + sum(x \/\/ 2 for x in a[1:-1]) * k + b * (k - 1))\n","change":"replace","i1":5,"i2":8,"j1":5,"j2":11,"error":"0","stderr":null,"stdout":"4\n"} {"problem_id":"p02891","language":"Python","original_status":"Runtime Error","pass":"S = input()\nN = len(S)\nK = int(input())\n\ni = 0\nT = []\nU = []\nwhile i <= N - 1:\n if i == N - 1:\n T.append(S[-1])\n if S[-2] == S[-1]:\n U.append(\"?\")\n else:\n U.append(S[-1])\n break\n if S[i] == S[i + 1]:\n T.append(S[i] + \"?\")\n U.append(\"?\" + S[i])\n i += 2\n else:\n T.append(S[i])\n U.append(S[i])\n i += 1\n\nT = \"\".join(T)\nU = \"\".join(U)\nif T[0] == T[-1]:\n print((K + 1) \/\/ 2 * T.count(\"?\") + K \/\/ 2 * U.count(\"?\"))\nelse:\n print(K * T.count(\"?\"))\n","fail":"def run_length_compress(S):\n res = [[S[0], 1]]\n for c in S[1:]:\n if c == res[-1][0]:\n res[-1][1] += 1\n else:\n res.append([c, 1])\n return res\n\n\nS = input()\nN = len(S)\nK = int(input())\nT = run_length_compress(S)\nif T[0][1] == N:\n print(N * K \/\/ 2)\n exit()\nans = sum(l \/\/ 2 for _, l in T) * K\nif T[0][0] == T[-1][0]:\n head, tail = T[0][1], T[-1][1]\n ans += ((head + tail) \/\/ 2 - head \/\/ 2 - tail \/\/ 2) * (K - 1)\nprint(ans)\n","change":"replace","i1":0,"i2":30,"j1":0,"j2":22,"error":"0","stderr":null,"stdout":"4\n"} {"problem_id":"p02891","language":"Python","original_status":"Runtime Error","pass":"def main():\n S = input()\n K = int(input())\n ans = 0\n\n if S[0] is S[-1]:\n length = len(S)\n else:\n length = len(S) - 1\n\n i = 0\n while i < length:\n if S[i] is S[i + 1]:\n ans += 1\n i += 1\n i += 1\n\n print(ans * K)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"def main():\n S = input()\n K = int(input())\n ans = 0\n\n if len(set(S)) is 1:\n print(len(S) * K \/\/ 2)\n return\n\n i = 0\n cnt = [1]\n while i < len(S) - 1:\n if S[i] is S[i + 1]:\n cnt[-1] += 1\n else:\n cnt.append(1)\n i += 1\n\n for v in cnt:\n ans += (v \/\/ 2) * K\n\n if S[0] is S[-1]:\n if cnt[0] % 2 == cnt[-1] % 2 == 1:\n ans += K - 1\n\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":5,"i2":18,"j1":5,"j2":26,"error":"0","stderr":null,"stdout":"4\n"} {"problem_id":"p02891","language":"Python","original_status":"Runtime Error","pass":"S = input()\nK = int(input())\n\nprint(S * K)\n\nX = []\nb = S[0]\ncnt = 1\nfor i in range(1, len(S)):\n s = S[i]\n if b == s:\n cnt += 1\n else:\n X.append([b, cnt])\n cnt = 1\n b = s\nX.append([b, cnt])\n\nresult = 0\nfor x in X:\n result += x[1] \/\/ 2\n\nresult = result * K\nif X[0][0] == X[-1][0]:\n result += 1\nprint(result)\n","fail":"S = input()\nK = int(input())\n\nX = []\nb = S[0]\ncnt = 1\nfor i in range(1, len(S)):\n s = S[i]\n if b == s:\n cnt += 1\n else:\n X.append([b, cnt])\n cnt = 1\n b = s\nX.append([b, cnt])\n\nresult = 0\nif len(X) == 1:\n print(X[0][1] * K \/\/ 2)\nelif X[0][0] == X[-1][0]:\n s = X.pop(0)\n e = X.pop()\n for x in X:\n result += x[1] \/\/ 2\n result *= K\n\n result += s[1] \/\/ 2\n result += e[1] \/\/ 2\n x = (s[1] + e[1]) \/\/ 2\n result += x * (K - 1)\n print(result)\nelse:\n for x in X:\n result += x[1] \/\/ 2\n result *= K\n print(result)\n","change":"replace","i1":2,"i2":26,"j1":2,"j2":36,"error":"WA","stderr":null,"stdout":"issiiissii\n5\n"} {"problem_id":"p02892","language":"Python","original_status":"Runtime Error","pass":"n = int(input())\ns = []\nfor _ in range(n):\n s.append(input())\ncheck = []\ntestc = 1000\nfor i in range(n):\n test = 0\n for c in s[i]:\n test += int(c)\n if test == testc:\n check.append(i)\n elif test < testc:\n check.clear()\n testc = test\n check.append(i)\n\nres = -1\nif testc > 1:\n check = check[0]\n\nfor i in check:\n tres = 1\n flag = [-2 for i in range(n)]\n\n flag[i] = 1\n que = [i]\n while que:\n target = que.pop()\n for j in range(n):\n if s[target][j] == \"1\":\n if flag[j] == -2:\n flag[j] = flag[target] + 1\n que.append(j)\n elif flag[j] != flag[target] + 1 and flag[j] != flag[target] - 1:\n tres = -1\n break\n if tres == -1:\n break\n\n if tres == -1:\n continue\n else:\n res = max(res, max(flag))\n\nprint(res)\n","fail":"import collections\n\nn = int(input())\ns = []\nfor _ in range(n):\n ch = input()\n s.append([int(c) for c in ch])\n\n\ndef graph(i, n, s):\n flag = [-2 for _ in range(n)]\n flag[i] = 1\n que = collections.deque([i])\n while que:\n target = que.popleft()\n for j in range(n):\n if s[target][j] == 1:\n if flag[j] == -2:\n flag[j] = flag[target] + 1\n que.append(j)\n elif flag[j] != flag[target] + 1 and flag[j] != flag[target] - 1:\n return [-1, -1]\n mf = max(flag)\n return [flag.index(mf), mf]\n\n\nr1 = graph(0, n, s)\nif r1[0] == -1:\n print(-1)\nelse:\n res = r1[1]\n for i in range(1, n):\n r = graph(i, n, s)\n res = max(res, r[1])\n print(res)\n","change":"replace","i1":0,"i2":46,"j1":0,"j2":35,"error":0,"stderr":null,"stdout":2} {"problem_id":"p02897","language":"Python","original_status":"Runtime Error","pass":"N = int(input())\nnums = filter(lambda x: x % 2 != 0, range(1, N + 1))\nprint(len(nums) \/ float(N))\n","fail":"N = int(input())\nodds = list(filter(lambda x: x % 2 != 0, range(1, N + 1)))\nprint(\"{:.10f}\".format(len(odds) \/ float(N)))\n","change":"replace","i1":1,"i2":3,"j1":1,"j2":3,"error":"TypeError: object of type 'filter' has no len()","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02897\/Python\/s177857539.py\", line 3, in \n print(len(nums) \/ float(N))\nTypeError: object of type 'filter' has no len()\n","stdout":null} {"problem_id":"p02897","language":"Python","original_status":"Runtime Error","pass":"if int(input()) == 1:\n print(1)\nelif int(input()) % 2 == 0:\n print(0.5)\nelse:\n print(0.6)\n","fail":"x = int(input())\nif x == 1:\n print(1)\nelif x % 2 == 0:\n print(0.5)\nelse:\n print((x \/\/ 2 + 1) \/ x)\n","change":"replace","i1":0,"i2":6,"j1":0,"j2":7,"error":"EOFError: EOF when reading a line","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02897\/Python\/s963162599.py\", line 3, in \n elif int(input()) % 2 == 0:\nEOFError: EOF when reading a line\n","stdout":null} {"problem_id":"p02897","language":"Python","original_status":"Runtime Error","pass":"N = input()\n\nif N % 2 == 0:\n print((N \/ 2) \/ N)\n\nelse:\n print(((N + 1) \/ 2) \/ N)\n","fail":"N = int(input())\n\nif N % 2 == 0:\n print((N \/ 2) \/ N)\n\nelse:\n print(((N + 1) \/ 2) \/ N)\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"TypeError: not all arguments converted during string formatting","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02897\/Python\/s639132796.py\", line 3, in \n if N % 2 == 0:\nTypeError: not all arguments converted during string formatting\n","stdout":null} {"problem_id":"p02897","language":"Python","original_status":"Runtime Error","pass":"n = input()\n\na = int(n \/ 2)\nb = n % 2\n\nc = a + b\n\nprint(c)\n","fail":"n = int(input())\n\na = int(n \/ 2)\nb = n % 2\n\nc = a + b\n\nprint(c \/ n)\n","change":"replace","i1":0,"i2":8,"j1":0,"j2":8,"error":"TypeError: unsupported operand type(s) for \/: 'str' and 'int'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02897\/Python\/s076405761.py\", line 3, in \n a = int(n \/ 2)\nTypeError: unsupported operand type(s) for \/: 'str' and 'int'\n","stdout":null} {"problem_id":"p02898","language":"Python","original_status":"Runtime Error","pass":"n, k = map(int, input().split())\nH = list(map(int, input().split()))\ncnt = 0\nfor i in n:\n if H[i] >= k:\n cnt += 1\nprint(cnt)\n","fail":"n, k = map(int, input().split())\nH = list(map(int, input().split()))\ncnt = 0\nfor i in range(n):\n if H[i] >= k:\n cnt += 1\nprint(cnt)\n","change":"replace","i1":3,"i2":4,"j1":3,"j2":4,"error":"TypeError: 'int' object is not iterable","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02898\/Python\/s127858228.py\", line 4, in \n for i in n:\nTypeError: 'int' object is not iterable\n","stdout":null} {"problem_id":"p02898","language":"Python","original_status":"Runtime Error","pass":"N = int(input())\nK = int(input())\nh = []\na = 0\nfor i in range(N):\n b = int(input())\n h.append(b)\n if h[i] >= K:\n a += 1\nprint(a)\n","fail":"NK_lis = list(map(int, input().split()))\nh_lis = list(map(int, input().split()))\na = 0\nfor i in range(NK_lis[0]):\n if h_lis[i] >= NK_lis[1]:\n a += 1\nprint(a)\n","change":"replace","i1":0,"i2":8,"j1":0,"j2":5,"error":"ValueError: invalid literal for int() with base 10: '4 150'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02898\/Python\/s286734935.py\", line 1, in \n N = int(input())\nValueError: invalid literal for int() with base 10: '4 150'\n","stdout":null} {"problem_id":"p02898","language":"Python","original_status":"Time Limit Exceeded","pass":"n, k = map(int, input().split())\na = list(map(int, input().split()))\ni = 0\nans = 0\nwhile i < n:\n if a[i] >= k:\n ans += 1\n i += 1\nprint(ans)\n","fail":"n, k = map(int, input().split())\nh = list(map(int, input().split()))\ni = 0\nans = 0\nfor i in range(n):\n if h[i] >= k:\n ans += 1\nprint(ans)\n","change":"replace","i1":1,"i2":8,"j1":1,"j2":7,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02898","language":"Python","original_status":"Runtime Error","pass":"n = int(input())\nmin_height = int(input())\n\nheight = []\nfor _ in range(n):\n height.append(int(input()))\nheight.sort(reverse=True)\n\ncnt = 0\nfor h in height:\n if h < min_height:\n break\n cnt += 1\nprint(cnt)\n","fail":"n, min_height = map(int, input().split())\nheight = list(map(int, input().split()))\nheight.sort(reverse=True)\n\ncnt = 0\nfor h in height:\n if h < min_height:\n break\n cnt += 1\nprint(cnt)\n","change":"replace","i1":0,"i2":6,"j1":0,"j2":2,"error":"ValueError: invalid literal for int() with base 10: '4 150'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02898\/Python\/s709157737.py\", line 1, in \n n = int(input())\nValueError: invalid literal for int() with base 10: '4 150'\n","stdout":null} {"problem_id":"p02898","language":"Python","original_status":"Runtime Error","pass":"n, k = map(int, input().split())\nh = list(map(int, input().split()))\nprint(len(filter(lambda x: x >= k, h)))\n","fail":"n, k = map(int, input().split())\nh = list(map(int, input().split()))\nprint(len(list(filter(lambda x: x >= k, h))))\n","change":"replace","i1":2,"i2":3,"j1":2,"j2":3,"error":"TypeError: object of type 'filter' has no len()","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02898\/Python\/s747999474.py\", line 3, in \n print(len(filter(lambda x: x >= k, h)))\nTypeError: object of type 'filter' has no len()\n","stdout":null} {"problem_id":"p02898","language":"Python","original_status":"Runtime Error","pass":"N, K = map(int, input().split())\nar = list(map, input().split())\n\ncount = 0\nfor i in range(N):\n if ar[i] >= K:\n count += 1\n\nprint(count)\n","fail":"N, K = map(int, input().split())\nar = list(map(int, input().split()))\n\ncount = 0\nfor i in range(N):\n if ar[i] >= K:\n count += 1\n\nprint(count)\n","change":"replace","i1":1,"i2":2,"j1":1,"j2":2,"error":"TypeError: list expected at most 1 argument, got 2","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02898\/Python\/s440277663.py\", line 2, in \n ar = list(map, input().split())\nTypeError: list expected at most 1 argument, got 2\n","stdout":null} {"problem_id":"p02898","language":"Python","original_status":"Runtime Error","pass":"N = int(input())\nK = int(input())\nh = list(map(int, input().split()))\n\n\ncount = 0\nfor i in h:\n if i >= K:\n count += 1\n\nprint(count)\n","fail":"N, K = list(map(int, input().split()))\nh = list(map(int, input().split()))\n\n\ncount = 0\nfor i in h:\n if i >= K:\n count += 1\n\nprint(count)\n","change":"replace","i1":0,"i2":2,"j1":0,"j2":1,"error":"ValueError: invalid literal for int() with base 10: '4 150'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02898\/Python\/s129159641.py\", line 1, in \n N = int(input())\nValueError: invalid literal for int() with base 10: '4 150'\n","stdout":null} {"problem_id":"p02899","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = list(map(int, input().split()))\n\norder = [0] * N\nflag = 0\nfor i in range(0, N):\n flag = A.index(min(A))\n order[i] = flag + 1\n A[flag] = N + 1\n\nprint(\" \".join(map(str, order)))\n","fail":"N = int(input())\nA = list(map(int, input().split()))\n\nlis = []\nfor i in range(N):\n lis.append([A[i], i + 1])\n\nlis.sort()\nans = []\nfor i in range(N):\n ans.append(lis[i][1])\n\nprint(\" \".join(map(str, ans)))\n","change":"replace","i1":3,"i2":11,"j1":3,"j2":13,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02899","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = list(map(int, input().split()))\nx = []\nx = [0 for i in range(n)]\nfor j in range(n):\n x.pop(a[j] - 1)\n x.insert(a[j] - 1, j + 1)\nprint(\" \".join(map(str, x)))\n","fail":"n = int(input())\na = list(map(int, input().split()))\nx = []\nfor i in range(n):\n x.append((a[i], i + 1))\nx.sort()\ny = []\nfor i in range(n):\n y.append(x[i][1])\nprint(\" \".join(map(str, y)))\n","change":"replace","i1":3,"i2":8,"j1":3,"j2":10,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02899","language":"Python","original_status":"Time Limit Exceeded","pass":"# #!\/usr\/bin\/env python3\n# # -*- coding: utf-8 -*-\n\n\ndef main():\n N = int(input())\n S = list(map(int, input().split()))\n print(*[S.index(i + 1) + 1 for i in range(N)])\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"# #!\/usr\/bin\/env python3\n# # -*- coding: utf-8 -*-\n\n\ndef main():\n N = int(input())\n A = list(map(int, input().split()))\n\n result = []\n for i, a in enumerate(A, start=1):\n result.append([i, a])\n result = sorted(result, key=lambda x: x[1])\n\n print(*[i for i, a in result])\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":6,"i2":8,"j1":6,"j2":14,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02899","language":"Python","original_status":"Time Limit Exceeded","pass":"def main():\n N = int(input())\n A = list(map(int, input().split()))\n\n for v in range(1, N + 1):\n print(A.index(v) + 1, end=\" \")\n\n print()\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"def main():\n N = int(input())\n A = list(map(int, input().split()))\n ans_list = [None for _ in range(N)]\n\n for i in range(N):\n ans_list[A[i] - 1] = i\n\n for v in ans_list:\n print(v + 1, end=\" \")\n\n print()\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":3,"i2":6,"j1":3,"j2":10,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02899","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = list(map(int, input().split()))\nans = [str(a.index(i + 1) + 1) for i in range(n)]\nprint(\" \".join(ans))\n","fail":"# https:\/\/atcoder.jp\/contests\/abc142\/tasks\/abc142_c\nn = int(input())\na = list(map(int, input().split()))\n#### TLE ####\n# ans = [str(a.index(i + 1) + 1) for i in range(n)]\n# print(\" \".join(ans))\n\nb = [\" \"] * n\nfor i in range(n):\n b[a[i] - 1] = str(i + 1)\n\nprint(\" \".join(b))\n","change":"replace","i1":0,"i2":4,"j1":0,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02899","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = list(map(int, input().split()))\n\nfor i in range(1, n + 1):\n print(a.index(i) + 1)\n","fail":"n = int(input())\na = list(map(int, input().split()))\noutput = [0] * n\nfor i, a in enumerate(a):\n output[a - 1] = i + 1\n\nprint(*output)\n","change":"replace","i1":2,"i2":5,"j1":2,"j2":7,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02899","language":"Python","original_status":"Time Limit Exceeded","pass":"import numpy as np\n\nN = int(input())\nA = list(map(int, input().split()))\nT = [0] * N\nfor i in range(N):\n t = np.argmin(A)\n T[i] = t + 1\n A[t] = N + 1\nprint(*T)\n","fail":"import numpy as np\n\nN = int(input())\nA = list(map(int, input().split()))\nT = [0] * N\nfor i in range(N):\n T[A[i] - 1] = i + 1\nprint(*T)\n","change":"replace","i1":6,"i2":9,"j1":6,"j2":7,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02899","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = list(map(int, input().split()))\n\nans = [0] * len(A)\n\nfor i in A:\n ans[i - 1] = A.index(i) + 1\n\nprint(*ans)\n","fail":"N = int(input())\nA = list(map(int, input().split()))\nans = [0] * N\n\nfor i in range(1, N + 1):\n ans[A[i - 1] - 1] = i\n\nprint(*ans)\n","change":"replace","i1":2,"i2":7,"j1":2,"j2":6,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02899","language":"Python","original_status":"Runtime Error","pass":"import numpy as np\n\nN = int(input())\nA = list(map(int, input().split()))\nA = np.array(A)\n\nAA = np.argsort(A) + 1\n\nprint(AA.to_list())\n","fail":"import numpy as np\n\nN = int(input())\nA = list(map(int, input().split()))\nA = np.array(A)\n\nAA = np.argsort(A) + 1\n\nprint(*AA)\n","change":"replace","i1":8,"i2":9,"j1":8,"j2":9,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02899","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = [int(i) for i in input().split()]\n\nans = []\nfor i in range(1, N + 1):\n ans.append(A.index(i) + 1)\n\nprint(*ans)\n","fail":"N = int(input())\nA = [int(i) for i in input().split()]\n\nans = [0] * N\nfor i in range(N):\n ans[A[i] - 1] = i + 1\n\nprint(*ans)\n","change":"replace","i1":3,"i2":6,"j1":3,"j2":6,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02899","language":"Python","original_status":"Time Limit Exceeded","pass":"def resolve():\n N = int(input())\n A = [int(i) for i in input().split()]\n for i in range(N):\n if i > 0:\n print(\" \", end=\"\")\n print(A.index(i + 1) + 1, end=\"\")\n print()\n\n\nresolve()\n","fail":"def resolve():\n N = int(input())\n A = [int(i) for i in input().split()]\n ans = [0] * N\n for i in range(N):\n ans[A[i] - 1] = i + 1\n print(*ans)\n\n\nresolve()\n","change":"replace","i1":3,"i2":8,"j1":3,"j2":7,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02899","language":"Python","original_status":"Time Limit Exceeded","pass":"n = input()\na = input().split()\n\nresult = []\n\nfor i in range(len(a)):\n result.append(a.index(str(i + 1)) + 1)\n\nprint(*result)\n","fail":"n = int(input())\na = list(map(int, input().split()))\n\nans = [0] * n\n\nfor i in range(n):\n ans[a[i] - 1] = i + 1\n\nprint(*ans)\n","change":"replace","i1":0,"i2":9,"j1":0,"j2":9,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02899","language":"Python","original_status":"Runtime Error","pass":"N = int(input())\nA = list(map(list, input().split()))\nfor i in range(N):\n A[i].append(i + 1) # \u51fa\u5e2d\u756a\u53f7\u3092\u305d\u308c\u305e\u308c\u8ffd\u52a0\u3057\u3066\u3044\u308b\nA = sorted(A) # \u4eba\u6570\u3067\u30bd\u30fc\u30c8\nans = []\nfor ai in range(N):\n ans.append(A[ai][1]) # \u4eba\u6570\u9806\u306b\u51fa\u5e2d\u756a\u53f7\u3067\u51fa\u529b\nprint(\" \".join(map(str, ans)))\n","fail":"N = int(input())\nA = list(map(int, input().split()))\nB = []\nfor i in range(N):\n B.append([A[i]])\n B[i].append(i + 1) # \u51fa\u5e2d\u756a\u53f7\u3092\u305d\u308c\u305e\u308c\u8ffd\u52a0\u3057\u3066\u3044\u308b\nB = sorted(B) # \u4eba\u6570\u3067\u30bd\u30fc\u30c8\nans = []\nfor ai in range(N):\n ans.append(B[ai][1]) # \u4eba\u6570\u9806\u306b\u51fa\u5e2d\u756a\u53f7\u3067\u51fa\u529b\nprint(\" \".join(map(str, ans)))\n","change":"replace","i1":1,"i2":8,"j1":1,"j2":10,"error":"0","stderr":null,"stdout":"3 1 2\n"} {"problem_id":"p02899","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA_i = list(map(int, input().split()))\n\nB_i = []\n\nfor i in range(1, N + 1):\n B_i.append(str(A_i.index(i) + 1))\n\nprint(\" \".join(B_i))\n","fail":"N = int(input())\nA_i = list(map(int, input().split()))\n\nB_i = [0 for s in range(N)]\n\nfor i in range(1, N + 1):\n B_i[A_i[i - 1] - 1] = str(i)\n\n\nprint(\" \".join(B_i))\n","change":"replace","i1":3,"i2":7,"j1":3,"j2":8,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02899","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = list(map(int, input().split(\" \")))\n\nd = {}\nfor a in A:\n d[A.index(a) + 1] = a\n\nans = [str(k) for k, _ in sorted(d.items(), key=lambda x: x[1])]\nprint(\" \".join(ans))\n","fail":"N = int(input())\nA = list(map(int, input().split(\" \")))\n\nd = dict(zip(range(N), A))\n\nans = [str(k + 1) for k, _ in sorted(d.items(), key=lambda x: x[1])]\nprint(\" \".join(ans))\n","change":"replace","i1":3,"i2":8,"j1":3,"j2":6,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02899","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = list(map(int, input().split()))\nout = [\"\"] * n\ncount = 0\nout_str = \"\"\nfor i in range(n):\n out_str += str(a.index(i + 1) + 1) + \" \"\n\nprint(out_str[:-1])\n","fail":"n = int(input())\na = list(map(int, input().split()))\nout = [\"\"] * n\nout_str = \"\"\nfor i in range(n):\n out[a[i] - 1] = str(i + 1)\n\nout_str = \" \".join(out)\n\nprint(out_str)\n","change":"replace","i1":3,"i2":9,"j1":3,"j2":10,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02899","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = list(map(int, input().split()))\nb = [None] * n\nprint(str(a.index(1) + 1), end=\" \")\nfor i in range(1, n):\n print(str(a.index(i + 1) + 1), end=\" \")\nprint()\n","fail":"import sys\nimport collections\nimport bisect\n\n\ndef main():\n n = int(input())\n A = list(map(int, input().split()))\n B = [0] * n\n for i in range(n):\n B[A[i] - 1] = str(i + 1)\n print(\" \".join(B))\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":0,"i2":7,"j1":0,"j2":16,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02899","language":"Python","original_status":"Time Limit Exceeded","pass":"import sys\n\n\ndef main():\n n = int(input())\n a = [int(i) for i in sys.stdin.readline().split()]\n ans = []\n ans_append = ans.append\n for i in range(n):\n ans_append(a.index(i + 1) + 1)\n print(*ans)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"import sys\n\n\ndef main():\n n = int(input())\n a = [int(i) for i in sys.stdin.readline().split()]\n ans = [0] * n\n for i in range(n):\n ans[a[i] - 1] = i + 1\n print(*ans)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":6,"i2":10,"j1":6,"j2":9,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02900","language":"Python","original_status":"Time Limit Exceeded","pass":"aa, bb = map(int, input().split())\nA = max(aa, bb)\nB = min(aa, bb)\n\n\ndef get_max(a, b):\n while True:\n c = a % b\n if c == 0:\n return b\n a = b\n b = c\n\n\nB = get_max(A, B)\n\ntemp = []\nfor i in range(1, B + 1):\n if B % i == 0:\n temp.append(i)\n\nflag = [0] * len(temp)\ncount = len(temp)\nfor i in range(0, len(temp)):\n for j in range(i + 1, len(temp)):\n if flag[j] == 0:\n max_ = get_max(temp[i], temp[j])\n if max_ != 1:\n flag[j] = 1\n count -= 1\n\nprint(count)\n","fail":"aa, bb = map(int, input().split())\nA = max(aa, bb)\nB = min(aa, bb)\n\n\ndef get_max(a, b):\n while True:\n c = a % b\n if c == 0:\n return b\n a = b\n b = c\n\n\ndef factorize(n):\n b = 2\n fct = []\n while b * b <= n:\n while n % b == 0:\n n \/\/= b\n fct.append(b)\n b = b + 1\n if n > 1:\n fct.append(n)\n return fct\n\n\nB = get_max(A, B)\nfactors = factorize(B)\n\nif len(factors) == 0:\n print(1)\nelse:\n count = 1\n for i in range(0, len(factors) - 1):\n if factors[i] != factors[i + 1]:\n count += 1\n print(count + 1)\n","change":"replace","i1":14,"i2":32,"j1":14,"j2":38,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02900","language":"Python","original_status":"Time Limit Exceeded","pass":"import fractions\nimport sys\n\ninput = sys.stdin.readline\n\n\ndef factorization(n):\n primes = []\n while n % 2 == 0:\n n \/\/= 2\n primes.append(2)\n for i in range(3, n + 1, 2):\n while n % i == 0:\n n \/\/= i\n primes.append(i)\n if n == 1:\n break\n return primes\n\n\ndef main():\n a, b = list(map(int, input().split()))\n\n # \u7d20\u56e0\u6570\u5206\u89e3\n g = fractions.gcd(a, b)\n print(len(set(factorization(g))) + 1)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"import fractions\nimport sys\n\ninput = sys.stdin.readline\n\n\ndef factorization(n):\n primes = []\n while n % 2 == 0:\n primes.append(2)\n n \/\/= 2\n f = 3\n while f * f <= n:\n if n % f == 0:\n primes.append(f)\n n \/\/= f\n else:\n f += 2\n if n != 1:\n primes.append(n)\n return primes\n\n\ndef main():\n a, b = list(map(int, input().split()))\n\n # \u7d20\u56e0\u6570\u5206\u89e3\n g = fractions.gcd(a, b)\n print(len(set(factorization(g))) + 1)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":9,"i2":17,"j1":9,"j2":20,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02900","language":"Python","original_status":"Runtime Error","pass":"import numpy as np\n\n\ndef is_prime(n):\n return n != 1 and not np.any(n % np.arange(2, n) == 0)\n\n\nA, B = [int(x) for x in input().split()]\n\nN = np.arange(1, min(A, B) + 1)\n\ncd = np.argwhere((A % N == 0) & (B % N == 0)).ravel() + 1\nprimes = [n for n in cd if is_prime(n)]\n\nprint(len(primes) + 1)\n","fail":"from fractions import gcd\n\n\ndef prime_factors(n):\n i = 2\n\n factors = []\n\n while i * i <= n:\n if n % i:\n i += 1\n else:\n n \/\/= i\n factors.append(i)\n if n > 1:\n factors.append(n)\n\n return factors\n\n\nA, B = [int(x) for x in input().split()]\n\nprint(len(set(prime_factors(gcd(A, B)))) + 1)\n","change":"replace","i1":0,"i2":15,"j1":0,"j2":23,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02900","language":"Python","original_status":"Runtime Error","pass":"# D - Disjoint Set of Common Divisors\n\nimport math\n\nA, B = map(int, input().split())\nC = math.gcd(A, B)\n\nprimes = []\ni = 2\nwhile i * i <= C:\n while C % i == 0:\n C \/\/= i\n primes.append(i)\n i += 1\nif C > 1:\n primes.append(C)\n\nprint(len(set(primes)) + 1)\n","fail":"# D - Disjoint Set of Common Divisors\n\nimport fractions\n\nA, B = map(int, input().split())\nC = fractions.gcd(A, B)\n\nprimes = []\ni = 2\nwhile i * i <= C:\n while C % i == 0:\n C \/\/= i\n primes.append(i)\n i += 1\nif C > 1:\n primes.append(C)\n\nprint(len(set(primes)) + 1)\n","change":"replace","i1":2,"i2":6,"j1":2,"j2":6,"error":"0","stderr":null,"stdout":3.0} {"problem_id":"p02900","language":"Python","original_status":"Time Limit Exceeded","pass":"from sys import stdin\n\na, b = [int(x) for x in stdin.readline().split()]\n\nwhile b != 0:\n a, b = b, a % b\n\nc = 1\nlim = a \/\/ 2\nn = 0\ni = 2\nwhile a > 1 and i <= lim:\n n = 0\n while a % i == 0:\n a \/\/= i\n n += 1\n if n > 0:\n c += 1\n i += 1\nif a > 1:\n c += 1\n\nprint(c)\n","fail":"from sys import stdin\n\na, b = [int(x) for x in stdin.readline().split()]\n\nwhile b != 0:\n a, b = b, a % b\n\nc = 1\nlim = a**0.5 + 10\nn = 0\ni = 2\nwhile a > 1 and i <= lim:\n n = 0\n while a % i == 0:\n a \/\/= i\n n += 1\n if n > 0:\n c += 1\n i += 1\nif a > 1:\n c += 1\n\nprint(c)\n","change":"replace","i1":8,"i2":9,"j1":8,"j2":9,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02900","language":"Python","original_status":"Time Limit Exceeded","pass":"from sys import stdin\nimport fractions\n\nA, B = [int(x) for x in stdin.readline().rstrip().split()]\ngcd = fractions.gcd(A, B)\n\nx = 2\nans = 1\ng = 1\n\nwhile gcd > 1:\n if gcd % x == 0:\n gcd \/\/= x\n if g != x:\n ans += 1\n g = x\n else:\n x += 1\n\nprint(ans)\n","fail":"from sys import stdin\nimport fractions\n\nA, B = [int(x) for x in stdin.readline().rstrip().split()]\ngcd = fractions.gcd(A, B)\nC = []\ny = 1\nwhile y**2 <= gcd:\n if gcd % y == 0:\n if y >= 2:\n C.append(y)\n if y**2 != gcd:\n C.append(gcd \/\/ y)\n y += 1\n\nans = 1\ng = 1\nC.sort()\nfor c in C:\n while gcd % c == 0:\n gcd \/\/= c\n if g != c:\n ans += 1\n g = c\n\nprint(ans)\n","change":"replace","i1":5,"i2":18,"j1":5,"j2":24,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02900","language":"Python","original_status":"Runtime Error","pass":"def make_divisors(n):\n divisors = []\n for i in range(2, 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 return divisors\n\n\ndef furui(data):\n for d in data:\n data = [x for x in data if (x == d or x % d != 0)]\n return data\n\n\na, b = map(int, input().split())\n# a, b = 100000000000000, 1000000000000000\na = make_divisors(a)\na = furui(a)\nb = make_divisors(b)\nb = furui(b)\nprint(len(set(a) & set(b)) + 1)\n","fail":"from collections import defaultdict\n\nA, B = map(int, input().split())\n\n\ndef gcd(a, b):\n return a if b == 0 else gcd(b, a % b)\n\n\nd = gcd(A, B)\n# print(d)\n\n\ndef f(v):\n dic = defaultdict(int)\n if v == 1:\n dic[1] = 1\n return dic\n for i in range(2, v):\n if i * i > v:\n break\n while v % i == 0:\n v \/\/= i\n dic[i] += 1\n if v != 1:\n dic[v] += 1\n dic[1] = 1\n return dic\n\n\ndivisor = f(d)\n# print(divisor)\nprint(len(divisor))\n","change":"replace","i1":0,"i2":23,"j1":0,"j2":33,"error":"0","stderr":null,"stdout":3.0} {"problem_id":"p02900","language":"Python","original_status":"Time Limit Exceeded","pass":"from fractions import gcd\n\nA, B = map(int, input().split())\n\nd = gcd(A, B)\nans = 1\nk = 2\nwhile d > 2:\n plus = 0\n while d % k == 0:\n d \/\/= k\n plus = 1\n ans += plus\n k += 1\nprint(ans)\n","fail":"from fractions import gcd\n\nA, B = map(int, input().split())\n\nd = gcd(A, B)\nd_ori = d\nans = 1\nk = 2\nwhile d > 2:\n plus = 0\n while d % k == 0:\n d \/\/= k\n plus = 1\n ans += plus\n k += 1\n if k > d_ori ** (1 \/ 2):\n ans += 1\n break\nprint(ans)\n","change":"replace","i1":5,"i2":14,"j1":5,"j2":18,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02900","language":"Python","original_status":"Runtime Error","pass":"import math\n\nA, B = map(int, input().split())\n\nN = math.gcd(A, B)\nprimes = []\nif N % 2 == 0:\n primes.append(2)\nfor i in range(3, int(math.sqrt(N)) + 2, 2):\n if N % i == 0:\n for p in primes:\n if i % p == 0:\n break\n else:\n primes.append(i)\nprint(len(primes) + 1)\n","fail":"import math\n\nA, B = map(int, input().split())\n\nwhile B > 0:\n A, B = B, A % B\nN = A\n\nans = 1\nfor i in [2] + list(range(3, int(math.sqrt(N)) + 2, 2)):\n if N % i == 0:\n while N % i == 0:\n N \/\/= i\n ans += 1\nif N > 1:\n ans += 1\nprint(ans)\n","change":"replace","i1":4,"i2":16,"j1":4,"j2":17,"error":"0","stderr":null,"stdout":3.0} {"problem_id":"p02900","language":"Python","original_status":"Runtime Error","pass":"from math import gcd\n\n\ndef prime_factorize(n):\n a = []\n while n % 2 == 0:\n a.append(2)\n n \/\/= 2\n f = 3\n while f * f <= n:\n if n % f == 0:\n a.append(f)\n n \/\/= f\n else:\n f += 2\n if n != 1:\n a.append(n)\n return a\n\n\nA, B = tuple(map(int, input().split(\" \")))\n\nprint(len(set(prime_factorize(gcd(A, B)))) + 1)\n","fail":"from fractions import gcd\n\n\ndef prime_factorize(n):\n a = []\n while n % 2 == 0:\n a.append(2)\n n \/\/= 2\n f = 3\n while f * f <= n:\n if n % f == 0:\n a.append(f)\n n \/\/= f\n else:\n f += 2\n if n != 1:\n a.append(n)\n return a\n\n\nA, B = tuple(map(int, input().split(\" \")))\n\nprint(len(set(prime_factorize(gcd(A, B)))) + 1)\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"0","stderr":null,"stdout":3.0} {"problem_id":"p02900","language":"Python","original_status":"Time Limit Exceeded","pass":"def gcd(g1, g2):\n x = min(g1, g2)\n y = max(g1, g2)\n\n if y % x == 0:\n return x\n else:\n return gcd(x, y % x)\n\n\ndef prime_factorize(n):\n p = []\n while n % 2 == 0:\n if 2 not in p:\n p.append(2)\n n \/\/= 2\n f = 3\n while f * f <= n:\n if n % f == 0:\n if f not in p:\n p.append(f)\n n \/\/= f\n else:\n f += 2\n if n != 1 and n not in p:\n p.append(n)\n return p\n\n\na, b = map(int, input().split())\nq = prime_factorize(gcd(a, b))\n# print(q)\nprint(len(q) + 1)\n","fail":"def gcd(x, y):\n if y == 0:\n return x\n else:\n return gcd(y, x % y)\n\n\ndef prime_factorize(n):\n p = []\n while n % 2 == 0:\n if 2 not in p:\n p.append(2)\n n \/\/= 2\n f = 3\n while f * f <= n:\n if n % f == 0:\n if f not in p:\n p.append(f)\n n \/\/= f\n else:\n f += 2\n if n != 1 and n not in p:\n p.append(n)\n return p\n\n\na, b = map(int, input().split())\nq = prime_factorize(gcd(a, b))\n# print(q)\nprint(len(q) + 1)\n","change":"replace","i1":0,"i2":22,"j1":0,"j2":19,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02900","language":"Python","original_status":"Runtime Error","pass":"import math\n\nd = math.gcd(*map(int, input().split()))\nr = 1\ni = 2\nwhile i * i <= d:\n if d % i == 0:\n d \/\/= i\n r += 1\n while d % i == 0:\n d \/\/= i\n i += 1\nprint(r + (d > 1))\n","fail":"from fractions import gcd\n\nd = gcd(*map(int, input().split()))\nr = 1\ni = 2\nwhile i * i <= d:\n if d % i == 0:\n d \/\/= i\n r += 1\n while d % i == 0:\n d \/\/= i\n i += 1\nprint(r + (d > 1))\n","change":"replace","i1":0,"i2":3,"j1":0,"j2":3,"error":"0","stderr":null,"stdout":3.0} {"problem_id":"p02900","language":"Python","original_status":"Time Limit Exceeded","pass":"import fractions\n\nprimes = [2]\n\n\ndef is_prime(n):\n for p in primes:\n if p * p > n:\n break\n if n % p == 0:\n return False\n\n return True\n\n\nA, B = map(int, input().split())\n\nG = int(fractions.gcd(A, B))\n\nres = 1\n\nif G % 2 == 0:\n res += 1\n G \/\/= 2\n\nfor i in range(3, G, 2):\n if i > G:\n break\n if not is_prime(i):\n continue\n primes.append(i)\n if G % i == 0:\n res += 1\n G \/\/= i\n\nif G > 1 and is_prime(G) and G not in primes:\n res += 1\n\nprint(res)\n","fail":"import fractions\n\nA, B = map(int, input().split())\n\nG = fractions.gcd(A, B)\n\nres = 1\n\nfor i in [2] + list(range(3, int(G**0.5) + 1, 2)):\n if G % i == 0:\n res += 1\n while G % i == 0:\n G \/\/= i\n\nif G > 2:\n res += 1\n\nprint(res)\n","change":"replace","i1":1,"i2":36,"j1":1,"j2":15,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02900","language":"Python","original_status":"Time Limit Exceeded","pass":"a, b = map(int, input().split())\ni = 1\ncommon = []\nwhile True:\n if a % i == 0 and b % i == 0:\n a \/\/= i\n b \/\/= i\n common.append(i)\n if min(a, b) < i:\n break\n i += 1\n\ncount = 1\nfor i in range(1, len(common)):\n for j in range(1, i):\n if common[i] % common[j] == 0:\n break\n else:\n count += 1\nprint(count)\n","fail":"import fractions\nimport math\n\na, b = map(int, input().split())\ngreatest = fractions.gcd(a, b)\n\nfactor = [1]\nmax_iter = int(math.sqrt(greatest)) + 1\nfor i in range(2, max_iter):\n while greatest % i == 0:\n greatest \/\/= i\n factor.append(i)\nif greatest != 1:\n factor.append(greatest)\nfactor = set(factor)\nprint(len(factor))\n","change":"replace","i1":0,"i2":20,"j1":0,"j2":16,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02900","language":"Python","original_status":"Time Limit Exceeded","pass":"def gcd(x, y):\n if y == 0:\n return x\n return gcd(y, x % y)\n\n\nA, B = map(int, input().split())\nC = gcd(A, B)\n\nans = []\ni = 2\nwhile True:\n if C == 1:\n break\n if C % i != 0:\n i += 1\n continue\n ans.append(i)\n C \/\/= i\nprint(len(set(ans)) + 1)\n","fail":"def gcd(x, y):\n if y == 0:\n return x\n return gcd(y, x % y)\n\n\nA, B = map(int, input().split())\nC = gcd(A, B)\n\nans = []\nwhile C % 2 == 0:\n ans.append(2)\n C \/\/= 2\ni = 3\nwhile C >= i * i:\n if C % i == 0:\n ans.append(i)\n C \/\/= i\n else:\n i += 2\nif C != 1:\n ans.append(C)\nprint(len(set(ans)) + 1)\n","change":"replace","i1":10,"i2":19,"j1":10,"j2":22,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02903","language":"Python","original_status":"Runtime Error","pass":"from math import gcd\n\n\nH, W, A, B = map(int, input().split())\ngcd_hw = gcd(H, W)\ngcd_ab = gcd(A, B)\nif H == 1:\n print(\"1\" * A + \"0\" * (W - A))\n exit()\nif W == 1:\n print(*(\"1\" * B + \"0\" * (H - B)), sep=\"\\\\n\")\n exit()\n\nif H \/\/ gcd_hw == B \/\/ gcd_ab and W \/\/ gcd_hw == A \/\/ gcd_ab:\n ans = [[0] * W for _ in range(H)]\n for i in range(H):\n for j in range(A):\n ans[i][(j + B * i) % W] = 1\n [print(\"\".join(map(str, row))) for row in ans]\nelse:\n print(\"No\")\n","fail":"H, W, A, B = map(int, input().split())\nfor _ in range(B):\n print(\"0\" * A + \"1\" * (W - A))\nfor _ in range(H - B):\n print(\"1\" * A + \"0\" * (W - A))\n","change":"replace","i1":0,"i2":21,"j1":0,"j2":5,"error":0,"stderr":null,"stdout":"100\n010\n001\n"} {"problem_id":"p02905","language":"Python","original_status":"Runtime Error","pass":"import sys\n\n\ndef prepare(n, MOD):\n f = 1\n factorials = [1]\n for m in range(1, n + 1):\n f *= m\n f %= MOD\n factorials.append(f)\n inv = pow(f, MOD - 2, MOD)\n invs = [1] * (n + 1)\n invs[n] = inv\n for m in range(n, 1, -1):\n inv *= m\n inv %= MOD\n invs[m - 1] = inv\n\n solo_invs = [0] + [f * i % MOD for f, i in zip(factorials, invs[1:])]\n\n return factorials, invs, solo_invs\n\n\ndef decompose_inverses(solo_invs, MOD):\n # \u5404\u6574\u6570 g \u306b\u5bfe\u3057\u3066\u3001g \u306e\u7d04\u6570\u3067\u3042\u308b\u5404 i \u306b\u3064\u3044\u3066 dcm[i] \u3092\u5168\u3066\u8db3\u3059\u3068 1\/g \u306b\u306a\u308b\u3088\u3046\u306a\u6570\u5217\u3092\u4f5c\u6210\n n = len(solo_invs)\n dcm = solo_invs.copy()\n for i in range(1, n):\n d = dcm[i]\n for j in range(2 * i, n, i):\n dcm[j] -= d\n for i in range(1, n):\n dcm[i] %= MOD\n return dcm\n\n\nn, *aaa = map(int, sys.stdin.buffer.read().split())\nMOD = 998244353\nLIMIT = max(aaa)\ncount = [0] * (LIMIT + 1)\ndouble = [0] * (LIMIT + 1)\nfor a in aaa:\n count[a] += a\n double[a] += a * a\n_, _, solo_invs = prepare(LIMIT, MOD)\ndcm = decompose_inverses(solo_invs, MOD)\n\nans = 0\ninv2 = solo_invs[2]\nfor d in range(1, LIMIT + 1):\n ans = (ans + dcm[d] * (sum(count[d::d]) ** 2 - sum(double[d::d])) * inv2) % MOD\nprint(ans)\n","fail":"import sys\n\n\ndef prepare(n, MOD):\n f = 1\n factorials = [1]\n for m in range(1, n + 1):\n f *= m\n f %= MOD\n factorials.append(f)\n inv = pow(f, MOD - 2, MOD)\n invs = [1] * (n + 1)\n invs[n] = inv\n for m in range(n, 1, -1):\n inv *= m\n inv %= MOD\n invs[m - 1] = inv\n\n solo_invs = [0] + [f * i % MOD for f, i in zip(factorials, invs[1:])]\n\n return factorials, invs, solo_invs\n\n\ndef decompose_inverses(solo_invs, MOD):\n # \u5404\u6574\u6570 g \u306b\u5bfe\u3057\u3066\u3001g \u306e\u7d04\u6570\u3067\u3042\u308b\u5404 i \u306b\u3064\u3044\u3066 dcm[i] \u3092\u5168\u3066\u8db3\u3059\u3068 1\/g \u306b\u306a\u308b\u3088\u3046\u306a\u6570\u5217\u3092\u4f5c\u6210\n n = len(solo_invs)\n dcm = solo_invs[:]\n for i in range(1, n):\n d = dcm[i]\n for j in range(2 * i, n, i):\n dcm[j] -= d\n for i in range(1, n):\n dcm[i] %= MOD\n return dcm\n\n\nn, *aaa = map(int, sys.stdin.buffer.read().split())\nMOD = 998244353\nLIMIT = max(aaa)\ncount = [0] * (LIMIT + 1)\ndouble = [0] * (LIMIT + 1)\nfor a in aaa:\n count[a] += a\n double[a] += a * a\n_, _, solo_invs = prepare(LIMIT, MOD)\ndcm = decompose_inverses(solo_invs, MOD)\n\nans = 0\ninv2 = solo_invs[2]\nfor d in range(1, LIMIT + 1):\n ans = (ans + dcm[d] * (sum(count[d::d]) ** 2 - sum(double[d::d])) * inv2) % MOD\nprint(ans)\n","change":"replace","i1":26,"i2":27,"j1":26,"j2":27,"error":0,"stderr":null,"stdout":22} {"problem_id":"p02909","language":"Python","original_status":"Runtime Error","pass":"S = input().strip()\n\nweather = [\"Sunny\", \"Cloudy\", \"Rainy\"]\n\n\nidx = weather.index(S) + 1\nif idx > len(weather):\n print(weather[0])\nelse:\n print(weather[idx])\n","fail":"S = input().strip()\n\nweather = [\"Sunny\", \"Cloudy\", \"Rainy\"]\n\n\nidx = weather.index(S) + 1\nif idx >= len(weather):\n print(weather[0])\nelse:\n print(weather[idx])\n","change":"replace","i1":6,"i2":7,"j1":6,"j2":7,"error":0,"stderr":null,"stdout":"Cloudy\n"} {"problem_id":"p02909","language":"Python","original_status":"Runtime Error","pass":"import sys\n\nS = sys.stdin.readline().rstrip()\n\nWS = [\"Sunny\", \"Cloudy\", \"Rainy\"]\n\ni = WS.index(S)\ni += 1\nif i == 2:\n i = 0\n\nprint(WS[i])\n","fail":"import sys\n\nS = sys.stdin.readline().rstrip()\n\nWS = [\"Sunny\", \"Cloudy\", \"Rainy\"]\n\ni = WS.index(S)\ni += 1\nif i == 3:\n i = 0\n\nprint(WS[i])\n","change":"replace","i1":8,"i2":9,"j1":8,"j2":9,"error":0,"stderr":null,"stdout":"Cloudy\n"} {"problem_id":"p02909","language":"Python","original_status":"Runtime Error","pass":"w = input()\nweather = [\"Sunny\", \"Cloudy\", \"Rainy\"]\n\nindex = weather.index(w)\nindex += 1\nif index == 2:\n index = 0\n\nprint(weather[index])\n","fail":"w = input()\nweather = [\"Sunny\", \"Cloudy\", \"Rainy\"]\n\nindex = weather.index(w)\nindex += 1\nif index == 3:\n index = 0\n\nprint(weather[index])\n","change":"replace","i1":5,"i2":6,"j1":5,"j2":6,"error":0,"stderr":null,"stdout":"Cloudy\n"} {"problem_id":"p02909","language":"Python","original_status":"Runtime Error","pass":"s = input()\n\nweather = [\"Sunny\", \"Cloudy\", \"Rainy\"]\nprint(weather[weather.index(s) + 1])\n","fail":"s = input()\n\nweather = [\"Sunny\", \"Cloudy\", \"Rainy\"]\nprint(weather[(weather.index(s) + 1) % 3])\n","change":"replace","i1":3,"i2":4,"j1":3,"j2":4,"error":0,"stderr":null,"stdout":"Cloudy\n"} {"problem_id":"p02910","language":"Python","original_status":"Runtime Error","pass":"li = list(input())\n\nfor i in range(len(li)):\n if i % 2 == 0:\n if len[i] == \"R\":\n print(\"No\")\n quit()\n else:\n if len[i] == \"L\":\n print(\"No\")\n quit()\nprint(\"Yes\")\n","fail":"li = list(input())\n\nfor i in range(len(li)):\n if i % 2 == 1:\n if li[i] == \"R\":\n print(\"No\")\n quit()\n else:\n continue\n else:\n if li[i] == \"L\":\n print(\"No\")\n quit()\n else:\n continue\nprint(\"Yes\")\n","change":"replace","i1":3,"i2":11,"j1":3,"j2":15,"error":"TypeError: 'builtin_function_or_method' object is not subscriptable","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02910\/Python\/s460535863.py\", line 5, in \n if len[i] == \"R\":\nTypeError: 'builtin_function_or_method' object is not subscriptable\n","stdout":null} {"problem_id":"p02911","language":"Python","original_status":"Time Limit Exceeded","pass":"n, k, q = map(int, input().split())\narr = [k for _ in range(n)]\n\nfor _ in range(q):\n winner_id = int(input()) - 1\n arr = [ele - 1 for ele in arr]\n arr[winner_id] += 1\n\nfor ele in arr:\n if ele > 0:\n print(\"Yes\")\n else:\n print(\"No\")\n","fail":"n, k, q = map(int, input().split())\narr = [k - q] * n\n\nfor _ in range(q):\n winner_id = int(input()) - 1\n arr[winner_id] += 1\n\nfor ele in arr:\n if ele > 0:\n print(\"Yes\")\n else:\n print(\"No\")\n","change":"replace","i1":1,"i2":6,"j1":1,"j2":5,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02911","language":"Python","original_status":"Time Limit Exceeded","pass":"def main():\n N, K, Q, *A = map(int, open(0).read().split())\n A = [K + A.count(i) for i in range(1, N + 1)]\n print(\"\\\\n\".join([\"Yes\" if Q < a else \"No\" for a in A]))\n return\n\n\nmain()\n","fail":"def main():\n N, K, Q, *A = map(int, open(0).read().split())\n ans = [0] * N\n for a in A:\n ans[a - 1] += 1\n print(\"\\\\n\".join([\"Yes\" if Q < K + a else \"No\" for a in ans]))\n return\n\n\nmain()\n","change":"replace","i1":2,"i2":4,"j1":2,"j2":6,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02911","language":"Python","original_status":"Runtime Error","pass":"n, k, q = map(int, input().split())\na = [int(input()) for _ in range(q)]\np = k - q\ns = [[i, p] for i in range(n)]\nfor i in a:\n s[i][1] += 1\n\nfor i in s:\n if i[1] < 1:\n print(\"No\")\n else:\n print(\"Yes\")\n","fail":"n, k, q = map(int, input().split())\na = [int(input()) for _ in range(q)]\np = k - q\ns = [p] * n\nfor i in a:\n s[i - 1] += 1\n\nfor i in s:\n if i < 1:\n print(\"No\")\n else:\n print(\"Yes\")\n","change":"replace","i1":3,"i2":9,"j1":3,"j2":9,"error":"WA","stderr":null,"stdout":"No\nNo\nNo\nYes\nNo\nNo\n"} {"problem_id":"p02911","language":"Python","original_status":"Time Limit Exceeded","pass":"n, k, q = map(int, input().split())\na = [int(input()) for _ in range(q)]\nfor i in range(n):\n print(\"Yes\" if k + a.count(i + 1) - q > 0 else \"No\")\n","fail":"n, k, q = map(int, input().split())\nnList = [0] * n\nfor _ in range(q):\n nList[int(input()) - 1] += 1\nfor j in range(n):\n print(\"Yes\" if k + nList[j] - q > 0 else \"No\")\n","change":"replace","i1":1,"i2":4,"j1":1,"j2":6,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02911","language":"Python","original_status":"Time Limit Exceeded","pass":"nkq = list(map(int, input().split()))\nn, k, q = nkq[0], nkq[1], nkq[2]\nattendees = dict()\nfor i in range(n):\n attendees[i] = k\n\nattendees = [(i, k) for i in range(n)]\n\nrespondents = [int(input()) for i in range(q)]\n\nfor r in respondents:\n r_index = r - 1\n for a in attendees:\n i, p = a\n if i != r_index:\n attendees[i] = (i, p - 1)\n\nfor a in attendees:\n i, p = a\n if p > 0:\n print(\"Yes\")\n else:\n print(\"No\")\n","fail":"nkq = list(map(int, input().split()))\nn, k, q = nkq[0], nkq[1], nkq[2]\nattendees = dict()\nfor i in range(n):\n attendees[i] = 0\n\nrespondents = [int(input()) for i in range(q)]\n\nfor r in respondents:\n r_index = r - 1\n attendees[r_index] += 1\n\nfor i, p in attendees.items():\n point = p + k - q\n if point > 0:\n print(\"Yes\")\n else:\n print(\"No\")\n","change":"replace","i1":4,"i2":20,"j1":4,"j2":15,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02911","language":"Python","original_status":"Time Limit Exceeded","pass":"import numpy as np\n\nN, K, Q = map(int, input().split())\nA = [int(input()) for i in range(Q)]\nN_array = [K] * N\nnp = np.array(N_array)\nfor x in A:\n np -= 1\n np[x - 1] += 1\nfor z in np:\n if z > 0:\n print(\"Yes\")\n else:\n print(\"No\")\n","fail":"N, K, Q = map(int, input().split())\nA = [int(input()) for i in range(Q)]\nN_array = [K - Q] * N\nfor x in A:\n N_array[x - 1] += 1\nfor z in N_array:\n if z > 0:\n print(\"Yes\")\n else:\n print(\"No\")\n","change":"replace","i1":0,"i2":10,"j1":0,"j2":6,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02911","language":"Python","original_status":"Time Limit Exceeded","pass":"def update_points(points, current_ansewr):\n return list(\n map(\n lambda x: x[1] if (x[0] + 1) == current_ansewr else x[1] - 1,\n enumerate(points),\n )\n )\n\n\nN, K, Q = [int(i) for i in input().split()]\npoints = [K] * N\nfor _ in range(Q):\n answer = int(input())\n points = update_points(points, answer)\nfor p in points:\n print(\"Yes\" if p > 0 else \"No\")\n","fail":"N, K, Q = [int(i) for i in input().split()]\npoints = [(K - Q)] * N\nfor _ in range(Q):\n answer = int(input())\n points[answer - 1] += 1\nfor p in points:\n print(\"Yes\" if p > 0 else \"No\")\n","change":"replace","i1":0,"i2":14,"j1":0,"j2":5,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02911","language":"Python","original_status":"Time Limit Exceeded","pass":"def main():\n N, K, Q = map(int, input().split())\n A = [int(input()) for _ in range(Q)]\n\n points = [K for _ in range(N)]\n\n for i in A:\n points = list(map(lambda x: x - 1, points))\n points[i - 1] += 1\n\n for i in points:\n if i <= 0:\n print(\"No\")\n else:\n print(\"Yes\")\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"def main():\n N, K, Q = map(int, input().split())\n A = [int(input()) for _ in range(Q)]\n\n points = [K for _ in range(N)]\n points = list(map(lambda x: x - Q, points))\n\n for i in A:\n points[i - 1] += 1\n\n for i in points:\n if i <= 0:\n print(\"No\")\n else:\n print(\"Yes\")\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":5,"i2":8,"j1":5,"j2":8,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02911","language":"Python","original_status":"Time Limit Exceeded","pass":"N, K, Q = map(int, input().split())\nA = [int(input()) for _ in range(Q)]\n\npoints = [K for _ in range(N)]\n\nfor i in range(Q):\n points[A[i] - 1] += 1\n for j in range(N):\n points[j] -= 1\n\nfor j in range(N):\n if points[j] >= 1:\n print(\"Yes\")\n else:\n print(\"No\")\n","fail":"N, K, Q = map(int, input().split())\nA = [int(input()) for _ in range(Q)]\n\npoints = [K for _ in range(N)]\n\nfor i in range(Q):\n points[A[i] - 1] += 1\n\nfor j in range(N):\n points[j] -= Q\n\nfor j in range(N):\n if points[j] >= 1:\n print(\"Yes\")\n else:\n print(\"No\")\n","change":"replace","i1":7,"i2":9,"j1":7,"j2":10,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02911","language":"Python","original_status":"Runtime Error","pass":"n, k, q = map(int, input().split())\na = []\nfor i in range(q):\n a[i] = int(input()) - 1\nscore = [0 for _ in range(n)]\n\nfor a_i in a:\n score[a_i] += 1\n\nfor i in range(n):\n result = k - q + score[i]\n print(\"Yes\" if result > 0 else \"No\")\n","fail":"n, k, q = map(int, input().split())\na = []\nfor i in range(q):\n a.append(int(input()) - 1)\nscore = [0 for _ in range(n)]\n\nfor a_i in a:\n score[a_i] += 1\n\nfor i in range(n):\n result = k - q + score[i]\n print(\"Yes\" if result > 0 else \"No\")\n","change":"replace","i1":3,"i2":4,"j1":3,"j2":4,"error":"IndexError: list assignment index out of range","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02911\/Python\/s560201752.py\", line 4, in \n a[i] = int(input()) - 1\nIndexError: list assignment index out of range\n","stdout":null} {"problem_id":"p02911","language":"Python","original_status":"Time Limit Exceeded","pass":"N, K, Q = map(int, input().split())\nans_r = [K] * N\ncor = list(map(int, [input() for i in range(Q)]))\nfor i in cor:\n ans_r[i - 1] += 1\n ans_r = list(map(lambda x: x - 1, ans_r))\nans_r = list(map(lambda x: \"No\" if x <= 0 else \"Yes\", ans_r))\nfor i in ans_r:\n print(i)\n","fail":"N, K, Q = map(int, input().split())\nans_r = [K - Q] * N\ncor = list(map(int, [input() for i in range(Q)]))\nfor i in cor:\n ans_r[i - 1] += 1\nfor i in ans_r:\n if i <= 0:\n print(\"No\")\n else:\n print(\"Yes\")\n","change":"replace","i1":1,"i2":9,"j1":1,"j2":10,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02911","language":"Python","original_status":"Time Limit Exceeded","pass":"# -*- coding: utf-8 -*-\nN, K, Q = map(int, input().split())\nA = [int(input()) for _ in range(Q)]\n\ndp = [K] * N\n\n\ndef calc_dp(n):\n return n - 1\n\n\nfor i in A:\n dp = list(map(calc_dp, dp))\n dp[i - 1] += 1\n\n\nfor j in dp:\n if j > 0:\n print(\"Yes\")\n else:\n print(\"No\")\n","fail":"# -*- coding: utf-8 -*-\nN, K, Q = map(int, input().split())\nA = [int(input()) for _ in range(Q)]\n\ndp = [K] * N\n\n\ndef calc_dp(n):\n return n - Q\n\n\nfor i in A:\n # dp = list(map(calc_dp, dp))\n dp[i - 1] += 1\n\ndp = list(map(calc_dp, dp))\n\nfor j in dp:\n if j > 0:\n print(\"Yes\")\n else:\n print(\"No\")\n","change":"replace","i1":8,"i2":15,"j1":8,"j2":16,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02911","language":"Python","original_status":"Time Limit Exceeded","pass":"import numpy as np\n\nN, K, Q = list(map(int, input().strip().split()))\nAs = [int(input()) for _ in range(Q)]\n\npoints = np.asarray([K for _ in range(N)])\nfor A in As:\n points -= 1\n points[A - 1] += 1\n\nfor p in points:\n if p > 0:\n print(\"Yes\")\n else:\n print(\"No\")\n","fail":"import numpy as np\n\nN, K, Q = list(map(int, input().strip().split()))\nAs = [int(input()) for _ in range(Q)]\n\npoints = np.asarray([K for _ in range(N)])\n\npoints -= Q\nfor A in As:\n points[A - 1] += 1\n\nfor p in points:\n if p > 0:\n print(\"Yes\")\n else:\n print(\"No\")\n","change":"replace","i1":6,"i2":8,"j1":6,"j2":9,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02911","language":"Python","original_status":"Time Limit Exceeded","pass":"N, K, Q = map(int, input().split())\nA = list(int(input()) for i in range(Q))\nfor i in range(N):\n if Q - A.count(i + 1) < K:\n print(\"Yes\")\n else:\n print(\"No\")\n","fail":"from collections import Counter\n\nN, K, Q = map(int, input().split())\nA = list(int(input()) for i in range(Q))\nc = Counter(A)\nfor i in range(N):\n if Q - c[i + 1] < K:\n print(\"Yes\")\n else:\n print(\"No\")\n","change":"replace","i1":0,"i2":4,"j1":0,"j2":7,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02912","language":"Python","original_status":"Time Limit Exceeded","pass":"N, M = map(int, input().split())\nA = list(sorted(map(int, input().split()), key=lambda x: -x))\n\nfor _ in range(M):\n A[0] \/= 2\n\n p = 0\n while p < N - 1 and A[p] < A[p + 1]:\n A[p], A[p + 1] = A[p + 1], A[p]\n p += 1\n\nprint(sum(map(int, A)))\n","fail":"import heapq\n\nN, M = map(int, input().split())\nA = list(map(lambda x: -1 * int(x), input().split()))\n\nheapq.heapify(A)\nfor _ in range(M):\n a = -1 * heapq.heappop(A)\n a \/\/= 2\n heapq.heappush(A, -1 * a)\n\nprint(-1 * sum(A))\n","change":"replace","i1":0,"i2":12,"j1":0,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02912","language":"Python","original_status":"Time Limit Exceeded","pass":"n, m = map(int, input().split())\na = list(map(int, input().split()))\na.sort()\n\nfor _ in range(m):\n a[-1] \/\/= 2\n a.sort()\n\nprint(sum(a))\n","fail":"import heapq\n\nn, m = map(int, input().split())\na = list(map(lambda x: int(x) * (-1), input().split()))\nheapq.heapify(a)\n\nfor _ in range(m):\n y = heapq.heappop(a)\n heapq.heappush(a, (-1) * (-y \/\/ 2))\n\nprint(-sum(a))\n","change":"replace","i1":0,"i2":9,"j1":0,"j2":11,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02912","language":"Python","original_status":"Time Limit Exceeded","pass":"n, m = map(int, input().split())\na = list(map(int, input().split()))\na.sort(reverse=True)\n\nfor _ in range(m):\n a[0] = a[0] \/\/ 2\n a.sort(reverse=True)\n\n\nprint(sum(a))\n","fail":"# priority queue\u3067\u697d\u52dd\u3060\u3063\u305f\nimport heapq\n\nn, m = map(int, input().split())\na = list(map(lambda x: int(x) * -1, input().split()))\nheapq.heapify(a)\n\nfor _ in range(m):\n x = -(-a[0] \/\/ 2)\n heapq.heapreplace(a, x)\n # print(a)\nprint(sum(a) * -1)\n","change":"replace","i1":0,"i2":10,"j1":0,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02912","language":"Python","original_status":"Time Limit Exceeded","pass":"N, M = map(int, input().split())\nA = list(map(int, input().split()))\n\nwhile M > 0:\n max_index = A.index(max(A))\n A[max_index] = A[max_index] \/\/ 2\n M -= 1\nprint(sum(A))\n","fail":"N, M = map(int, input().split())\nA = list(map(int, input().split()))\n\nwhile M > 0:\n A.sort(reverse=True)\n if A[0] == 0:\n break\n ham = A[0] \/\/ 2\n for i, a in enumerate(A):\n if ham < a and M > 0:\n A[i] = A[i] \/\/ 2\n M -= 1\n else:\n break\nprint(sum(A))\n","change":"replace","i1":4,"i2":7,"j1":4,"j2":14,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02912","language":"Python","original_status":"Time Limit Exceeded","pass":"n, m = map(int, input().split())\na_list = list(map(int, input().split()))\n\na_list.sort(reverse=True)\nswapped = False\nwhile m > 0:\n a_list[0] = a_list[0] \/\/ 2\n m -= 1\n if (n > 1) and (a_list[0] < a_list[1]) and not swapped:\n temp = a_list[0]\n a_list[0] = a_list[1]\n a_list[1] = temp\n swapped = True\n else:\n a_list.sort(reverse=True)\n swapped = False\n\ncost_sum = 0\nfor a in a_list:\n cost_sum += a\n\nprint(cost_sum)\n","fail":"from heapq import heappush, heappop\n\nn, m = map(int, input().split())\na_list = list(map(int, input().split()))\n\nhqueue = []\nfor a in a_list:\n heappush(hqueue, -a)\n\nfor i in range(m):\n max_item = -(-heappop(hqueue) \/\/ 2)\n heappush(hqueue, max_item)\n\ncost = 0\nfor i in range(n):\n cost += -heappop(hqueue)\n\nprint(cost)\n","change":"replace","i1":0,"i2":22,"j1":0,"j2":18,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02912","language":"Python","original_status":"Time Limit Exceeded","pass":"import bisect as b\nimport math\n\nn, m = list(map(int, input().split()))\na = sorted(list(map(int, input().split())))\n\nfor _ in range(m):\n half = a.pop(-1) \/ 2\n a.insert(b.bisect_left(a, half), half)\n\nprint(sum(list(map(lambda x: math.floor(x), a))))\n","fail":"import heapq\nimport math\n\nn, m = list(map(int, input().split()))\na = list(map(lambda x: int(x) * (-1), input().split()))\nheapq.heapify(a)\n\nfor _ in range(m):\n heapq.heappush(a, math.ceil(heapq.heappop(a) \/ 2))\n\nprint(-sum(a))\n","change":"replace","i1":0,"i2":11,"j1":0,"j2":11,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02912","language":"Python","original_status":"Time Limit Exceeded","pass":"N, M = map(int, input().split())\nA_list = list(map(int, input().split()))\nA_list.sort()\nif N == 1:\n A_list[-1] = A_list[-1] \/\/ (2**M)\nelif N > 1:\n while M > 0:\n A_list[-1] = A_list[-1] \/\/ 2\n if A_list[-1] < A_list[-2]:\n A_list.sort()\n M -= 1\nprint(sum(A_list))\n","fail":"# \u512a\u5148\u5ea6\u4ed8\u304d\u30ad\u30e5\u30fc\u306e\u8003\u3048\u65b9\u304c\u5fc5\u9808\nimport heapq\n\nN, M = map(int, input().split())\n# \u8aad\u307f\u8fbc\u307f\u6642\u306b * -1 \u3092\u4e57\u7b97\u3057\u3066\u3044\u308b\nA_list = list(map(lambda x: int(x) * (-1), input().split()))\n# A_list\u3092\u512a\u5148\u5ea6\u4ed8\u304d\u30ad\u30e5\u30fc\u306b\u3059\u308b\nheapq.heapify(A_list)\n\nwhile M > 0:\n temp_max = heapq.heappop(A_list)\n # \/\/2 \u3067\u4f59\u308a\u306f\u5207\u308a\u6368\u3066\u306e\u305f\u3081 -1 \u3092 2\u56de \u4e57\u7b97\u3057\u3066\u3044\u308b\n heapq.heappush(A_list, (-1) * ((-1 * temp_max) \/\/ 2))\n M -= 1\nprint(-1 * sum(A_list))\n","change":"replace","i1":0,"i2":12,"j1":0,"j2":15,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02912","language":"Python","original_status":"Time Limit Exceeded","pass":"N, M = map(int, input().split())\nA = list(map(int, input().split()))\nwhile M > 0:\n M -= 1\n A[A.index(max(A))] \/\/= 2\nprint(sum(A))\n","fail":"import heapq\n\nn, m = map(int, input().split())\na = list(map(lambda x: int(x) * (-1), input().split()))\nheapq.heapify(a) # a\u3092\u512a\u5148\u5ea6\u4ed8\u304d\u30ad\u30e5\u30fc\u306b\n\nfor _ in range(m):\n tmp_min = heapq.heappop(a)\n heapq.heappush(a, (-1) * (-tmp_min \/\/ 2)) # \u8a08\u7b97\u8aa4\u5dee\u306e\u95a2\u4fc2\u3067-1\u30922\u56de\u304b\u3051\u3066\u307e\u3059\nprint(-sum(a))\n","change":"replace","i1":0,"i2":6,"j1":0,"j2":10,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02912","language":"Python","original_status":"Time Limit Exceeded","pass":"N, M = map(int, input().split())\nA = list(map(float, input().split()))\n\nfor _ in range(M):\n i = max(range(len(A)), key=A.__getitem__)\n A[i] \/= 2\nA = list(map(int, A))\nprint(sum(A))\n","fail":"import heapq\n\nN, M = map(int, input().split())\nA = list(map(float, input().split()))\n\nheap = [-Ai for Ai in A]\nheapq.heapify(heap)\nfor _ in range(M):\n heapq.heapreplace(heap, heap[0] \/ 2)\nA = [int(-p) for p in heap]\nprint(sum(A))\n","change":"replace","i1":0,"i2":7,"j1":0,"j2":10,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02912","language":"Python","original_status":"Time Limit Exceeded","pass":"N, M = map(int, input().split()) # \u54c1\u7269\u306e\u6570\u3001\u5272\u5f15\u5238\u306e\u679a\u6570\nA = list(map(int, input().split())) # \u54c1\u7269\u306e\u5024\u6bb5\nfor _ in range(M):\n tmp = A.index(max(A))\n A[tmp] = A[tmp] \/\/ 2\nprint(str(sum(A)))\n","fail":"N, M = map(int, input().split()) # \u54c1\u7269\u306e\u6570\u3001\u5272\u5f15\u5238\u306e\u679a\u6570\nA = list(map(int, input().split())) # \u54c1\u7269\u306e\u5024\u6bb5\nA.sort(reverse=True)\ni = 0\nfor _ in range(M):\n A[i] = A[i] \/\/ 2\n if i <= N - 2 and A[i] < A[i + 1] and A[0] < A[i + 1]:\n i += 1\n else:\n A.sort(reverse=True)\n i = 0\nprint(str(sum(A)))\n","change":"replace","i1":2,"i2":5,"j1":2,"j2":11,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02912","language":"Python","original_status":"Time Limit Exceeded","pass":"n, m = map(int, input().split())\na = list(map(int, input().split()))\nwhile m > 0:\n M = max(a)\n tmp = a.index(M)\n a[tmp] = a[tmp] \/\/ 2\n m -= 1\nprint(sum(a))\n","fail":"import heapq\n\nn, m = map(int, input().split())\nA = list(map(int, input().split()))\n\npq = []\nfor a in A:\n heapq.heappush(pq, -a) #'-'\u306b\u3059\u308b\u3053\u3068\u3067\u6700\u5927\u5024\u3092\u8003\u3048\u308b\u3053\u3068\u304c\u3067\u304d\u308b\uff01\n# print(pq)\nfor _ in range(m):\n a = (-heapq.heappop(pq)) \/\/ 2\n heapq.heappush(pq, -a)\nprint(-sum(pq))\n","change":"replace","i1":0,"i2":8,"j1":0,"j2":13,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02912","language":"Python","original_status":"Time Limit Exceeded","pass":"N, M = map(int, input().split())\nA = [int(i) for i in input().split()]\n\nA = sorted(A, reverse=True)\n\nfor _ in range(M):\n A[0] = A[0] \/ 2\n A = sorted(A, reverse=True)\n\nans = 0\nfor a in A:\n ans += int(a)\n\nprint(ans)\n","fail":"import heapq\n\nN, M = map(int, input().split())\nA = [-int(i) for i in input().split()]\n\nheapq.heapify(A)\n\nfor _ in range(M):\n x = heapq.heappop(A) \/ 2\n heapq.heappush(A, x)\n\nans = 0\nfor a in A:\n ans -= int(a)\n\nprint(ans)\n","change":"replace","i1":0,"i2":12,"j1":0,"j2":14,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02912","language":"Python","original_status":"Time Limit Exceeded","pass":"import numpy as np\n\nN, M = map(int, input().split())\nA = np.array([int(n) for n in input().split()])\n\nfor _ in range(M):\n A[np.argmax(A)] \/\/= 2\n\nprint(int(np.sum(A)))\n","fail":"import heapq\n\nN, M = map(int, input().split())\nA = [-int(n) for n in input().split()]\nheapq.heapify(A)\n\nfor _ in range(M):\n a = heapq.heappop(A)\n a = a \/\/ 2 if a % 2 == 0 else a \/\/ 2 + 1\n heapq.heappush(A, a)\n\nprint(-sum(A))\n","change":"replace","i1":0,"i2":9,"j1":0,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02912","language":"Python","original_status":"Time Limit Exceeded","pass":"N, M = map(int, input().split())\nA = list(map(int, input().split()))\n\nfor _ in range(M):\n A.sort()\n A[-1] \/\/= 2\n\nprint(sum(A))\n","fail":"import heapq\n\nN, M = map(int, input().split())\nA = list(map(lambda x: int(x) * -1, input().split()))\n\nheapq.heapify(A)\n\nfor _ in range(M):\n heapq.heappush(A, (heapq.heappop(A) + 1) \/\/ 2)\n\nans = sum(A) * -1\n\nprint(ans)\n","change":"replace","i1":0,"i2":8,"j1":0,"j2":13,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02912","language":"Python","original_status":"Runtime Error","pass":"import heapq # heapq\u30e9\u30a4\u30d6\u30e9\u30ea\u306eimoprt\n\nN, M = map(int, input().split())\nA = map(lambda x: int(x) * (-1), input().split())\nheapq.heapify(A)\n\nfor _ in range(N):\n a = heapq.heappop(A)\n a = (-a \/\/ 2) * (-1)\n heapq.heappush(A, a)\nprint(-sum(A))\n","fail":"from heapq import heapify, heappop, heappush\n\nN, M = map(int, input().split())\nA = []\nfor i in input().split():\n A.append(-int(i))\nheapify(A)\nfor _ in range(M):\n a = -heappop(A)\n heappush(A, (a \/\/ 2) * -1)\n# print('A', A)\nans = -sum(A)\nprint(ans)\n","change":"replace","i1":0,"i2":11,"j1":0,"j2":13,"error":"TypeError: heapify() argument must be list, not map","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02912\/Python\/s538766589.py\", line 5, in \n heapq.heapify(A)\nTypeError: heapify() argument must be list, not map\n","stdout":null} {"problem_id":"p02912","language":"Python","original_status":"Time Limit Exceeded","pass":"#!\/usr\/bin\/env python3\n\nN, M = list(map(int, input().split()))\na_list = list(map(int, input().split()))\n\nfor _ in range(M):\n a_list = sorted(a_list, reverse=True)\n a_list[0] = a_list[0] \/\/ 2\n\nans = sum(a_list)\nprint(ans)\n","fail":"#!\/usr\/bin\/env python3\nimport heapq\n\nN, M = list(map(int, input().split()))\na_list = list(map(int, input().split()))\n\n# Python\u306eheapq\u306f\u6700\u5c0f\u5024\u3057\u304b\u3068\u308c\u306a\u3044\u306e\u3067\u3001\u8ca0\u306e\u5024\u306b\u5909\u63db\u3057\u3066\u6271\u3046\na_list = list(map(lambda x: x * (-1), a_list))\nheapq.heapify(a_list)\n\nfor _ in range(M):\n max_value = -heapq.heappop(a_list)\n heapq.heappush(a_list, -(max_value \/\/ 2))\n\nans = -sum(a_list)\nprint(ans)\n","change":"replace","i1":1,"i2":10,"j1":1,"j2":15,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02912","language":"Python","original_status":"Time Limit Exceeded","pass":"N, M = map(int, input().split())\na_list = sorted(map(int, input().split()))\nfor _ in range(M):\n a_list[-1] \/\/= 2\n a_list.sort()\nprint(sum(a_list))\n","fail":"import heapq\n\nN, M = map(int, input().split())\na_list = list(map(lambda x: int(x) * (-1), input().split()))\nheapq.heapify(a_list)\nfor _ in range(M):\n min_num = heapq.heappop(a_list)\n heapq.heappush(a_list, (-1) * (-min_num \/\/ 2))\nprint(-sum(a_list))\n","change":"replace","i1":0,"i2":6,"j1":0,"j2":9,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02912","language":"Python","original_status":"Time Limit Exceeded","pass":"from sys import stdin\nfrom bisect import insort\n\n\ndef main():\n N, M = [int(x) for x in stdin.readline().rstrip().split()]\n As = [int(x) for x in stdin.readline().rstrip().split()]\n As.sort()\n for _ in range(M):\n x = As[-1] \/ 2\n insort(As, x)\n del As[-1]\n sum_ = 0\n for x in As:\n sum_ += int(x)\n print(sum_)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"from sys import stdin\nimport heapq\n\n\ndef main():\n N, M = [int(x) for x in stdin.readline().rstrip().split()]\n As = []\n for i in [int(x) for x in stdin.readline().rstrip().split()]:\n heapq.heappush(As, -i)\n for _ in range(M):\n x = heapq.heappop(As)\n heapq.heappush(As, x \/ 2)\n print(sum([-1 * int(x) for x in As]))\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":1,"i2":16,"j1":1,"j2":13,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02912","language":"Python","original_status":"Time Limit Exceeded","pass":"n, m = input().split()\nN = int(n)\nM = int(m)\n\nA = list(map(int, input().split()))\nA.sort(reverse=True)\n\nfor _ in range(M):\n A[0] = A[0] \/\/ 2\n A.sort(reverse=True)\nprint(sum(A))\n","fail":"N, M = map(int, input().split())\nA = list(map(int, input().split()))\nA.sort(reverse=True)\nit = 0\nfor i in range(M):\n A[it] = A[it] \/\/ 2\n if it < N - 1:\n if A[it] < A[it + 1] and A[0] < A[it + 1]:\n it += 1\n else:\n A.sort(reverse=True)\n it = 0\n if it == N - 1:\n A.sort(reverse=True)\n it = 0\nprint(sum(A))\n","change":"replace","i1":0,"i2":10,"j1":0,"j2":15,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02912","language":"Python","original_status":"Time Limit Exceeded","pass":"#!\/usr\/bin\/env python3\n\nfrom bisect import insort_right\nfrom collections import deque\n\nn, m, *a = map(int, open(0).read().split())\n\na = deque(sorted(a))\nfor _ in range(m):\n insort_right(a, a.pop() >> 1)\nprint(sum(a))\n","fail":"#!\/usr\/bin\/env python3\n\nfrom bisect import insort_right\n\nn, m, *a = map(int, open(0).read().split())\na.sort()\nfor _ in range(m):\n insort_right(a, a.pop() >> 1)\nprint(sum(a))\n","change":"replace","i1":3,"i2":8,"j1":3,"j2":6,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02912","language":"Python","original_status":"Time Limit Exceeded","pass":"n, m = map(int, input().split())\na = list(map(int, input().split()))\n\nfor _ in range(m):\n a[a.index(max(a))] = a[a.index(max(a))] \/\/ 2\n\nprint(sum(a))\n","fail":"import heapq\n\nn, m = map(int, input().split())\na = []\nfor i in list(map(int, input().split())):\n heapq.heappush(a, -i)\n\nfor _ in range(m):\n p = heapq.heappop(a)\n heapq.heappush(a, int(p \/ 2))\n\nprint(-sum(a))\n","change":"replace","i1":0,"i2":7,"j1":0,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02912","language":"Python","original_status":"Time Limit Exceeded","pass":"N, M = map(int, input().split())\nA = sorted(list(map(int, input().split())), reverse=True)\n\nwhile M > 0:\n A[0] \/\/= 2\n for i in range(1, N):\n if A[0] > A[i]:\n A = A[1:i] + [A[0]] + A[i:]\n break\n else:\n A = A[1:] + [A[0]]\n M -= 1\nprint(sum(A))\n","fail":"import heapq\n\n\nclass Reverse:\n def __init__(self, val):\n self.val = val\n\n def __lt__(self, other):\n return self.val > other.val\n\n def __repr__(self):\n return repr(self.val)\n\n\nclass Heapq:\n def __init__(self, arr, desc=False):\n if desc:\n for i in range(len(arr)):\n arr[i] = Reverse(arr[i])\n self.desc = desc\n self.hq = arr\n heapq.heapify(self.hq)\n\n def pop(self):\n if len(self.hq) == 0:\n return None\n if self.desc:\n return heapq.heappop(self.hq).val\n else:\n return heapq.heappop(self.hq)\n\n def push(self, a):\n if self.desc:\n heapq.heappush(self.hq, Reverse(a))\n else:\n heapq.heappush(self.hq, a)\n\n\nN, M = map(int, input().split())\nq = Heapq(list(map(int, input().split())), desc=True)\n\nwhile M > 0:\n a = q.pop() \/\/ 2\n q.push(a)\n M -= 1\n\ntmp = 0\nwhile True:\n try:\n a = q.pop()\n tmp += a\n except:\n break\nprint(tmp)\n","change":"replace","i1":0,"i2":13,"j1":0,"j2":54,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02912","language":"Python","original_status":"Time Limit Exceeded","pass":"N, M = map(int, input().split())\nA = list(map(int, input().split()))\n\nwhile M > 0:\n maxv = max(A)\n max_index = A.index(maxv)\n A[max_index] = A[max_index] \/\/ 2\n M -= 1\n\nprint(sum(A))\n","fail":"import heapq\n\n\nN, M = map(int, input().split())\nA = list(map(int, input().split()))\n\nA = [a * -1 for a in A]\n\nheapq.heapify(A)\nfor _ in range(M):\n a = heapq.heappop(A)\n heapq.heappush(A, (-a \/\/ 2) * (-1))\n\nprint(-sum(A))\n","change":"replace","i1":0,"i2":10,"j1":0,"j2":14,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02912","language":"Python","original_status":"Time Limit Exceeded","pass":"N, M = map(int, input().split())\nA = list(map(int, input().split()))\n\nfor _ in range(M):\n A.sort(reverse=True)\n A[0] \/\/= 2\n\nprint(sum(A))\n","fail":"import sys\nfrom heapq import heappush, heappop\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\nN, M = map(int, input().split())\nA = []\nfor i in input().split():\n heappush(A, -1 * int(i))\n# print(A)\n\nfor _ in range(M):\n val = heappop(A)\n if val == 0:\n break\n heappush(A, (val + 1) \/\/ 2)\n\nprint(-1 * sum(A))\n","change":"replace","i1":0,"i2":8,"j1":0,"j2":21,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02912","language":"Python","original_status":"Time Limit Exceeded","pass":"from sys import stdin, setrecursionlimit\nfrom bisect import insort\n\n\ndef main():\n input = stdin.buffer.readline\n n, m = map(int, input().split())\n a = list(map(int, input().split()))\n a.sort()\n\n for _ in range(m):\n tmp = a[n - 1] \/\/ 2\n insort(a, tmp)\n\n print(sum(a[:n]))\n\n\nif __name__ == \"__main__\":\n setrecursionlimit(10000)\n main()\n","fail":"from sys import stdin, setrecursionlimit\nfrom heapq import heapify, heappop, heappush\n\n\ndef main():\n input = stdin.buffer.readline\n n, m = map(int, input().split())\n a = list(map(int, input().split()))\n a = [-ai for ai in a]\n heapify(a)\n\n for _ in range(m):\n tmp = -heappop(a)\n heappush(a, -(tmp \/\/ 2))\n\n print(-sum(a))\n\n\nif __name__ == \"__main__\":\n setrecursionlimit(10000)\n main()\n","change":"replace","i1":1,"i2":15,"j1":1,"j2":16,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02912","language":"Python","original_status":"Time Limit Exceeded","pass":"import math\nimport numpy as np\n\nn, m = map(int, input().split())\nprices = np.array(list(map(int, input().split())))\n\nfor _ in range(m):\n max_index = np.argmax(prices)\n prices[max_index] = prices[max_index] \/ 2\n\ntotal = 0\nfor price in prices:\n total += math.floor(price)\n\nprint(total)\n","fail":"import math\nimport heapq\n\nn, m = map(int, input().split())\nprices = list(map(int, input().split()))\nhq = []\n\n\ndef _heappush_max(heap, item):\n heap.append(item)\n heapq._siftdown_max(heap, 0, len(heap) - 1)\n\n\ndef _heappop_max(heap):\n \"\"\"Maxheap version of a heappop.\"\"\"\n lastelt = heap.pop() # raises appropriate IndexError if heap is empty\n if heap:\n returnitem = heap[0]\n heap[0] = lastelt\n heapq._siftup_max(heap, 0)\n return returnitem\n return lastelt\n\n\n# \u512a\u5148\u5ea6\u4ed8\u30ad\u30e5\u30fc\u306e\u4f5c\u6210\nfor price in prices:\n _heappush_max(hq, price)\n\n# \u5272\u5f15\u9069\u7528\nfor _ in range(m):\n target = _heappop_max(hq)\n _heappush_max(hq, target \/ 2)\n\ntotal = 0\nfor price in hq:\n total += math.floor(price)\n\nprint(total)\n","change":"replace","i1":1,"i2":12,"j1":1,"j2":35,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02912","language":"Python","original_status":"Time Limit Exceeded","pass":"# \u6bce\u56de\u30bd\u30fc\u30c8\u3057\u3066\u3082\u5225\u306b\u3044\u3044\u3093\u3058\u3083\u306a\u3044\u306e -> \u30c0\u30e1\u3067\u3057\u305f\n\nn, m = map(int, input().split())\narr = list(map(int, input().split()))\n\nwhile m > 0:\n arr = list(sorted(arr))\n arr[-1] = arr[-1] \/\/ 2\n m -= 1\n\nprint(sum(arr))\n","fail":"# \u6bce\u56de\u30bd\u30fc\u30c8\u3057\u3066\u3082\u5225\u306b\u3044\u3044\u3093\u3058\u3083\u306a\u3044\u306e -> \u30c0\u30e1\u3067\u3057\u305f\n# \u6bce\u56de\u6700\u5927\u306e\u3082\u306e\u304c\u307b\u3057\u3044\u306a\u3089heapq\u4f7f\u3046\u304b\nimport heapq\n\nn, m = map(int, input().split())\n# heap\u306f\u6700\u5c0f\u306e\u3082\u306e\u3092\u53d6\u308a\u51fa\u3059\u306e\u3067\u4e88\u3081-1\u3092\u304b\u3051\u3066\u5927\u5c0f\u3092\u898b\u304b\u3051\u4e0a\u9006\u8ee2\u3057\u3066\u304a\u304f\narr = list(map(lambda x: int(x) * -1, input().split()))\nheapq.heapify(arr)\nfor _ in range(m):\n a = heapq.heappop(arr)\n # \u8ca0\u6570\u306b\u3057\u305f\u3068\u304d\u306e\u8aa4\u5dee\u304c\u3081\u3093\u3069\u304f\u3055\u3044\n a *= -1\n a \/\/= 2\n heapq.heappush(arr, a * -1)\nprint(sum(arr) * -1)\n","change":"replace","i1":1,"i2":11,"j1":1,"j2":15,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02912","language":"Python","original_status":"Time Limit Exceeded","pass":"n, m = map(int, input().split())\nA = list(map(int, input().split()))\n\nfor _ in range(m):\n i = A.index(max(A))\n A[i] \/= 2\nA = [int(a) for a in A]\n\nprint(sum(A))\n","fail":"n, m = map(int, input().split())\nA = list(map(int, input().split()))\n\nA = [a * (-1) for a in A]\nimport heapq\n\nheapq.heapify(A)\n\nfor _ in range(m):\n a = heapq.heappop(A) * (-1)\n heapq.heappush(A, a \/\/ 2 * (-1))\n\nprint(abs(sum(A)))\n","change":"replace","i1":3,"i2":9,"j1":3,"j2":13,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02913","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nS = input()\n\nans = 0\nfor i in range(N):\n for j in range((N + i) \/\/ 2, i, -1):\n if S[i:j] in S[j:]:\n ans = max(ans, j - i)\n break\n\nprint(ans)\n","fail":"def z_algo(S):\n N = len(S)\n\n A = [0] * N\n A[0] = N\n i = 1\n j = 0\n\n while i < N:\n while i + j < N and S[j] == S[i + j]:\n j += 1\n if not j:\n i += 1\n continue\n A[i] = j\n k = 1\n while N - i > k < j - A[k]:\n A[i + k] = A[k]\n k += 1\n i += k\n j -= k\n return A\n\n\nN = int(input())\nS = input()\n\nans = 0\nfor i in range(N):\n A = z_algo(S[i:])\n for idx, ls in enumerate(A):\n if idx - ls >= 0:\n ans = max(ans, ls)\n\nprint(ans)\n","change":"replace","i1":0,"i2":9,"j1":0,"j2":33,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02913","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nS = input()\n\nans = 0\nleft, right = 0, 1\n\nwhile right < N:\n s = S[left:right]\n if s in S[right:]:\n right += 1\n ans = max(ans, len(s))\n else:\n left = right - 1\n\nprint(ans)\n","fail":"N = int(input())\nS = input()\n\nans = 0\nleft, right = 0, 1\n\nwhile right < N:\n s = S[left:right]\n if s in S[right:]:\n right += 1\n ans = max(ans, len(s))\n else:\n left += 1\n\nprint(ans)\n","change":"replace","i1":12,"i2":13,"j1":12,"j2":13,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02913","language":"Python","original_status":"Time Limit Exceeded","pass":"def Z_algo(S):\n n = len(S)\n LCP = [0] * n\n i = 1\n j = 0\n c = 0 # \u6700\u3082\u672b\u5c3e\u5074\u307e\u3067LCP\u3092\u6c42\u3081\u305f\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\n for i in range(1, n):\n # i\u756a\u76ee\u304b\u3089\u306eLCP\u304c\u4ee5\u524d\u8a08\u7b97\u3057\u305fc\u304b\u3089\u306eLCP\u306b\u542b\u307e\u308c\u3066\u3044\u308b\u5834\u5408\n if i + LCP[i - c] < c + LCP[c]:\n LCP[i] = LCP[i - c]\n else:\n j = max(0, c + LCP[c] - i)\n while i + j < n and S[j] == S[i + j]:\n j += 1\n LCP[i] = j\n c = i\n LCP[0] = n\n return LCP\n\n\nn = int(input())\ns = input()\nans = 0\nfor i in range(n):\n lcp = Z_algo(s[i:])\n for j in range(len(lcp)):\n tmp = min(j, lcp[j])\n ans = max(ans, tmp)\nprint(ans)\n","fail":"def Z_algo(S):\n n = len(S)\n LCP = [0] * n\n c = 0 # \u6700\u3082\u672b\u5c3e\u5074\u307e\u3067LCP\u3092\u6c42\u3081\u305f\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\n for i in range(1, n):\n # i\u756a\u76ee\u304b\u3089\u306eLCP\u304c\u4ee5\u524d\u8a08\u7b97\u3057\u305fc\u304b\u3089\u306eLCP\u306b\u542b\u307e\u308c\u3066\u3044\u308b\u5834\u5408\n if i + LCP[i - c] < c + LCP[c]:\n LCP[i] = LCP[i - c]\n else:\n j = max(0, c + LCP[c] - i)\n while i + j < n and S[j] == S[i + j]:\n j += 1\n LCP[i] = j\n c = i\n LCP[0] = n\n return LCP\n\n\nn = int(input())\ns = input()\nans = 0\nfor i in range(n):\n lcp = Z_algo(s[i:])\n for j, p in enumerate(lcp):\n tmp = min(j, p)\n ans = max(ans, tmp)\nprint(ans)\n","change":"replace","i1":3,"i2":27,"j1":3,"j2":25,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02913","language":"Python","original_status":"Time Limit Exceeded","pass":"def z_algorithm(s):\n n = len(s)\n prefix = [0] * n\n j = 0\n ret = 0\n for i in range(1, n):\n if i + prefix[i - j] < j + prefix[j]:\n prefix[i] = prefix[i - j]\n else:\n k = max(0, j + prefix[j] - i)\n while i + k < n and s[k] == s[i + k]:\n k += 1\n prefix[i] = k\n ret = min(i, k)\n j = i\n return ret\n\n\nn = int(input())\ns = input()\nprint(max(z_algorithm(s[i:]) for i in range(n - 1)))\n","fail":"def z_algorithm(s):\n n = len(s)\n prefix = [0] * n\n j = 0\n ret = 0\n for i in range(1, n):\n if i + prefix[i - j] < j + prefix[j]:\n prefix[i] = prefix[i - j]\n else:\n k = max(0, j + prefix[j] - i)\n while i + k < n and s[k] == s[i + k]:\n k += 1\n prefix[i] = k\n ret = max(ret, min(i, k))\n j = i\n return ret\n\n\nn = int(input())\ns = input()\nprint(max(z_algorithm(s[i:]) for i in range(n - 1)))\n","change":"replace","i1":13,"i2":14,"j1":13,"j2":14,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02913","language":"Python","original_status":"Runtime Error","pass":"from sys import stdin\n\nN = int(stdin.readline().rstrip())\nS = stdin.readline().rstrip()\ndp = [[0] * (N + 1) for _ in range(N + 1)]\nres = 0\n\nfor i in range(N - 1, -1, -1):\n for j in range(N - 1, i, -1):\n if S[i] == S[j]:\n dp[i][j] = dp[i + 1][j + 1] + 1, dp[i][j]\n res = max(res, min(j - i, dp[i][j]))\n\nprint(res)\n","fail":"from sys import stdin\n\nN = int(stdin.readline().rstrip())\nS = stdin.readline().rstrip()\ndp = [[0] * (N + 1) for _ in range(N + 1)]\nres = 0\n\nfor i in range(N - 1, -1, -1):\n for j in range(N - 1, i, -1):\n if S[i] == S[j]:\n dp[i][j] = dp[i + 1][j + 1] + 1\n res = max(res, min(j - i, dp[i][j]))\n\nprint(res)\n","change":"replace","i1":10,"i2":11,"j1":10,"j2":11,"error":"TypeError: '<' not supported between instances of 'tuple' and 'int'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02913\/Python\/s512048354.py\", line 12, in \n res = max(res, min(j - i, dp[i][j]))\nTypeError: '<' not supported between instances of 'tuple' and 'int'\n","stdout":null} {"problem_id":"p02913","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\ns = input()\n\ndp = [[0] * (n + 1) for _ in range(n + 1)]\n\nres = 0\nfor i in range(n - 1, -1, -1):\n for j in range(n - 1, i, -1):\n if s[i] == s[j]:\n dp[i][j] = max(dp[i][j], dp[i + 1][j + 1] + 1)\n res = max(res, min(dp[i][j], j - i))\nprint(res)\n","fail":"n = int(input())\ns = input()\n\ndp = [[0] * (n + 1) for _ in range(n + 1)]\n\nres = 0\nfor i in range(n - 1, -1, -1):\n for j in range(n - 1, i, -1):\n if s[i] == s[j]:\n dp[i][j] = dp[i + 1][j + 1] + 1\n # dp[i][j] = max(dp[i][j], dp[i + 1][j + 1] + 1)\n res = max(res, min(dp[i][j], j - i))\nprint(res)\n","change":"replace","i1":9,"i2":10,"j1":9,"j2":11,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02913","language":"Python","original_status":"Time Limit Exceeded","pass":"import numpy as np\n\n\ndef Z_algorithm(s):\n n = len(s)\n Z = [0] * n # z[i] = sum(s[0::n - i], s[i::n])\n Z[0] = n\n i, j = 1, 0\n while i < n:\n # \u5171\u901a\u90e8\u5206\u3092\u898b\u3064\u3051\u308b\u30d1\u30fc\u30c8\n while i + j < n and s[j] == s[i + j]:\n j += 1\n Z[i] = j\n\n if j == 0:\n i += 1\n continue\n # \u8a08\u7b97\u306e\u518d\u5229\u7528\u30d1\u30fc\u30c8\n # k + Z[k] < j \u306a\u3089\u518d\u5229\u7528\u3067\u304d\u308b\n k = 1\n while k < j and k + Z[k] < j:\n Z[i + k] = Z[k]\n k += 1\n # k\u500b\u5148\u307e\u3067\u898b\u305f\u306e\u3067k\u500b\u5148\u306b\u30d0\u30c8\u30f3\u3092\u6e21\u3059\n i += k\n j -= k\n return Z\n\n\nn, s = int(input()), input()\nprint(max((np.minimum(Z_algorithm(s[i:]), range(n - i))).max() for i in range(n)))\n","fail":"def Z_algorithm(s):\n n = len(s)\n Z = [0] * n # z[i] = sum(s[0::n - i], s[i::n])\n Z[0] = n\n i, j = 1, 0\n while i < n:\n # \u5171\u901a\u90e8\u5206\u3092\u898b\u3064\u3051\u308b\u30d1\u30fc\u30c8\n while i + j < n and s[j] == s[i + j]:\n j += 1\n Z[i] = j\n\n if j == 0:\n i += 1\n continue\n # \u8a08\u7b97\u306e\u518d\u5229\u7528\u30d1\u30fc\u30c8\n # k + Z[k] < j \u306a\u3089\u518d\u5229\u7528\u3067\u304d\u308b\n k = 1\n while k < j and k + Z[k] < j:\n Z[i + k] = Z[k]\n k += 1\n # k\u500b\u5148\u307e\u3067\u898b\u305f\u306e\u3067k\u500b\u5148\u306b\u30d0\u30c8\u30f3\u3092\u6e21\u3059\n i += k\n j -= k\n return Z\n\n\ndef solve(k):\n a = Z_algorithm(s[k:])\n ans = 0\n for i in range(n - k):\n ans = max(ans, min(i, a[i]))\n return ans\n\n\nn, s = int(input()), input()\nprint(max(solve(i) for i in range(n)))\n","change":"replace","i1":0,"i2":31,"j1":0,"j2":36,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02913","language":"Python","original_status":"Time Limit Exceeded","pass":"def z_algorithm(s):\n n = len(s)\n prefix = [0] * n\n j = 0\n ret = 0\n for i in range(1, n):\n if i + prefix[i - j] < j + prefix[j]:\n prefix[i] = prefix[i - j]\n else:\n k = max(0, j + prefix[j] - i)\n while i + k < n and s[k] == s[i + k]:\n k += 1\n prefix[i] = k\n ret = max(ret, min(i, k))\n j = i\n return ret\n\n\nn = int(input())\ns = input()\nprint(max(z_algorithm(s[i:]) for i in range(n - 1)))\n","fail":"def solve(n, s, d, MOD):\n ttt = [ord(c) - 97 for c in s]\n\n ttx = []\n c = 1\n for t in ttt[::-1]:\n ttx.append(t * c % MOD)\n c = c * d % MOD\n ttx.reverse()\n ttc = [0]\n for t in ttx:\n ttc.append((ttc[-1] + t) % MOD)\n\n l, r = 0, n\n while l < r:\n m = (l + r + 1) \/\/ 2\n if search(m, d, ttc, MOD):\n l = m\n else:\n r = m - 1\n\n return l\n\n\ndef search(w, d, ttc, MOD):\n appeared = []\n comparing = set()\n w2 = w * 2\n p = 1\n\n for i in range(w, n + 1):\n t = (ttc[i] - ttc[i - w]) * p % MOD\n if i >= w2:\n comparing.add(appeared[i - w2])\n if t in comparing:\n return True\n appeared.append(t)\n p = p * d % MOD\n\n return False\n\n\nn = int(input())\ns = input()\nMOD = 10**9 + 7\nprint(min(solve(n, s, d, MOD) for d in (26, 29, 31)))\n","change":"replace","i1":0,"i2":21,"j1":0,"j2":46,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02915","language":"Python","original_status":"Runtime Error","pass":"# -*- coding: utf-8 -*-\nfrom itertools import combination_with_replacement\n\nn = int(input())\nprint(len(list(combination_with_replacement(n, 3))))\n","fail":"# -*- coding: utf-8 -*-\nimport itertools\n\nn = int(input())\nprint(len(list(itertools.product(range(1, n + 1), repeat=3))))\n","change":"replace","i1":1,"i2":5,"j1":1,"j2":5,"error":"ImportError: cannot import name 'combination_with_replacement' from 'itertools' (unknown location)","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02915\/Python\/s250145116.py\", line 2, in \n from itertools import combination_with_replacement\nImportError: cannot import name 'combination_with_replacement' from 'itertools' (unknown location)\n","stdout":null} {"problem_id":"p02915","language":"Python","original_status":"Runtime Error","pass":"N = int(input().split())\n\nprint(N * N * N)\n","fail":"N = int(input())\n\nprint(N * N * N)\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"TypeError: int() argument must be a string, a bytes-like object or a real number, not 'list'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02915\/Python\/s074412118.py\", line 1, in \n N = int(input().split())\nTypeError: int() argument must be a string, a bytes-like object or a real number, not 'list'\n","stdout":null} {"problem_id":"p02915","language":"Python","original_status":"Runtime Error","pass":"N = input(int())\nprint(N**3)\n","fail":"N = int(input())\nprint(N**3)\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"TypeError: unsupported operand type(s) for ** or pow(): 'str' and 'int'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02915\/Python\/s203905734.py\", line 2, in \n print(N**3)\nTypeError: unsupported operand type(s) for ** or pow(): 'str' and 'int'\n","stdout":0.0} {"problem_id":"p02915","language":"Python","original_status":"Runtime Error","pass":"len = input()\nprint(len**3)\n","fail":"len = int(input())\nprint(len**3)\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"TypeError: unsupported operand type(s) for ** or pow(): 'str' and 'int'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02915\/Python\/s357662058.py\", line 2, in \n print(len**3)\nTypeError: unsupported operand type(s) for ** or pow(): 'str' and 'int'\n","stdout":null} {"problem_id":"p02915","language":"Python","original_status":"Runtime Error","pass":"a = input()\nprint(a**3)\n","fail":"a = int(input())\nprint(a**3)\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"TypeError: unsupported operand type(s) for ** or pow(): 'str' and 'int'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02915\/Python\/s464353610.py\", line 2, in \n print(a**3)\nTypeError: unsupported operand type(s) for ** or pow(): 'str' and 'int'\n","stdout":null} {"problem_id":"p02916","language":"Python","original_status":"Runtime Error","pass":"n = int(input())\na = [int(i) for i in input().split()]\nb = [int(i) for i in input().split()]\nc = [int(i) for i in input().split()]\nif len(c) == 1:\n print(sum(b) + sum(c))\nelse:\n print(sum(b) + sum(c) - c[a[n - 1] - 1])\n","fail":"n = int(input())\na = [int(i) for i in input().split()]\nb = [int(i) for i in input().split()]\nc = [int(i) for i in input().split()]\nans = b[a[0] - 1]\nfor i in range(1, n):\n ans += b[a[i] - 1]\n if a[i] == a[i - 1] + 1:\n ans += c[a[i - 1] - 1]\nprint(ans)\n","change":"replace","i1":4,"i2":8,"j1":4,"j2":10,"error":0,"stderr":null,"stdout":14} {"problem_id":"p02917","language":"Python","original_status":"Runtime Error","pass":"n = int(input())\nB = list(map(int, input().split()))\nans = 0\nans += B[0]\nfor i in range(n - 2):\n if B[i] > B[i + 1]:\n ans += B[i + i]\n else:\n ans += B[i]\nans += B[-1]\nprint(ans)\n","fail":"n = int(input())\nB = list(map(int, input().split()))\nans = 0\nans += B[0]\nfor i in range(n - 2):\n if B[i] > B[i + 1]:\n ans += B[i + 1]\n else:\n ans += B[i]\nans += B[-1]\nprint(ans)\n","change":"replace","i1":6,"i2":7,"j1":6,"j2":7,"error":"0","stderr":null,"stdout":9} {"problem_id":"p02917","language":"Python","original_status":"Runtime Error","pass":"N = int(input())\nB = [int(i) for i in input().split()][::-1]\n# N = 6\n# B = [0, 153, 10, 10, 23]\n# N = 3\n# B = [2, 5]\nans = 0\nans += B[1] # A[1]\nfor i in range(0, N - 1):\n ans += min(B[i - 1], B[i])\nprint(ans)\n","fail":"N = int(input())\nB = [int(i) for i in input().split()][::-1]\nret = B[0] + B[N - 2]\nfor i in range(1, N - 1):\n ret += min(B[i - 1], B[i])\nprint(ret)\n","change":"replace","i1":2,"i2":11,"j1":2,"j2":6,"error":"WA","stderr":null,"stdout":6} {"problem_id":"p02918","language":"Python","original_status":"Runtime Error","pass":"N = int(input())\n\nB = list(map(int, input().split()))\nB.append(max(B[0], B[-1]))\n\nans = 0\nfor i in range(N):\n ans += min(B[i], B[i - 1])\n\nprint(ans)\n","fail":"N, K = map(int, input().split())\nS = input()\nT = []\n\ng = S[0]\ncnt = 0\nfor s in S:\n if s == g:\n cnt += 1\n else:\n T.append(cnt)\n cnt = 1\n g = s\nelse:\n T.append(cnt)\n\n\nt = len(T)\nfor k in range(K):\n t -= 2\n\nif t <= 1:\n print(N - 1)\nelse:\n print(N - t)\n","change":"replace","i1":0,"i2":10,"j1":0,"j2":25,"error":"ValueError: invalid literal for int() with base 10: '6 1'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02918\/Python\/s122225482.py\", line 1, in \n N = int(input())\nValueError: invalid literal for int() with base 10: '6 1'\n","stdout":null} {"problem_id":"p02919","language":"Python","original_status":"Time Limit Exceeded","pass":"import bisect\n\nN = int(input())\nP = list(map(int, input().split()))\n\nplace = [-1] * (N + 1)\nfor i in range(N):\n p = P[i]\n place[p] = i\n\nans = 0\nbig_place = [place[N]]\nfor i in range(N - 1, 0, -1):\n pos = bisect.bisect_left(big_place, place[i])\n if pos < len(big_place):\n right = big_place[pos]\n else:\n right = N\n if pos + 1 < len(big_place):\n right2 = big_place[pos + 1]\n else:\n right2 = N\n if pos - 1 >= 0:\n left = big_place[pos - 1]\n else:\n left = -1\n if pos - 2 >= 0:\n left2 = big_place[pos - 2]\n else:\n left2 = -1\n\n if left >= 0:\n left_cand = left - left2\n else:\n left_cand = 0\n right_cand = right - place[i]\n\n ans += i * left_cand * right_cand\n\n if right < N:\n right_cand = right2 - right\n else:\n right_cand = 0\n left_cand = place[i] - left\n ans += i * left_cand * right_cand\n\n big_place1 = big_place[:pos]\n big_place2 = big_place[pos:]\n big_place = big_place1 + [place[i]] + big_place2\n\nprint(ans)\n","fail":"class Bit:\n def __init__(self, n):\n self.size = n\n self.tree = [0] * (n + 1)\n\n def sum(self, i):\n s = 0\n while i > 0:\n s += self.tree[i]\n i -= i & -i\n return s\n\n def add(self, i, x):\n while i <= self.size:\n self.tree[i] += x\n i += i & -i\n\n # i+1\u756a\u76ee\u304b\u3089R\u756a\u76ee\u307e\u3067\u8db3\u3059\u3068t\u4ee5\u4e0a\u3068\u306a\u308b\u3088\u3046\u306a\u6700\u5c0f\u306eR\u3092\u8fd4\u3059\n def bisect_plus(self, i, t):\n L = i\n R = self.size\n R_prev = R\n sum_i = self.sum(i)\n while True:\n range_sum = self.sum(R) - sum_i\n if range_sum < t:\n if R == self.size:\n return self.size + 1\n L, R = R, R_prev\n else:\n R_prev = R\n R = (L + R + 1) \/\/ 2\n if R == R_prev:\n return R\n\n # L\u756a\u76ee\u304b\u3089i-1\u756a\u76ee\u307e\u3067\u8db3\u3059\u3068t\u4ee5\u4e0a\u3068\u306a\u308b\u3088\u3046\u306a\u6700\u5c0f\u306eR\u3092\u8fd4\u3059\n def bisect_minus(self, i, t):\n L = 1\n R = i\n L_prev = L\n sum_i = self.sum(i - 1)\n while True:\n range_sum = sum_i - self.sum(L - 1)\n if range_sum < t:\n if L == 1:\n return 0\n L, R = L_prev, L\n else:\n L_prev = L\n L = (L + R) \/\/ 2\n if L == L_prev:\n return L\n\n\nN = int(input())\nP = list(map(int, input().split()))\n\nplace = [-1] * (N + 1)\nfor i in range(N):\n p = P[i]\n place[p] = i\n\nans = 0\nbig_place = Bit(N)\nbig_place.add(place[N] + 1, 1)\nfor i in range(N - 1, 0, -1):\n pos = place[i] + 1\n right = big_place.bisect_plus(pos, 1)\n right2 = big_place.bisect_plus(pos, 2)\n left = big_place.bisect_minus(pos, 1)\n left2 = big_place.bisect_minus(pos, 2)\n if left > 0:\n left_cand = left - left2\n else:\n left_cand = 0\n right_cand = right - pos\n ans += i * left_cand * right_cand\n\n if right < N + 1:\n right_cand = right2 - right\n else:\n right_cand = 0\n left_cand = pos - left\n ans += i * left_cand * right_cand\n\n big_place.add(pos, 1)\n\nprint(ans)\n","change":"replace","i1":0,"i2":49,"j1":0,"j2":86,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02919","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nP = list(map(int, input().split()))\n\nleftMax = [0] * N\nrightMax = [0] * N\nleftMax[0] = P[0]\nrightMax[-1] = P[-1]\nfor i in range(N - 1):\n leftMax[i + 1] = max(leftMax[i], P[i + 1])\n rightMax[N - 1 - (i + 1)] = max(rightMax[N - 1 - i], P[N - 1 - i])\n\nans = 0\nfor i in range(N):\n a, b, c, d = -1, -1, N, N\n p = P[i]\n if leftMax[i] != p:\n for L in range(i - 1, -1, -1):\n if P[L] > p:\n if b == -1:\n b = L\n elif a == -1:\n a = L\n else:\n break\n if rightMax[i] != p:\n for R in range(i + 1, N):\n if P[R] > p:\n if c == N:\n c = R\n elif d == N:\n d = R\n else:\n break\n left = (b - a) * (c - i)\n right = (d - c) * (i - b)\n ans += p * (left + right)\n\nprint(ans)\n","fail":"class SegmentTree:\n \"\"\"\n update, get \u3092\u63d0\u4f9b\u3059\u308bSegmentTree\n\n Attributes\n ----------\n __n : int\n \u8449\u306e\u6570\u30022 ^ i - 1\n __dot :\n Segment function\n __e: int\n \u5358\u4f4d\u5143\n __node: list\n Segment Tree\n \"\"\"\n\n def __init__(self, A, dot, e):\n \"\"\"\n Parameters\n ----------\n A : list\n \u5bfe\u8c61\u306e\u914d\u5217\n dot :\n Segment function\n e : int\n \u5358\u4f4d\u5143\n \"\"\"\n n = 2 ** (len(A) - 1).bit_length()\n self.__n = n\n self.__dot = dot\n self.__e = e\n self.__node = [e] * (2 * n)\n # for i in range(len(A)):\n # self.__node[i + n] = A[i]\n # for i in range(n - 1, 0, -1):\n # self.__node[i] = self.__dot(self.__node[2 * i], self.__node[2 * i + 1])\n\n def update(self, i, c):\n i += self.__n\n node = self.__node\n node[i] = c\n while i > 0:\n i \/\/= 2\n node[i] = self.__dot(node[2 * i], node[2 * i + 1])\n\n def get(self, l, r):\n vl, vr = self.__e, self.__e\n l += self.__n\n r += self.__n\n while l < r:\n if l & 1:\n vl = self.__dot(vl, self.__node[l])\n l += 1\n l \/\/= 2\n if r & 1:\n r -= 1\n vr = self.__dot(vr, self.__node[r])\n r \/\/= 2\n return self.__dot(vl, vr)\n\n\ndef solve():\n N = int(input())\n P = map(int, input().split())\n plist = []\n for i, p in enumerate(P):\n plist.append((p, i))\n plist.sort(reverse=True)\n\n maxSeg = SegmentTree([-1] * N, max, -1)\n minSeg = SegmentTree([N] * N, min, N)\n\n cnt = 0\n for p, c in plist:\n l2 = maxSeg.get(0, c)\n l1 = -1 if l2 <= 0 else maxSeg.get(0, l2)\n\n r1 = minSeg.get(c + 1, N)\n r2 = N if r1 >= N - 1 else minSeg.get(r1 + 1, N)\n\n a = (l2 - l1) * (r1 - c)\n b = (r2 - r1) * (c - l2)\n cnt += p * (a + b)\n\n maxSeg.update(c, c)\n minSeg.update(c, c)\n\n print(cnt)\n\n\nsolve()\n","change":"replace","i1":0,"i2":38,"j1":0,"j2":91,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02919","language":"Python","original_status":"Time Limit Exceeded","pass":"from bisect import bisect_left\nimport sys\n\ninput = sys.stdin.readline\n\nn = int(input())\np = tuple(map(int, input().split()))\n\npos = [[] for _ in range(n + 1)]\nfor ind, pp in enumerate(p):\n for j in range(pp + 1):\n pos[j].append(ind)\n\nans = 0\nfor i, pp in enumerate(p):\n ind = bisect_left(pos[pp], i)\n\n left = 1\n if ind - 1 >= 0:\n left = i - pos[pp][ind - 1]\n else:\n left = i + 1\n right = 0\n if ind + 1 < len(pos[pp]):\n i_right = pos[pp][ind + 1]\n right = 1\n if ind + 2 < len(pos[pp]):\n right = pos[pp][ind + 2] - i_right\n else:\n right = n - i_right\n\n # print(i, pp, left * right, left, right)\n ans += left * right * pp\n\n left = 0\n if ind - 1 >= 0:\n i_left = pos[pp][ind - 1]\n left = 1\n if ind - 2 >= 0:\n left = i_left - pos[pp][ind - 2]\n else:\n left = i_left + 1\n right = 1\n if ind + 1 < len(pos[pp]):\n right = pos[pp][ind + 1] - i\n else:\n right = n - i\n\n # print(i, pp, left * right, left, right)\n ans += left * right * pp\n\nprint(ans)\n","fail":"# https:\/\/atcoder.jp\/contests\/abc140\/submissions\/7411285\n# \u5199\u7d4c\n\n\ndef main():\n N = int(input())\n (*p,) = map(int, input().split())\n\n xtoi = [-1] * (N + 1)\n for i, x in enumerate(p):\n xtoi[x] = i\n\n L = [-1] * (N + 2)\n R = [N] * (N + 2)\n for i in range(N):\n L[i] = i - 1\n R[i] = i + 1\n\n iter_inds = iter(xtoi)\n next(iter_inds)\n\n ans = 0\n for x, ind in enumerate(iter_inds, start=1):\n # l2, ..., l1, ..., x, ..., r1, ..., r2\n # (l2,r1) or (l1,r2)\n l1 = L[ind]\n l2 = L[l1]\n r1 = R[ind]\n r2 = R[r1]\n ans += x * ((l1 - l2) * (r1 - ind) + (r2 - r1) * (ind - l1))\n L[r1] = l1\n R[l1] = r1\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":0,"i2":52,"j1":0,"j2":37,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02920","language":"Python","original_status":"Time Limit Exceeded","pass":"from bisect import bisect_left\n\nn = int(input())\ns = list(map(int, input().split()))\n\nfirst = max(s)\nmade = [first]\ns.remove(first)\ns.append(0)\ns.sort()\n\nfor _ in range(n):\n made_now = []\n for e in made:\n i = bisect_left(s, e)\n make = s.pop(i - 1)\n if make == 0:\n print(\"No\")\n exit()\n made_now.append(make)\n\n made += made_now\n\nprint(\"Yes\")\n","fail":"from heapq import heappush, heappop\nfrom copy import deepcopy\n\nn = int(input())\ns = list(map(int, input().split()))\n\nleft = []\nfor e in s:\n heappush(left, -e)\nmx = heappop(left)\n\nmade = []\nheappush(made, mx)\n\nfor _ in range(n):\n made_nxt = deepcopy(made)\n tmp = []\n\n while made:\n made_val = heappop(made)\n while left and left[0] <= made_val:\n pp = heappop(left)\n tmp.append(pp)\n\n if not left:\n print(\"No\")\n exit()\n\n left_val = heappop(left)\n heappush(made_nxt, left_val)\n\n made = made_nxt\n\n for e in tmp:\n heappush(left, e)\n\nprint(\"Yes\")\n","change":"replace","i1":0,"i2":22,"j1":0,"j2":35,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02920","language":"Python","original_status":"Time Limit Exceeded","pass":"from heapq import heappush, heappop\nfrom copy import deepcopy\n\nn = int(input())\ns = list(map(int, input().split()))\n\nleft = []\nfor e in s:\n heappush(left, -e)\nmx = heappop(left)\n\nmade = []\nheappush(made, mx)\n\nfor _ in range(n):\n made_prev = deepcopy(made)\n tmp = []\n\n while made_prev:\n made_val = heappop(made_prev)\n while left and left[0] <= made_val:\n pp = heappop(left)\n tmp.append(pp)\n\n if not left:\n print(\"No\")\n exit()\n\n left_val = heappop(left)\n heappush(made, left_val)\n\n for e in tmp:\n heappush(left, e)\n\nprint(\"Yes\")\n","fail":"from heapq import heappush, heappop\nfrom copy import deepcopy\n\n\ndef main():\n n = int(input())\n s = list(map(int, input().split()))\n\n left = []\n for e in s:\n heappush(left, -e)\n mx = heappop(left)\n\n made = []\n heappush(made, mx)\n\n for _ in range(n):\n made_prev = deepcopy(made)\n tmp = []\n\n while made_prev:\n made_val = heappop(made_prev)\n while left and left[0] <= made_val:\n pp = heappop(left)\n tmp.append(pp)\n\n if not left:\n print(\"No\")\n exit()\n\n left_val = heappop(left)\n heappush(made, left_val)\n\n for e in tmp:\n heappush(left, e)\n\n print(\"Yes\")\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":3,"i2":35,"j1":3,"j2":41,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02921","language":"Python","original_status":"Runtime Error","pass":"def main(S, T):\n count = 0\n\n for i in range(len(S)):\n if T[i] == S[i]:\n count += 1\n\n return count\n\n\nif __name__ == \"__main__\":\n S, T = map(str, input().split())\n print(main(S, T))\n","fail":"def main(S, T):\n count = 0\n\n for i in range(len(S)):\n if T[i] == S[i]:\n count += 1\n\n return count\n\n\nif __name__ == \"__main__\":\n S = input()\n T = input()\n print(main(S, T))\n","change":"replace","i1":11,"i2":12,"j1":11,"j2":13,"error":"ValueError: not enough values to unpack (expected 2, got 1)","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02921\/Python\/s746445364.py\", line 12, in \n S, T = map(str, input().split())\nValueError: not enough values to unpack (expected 2, got 1)\n","stdout":null} {"problem_id":"p02921","language":"Python","original_status":"Runtime Error","pass":"S = list(input())\nT = list(input())\n\ni = 0\nans_cnt = 0\n\nwhile i < len(S):\n i += 1\n if S[i] == T[i]:\n ans_cnt += 1\n\nprint(ans_cnt)\n","fail":"S = list(input())\nT = list(input())\n\ni = 0\nans_cnt = 0\n\nwhile i < len(S):\n if S[i] == T[i]:\n ans_cnt += 1\n i += 1\n\nprint(ans_cnt)\n","change":"replace","i1":7,"i2":10,"j1":7,"j2":10,"error":"IndexError: list index out of range","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02921\/Python\/s479288383.py\", line 9, in \n if S[i] == T[i]:\nIndexError: list index out of range\n","stdout":null} {"problem_id":"p02921","language":"Python","original_status":"Runtime Error","pass":"def main(s, t):\n s = list(input())\n t = list(input())\n assert len(s) == len(t)\n res = 0\n for i, ss in enumerate(s):\n if ss == t[i]:\n res += 1\n return res\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"def main():\n s = list(input())\n t = list(input())\n assert len(s) == len(t)\n res = 0\n for i, ss in enumerate(s):\n if ss == t[i]:\n res += 1\n print(res)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":0,"i2":9,"j1":0,"j2":9,"error":"TypeError: main() missing 2 required positional arguments: 's' and 't'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02921\/Python\/s322260042.py\", line 13, in \n main()\nTypeError: main() missing 2 required positional arguments: 's' and 't'\n","stdout":null} {"problem_id":"p02921","language":"Python","original_status":"Runtime Error","pass":"s = input().split()\nt = input().split()\n\nans = 0\nfor i in range(3):\n if s[i] == t[i]:\n ans += 1\n\nprint(ans)\n","fail":"s = list(input())\nt = list(input())\n\nans = 0\nfor i in range(3):\n if s[i] == t[i]:\n ans += 1\n\nprint(ans)\n","change":"replace","i1":0,"i2":2,"j1":0,"j2":2,"error":"IndexError: list index out of range","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02921\/Python\/s694576581.py\", line 6, in \n if s[i] == t[i]:\nIndexError: list index out of range\n","stdout":null} {"problem_id":"p02921","language":"Python","original_status":"Runtime Error","pass":"s, t = input()\nprint(sum(s[i] == t[i] for i in range(3)))\n","fail":"s = input()\nt = input()\nprint(sum(s[i] == t[i] for i in range(3)))\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":2,"error":"ValueError: too many values to unpack (expected 2)","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02921\/Python\/s393555435.py\", line 1, in \n s, t = input()\nValueError: too many values to unpack (expected 2)\n","stdout":null} {"problem_id":"p02922","language":"Python","original_status":"Runtime Error","pass":"A, B = map(int, input().split())\n\nif B == 1:\n print(0)\nelse:\n C = A\n cnt = 1\n while C < B:\n C += A - 1\n cnt += 1\n\nprint(cnt)\n","fail":"A, B = map(int, input().split())\n\nif B == 1:\n print(0)\nelse:\n C = A\n cnt = 1\n while C < B:\n C += A - 1\n cnt += 1\n print(cnt)\n","change":"replace","i1":10,"i2":12,"j1":10,"j2":11,"error":"0","stderr":null,"stdout":3.0} {"problem_id":"p02922","language":"Python","original_status":"Runtime Error","pass":"S = input()\nList = [input() for i in range(1)]\nT = List[0]\n\nSlst = list(S)\nTlst = list(T)\nM = 0\n\nfor x in range(3):\n if Slst[x] == Tlst[x]:\n M += 1\nprint(M)\n","fail":"lst = [int(x) for x in input().split()]\nA = lst[0]\nB = lst[1]\n\nif B >= 2:\n m = 0\n while (A - 1) * m + 1 < B:\n m += 1\n print(m)\n\nif B == 1:\n print(0)\n","change":"replace","i1":0,"i2":12,"j1":0,"j2":12,"error":"EOFError: EOF when reading a line","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02922\/Python\/s688512487.py\", line 2, in \n List = [input() for i in range(1)]\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02922\/Python\/s688512487.py\", line 2, in \n List = [input() for i in range(1)]\nEOFError: EOF when reading a line\n","stdout":null} {"problem_id":"p02922","language":"Python","original_status":"Runtime Error","pass":"A = int(input())\nB = int(input())\ncount = 1\n\nwhile A < B:\n A += A\n count += 1\n if A > B:\n break\n\nprint(count)\n","fail":"A = input().split()\ncount = 1\na = int(A[0])\nb = int(A[1])\nc = a\n\nif b == 1:\n print(0)\nelse:\n while a < b:\n a += c - 1\n count += 1\n if a > b:\n break\n print(count)\n","change":"replace","i1":0,"i2":11,"j1":0,"j2":15,"error":"ValueError: invalid literal for int() with base 10: '4 10'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02922\/Python\/s307369986.py\", line 1, in \n A = int(input())\nValueError: invalid literal for int() with base 10: '4 10'\n","stdout":null} {"problem_id":"p02923","language":"Python","original_status":"Runtime Error","pass":"def main():\n N = int(input())\n H = [int(x) for x in input().split()]\n ans = []\n count = 0\n if N > 2:\n for i in range(1, N):\n j = i + 1\n if H[-i] <= H[-j]:\n count += 1\n else:\n ans.append(count)\n count = 0\n elif N == 2:\n if H[0] >= H[1]:\n ans.append(1)\n elif N == 1:\n ans.append(1)\n\n print(max(ans))\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"def main():\n N = int(input())\n H = [int(x) for x in input().split()]\n ans = 0\n count = 0\n\n if N == 2:\n if H[0] >= H[1]:\n ans = 1\n elif N > 2:\n for i in range(1, N):\n j = i + 1\n if H[-i] <= H[-j]:\n count += 1\n if j == N:\n if ans <= count:\n ans = count\n else:\n if ans <= count:\n ans = count\n count = 0\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":3,"i2":20,"j1":3,"j2":22,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p02923","language":"Python","original_status":"Time Limit Exceeded","pass":"#!\/usr\/bin\/env python3\nn = int(input())\nh = list(map(int, input().split()))\nans = 0\nfor i in range(n):\n tmp = 0\n for j in range(i, n - 1):\n if h[j] < h[j + 1]:\n tmp = 0\n else:\n tmp += 1\n ans = max(ans, tmp)\nprint(ans)\n","fail":"#!\/usr\/bin\/env python3\nn = int(input())\nh = list(map(int, input().split()))\nans = 0\ntmp = 0\nfor i in range(n - 1):\n if h[i] < h[i + 1]:\n tmp = 0\n else:\n tmp += 1\n ans = max(ans, tmp)\nprint(ans)\n","change":"replace","i1":4,"i2":12,"j1":4,"j2":11,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02923","language":"Python","original_status":"Time Limit Exceeded","pass":"def resolve():\n N = int(input())\n H = [int(i) for i in input().split()]\n maxM = 0\n for i in range(N - 1):\n m = 0\n for j in range(i, N - 1):\n if H[j] < H[j + 1]:\n break\n else:\n m += 1\n maxM = max(maxM, m)\n print(maxM)\n\n\nresolve()\n","fail":"def resolve():\n N = int(input())\n H = [int(i) for i in input().split()]\n maxM = 0\n m = 0\n for i in range(N - 1):\n if H[i] < H[i + 1]:\n m = 0\n else:\n m += 1\n maxM = max(maxM, m)\n print(maxM)\n\n\nresolve()\n","change":"replace","i1":4,"i2":12,"j1":4,"j2":11,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02923","language":"Python","original_status":"Runtime Error","pass":"N = int(input())\nH = list(map(int, input().split()))\n\nif N == 1:\n print(0)\nelse:\n ans = 0\n H1 = H[0]\n H2 = H[1]\n count = 1\n move = 0\n while count != (N):\n count += 1\n if H2 <= H1:\n move += 1\n ans = max(ans, move)\n else:\n move = 0\n if count != N:\n H1 = H2\n H2 = H[count]\n\nprint(ans)\n","fail":"N = int(input())\nH = list(map(int, input().split()))\n\nif N == 1:\n print(0)\nelse:\n ans = 0\n H1 = H[0]\n H2 = H[1]\n count = 1\n move = 0\n while count != N:\n count += 1\n if H2 <= H1:\n move += 1\n ans = max(ans, move)\n else:\n move = 0\n if count != N:\n H1 = H2\n H2 = H[count]\n\n print(ans)\n","change":"replace","i1":11,"i2":23,"j1":11,"j2":23,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p02923","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\nhh = list(map(int, input().split()))\n\nans = 0\nfor i in range(n - 1, 0, -1):\n x = 1\n while i + x < n and hh[i + x - 1] >= hh[i + x]:\n x += 1\n ans = max(ans, x - 1)\nprint(ans)\n","fail":"n = int(input())\nh = list(map(int, input().split()))\n\nans = 0\nx = 0\nfor i in range(1, n):\n if h[i - 1] >= h[i]:\n x += 1\n else:\n x = 0\n ans = max(ans, x)\nprint(ans)\n","change":"replace","i1":1,"i2":9,"j1":1,"j2":11,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02923","language":"Python","original_status":"Runtime Error","pass":"# coding: utf-8\nn = int(input())\nlst = list(map(int, input().split()))\ncnt = 0\ndata = []\nfor i in range(n - 1):\n if lst[i] >= lst[i + 1]:\n cnt += 1\n else:\n data.append(cnt)\n cnt = 0\nprint(max(cnt))\n","fail":"# coding: utf-8\nn = int(input())\nlst = list(map(int, input().split()))\ncnt = 0\ndata = []\nfor i in range(n - 1):\n if lst[i] >= lst[i + 1]:\n cnt += 1\n else:\n data.append(cnt)\n cnt = 0\ndata.append(cnt)\nprint(max(data))\n","change":"replace","i1":11,"i2":12,"j1":11,"j2":13,"error":"TypeError: 'int' object is not iterable","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02923\/Python\/s153309090.py\", line 12, in \n print(max(cnt))\nTypeError: 'int' object is not iterable\n","stdout":null} {"problem_id":"p02923","language":"Python","original_status":"Runtime Error","pass":"n = input()\nh_string = input()\nh_list = h_string.split(\" \")\nfor item in h_list:\n item = int(item)\n\n\nlongest = 0\nnow_value = -1\nnow_length = 0\n\n\nfor value in h_list:\n if value <= now_value:\n now_length += 1\n now_value = value\n if now_length > longest:\n longest = now_length\n else:\n if now_length > longest:\n longest = now_length\n now_value = value\n now_length = 0\n\nprint(longest)\n","fail":"n = input()\nh_string = input()\nh_list = h_string.split(\" \")\nfor i in range(len(h_list)):\n h_list[i] = int(h_list[i])\n\n\nlongest = 0\nnow_value = -1\nnow_length = 0\n\n\nfor value in h_list:\n if value <= now_value:\n now_length += 1\n now_value = value\n if now_length > longest:\n longest = now_length\n else:\n if now_length > longest:\n longest = now_length\n now_value = value\n now_length = 0\n\nprint(longest)\n","change":"replace","i1":3,"i2":5,"j1":3,"j2":5,"error":"TypeError: '<=' not supported between instances of 'str' and 'int'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02923\/Python\/s196465841.py\", line 14, in \n if value <= now_value:\nTypeError: '<=' not supported between instances of 'str' and 'int'\n","stdout":null} {"problem_id":"p02923","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\nh = list(map(int, input().split()))\n\nmax_step = 0\nfor i in range(n):\n current_step = 0\n for j in range(i + 1, n):\n if h[j - 1] >= h[j]:\n current_step += 1\n if current_step > max_step:\n max_step = current_step\n else:\n i = j\n break\nprint(max_step)\n","fail":"n = int(input())\nh = list(map(int, input().split()))\n\nmax_step = 0\ncurrent_step = 0\nfor i in range(n - 1):\n if h[i] >= h[i + 1]:\n current_step += 1\n if current_step > max_step:\n max_step = current_step\n else:\n current_step = 0\nprint(max_step)\n","change":"replace","i1":4,"i2":14,"j1":4,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02923","language":"Python","original_status":"Runtime Error","pass":"# -*- coding: utf-8 -*-\n# \u6574\u6570\u306e\u5165\u529b\n\n\ndef main():\n n = int(input())\n h = list(map(int, input().split()))\n\n result = []\n count = 0\n for i in range(n - 1):\n if h[i] < h[i + 1]:\n result.append(count)\n count = 0\n continue\n\n count += 1\n if i == n - 2:\n result.append(count)\n\n print(max(result))\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"# -*- coding: utf-8 -*-\n# \u6574\u6570\u306e\u5165\u529b\n\n\ndef main():\n n = int(input())\n h = list(map(int, input().split()))\n\n if n == 1:\n print(0)\n return\n\n result = []\n count = 0\n for i in range(n - 1):\n if h[i] < h[i + 1]:\n result.append(count)\n count = 0\n continue\n\n count += 1\n if i == n - 2:\n result.append(count)\n\n print(max(result))\n\n\nif __name__ == \"__main__\":\n main()\n","change":"insert","i1":7,"i2":7,"j1":7,"j2":11,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p02923","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\nheight = list(map(int, input().split()))\nmax_count = 0\nfor i in range(n):\n count = 0\n for j in range(i, n):\n if j == n - 1 or height[j] < height[j + 1]:\n break\n count += 1\n max_count = max(max_count, count)\nprint(max_count)\n","fail":"n = int(input())\nheight = list(map(int, input().split()))\nmax_count = 0\ncount = 0\nfor i in range(n - 1):\n if height[i] < height[i + 1]:\n max_count = max(count, max_count)\n count = 0\n continue\n count += 1\nmax_count = max(count, max_count)\nprint(max_count)\n","change":"replace","i1":3,"i2":10,"j1":3,"j2":11,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02923","language":"Python","original_status":"Runtime Error","pass":"n = int(input())\nhlist = list(map(int, input().split()))\ndelta = [hlist[i + 1] - hlist[i] for i in range(len(hlist) - 1)]\n\ncounter = 0\nfor i in range(len(delta)):\n if delta[i] <= 0:\n counter += 1\n else:\n ans = counter\n counter = 0\nans = max(ans, counter)\nprint(ans)\n","fail":"n = int(input())\nh = list(map(int, input().split()))\n\ncounter, ans = 0, 0\nfor i in range(len(h) - 1):\n if h[i] >= h[i + 1]:\n counter += 1\n else:\n if ans <= counter:\n ans = counter\n counter = 0\nans = max(ans, counter)\n\n\nprint(ans)\n","change":"replace","i1":1,"i2":12,"j1":1,"j2":14,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p02923","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\nh = list(map(int, input().split()))\n\nans = 0\nfor left in range(n - 1):\n right = left + 1\n length = 0\n while right < n and h[right - 1] >= h[right]:\n length += 1\n right += 1\n ans = max(ans, length)\nprint(ans)\n","fail":"n = int(input())\nh = list(map(int, input().split()))\n\ndp = [0] * n\ndp[0] = 0\nans = 0\nfor i in range(1, n):\n if h[i - 1] >= h[i]:\n if dp[i - 1] == 0:\n dp[i] = 1\n else:\n dp[i] = dp[i - 1] + 1\n ans = max(dp[i], ans)\nprint(ans)\n","change":"replace","i1":3,"i2":11,"j1":3,"j2":13,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02923","language":"Python","original_status":"Runtime Error","pass":"from sys import stdin\n\nn = int(stdin.readline().rstrip())\nh = [int(x) for x in stdin.readline().rstrip().split()]\n\nm = 0\ncount = 0\nfor i in range(n):\n if (i == n - 1) and (m < count):\n m = count\n else:\n if h[i] >= h[i + 1]:\n count += 1\n else:\n if m < count:\n m = count\n count = 0\n\nprint(m)\n","fail":"from sys import stdin\n\nn = int(stdin.readline().rstrip())\nh = [int(x) for x in stdin.readline().rstrip().split()]\n\nm = 0\ncount = 0\nfor i in range(n):\n if i == n - 1:\n if m < count:\n m = count\n else:\n if h[i] >= h[i + 1]:\n count += 1\n else:\n if m < count:\n m = count\n count = 0\n\nprint(m)\n","change":"replace","i1":8,"i2":10,"j1":8,"j2":11,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p02924","language":"Python","original_status":"Runtime Error","pass":"N = int(input())\nprint(sum(list(range(N))))\n","fail":"N = int(input())\nprint(sum(range(N)))\n","change":"replace","i1":1,"i2":2,"j1":1,"j2":2,"error":"0","stderr":null,"stdout":1.0} {"problem_id":"p02924","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\n\nc = 0\nfor i in range(1, N):\n c += i\n\nprint(c)\n","fail":"N = int(input())\nprint(N * (N - 1) \/\/ 2)\n","change":"replace","i1":1,"i2":7,"j1":1,"j2":2,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02924","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\n\nsum = 0\nfor i in range(n):\n sum += i\n\nprint(sum)\n","fail":"n = int(input())\n\nprint((n * (n - 1)) \/\/ 2)\n","change":"replace","i1":2,"i2":7,"j1":2,"j2":3,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02924","language":"Python","original_status":"Time Limit Exceeded","pass":"# -*- coding: utf-8 -*-\n# \u6574\u6570\u306e\u5165\u529b\n\n\ndef main():\n n = int(input())\n ans = 0\n for i in range(1, n + 1):\n ans += i - 1\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"# -*- coding: utf-8 -*-\n# \u6574\u6570\u306e\u5165\u529b\nfrom decimal import Decimal\n\n\ndef main():\n n = int(input())\n\n if n == 1:\n print(0)\n return\n\n # print(int(n ** 2 - n))\n # print((n ** 2 - n) \/ 2)\n # print(n * (n - 1))\n # print(n * (n - 1) \/ 2)\n ans = int(Decimal(n * (n - 1)) \/ 2)\n print(ans)\n # print(ans * 2)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":2,"i2":10,"j1":2,"j2":19,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02924","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\nsum = 0\nfor i in range(n):\n sum += i\n\nprint(sum)\n","fail":"n = int(input())\nif n % 2 == 0:\n sum = int(n \/ 2)\n sum = sum * (n - 1)\n\nelse:\n sum = int((n - 1) \/ 2)\n sum = sum * n\n\nprint(int(sum))\n","change":"replace","i1":1,"i2":6,"j1":1,"j2":10,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02924","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\n\nresult = 0\nfor i in range(N):\n result += i\n\nprint(result)\n","fail":"N = int(input())\n\nn = N - 1\nresult = 0\n\nif n != 0:\n result = n * (n + 1) \/\/ 2\n\nprint(result)\n","change":"replace","i1":2,"i2":5,"j1":2,"j2":7,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02924","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nmax = 0\n\nfor i in range(N):\n max += i\n\nprint(max)\n","fail":"N = int(input())\nmax = 0\n\n\nprint((N - 1) * N \/\/ 2)\n","change":"replace","i1":3,"i2":7,"j1":3,"j2":5,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02924","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\nans = 0\nfor i in range(1, n):\n ans += i\nprint(ans)\n","fail":"n = int(input())\nprint(n * (n - 1) \/\/ 2)\n","change":"replace","i1":1,"i2":5,"j1":1,"j2":2,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02924","language":"Python","original_status":"Runtime Error","pass":"N = int(input())\nprint(sum(list(range(N))))\n","fail":"N = int(input())\nprint((N - 1) * N \/\/ 2)\n","change":"replace","i1":1,"i2":2,"j1":1,"j2":2,"error":"0","stderr":null,"stdout":1.0} {"problem_id":"p02924","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\nans = 0\n\nfor i in range(1, n):\n ans += i\n\nprint(ans)\n","fail":"n = int(input()) - 1\nprint(n * (n + 1) \/\/ 2)\n","change":"replace","i1":0,"i2":7,"j1":0,"j2":2,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02924","language":"Python","original_status":"Runtime Error","pass":"n = int(input())\na = list(range(1, n))\nprint(sum(a))\n","fail":"n = int(input())\nans = (n - 1) * (1 + n - 1) \/\/ 2\nprint(ans)\n","change":"replace","i1":1,"i2":3,"j1":1,"j2":3,"error":"0","stderr":null,"stdout":1.0} {"problem_id":"p02924","language":"Python","original_status":"Runtime Error","pass":"n = int(input())\n\n\na = list(range(1, n))\n\nprint(sum(a))\n","fail":"n = int(input())\n\n\na = (1 + n - 1) * (n - 1) \/\/ 2\nprint(a)\n","change":"replace","i1":3,"i2":6,"j1":3,"j2":5,"error":"0","stderr":null,"stdout":1.0} {"problem_id":"p02924","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\n\nans = 0\nfor i in range(n):\n ans += i\n\nprint(ans)\n","fail":"n = int(input())\n\nans = n * (n - 1) \/\/ 2\n\nprint(ans)\n","change":"replace","i1":2,"i2":5,"j1":2,"j2":3,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02924","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nprint(sum(range(1, N)))\n","fail":"N = int(input())\nprint((N - 1) * N \/\/ 2)\n","change":"replace","i1":1,"i2":2,"j1":1,"j2":2,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02924","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nans = 0\n\nfor i in range(1, N):\n ans += i\n\nprint(ans)\n","fail":"N = int(input())\nprint((N - 1) * N \/\/ 2)\n","change":"replace","i1":1,"i2":7,"j1":1,"j2":2,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02924","language":"Python","original_status":"Runtime Error","pass":"N = int(input())\nprint(sum(list(range(N))[1:]))\n","fail":"N = int(input())\nprint((N - 1) * (N) \/\/ 2)\n","change":"replace","i1":1,"i2":2,"j1":1,"j2":2,"error":"0","stderr":null,"stdout":1.0} {"problem_id":"p02924","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\nprint(sum(x for x in range(n)))\n","fail":"n = int(input())\nprint(n * (n - 1) \/\/ 2)\n","change":"replace","i1":1,"i2":2,"j1":1,"j2":2,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02924","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nres = 0\nfor i in range(N):\n res += i\nprint(res)\n","fail":"N = int(input())\nres = int(N * (N - 1) \/\/ 2)\nprint(res)\n","change":"replace","i1":1,"i2":4,"j1":1,"j2":2,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02924","language":"Python","original_status":"Time Limit Exceeded","pass":"# from math import factorial,sqrt\n# from itertools import permutations as permus\n# from fractions import gcd\n# from collections import deque,Counter\n# from decimal import Decimal, getcontext\n# # getcontext().prec = 1000\n# # eps = Decimal(10) ** (-100)\n\n# import numpy as np\n# import scipy as scp\n\n# \u5165\u529b\u306e\u53d7\u3051\u53d6\u308a\nn = int(input())\n\nans = sum(range(n))\n\nprint(ans)\n# print(\"{:.10f}\".format(ans))\n","fail":"# from math import factorial,sqrt\n# from itertools import permutations as permus\n# from fractions import gcd\n# from collections import deque,Counter\n# from decimal import Decimal, getcontext\n# # getcontext().prec = 1000\n# # eps = Decimal(10) ** (-100)\n\n# import numpy as np\n# import scipy as scp\n\n# \u5165\u529b\u306e\u53d7\u3051\u53d6\u308a\nn = int(input())\n\nn = n - 1\n\nans = (1 + n) * n \/\/ 2\n\nprint(ans)\n# print(\"{:.10f}\".format(ans))\n","change":"replace","i1":14,"i2":15,"j1":14,"j2":17,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02924","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\nprint(sum(range(n)))\n","fail":"n = int(input())\n\nif n % 2:\n print(n * (n - 1) \/\/ 2)\nelse:\n print(n * (n \/\/ 2 - 1) + n \/\/ 2)\n","change":"replace","i1":1,"i2":2,"j1":1,"j2":6,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02924","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\n\nx = [i + 1 for i in range(N)]\n\nprint(sum(x) - N)\n","fail":"N = int(input())\n\n\nprint(N * (N + 1) \/\/ 2 - N)\n","change":"replace","i1":2,"i2":5,"j1":2,"j2":4,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02924","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nans = 0\n\nfor i in range(N):\n ans += i\n\nprint(ans)\n","fail":"N = int(input())\nprint(N * (N - 1) \/\/ 2)\n","change":"replace","i1":1,"i2":7,"j1":1,"j2":2,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02924","language":"Python","original_status":"Time Limit Exceeded","pass":"# -*- coding: utf-8 -*-\nn = int(input())\n\ntmp = [i for i in range(1, n + 1)]\nprint(sum(tmp) - n)\n","fail":"# -*- coding: utf-8 -*-\nn = int(input())\n\nsu = n * (n + 1) \/\/ 2\nprint(su - n)\n","change":"replace","i1":3,"i2":5,"j1":3,"j2":5,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02924","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nnums = [i for i in range(1, N + 1)]\nif (N - 1) % 2 == 0:\n print(N * ((N - 1) \/\/ 2))\nelse:\n # 12 =>\n print(N * ((N - 1) \/\/ 2) + (N \/\/ 2))\n","fail":"N = int(input())\n# nums = [i for i in range(1, N + 1)]\nif (N - 1) % 2 == 0:\n print(N * ((N - 1) \/\/ 2))\nelse:\n # 12 =>\n print(N * ((N - 1) \/\/ 2) + (N \/\/ 2))\n","change":"replace","i1":1,"i2":2,"j1":1,"j2":2,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02924","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\nans = 0\nfor i in range(1, n):\n ans += i\nprint(ans)\n","fail":"n = int(input())\nprint(n * (n - 1) \/\/ 2)\n","change":"replace","i1":1,"i2":5,"j1":1,"j2":2,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02924","language":"Python","original_status":"Time Limit Exceeded","pass":"a = int(input())\nsum = 0\nfor i in range(a):\n sum += i\nprint(sum)\n","fail":"a = int(input())\nsum = 0\nsum = (a - 1) * a \/\/ 2\nprint(sum)\n","change":"replace","i1":2,"i2":4,"j1":2,"j2":3,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02924","language":"Python","original_status":"Runtime Error","pass":"N = int(input())\n\nlist = list(range(N))\n\nprint(sum(list))\n","fail":"N = int(input())\n\nprint(N * (N - 1) \/\/ 2)\n","change":"replace","i1":2,"i2":5,"j1":2,"j2":3,"error":"0","stderr":null,"stdout":1.0} {"problem_id":"p02924","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\n\nans = 0\nfor n in range(1, N):\n ans += n\nprint(ans)\n","fail":"N = int(input())\n\nprint((N - 1) * (1 + N - 1) \/\/ 2)\n","change":"replace","i1":2,"i2":6,"j1":2,"j2":3,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02924","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\n\nprint(sum(i % (i + 1) for i in range(1, N)))\n","fail":"N = int(input())\n\nprint(int(N * (N - 1) \/\/ 2))\n","change":"replace","i1":2,"i2":3,"j1":2,"j2":3,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02924","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nprint(sum(v for v in range(N)))\n","fail":"N = int(input())\nprint(N * (N - 1) \/\/ 2)\n","change":"replace","i1":1,"i2":2,"j1":1,"j2":2,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02924","language":"Python","original_status":"Time Limit Exceeded","pass":"print(sum(range(int(input()))))\n","fail":"n = int(input())\nprint(n * (n - 1) \/\/ 2)\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":2,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02924","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\n\nif N == 1:\n print(0)\nelse:\n print(sum([i for i in range(1, N)]))\n","fail":"N = int(input())\nprint(N * (N - 1) \/\/ 2)\n","change":"replace","i1":1,"i2":6,"j1":1,"j2":2,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02924","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\n\nans = 0\nfor i in range(n):\n ans += i\n\nprint(ans)\n","fail":"n = int(input())\n\nprint(n * (n - 1) \/\/ 2)\n","change":"replace","i1":2,"i2":7,"j1":2,"j2":3,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02924","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\n\nans = 0\nfor i in range(1, n):\n ans += i\n\nprint(ans)\n","fail":"n = int(input())\n\nprint(n * (n - 1) \/\/ 2)\n","change":"replace","i1":2,"i2":7,"j1":2,"j2":3,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02924","language":"Python","original_status":"Time Limit Exceeded","pass":"def main():\n n = int(input())\n print(sum(range(n)))\n\n\nmain()\n","fail":"def main():\n n = int(input())\n print((n - 1) * n \/\/ 2)\n\n\nmain()\n","change":"replace","i1":2,"i2":3,"j1":2,"j2":3,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02924","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nprint(sum([i for i in range(N)]))\n","fail":"N = int(input())\nprint(N * (N - 1) \/\/ 2)\n","change":"replace","i1":1,"i2":2,"j1":1,"j2":2,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02924","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\nm = 0\n\n\nfor i in range(n):\n t = i + 1\n if t == n:\n m += 0\n else:\n m += t % (t + 1)\n\n\nprint(m)\n","fail":"n = int(input())\n\nm = n * (n - 1) \/\/ 2\n\nprint(m)\n","change":"replace","i1":1,"i2":11,"j1":1,"j2":3,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02924","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\nr = 0\nfor i in range(n):\n r += i\nprint(r)\n","fail":"n = int(input())\nprint(n * (n - 1) \/\/ 2)\n","change":"replace","i1":1,"i2":5,"j1":1,"j2":2,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02924","language":"Python","original_status":"Time Limit Exceeded","pass":"print(sum(range(1, int(input()))))\n","fail":"N = int(input())\nprint((1 + (N - 1)) * (N - 1) \/\/ 2)\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":2,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02924","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\nans = 0\n\nfor i in range(n):\n ans += i\nprint(ans)\n","fail":"n = int(input())\nans = 0\n\nprint((n * (n - 1)) \/\/ 2)\n","change":"replace","i1":3,"i2":6,"j1":3,"j2":4,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02924","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\nans = 0\nfor i in range(n):\n ans += i\nprint(ans)\n","fail":"n = int(input())\nprint((n * (n - 1)) \/\/ 2)\n","change":"replace","i1":1,"i2":5,"j1":1,"j2":2,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02924","language":"Python","original_status":"Time Limit Exceeded","pass":"print(sum(range(int(input()))))\n","fail":"n = int(input())\nprint((n - 1) * n \/\/ 2)\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":2,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02924","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nprint(sum([i for i in range(N)]))\n","fail":"N = int(input())\n# print(sum([i for i in range(N)]))\nprint(N * (0 + N - 1) \/\/ 2)\n","change":"replace","i1":1,"i2":2,"j1":1,"j2":3,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02924","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\n\nans = 0\nfor i in range(N):\n ans += i\nprint(ans)\n","fail":"N = int(input())\n\nans = N * (N - 1) \/\/ 2\n\nprint(ans)\n","change":"replace","i1":2,"i2":5,"j1":2,"j2":4,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02924","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\nr = 0\nfor i in range(n):\n r += i\nprint(r)\n","fail":"n = int(input())\nprint(n * (n - 1) \/\/ 2)\n","change":"replace","i1":1,"i2":5,"j1":1,"j2":2,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02924","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nscore = 0\n\nfor i in range(1, N):\n score += i\n\nprint(score)\n","fail":"N = int(input())\n\nprint((N) * (N - 1) \/\/ 2)\n","change":"replace","i1":1,"i2":7,"j1":1,"j2":3,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02924","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\n\nprint(sum([i for i in range(1, n)]))\n","fail":"n = int(input())\n\nans = n * (n \/\/ 2)\nif (n - 1) % 2 == 0:\n print(ans)\nelse:\n print(ans - int(n \/ 2))\n","change":"replace","i1":2,"i2":3,"j1":2,"j2":7,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02924","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nprint(sum(i for i in range(N)))\n","fail":"N = int(input())\nprint((N - 1) * N \/\/ 2)\n","change":"replace","i1":1,"i2":2,"j1":1,"j2":2,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02924","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\nprint(sum(range(1, n)))\n","fail":"n = int(input())\nans = n * (n - 1) \/\/ 2\nprint(ans)\n","change":"replace","i1":1,"i2":2,"j1":1,"j2":3,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02924","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\nprint(sum(i for i in range(1, n)))\n","fail":"n = int(input())\nprint(n * (n - 1) \/\/ 2)\n","change":"replace","i1":1,"i2":2,"j1":1,"j2":2,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02924","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\n\nn_list = [i for i in range(1, n)]\nans = sum(n_list)\nprint(ans)\n","fail":"from decimal import Decimal\n\n\nn = int(input())\n\nans = Decimal((n - 1) * n) \/ 2\nprint(ans)\n","change":"replace","i1":0,"i2":4,"j1":0,"j2":6,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02924","language":"Python","original_status":"Time Limit Exceeded","pass":"# -*- coding: utf-8 -*-\n\nN = int(input())\n\nans = 0\nfor y in range(1, N):\n ans += y\n\nprint(ans)\n","fail":"# -*- coding: utf-8 -*-\n\nN = int(input())\n\nans = ((N + 1) * N) \/\/ 2\nans -= N\n\nprint(ans)\n","change":"replace","i1":4,"i2":7,"j1":4,"j2":6,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02924","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\n\nsum = 0\nfor i in range(N):\n sum += i\n\nprint(sum)\n","fail":"N = int(input())\nprint(N * (N - 1) \/\/ 2)\n","change":"replace","i1":1,"i2":7,"j1":1,"j2":2,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02924","language":"Python","original_status":"Time Limit Exceeded","pass":"# \u3057\u3089\u3093\u3051\u3069\nn = int(input())\nprint(sum(range(n)))\n","fail":"# \u3057\u3089\u3093\u3051\u3069\n# \u3075\u3064\u3046\u306b\u3053\u308c\u3084\u3063\u305f\u3089TLE\u306a\u3063\u305f\u306e\u3067\u30a2\u30ec\u3059\u308b\n# n = int(input())\n# print(sum(range(n)))\n\nn = int(input())\nif n % 2 == 0:\n a = (1 + n) * (n \/\/ 2)\n print(a - n)\nelse:\n a = (1 + n) * ((n - 1) \/\/ 2) + (n \/\/ 2 + 1)\n print(a - n)\n","change":"replace","i1":1,"i2":3,"j1":1,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02924","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\n\nres = 0\nfor i in range(N):\n res += i\n\nprint(res)\n","fail":"N = int(input())\n\nres = (N - 1) * N \/\/ 2\n\nprint(res)\n","change":"replace","i1":2,"i2":5,"j1":2,"j2":3,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02924","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\nprint(sum(range(1, n)))\n","fail":"n = int(input())\n\nans = n * (n - 1) \/\/ 2\nprint(ans)\n","change":"replace","i1":1,"i2":2,"j1":1,"j2":4,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02924","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\n\nans = 0\n\nfor i in range(1, n):\n ans += i\n\nprint(ans)\n","fail":"n = int(input())\n\nprint((n * (n - 1)) \/\/ 2)\n","change":"replace","i1":2,"i2":8,"j1":2,"j2":3,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02924","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\nnum = 0\n\nfor i in range(n):\n num = num + i\n\nprint(num)\n","fail":"n = int(input())\n\nnum = 0\n\nnum = n * (n - 1) \/\/ 2\n\nprint(num)\n","change":"replace","i1":1,"i2":5,"j1":1,"j2":5,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02924","language":"Python","original_status":"Time Limit Exceeded","pass":"import sys\n\nN = int(sys.stdin.readline())\nprint(sum(n + 1 for n in range(N - 1)))\n","fail":"import sys\n\nN = int(sys.stdin.readline())\nprint(int((N - 1) * N \/\/ 2))\n","change":"replace","i1":3,"i2":4,"j1":3,"j2":4,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02924","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\n\nresult = 0\nfor i in range(N):\n result += i\nprint(result)\n","fail":"N = int(input())\n\nprint(N * (N - 1) \/\/ 2)\n","change":"replace","i1":2,"i2":6,"j1":2,"j2":3,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02924","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nn = 0\nfor m in range(N - 1, 0, -1):\n n = n + m\nprint(n)\n","fail":"N = int(input())\nprint((N * (N - 1)) \/\/ 2)\n","change":"replace","i1":1,"i2":5,"j1":1,"j2":2,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02924","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input().strip())\nans = 0\nfor i in range(n):\n ans = ans + i\nprint(ans)\n","fail":"import math\n\nn = int(input().strip())\nans = (n * (n - 1)) \/\/ 2\n\nprint(ans)\n","change":"replace","i1":0,"i2":4,"j1":0,"j2":5,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02924","language":"Python","original_status":"Time Limit Exceeded","pass":"# -*- coding: utf-8 -*-\nN = int(input())\nsum = 0\nfor i in range(N):\n sum += i\nprint(sum)\n","fail":"# -*- coding: utf-8 -*-\nimport math\n\nN = int(input()) - 1\nM = 0\nx = int(math.ceil((N) \/ 2))\nif N % 2 == 0:\n M = x * (N + 1)\nelse:\n M = (x - 1) * (N + 1) + x\nprint(M)\n","change":"replace","i1":1,"i2":6,"j1":1,"j2":11,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02924","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\n\nsum = 0\nfor i in range(N):\n sum += i\nprint(sum)\n","fail":"N = int(input())\n\nif N % 2 == 1:\n print(N * (N - 1) \/\/ 2)\nelse:\n print(N * (N \/\/ 2 - 1) + N \/\/ 2)\n","change":"replace","i1":2,"i2":6,"j1":2,"j2":6,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02924","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nprint(sum([i for i in range(1, N)]))\n","fail":"N = int(input())\nprint(N * (N - 1) \/\/ 2)\n","change":"replace","i1":1,"i2":2,"j1":1,"j2":2,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02924","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\n\nsum = 0\nfor i in range(1, n):\n sum += i\n\nprint(sum)\n","fail":"n = int(input())\nprint(sum(range(1, n)))\n","change":"replace","i1":1,"i2":7,"j1":1,"j2":2,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02924","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\nprint(sum(range(n)))\n","fail":"n = int(input())\nprint(((n * (n + 1)) \/\/ 2) - n)\n","change":"replace","i1":1,"i2":2,"j1":1,"j2":2,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02924","language":"Python","original_status":"Time Limit Exceeded","pass":"import sys\n\nsys.setrecursionlimit(4100000)\n\n\ndef inputs(num_of_input):\n ins = [input() for i in range(num_of_input)]\n return ins\n\n\ndef solve(inputs):\n [N] = string_to_int(inputs[0])\n count = 0\n for x in range(1, N):\n count += x\n return count\n\n\ndef string_to_int(string):\n return list(map(lambda x: int(x), string.split()))\n\n\nif __name__ == \"__main__\":\n ret = solve(inputs(1))\n print(ret)\n","fail":"import sys\nimport math\n\nsys.setrecursionlimit(4100000)\n\n\ndef inputs(num_of_input):\n ins = [input() for i in range(num_of_input)]\n return ins\n\n\ndef solve(inputs):\n [N] = string_to_int(inputs[0])\n num = N - 1\n if num == 0:\n return 0\n if num == 1:\n return 1\n if num % 2 == 0:\n # half_l = math.floor(num \/ 2)\n # half = (half_l + half_l + 1) \/ 2\n half = num \/\/ 2\n append = num \/\/ 2\n else:\n half = (num + 1) \/\/ 2\n append = 0\n # half = math.floor(num \/ 2)\n return half * num + append\n\n\ndef string_to_int(string):\n return list(map(lambda x: int(x), string.split()))\n\n\nif __name__ == \"__main__\":\n ret = solve(inputs(1))\n print(ret)\n","change":"replace","i1":1,"i2":16,"j1":1,"j2":28,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02924","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\nans = 0\nfor i in range(1, n):\n ans += i\nprint(ans)\n","fail":"n = int(input())\nn = n - 1\nif n % 2 == 1:\n ans = ((n + 1) \/\/ 2) * n\nelse:\n ans = n + (n \/\/ 2) * (n - 1)\nprint(ans)\n","change":"replace","i1":1,"i2":4,"j1":1,"j2":6,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02924","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nans = 0\nfor i in range(N):\n ans += i\n\nprint(ans)\n","fail":"N = int(input())\nprint(N * (N - 1) \/\/ 2)\n","change":"replace","i1":1,"i2":6,"j1":1,"j2":2,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02924","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\nm = [i for i in range(n)]\nprint(sum(m))\n","fail":"n = int(input())\nprint((n * (n - 1)) \/\/ 2)\n","change":"replace","i1":1,"i2":3,"j1":1,"j2":2,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02924","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\n\nlis = [i for i in range(1, N)]\n\nprint(sum(lis))\n","fail":"N = int(input())\n\nans = N * (N - 1) \/\/ 2\n\nprint(ans)\n","change":"replace","i1":2,"i2":5,"j1":2,"j2":5,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02924","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nret = 0\nfor i in range(1, N):\n ret += i\n# 1 2 3 4 5 6 7 8 9 10 11 12 13\n# 2 3 4 5 6 7 8 9 10 11 12 13 1\nprint(ret)\n","fail":"N = int(input())\nret = (1 + N) * N \/\/ 2 - N\n# 1 2 3 4 5 6 7 8 9 10 11 12 13\n# 2 3 4 5 6 7 8 9 10 11 12 13 1\nprint(ret)\n","change":"replace","i1":1,"i2":4,"j1":1,"j2":2,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02924","language":"Python","original_status":"Time Limit Exceeded","pass":"print(sum(range(1, int(input()))))\n","fail":"N = int(input())\nprint(((N - 1) * N \/\/ 2))\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":2,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02924","language":"Python","original_status":"Time Limit Exceeded","pass":"# 2020\/08\/16\n# AtCoder Beginner Contest 139 - D\n\n# Input\nn = int(input())\n\n# Calc\nasum = 0\n# for i in range(1, n+1):\n# asum = asum + (n + 1 - i) % i\nfor i in range(1, n):\n asum = asum + i\n\n# Output\nprint(asum)\n","fail":"# 2020\/08\/16\n# AtCoder Beginner Contest 139 - D\n\n# Input\nn = int(input())\n\n# Calc\nans = n * (n - 1) \/\/ 2\n\n# Output\nprint(ans)\n","change":"replace","i1":7,"i2":15,"j1":7,"j2":11,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02925","language":"Python","original_status":"Time Limit Exceeded","pass":"import sys\n\ninput = sys.stdin.readline\n\nn = int(input())\n\ne = [[] for _ in range(n)]\nfor i in range(n):\n a = map(int, input().split())\n for aa in a:\n aa -= 1\n e[i].append(aa)\n# print(e)\n\ninds = [0] * n\ncur = [e[i][0] for i in range(n)]\n# print(cur)\ncnt = 0\nwhile sum(cur) != -n:\n flg = False\n bls = [False] * n\n for ind, target in enumerate(cur):\n if bls[ind] or bls[target]:\n continue\n if cur[target] == ind:\n flg = True\n inds[ind] += 1\n inds[target] += 1\n bls[ind] = True\n bls[target] = True\n cur[ind] = e[ind][inds[ind]] if inds[ind] < n - 1 else -1\n cur[target] = e[target][inds[target]] if inds[target] < n - 1 else -1\n if not flg:\n print(-1)\n exit()\n cnt += 1\n # print(cur, cnt)\n\nprint(cnt)\n","fail":"def check(player):\n if not a[player]:\n return\n opponent = a[player][-1]\n if not a[opponent]:\n return\n if a[opponent][-1] == player:\n tpl = (player, opponent)\n q.add((min(tpl), max(tpl)))\n\n\nn = int(input())\n\na = []\nfor _ in range(n):\n t = list(map(lambda x: int(x) - 1, input().split()))\n t.reverse()\n a.append(t)\n\nq = set()\nfor i in range(n):\n check(i)\n\nday = 0\nwhile q:\n day += 1\n prev_q = set()\n q, prev_q = prev_q, q\n for player, opponent in prev_q:\n a[player].pop()\n a[opponent].pop()\n for player, opponent in prev_q:\n check(player)\n check(opponent)\n\nif any(a[player] for player in range(n)):\n print(-1)\n exit()\n\nprint(day)\n","change":"replace","i1":0,"i2":39,"j1":0,"j2":40,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02925","language":"Python","original_status":"Time Limit Exceeded","pass":"from collections import defaultdict\n\nn = int(input())\na = [list(map(int, input().split())) for _ in range(n)]\n\nadj = defaultdict(list)\nin_deg = defaultdict(int)\nfor u, row in enumerate(a, 1):\n for v1, v2 in zip(row, row[1:]):\n uu1, vv1 = min(u, v1), max(u, v1)\n uu2, vv2 = min(u, v2), max(u, v2)\n adj[(uu1, vv1)].append((uu2, vv2))\n in_deg[(uu1, vv1)]\n in_deg[(uu2, vv2)] += 1\n\nnow = [tpl for tpl, val in in_deg.items() if val == 0]\nday = 0\nwhile now:\n day += 1\n nxt = []\n for u in now:\n for v in adj[u]:\n in_deg[v] -= 1\n if in_deg[v] == 0:\n nxt.append(v)\n\n now = nxt\n\nif max(in_deg.values()) > 0:\n day = -1\n\nprint(day)\n","fail":"from collections import defaultdict\n\nn = int(input())\na = [tuple(map(int, input().split())) for _ in range(n)]\n\nadj = defaultdict(list)\nin_deg = defaultdict(int)\nfor u, row in enumerate(a, 1):\n for v1, v2 in zip(row, row[1:]):\n uu1, vv1 = min(u, v1), max(u, v1)\n uu2, vv2 = min(u, v2), max(u, v2)\n match1 = uu1 + vv1 * 1000\n match2 = uu2 + vv2 * 1000\n adj[match1].append(match2)\n in_deg[match1]\n in_deg[match2] += 1\n\nnow = [key for key, val in in_deg.items() if val == 0]\nday = 0\nwhile now:\n day += 1\n nxt = []\n for u in now:\n for v in adj[u]:\n in_deg[v] -= 1\n if in_deg[v] == 0:\n nxt.append(v)\n\n now = nxt\n\nif max(in_deg.values()) > 0:\n day = -1\n\nprint(day)\n","change":"replace","i1":3,"i2":16,"j1":3,"j2":18,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02925","language":"Python","original_status":"Time Limit Exceeded","pass":"def solve():\n rem = N * (N - 1) \/\/ 2\n for day in range(N * (N - 1) \/\/ 2):\n did_play = [0] * N\n for i in range(N):\n if did_play[i] or A[i] == []:\n continue\n opponent = A[i][-1]\n if A[opponent][-1] == i and not did_play[opponent]:\n A[i].pop()\n A[opponent].pop()\n rem -= 1\n did_play[i] = 1\n did_play[opponent] = 1\n if sum(did_play) == 0:\n break\n if rem == 0:\n return day + 1\n return -1\n\n\nN = int(input())\nA = [list(map(lambda x: int(x) - 1, input().split()))[::-1] for _ in range(N)]\nprint(solve())\n","fail":"from sys import setrecursionlimit\n\n\ndef encode(i, j):\n if i < j:\n i, j = j, i\n return i * (i - 1) \/\/ 2 + j + 1\n\n\ndef dfs(v):\n if visited[v] == 2:\n return dp[v]\n visited[v] = 1\n for nv in g[v]:\n if visited[nv] == 1:\n print(-1)\n exit()\n dp[v] = max(dp[v], dfs(nv) + 1)\n visited[v] = 2\n return dp[v]\n\n\nsetrecursionlimit(10**6)\nN = int(input())\nGAMES_CNT = N * (N - 1) \/\/ 2\ng = [[] for _ in range(GAMES_CNT + 1)]\nfor i in range(N):\n orig = 0\n for j in map(lambda x: int(x) - 1, input().split()):\n dest = encode(i, j)\n g[orig].append(dest)\n orig = dest\ndp = [0] * (GAMES_CNT + 1)\nvisited = [0] * (GAMES_CNT + 1)\nprint(dfs(0))\n","change":"replace","i1":0,"i2":24,"j1":0,"j2":35,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02925","language":"Python","original_status":"Time Limit Exceeded","pass":"import sys\n\nN = int(input())\nA = [list(map(lambda x: int(x) - 1, input().split(\" \"))) for i in range(N)]\n\ncanUse = set(range(N))\n\nans = 0\nwhile any([len(i) > 0 for i in A]):\n # print(\"\\\\nDay\", ans)\n ans += 1\n canUseNew = set()\n for n in canUse:\n if not A[n]:\n continue\n\n first = A[n][-1]\n if first in canUseNew or n in canUseNew:\n continue\n\n if A[first][-1] == n:\n # print(\"Do\", n + 1, first + 1)\n A[n].pop()\n A[first].pop()\n canUseNew.add(n)\n canUseNew.add(first)\n\n if len(canUseNew) == 0:\n print(-1)\n sys.exit(0)\n canUse = canUseNew\n\nprint(ans)\n","fail":"import sys\n\nN = int(input())\nA = [list(map(lambda x: int(x) - 1, input().split(\" \"))) for i in range(N)]\n\ncanUse = set(range(N))\n\nans = 0\ndone = 0\nwhile done < N:\n ans += 1\n canUseNew = set()\n # print(\"LC\", len(canUse))\n for n in canUse:\n if not A[n]:\n continue\n\n first = A[n][-1]\n if first in canUseNew or n in canUseNew:\n continue\n\n if A[first][-1] == n:\n # print(\"Do\", n + 1, first + 1)\n A[n].pop()\n if len(A[n]) == 0:\n done += 1\n A[first].pop()\n if len(A[first]) == 0:\n done += 1\n canUseNew.add(n)\n canUseNew.add(first)\n\n if len(canUseNew) == 0:\n print(-1)\n sys.exit(0)\n canUse = canUseNew\n\nprint(ans)\n","change":"replace","i1":8,"i2":24,"j1":8,"j2":29,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02925","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\n\nG = [list(map(lambda x: int(x) - 1, input().split())) for _ in range(N)]\ncur = [0] * N\nedge = [0] * N\nfor i in range(N):\n edge[i] = G[i][cur[i]]\n\nday = 0\nplayer = set(range(N))\nwhile len(player) > 0:\n day += 1\n game = []\n for i in player:\n if i == edge[edge[i]]:\n game.append(i)\n if len(game) == 0:\n print(-1)\n exit()\n else:\n for j in game:\n cur[j] += 1\n c = cur[j]\n if c >= N - 1:\n player.remove(j)\n else:\n edge[j] = G[j][c]\n\nprint(day)\n","fail":"N = int(input())\n\nG = [list(map(int, input().split())) for _ in range(N)]\ncur = [0] * N\nedge = [0] * N\nfor i in range(N):\n edge[i] = G[i][0] - 1\n\nday = 0\nplayer = set(range(N))\ncnt = 0\nwhile len(player) > 0:\n day += 1\n game = set()\n for i in player:\n e = edge[i]\n if i == edge[e] and i != e:\n game.add(i)\n game.add(e)\n player = set()\n for j in game:\n cur[j] += 1\n c = cur[j]\n if c >= N - 1:\n edge[j] = j\n else:\n edge[j] = G[j][c] - 1\n player.add(j)\n\nif min(cur) != N - 1:\n ans = -1\nelse:\n ans = day\nprint(ans)\n","change":"replace","i1":2,"i2":29,"j1":2,"j2":34,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02925","language":"Python","original_status":"Time Limit Exceeded","pass":"import sys\n\nn = int(input())\na = []\nfor _ in range(n):\n a.append(list(map(int, input().split())))\nans = 0\npos = [0] * n\n\nwhile any([(n - 1) - x for x in pos]):\n pos_check = [False] * n\n checker = True\n for i in range(n):\n for j in range(i + 1, n):\n if pos[i] == n - 1 or pos[j] == n - 1:\n continue\n if a[i][pos[i]] == j + 1 and a[j][pos[j]] == i + 1:\n pos_check[i] = True\n pos_check[j] = True\n for i in range(n):\n if pos_check[i]:\n pos[i] += 1\n checker = False\n if checker:\n print(-1)\n sys.exit()\n ans += 1\nprint(ans)\n","fail":"n = int(input())\na = [list(map(int, input().split())) for _ in range(n)]\n\nl = [i for i in range(n)]\npos = [0] * n\nres = 0\ncnt = 0\nwhile True:\n res += 1\n flag = True\n tmp = l.copy()\n l = []\n used = [False] * n\n for v in tmp:\n if used[v] or pos[v] == n - 1:\n continue\n\n opp = a[v][pos[v]] - 1\n\n if used[opp] or pos[opp] == n - 1:\n continue\n\n if a[opp][pos[opp]] - 1 == v:\n pos[v] += 1\n pos[opp] += 1\n l.append(v)\n l.append(opp)\n used[v] = True\n used[opp] = True\n flag = False\n if pos[v] == n - 1:\n cnt += 1\n if pos[opp] == n - 1:\n cnt += 1\n\n if flag:\n print(-1)\n break\n\n if cnt == n:\n print(res)\n break\n","change":"replace","i1":0,"i2":28,"j1":0,"j2":42,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02925","language":"Python","original_status":"Time Limit Exceeded","pass":"from collections import deque, defaultdict\nfrom time import time\n\nN = int(input())\nA = [deque(map(lambda a: int(a) - 1, input().split())) for _ in range(N)]\nS = time()\n\ncanBattle = defaultdict(lambda: False)\nD = [0] * N\n\nwhile True:\n isChanged = False\n for i, a in enumerate(A):\n if not a:\n continue\n j = a[0]\n canBattle[(i, j)] = True\n\n if canBattle[(j, i)]:\n isChanged = True\n A[i].popleft()\n A[j].popleft()\n d = max(D[i], D[j])\n D[i], D[j] = d + 1, d + 1\n if all(len(a) == 0 for a in A):\n print(max(D))\n exit()\n if time() - S >= 1.800:\n print(N * (N - 1) \/\/ 2)\n exit()\n if not isChanged:\n break\n\nprint(-1)\n","fail":"from collections import deque, defaultdict\nfrom time import time\n\nS = time()\n\nN = int(input())\nA = [deque(map(lambda a: int(a) - 1, input().split())) for _ in range(N)]\n\ncanBattle = defaultdict(lambda: False)\nD = [0] * N\n\nwhile True:\n isChanged = False\n for i, a in enumerate(A):\n if not a:\n continue\n j = a[0]\n canBattle[(i, j)] = True\n\n if canBattle[(j, i)]:\n isChanged = True\n A[i].popleft()\n A[j].popleft()\n d = max(D[i], D[j])\n D[i], D[j] = d + 1, d + 1\n if all(len(a) == 0 for a in A):\n print(max(D))\n exit()\n if time() - S >= 1.700:\n print(N * (N - 1) \/\/ 2)\n exit()\n if not isChanged:\n break\n\nprint(-1)\n","change":"replace","i1":3,"i2":28,"j1":3,"j2":29,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02925","language":"Python","original_status":"Time Limit Exceeded","pass":"from sys import exit, setrecursionlimit\n\n\ndef get_node_id(i, j, node_id_db):\n if i < j:\n return node_id_db[i][j]\n else:\n return node_id_db[j][i]\n\n\ndef dfs(node_id, edges, dp):\n t = dp[node_id]\n if t >= 0:\n return t\n dp[node_id] = 0\n result = 0\n for n in edges[node_id]:\n t = dfs(n, edges, dp)\n if t == 0: # looped\n print(-1)\n exit()\n if t > result:\n result = t\n result += 1\n dp[node_id] = result\n return result\n\n\nsetrecursionlimit(1000000)\n\nN = int(input())\nA = [[int(e) - 1 for e in input().split()] for _ in range(N)]\n\nnode_id_db = [[0] * N for _ in range(N)]\nv = 0\nfor i in range(N):\n for j in range(i + 1, N):\n node_id_db[i][j] = v\n v += 1\n\nstart_nodes = []\nedges = [[] for _ in range(N * (N - 1) \/\/ 2)]\nfor i in range(N):\n Ai = A[i]\n from_id = get_node_id(i, Ai[0], node_id_db)\n if i < Ai[0]:\n start_nodes.append(from_id)\n for j in range(1, N - 1):\n to_id = get_node_id(i, Ai[j], node_id_db)\n edges[from_id].append(to_id)\n from_id = to_id\n\ndp = [-1] * (N * (N - 1) \/\/ 2)\nprint(max(dfs(n, edges, dp) for n in start_nodes))\n","fail":"from sys import setrecursionlimit\n\n\ndef get_node_id(i, j, node_id_db):\n if i < j:\n return node_id_db[i][j]\n else:\n return node_id_db[j][i]\n\n\ndef dfs(node_id, edges, dp):\n t = dp[node_id]\n if t >= 0:\n return t\n dp[node_id] = 0\n result = 0\n for n in edges[node_id]:\n t = dfs(n, edges, dp)\n if t == 0: # looped\n print(-1)\n exit()\n if t > result:\n result = t\n result += 1\n dp[node_id] = result\n return result\n\n\ndef main():\n N = int(input())\n A = [[int(e) - 1 for e in input().split()] for _ in range(N)]\n\n node_id_db = [[0] * N for _ in range(N)]\n v = 0\n for i in range(N):\n for j in range(i + 1, N):\n node_id_db[i][j] = v\n v += 1\n\n start_nodes = []\n edges = [[] for _ in range(N * (N - 1) \/\/ 2)]\n for i in range(N):\n Ai = A[i]\n from_id = get_node_id(i, Ai[0], node_id_db)\n if i < Ai[0]:\n start_nodes.append(from_id)\n for j in range(1, N - 1):\n to_id = get_node_id(i, Ai[j], node_id_db)\n edges[from_id].append(to_id)\n from_id = to_id\n\n dp = [-1] * (N * (N - 1) \/\/ 2)\n print(max(dfs(n, edges, dp) for n in start_nodes))\n\n\nsetrecursionlimit(10**6)\nmain()\n","change":"replace","i1":0,"i2":54,"j1":0,"j2":57,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02925","language":"Python","original_status":"Time Limit Exceeded","pass":"import sys\n\n\ndef topological_sort(root, links, in_count):\n topological = []\n q = root\n while q:\n v = q.pop()\n topological.append(v)\n for u in links[v]:\n in_count[u] -= 1\n if in_count[u] == 0:\n q.add(u)\n return topological\n\n\nn = int(input())\nmatch_count = n * (n - 1) \/\/ 2\n\noffsets = [0]\ntmp = -2\nfor i in range(1, n + 1):\n offsets.append(tmp)\n tmp += n - i - 1\n\nroots = set()\nin_links = [set() for _ in range(match_count)]\nout_links = [set() for _ in range(match_count)]\n\nfor i, line in enumerate(sys.stdin, start=1):\n aaa = list(map(int, line.split()))\n j = aaa[0]\n prev = offsets[i] + j if i < j else offsets[j] + i\n roots.add(prev)\n\n for j in aaa[1:]:\n key = offsets[i] + j if i < j else offsets[j] + i\n out_links[prev].add(key)\n in_links[key].add(prev)\n prev = key\n\nin_count = list(map(len, in_links))\nroots = {r for r in roots if in_count[r] == 0}\n\nif not roots:\n print(-1)\n exit()\n\ntopological = topological_sort(roots, out_links, in_count)\nif len(topological) != match_count:\n print(-1)\n exit()\n\ndepth = [0] * match_count\nfor v in topological:\n depth[v] = max(map(depth.__getitem__, in_links[v]), default=0) + 1\n\nprint(max(depth))\n","fail":"import sys\nfrom collections import deque\n\n\ndef topological_check(roots, out_links, in_count):\n depth = [0] * match_count\n for r in roots:\n depth[r] = 1\n q = deque(roots)\n while q:\n v = q.popleft()\n d = depth[v] + 1\n for u in out_links[v]:\n in_count[u] -= 1\n if in_count[u] == 0:\n depth[u] = d\n q.append(u)\n if any(in_count):\n return -1\n return max(depth)\n\n\nn = int(input())\nmatch_count = n * (n - 1) \/\/ 2\n\noffsets = [0]\ntmp = -2\nfor i in range(1, n + 1):\n offsets.append(tmp)\n tmp += n - i - 1\n\nroots = set()\nin_links = [set() for _ in range(match_count)]\nout_links = [set() for _ in range(match_count)]\n\nfor i, line in enumerate(sys.stdin, start=1):\n aaa = list(map(int, line.split()))\n j = aaa[0]\n prev = offsets[i] + j if i < j else offsets[j] + i\n roots.add(prev)\n\n for j in aaa[1:]:\n key = offsets[i] + j if i < j else offsets[j] + i\n out_links[prev].add(key)\n in_links[key].add(prev)\n prev = key\n\nin_count = list(map(len, in_links))\nroots = {r for r in roots if in_count[r] == 0}\n\nif not roots:\n print(-1)\n exit()\n\nprint(topological_check(roots, out_links, in_count))\n","change":"replace","i1":1,"i2":58,"j1":1,"j2":55,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02925","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\nA = [list(int(x) - 1 for x in input().split()) for _ in range(n)]\nB = [0] * n\n\nans = 1\nwhile True:\n day_set = set()\n for i in range(n):\n if i in day_set or B[i] >= n - 1:\n continue\n j = A[i][B[i]]\n if j in day_set or B[j] >= n - 1:\n continue\n if A[j][B[j]] == i:\n B[i] += 1\n B[j] += 1\n day_set.add(i)\n day_set.add(j)\n if all(b >= n - 1 for b in B):\n print(ans)\n exit()\n if not day_set:\n print(-1)\n exit()\n else:\n ans += 1\n","fail":"n = int(input())\nA = [list(int(x) - 1 for x in input().split()) for _ in range(n)]\nB = [0] * n\n\nans = 1\nstack = [i for i in range(n)]\nwhile True:\n day_set = set()\n next_stack = []\n while stack:\n i = stack.pop()\n if i in day_set or B[i] >= n - 1:\n continue\n j = A[i][B[i]]\n if j in day_set or B[j] >= n - 1:\n continue\n if A[j][B[j]] == i:\n B[i] += 1\n B[j] += 1\n day_set.add(i)\n day_set.add(j)\n next_stack += [i, j]\n if all(b >= n - 1 for b in B):\n print(ans)\n exit()\n\n if not day_set:\n print(-1)\n exit()\n ans += 1\n stack = next_stack\n","change":"replace","i1":5,"i2":26,"j1":5,"j2":31,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02925","language":"Python","original_status":"Runtime Error","pass":"from collections import deque\nfrom typing import List, Optional, Tuple\n\n\ndef cycle_detectable_topological_sort(\n graph: List[List[int]], in_degrees: List[int], first_index: int = 0\n) -> Tuple[Optional[List[int]], Optional[List[int]]]:\n \"\"\"Topological sort that uses Kahn's algorithm and detects a loop (DAG or not).\n Returns:\n if the given graph is DAG, a list of sorted vertices and a list of depths of\n each vertex is returned.\n Otherwise, (None, None) is returned.\n \"\"\"\n V = len(graph) + first_index\n order = []\n depths = [-1] * V # depths[i] := the length of the longest path to V_i\n for i in range(first_index, V):\n if not in_degrees[i]:\n order.append(i)\n depths[i] = 0\n\n queue = deque(order)\n while queue:\n u = queue.popleft()\n cur_depth = depths[u]\n for v in graph[u]:\n in_degrees[v] -= 1\n if not in_degrees[v]:\n depths[v] = max(depths[v], cur_depth + 1)\n queue.append(v), order.append(v)\n return (order, depths) if len(order) + first_index == V else (None, None)\n\n\ndef abc139_e():\n N, *A = map(int, open(0).read().split())\n\n ids = [[-1] * (N + 1) for _ in range(N + 1)]\n cur_id = 0\n for i in range(1, N + 1):\n for j in range(i + 1, N + 1):\n ids[i][j] = ids[j][i] = cur_id\n cur_id += 1\n\n graph = [[] for _ in range(N * (N - 1) \/\/ 2)]\n in_degrees = [0] * (N * (N - 1) \/\/ 2)\n for i, a in enumerate(zip(*[iter(A)] * (N - 1)), 1):\n prev_id = -1\n for j in a:\n cur_id = ids[i][j]\n if prev_id != -1:\n graph[prev_id].append(cur_id)\n in_degrees[cur_id] += 1\n prev_id = cur_id\n\n _, depths = cycle_detectable_topological_sort(graph, in_degrees, 1)\n print(max(depths) + 1 if depths is not None else -1)\n\n\nif __name__ == \"__main__\":\n abc139_e()\n","fail":"from collections import deque\nfrom typing import List, Optional, Tuple\n\n\ndef cycle_detectable_topological_sort(\n graph: List[List[int]], in_degrees: List[int], first_index: int = 0\n) -> Tuple[Optional[List[int]], Optional[List[int]]]:\n \"\"\"Topological sort that uses Kahn's algorithm and detects a loop (DAG or not).\n Returns:\n if the given graph is DAG, a list of sorted vertices and a list of depths of\n each vertex is returned.\n Otherwise, (None, None) is returned.\n \"\"\"\n V = len(graph) + first_index\n order = []\n depths = [-1] * V # depths[i] := the length of the longest path to V_i\n for i in range(first_index, V):\n if not in_degrees[i]:\n order.append(i)\n depths[i] = 0\n\n queue = deque(order)\n while queue:\n u = queue.popleft()\n cur_depth = depths[u]\n for v in graph[u]:\n in_degrees[v] -= 1\n if not in_degrees[v]:\n depths[v] = cur_depth + 1\n queue.append(v), order.append(v)\n return (order, depths) if len(order) + first_index == V else (None, None)\n\n\ndef abc139_e():\n # https:\/\/atcoder.jp\/contests\/abc139\/tasks\/abc139_e\n N, *A = map(int, open(0).read().split())\n\n ids = [[-1] * (N + 1) for _ in range(N + 1)]\n cur_id = 0\n for i in range(1, N + 1):\n for j in range(i + 1, N + 1):\n ids[i][j] = ids[j][i] = cur_id\n cur_id += 1\n\n graph = [[] for _ in range(N * (N - 1) \/\/ 2)]\n in_degrees = [0] * (N * (N - 1) \/\/ 2)\n for i, a in enumerate(zip(*[iter(A)] * (N - 1)), 1):\n source = -1\n for j in a:\n target = ids[i][j]\n if source != -1:\n graph[source].append(target)\n in_degrees[target] += 1\n source = target\n\n _, depths = cycle_detectable_topological_sort(graph, in_degrees)\n print(max(depths) + 1 if depths else -1)\n\n\ndef grl_4_a():\n # https:\/\/onlinejudge.u-aizu.ac.jp\/courses\/library\/5\/GRL\/4\/GRL_4_A\n V, _, *ST = map(int, open(0).read().split())\n graph = [[] for _ in range(V)]\n in_degrees = [0] * V\n for s, t in zip(*[iter(ST)] * 2):\n graph[s].append(t)\n in_degrees[t] += 1\n\n res, _ = cycle_detectable_topological_sort(graph, in_degrees)\n print(1 if res is None else 0)\n\n\nif __name__ == \"__main__\":\n abc139_e()\n # grl_4_a()\n","change":"replace","i1":28,"i2":60,"j1":28,"j2":75,"error":"IndexError: list index out of range","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02925\/Python\/s199555877.py\", line 60, in \n abc139_e()\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02925\/Python\/s199555877.py\", line 55, in abc139_e\n _, depths = cycle_detectable_topological_sort(graph, in_degrees, 1)\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02925\/Python\/s199555877.py\", line 18, in cycle_detectable_topological_sort\n if not in_degrees[i]:\nIndexError: list index out of range\n","stdout":null} {"problem_id":"p02925","language":"Python","original_status":"Runtime Error","pass":"# E - League\nimport sys\nfrom collections import deque\nfrom typing import Deque, List\n\nreadline = sys.stdin.buffer.readline\nreadlines = sys.stdin.buffer.readline\n\n\ndef main():\n N = int(readline())\n A: List[Deque[int]] = [deque()] + list(\n deque(map(int, line.split())) for line in readlines()\n )\n matched_games_cnt = 0\n next_games_opponent, last_games_day = [0] * (N + 1), [0] * (N + 1)\n queue = deque(list(range(1, N + 1)))\n while queue:\n player = queue.popleft()\n if not A[player]: # The player has finished all games.\n continue\n opponent = A[player].popleft()\n\n # The opponent will have another game before playing against x.\n if next_games_opponent[opponent] != player:\n next_games_opponent[player] = opponent\n continue\n\n # The opponent's next game is against the player and vice versa.\n matched_games_cnt += 1\n last_games_day[player] = last_games_day[opponent] = (\n max(last_games_day[player], last_games_day[opponent]) + 1\n )\n # No next game is currently planned.\n next_games_opponent[player] = next_games_opponent[opponent] = 0\n queue.append(player), queue.append(opponent)\n\n print(max(last_games_day) if matched_games_cnt == N * (N - 1) \/\/ 2 else -1)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"# E - League\nimport sys\nfrom collections import deque\nfrom typing import Deque, List\n\nreadline = sys.stdin.buffer.readline\nreadlines = sys.stdin.buffer.readlines\n\n\ndef main():\n N = int(readline())\n A: List[Deque[int]] = [deque()] + [\n deque(map(int, line.split())) for line in readlines()\n ]\n matched_games_cnt = 0\n next_games_opponent, last_games_day = [0] * (N + 1), [0] * (N + 1)\n queue = deque(list(range(1, N + 1)))\n while queue:\n player = queue.popleft()\n if not A[player]: # The player has finished all games.\n continue\n opponent = A[player].popleft()\n\n # The opponent will have another game before playing against x.\n if next_games_opponent[opponent] != player:\n next_games_opponent[player] = opponent\n continue\n\n # The opponent's next game is against the player and vice versa.\n matched_games_cnt += 1\n last_games_day[player] = last_games_day[opponent] = (\n max(last_games_day[player], last_games_day[opponent]) + 1\n )\n # No next game is currently planned.\n next_games_opponent[player] = next_games_opponent[opponent] = 0\n queue.append(player), queue.append(opponent)\n\n print(max(last_games_day) if matched_games_cnt == N * (N - 1) \/\/ 2 else -1)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":6,"i2":14,"j1":6,"j2":14,"error":"AttributeError: 'int' object has no attribute 'split'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02925\/Python\/s342375203.py\", line 42, in \n main()\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02925\/Python\/s342375203.py\", line 12, in main\n A: List[Deque[int]] = [deque()] + list(\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02925\/Python\/s342375203.py\", line 13, in \n deque(map(int, line.split())) for line in readlines()\nAttributeError: 'int' object has no attribute 'split'\n","stdout":null} {"problem_id":"p02928","language":"Python","original_status":"Runtime Error","pass":"n, k = list(map(int, input().split()))\na = list(map(int, input().split()))\ncnt = 0\ncnt2 = 0\nfor i, ai in enumerate(a):\n for j in range(i, n):\n if ai > a[j]:\n cnt += 1\n if i > 0:\n for j in range(i):\n if ai > a[j]:\n cnt2 += 1\n\nif k % 2 == 0:\n mul = (1 + k) * (k \/\/ 2)\nelse:\n mul = (1 + k) * (k \/\/ 2) + (k \/\/ 2 + 1)\nif k > 1:\n k -= 1\n if k % 2 == 0:\n mul2 = (1 + k) * (k \/\/ 2)\n else:\n mul2 = (1 + k) * (k \/\/ 2) + (k \/\/ 2 + 1)\nprint(((cnt * mul) + (cnt2 * mul2)) % 1000000007)\n","fail":"n, k = list(map(int, input().split()))\na = list(map(int, input().split()))\ncnt = 0\ncnt2 = 0\nfor i, ai in enumerate(a):\n for j in range(i, n):\n if ai > a[j]:\n cnt += 1\n if i > 0:\n for j in range(i):\n if ai > a[j]:\n cnt2 += 1\n\nif k % 2 == 0:\n mul = (1 + k) * (k \/\/ 2)\nelse:\n mul = (1 + k) * (k \/\/ 2) + (k \/\/ 2 + 1)\nmul2 = 0\nif k > 1:\n k -= 1\n if k % 2 == 0:\n mul2 = (1 + k) * (k \/\/ 2)\n else:\n mul2 = (1 + k) * (k \/\/ 2) + (k \/\/ 2 + 1)\nprint(((cnt * mul) + (cnt2 * mul2)) % 1000000007)\n","change":"insert","i1":17,"i2":17,"j1":17,"j2":18,"error":0,"stderr":null,"stdout":3} {"problem_id":"p02933","language":"Python","original_status":"Runtime Error","pass":"a = int(input())\ns = int(input())\nprint(s if a < 3200 else \"red\")\n","fail":"a = int(input())\ns = input()\nprint(s if a >= 3200 else \"red\")\n","change":"replace","i1":1,"i2":3,"j1":1,"j2":3,"error":"ValueError: invalid literal for int() with base 10: 'pink'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02933\/Python\/s382036046.py\", line 2, in \n s = int(input())\nValueError: invalid literal for int() with base 10: 'pink'\n","stdout":null} {"problem_id":"p02934","language":"Python","original_status":"Runtime Error","pass":"n = int(input())\na = list(map(int, input().split()))\nans = 0\nfor i in n:\n ans += 1 \/ i\nprint(1 \/ ans)\n","fail":"n = int(input())\na = list(map(int, input().split()))\nans = 0\nfor i in a:\n ans += 1 \/ i\nprint(1 \/ ans)\n","change":"replace","i1":3,"i2":4,"j1":3,"j2":4,"error":"TypeError: 'int' object is not iterable","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02934\/Python\/s273231160.py\", line 4, in \n for i in n:\nTypeError: 'int' object is not iterable\n","stdout":null} {"problem_id":"p02934","language":"Python","original_status":"Runtime Error","pass":"n = int(input())\na = list(map(int, input().split()))\n\ndiv = 0\nfor i in range(n):\n div += a \/ a[i]\nprint(1 \/ div)\n","fail":"n = int(input())\na = list(map(int, input().split()))\n\ndiv = 0\nfor i in range(n):\n div += 1 \/ a[i]\nprint(1 \/ div)\n","change":"replace","i1":5,"i2":6,"j1":5,"j2":6,"error":"TypeError: unsupported operand type(s) for \/: 'list' and 'int'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02934\/Python\/s178492873.py\", line 6, in \n div += a \/ a[i]\nTypeError: unsupported operand type(s) for \/: 'list' and 'int'\n","stdout":null} {"problem_id":"p02934","language":"Python","original_status":"Runtime Error","pass":"def gcd(a, b):\n mi = min(a, b)\n ma = max(a, b)\n r = ma % mi\n if r == 0:\n return mi\n gcd(mi, r)\n\n\nN = input()\nA = list(map(int, input().split()))\n\nSum = sum(A)\ns = []\nmulti = 1.0\nfor t in A:\n multi = int((multi * t) \/ gcd(int(multi), int(t)))\n\nfor a in A:\n s.append(int(multi \/ a))\n\nprint(multi \/ sum(s))\n","fail":"N = input()\nA = list(map(float, input().split()))\n\nprint(1 \/ sum(1 \/ x for x in A))\n","change":"replace","i1":0,"i2":22,"j1":0,"j2":4,"error":"0","stderr":null,"stdout":7.5} {"problem_id":"p02934","language":"Python","original_status":"Runtime Error","pass":"import numpy as np\n\nn = int(input())\n\na = list(map(int, input().split()))\np = np.prod(a)\n\ntop = p\nunder = 0\n\nfor aa in a:\n under += p \/ aa\n\nprint(top \/ under)\n","fail":"import numpy as np\n\nn = int(input())\n\na = list(map(int, input().split()))\n\nue = 1\n\nfor aa in a:\n ue *= aa\n\nshita = 0\n\nfor aa in a:\n shita += ue \/ aa\n\nprint(ue \/ shita)\n","change":"replace","i1":5,"i2":14,"j1":5,"j2":17,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02934","language":"Python","original_status":"Runtime Error","pass":"import numpy as np\n\nN = int(input())\nA = [float(input()) for _ in range(N)]\n\nnA = np.array(A)\nprint(np.reciprocal(np.sum(np.reciprocal(nA))))\n","fail":"import numpy as np\n\nN = int(input())\nA = [float(x) for x in input().split()]\n\nnA = np.array(A)\nprint(np.reciprocal(np.sum(np.reciprocal(nA))))\n","change":"replace","i1":3,"i2":4,"j1":3,"j2":4,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02934","language":"Python","original_status":"Runtime Error","pass":"import math\n\nN = int(input())\nA = list(map(int, input().split()))\n\na = A[0]\n\nfor i in range(1, N):\n a = (a * A[i]) \/\/ math.gcd(a, A[i])\n\nb = 0\n\nfor i in range(N):\n b += a \/\/ A[i]\n\nprint(a \/ b)\n","fail":"import math\n\nN = int(input())\nA = list(map(int, input().split()))\n\n# num is numerator\n# den is denominator\nnum, den = A[0], 0\n\nfor i in A:\n num = (num * i) \/\/ math.gcd(num, i)\n\nfor i in A:\n den += num \/\/ i\n\nans = num \/ den\nprint(ans)\n","change":"replace","i1":5,"i2":16,"j1":5,"j2":17,"error":"0","stderr":null,"stdout":7.5} {"problem_id":"p02934","language":"Python","original_status":"Runtime Error","pass":"from sys import stdin, setrecursionlimit\nimport numpy as np\n\n\ndef main():\n input = stdin.buffer.readline\n n = int(input())\n a = list(map(int, input().split()))\n\n num = np.prod(a)\n\n den = sum([num \/\/ a[i] for i in range(n)])\n\n print(num \/ den)\n\n\nif __name__ == \"__main__\":\n setrecursionlimit(10000)\n main()\n","fail":"from sys import stdin, setrecursionlimit\n\n\ndef main():\n input = stdin.buffer.readline\n n = int(input())\n a = list(map(int, input().split()))\n\n num = 1\n for ai in a:\n num *= ai\n\n den = sum([num \/\/ a[i] for i in range(n)])\n\n print(num \/ den)\n\n\nif __name__ == \"__main__\":\n setrecursionlimit(10000)\n main()\n","change":"replace","i1":1,"i2":10,"j1":1,"j2":11,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02935","language":"Python","original_status":"Runtime Error","pass":"import heapq\nimport math\n\n\ndef solve(n, v):\n heapq.heapify(v)\n nn = math.ceil(n \/ 2)\n\n while len(nn) != 1:\n x = heapq.heappop(v)\n y = heapq.heappop(v)\n z = (x + y) \/ 2\n heapq.heappush(v, z)\n\n return v[0]\n\n\nn = int(input())\nv = list(map(int, input().split()))\n\nprint(solve(n, v))\n","fail":"import heapq\nimport math\n\n\ndef solve(n, v):\n heapq.heapify(v)\n\n while len(v) != 1:\n x = heapq.heappop(v)\n y = heapq.heappop(v)\n z = (x + y) \/ 2\n heapq.heappush(v, z)\n\n return v[0]\n\n\nn = int(input())\nv = list(map(int, input().split()))\n\nprint(solve(n, v))\n","change":"replace","i1":6,"i2":9,"j1":6,"j2":8,"error":"TypeError: object of type 'int' has no len()","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02935\/Python\/s983148308.py\", line 21, in \n print(solve(n, v))\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02935\/Python\/s983148308.py\", line 9, in solve\n while len(nn) != 1:\nTypeError: object of type 'int' has no len()\n","stdout":null} {"problem_id":"p02935","language":"Python","original_status":"Time Limit Exceeded","pass":"import numpy as np\n\n\ndef get_answer(n, a):\n n = int(n)\n a = [int(v) for v in a.split(\" \")]\n indexes_all = create_index(n)\n v_max = -1\n for indexes in indexes_all:\n v = a[indexes[0]]\n for i in range(1, len(indexes)):\n v = (v + a[indexes[i]]) \/ 2\n if v > v_max:\n v_max = v\n return v_max\n\n\ndef create_index(n):\n ret_all = []\n index_queue = np.arange(0, n)\n ret = []\n search_index(index_queue, ret_all, ret, n)\n return ret_all\n\n\ndef search_index(index_q, ret_all, ret, n):\n if n <= 0:\n ret_all.append(list(ret))\n return\n for i in range(n):\n index = index_q[i]\n index_q = np.delete(index_q, i)\n ret.append(index)\n search_index(index_q, ret_all, ret, n - 1)\n index_q = np.insert(index_q, i, index)\n ret.pop()\n\n\nif __name__ == \"__main__\":\n input1 = input()\n input2 = input()\n print(get_answer(input1, input2))\n","fail":"def sort_index(a):\n for i in range(len(a)):\n for j in range(i + 1, len(a)):\n if a[i] > a[j]:\n a[i], a[j] = a[j], a[i]\n return a\n\n\ndef get_answer(n, a):\n n = int(n)\n a = [int(v) for v in a.split(\" \")]\n a = sort_index(a)\n v_max = 0\n v = a[0]\n for i in range(1, len(a)):\n v = (v + a[i]) \/ 2\n if v > v_max:\n v_max = v\n return v_max\n\n\nif __name__ == \"__main__\":\n input1 = input()\n input2 = input()\n print(get_answer(input1, input2))\n","change":"replace","i1":0,"i2":36,"j1":0,"j2":19,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02935","language":"Python","original_status":"Time Limit Exceeded","pass":"from itertools import combinations\n\nn = int(input())\nvalues = list(map(int, input().split()))\n\nans = 0\n\n\ndef dfs(v):\n if len(v) == 2:\n global ans\n ans = max((v[0] + v[1]) \/ 2, ans)\n return\n\n for vv in combinations(v, 2):\n v_alche = v[:]\n v_alche.remove(vv[0])\n v_alche.remove(vv[1])\n v_alche.append((vv[0] + vv[1]) \/ 2)\n dfs(v_alche)\n\n\ndfs(values)\nprint(ans)\n","fail":"n = int(input())\nv = list(map(int, input().split()))\n\nv.sort(reverse=True)\n\nwhile len(v) > 1:\n v = v[:-2] + [(v[-1] + v[-2]) \/ 2]\n\nprint(v[0])\n","change":"replace","i1":0,"i2":24,"j1":0,"j2":9,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02935","language":"Python","original_status":"Time Limit Exceeded","pass":"# -*- coding: utf-8 -*-\nfrom decimal import Decimal\nfrom itertools import permutations\n\n# \u6574\u6570\u306e\u5165\u529b\nN = int(input())\n\n# \u30b9\u30da\u30fc\u30b9\u533a\u5207\u308a\u306e\u6574\u6570\u306e\u5165\u529b\nV = list(map(Decimal, input().split()))\n\nresult = 0\n\nfor values in permutations(V, N):\n new_result = values[0]\n\n for value in values[1:]:\n new_result = (new_result + value) \/ 2\n\n if result < new_result:\n result = new_result\n\n# \u51fa\u529b\nprint(result)\n","fail":"# -*- coding: utf-8 -*-\nfrom decimal import Decimal\nfrom itertools import permutations\n\n# \u6574\u6570\u306e\u5165\u529b\nN = int(input())\n\n# \u30b9\u30da\u30fc\u30b9\u533a\u5207\u308a\u306e\u6574\u6570\u306e\u5165\u529b\nV = list(map(Decimal, input().split()))\n\nresult = 0\n\nV = sorted(V)\nresult = V[0]\n\nfor value in V[1:]:\n result = (result + value) \/ 2\n\n\n# \u51fa\u529b\nprint(result)\n","change":"replace","i1":12,"i2":20,"j1":12,"j2":18,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02936","language":"Python","original_status":"Time Limit Exceeded","pass":"import sys\n\ninput = sys.stdin.readline # NOQA\nsys.setrecursionlimit(10**7) # NOQA\n\n\ndef dfs(G, v, p, counter, x):\n \"\"\"G: graph, v: vertex, p: parent\"\"\"\n counter[v] += x\n # Loop for each child\n for c in G[v]:\n if c == p:\n continue # Avoid multiple access to parent\n dfs(G, c, v, counter, x)\n\n\ndef calc_parent(G, v, p, parent):\n parent[v] = p\n for c in G[v]:\n if c == p:\n continue\n calc_parent(G, c, v, parent)\n\n\ndef main():\n N, Q = map(int, input().split())\n G = [[] for _ in range(N)]\n for _ in range(N - 1):\n a, b = map(int, input().split())\n a -= 1\n b -= 1\n G[a].append(b)\n G[b].append(a)\n\n parent = [-1] * N\n calc_parent(G, 0, -1, parent)\n counter = [0] * N\n for _ in range(Q):\n p, x = map(int, input().split())\n p -= 1\n dfs(G, p, parent[p], counter, x)\n\n print(*counter)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"import sys\n\ninput = sys.stdin.readline # NOQA\nsys.setrecursionlimit(10**7) # NOQA\n\n\ndef dfs(G, v, p, counter):\n \"\"\"G: graph, v: vertex, p: parent\"\"\"\n # Loop for each child\n counter_v = counter[v]\n for c in G[v]:\n if c == p:\n continue # Avoid multiple access to parent\n counter[c] += counter_v\n dfs(G, c, v, counter)\n\n\ndef main():\n N, Q = map(int, input().split())\n G = [[] for _ in range(N)]\n for _ in range(N - 1):\n a, b = map(int, input().split())\n a -= 1\n b -= 1\n G[a].append(b)\n G[b].append(a)\n\n counter = [0] * N\n for _ in range(Q):\n p, x = map(int, input().split())\n p -= 1\n counter[p] += x\n\n dfs(G, 0, -1, counter)\n print(*counter)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":6,"i2":42,"j1":6,"j2":34,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02936","language":"Python","original_status":"Time Limit Exceeded","pass":"N, Q = map(int, input().split())\n\nvalues = [0] * N\nlinks = [[] for _ in range(N)]\nfor _ in range(N - 1):\n a, b = map(int, input().split())\n links[a - 1].append(b - 1)\n links[b - 1].append(a - 1)\nfor _ in range(Q):\n p, x = map(int, input().split())\n values[p - 1] += x\n\ns = [(0, -1)]\nwhile s:\n i, p = s.pop(0)\n for j in links[i]:\n if j == p:\n continue\n values[j] += values[i]\n s.append((j, i))\nprint(*values)\n","fail":"def main():\n N, Q = map(int, input().split())\n\n values = [0] * N\n links = [[] for _ in range(N)]\n for _ in range(N - 1):\n a, b = map(int, input().split())\n links[a - 1].append(b - 1)\n links[b - 1].append(a - 1)\n for _ in range(Q):\n p, x = map(int, input().split())\n values[p - 1] += x\n\n s = [(0, -1)]\n while s:\n i, p = s.pop()\n for j in links[i]:\n if j == p:\n continue\n values[j] += values[i]\n s.append((j, i))\n print(*values)\n\n\nmain()\n","change":"replace","i1":0,"i2":21,"j1":0,"j2":25,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02936","language":"Python","original_status":"Time Limit Exceeded","pass":"from collections import deque\n\nN, Q = map(int, input().split())\n\nG = dict()\nfor i in range(1, N + 1):\n G[i] = dict()\n\nfor _ in range(N - 1):\n a, b = map(int, input().split())\n G[a][b] = 1\n G[b][a] = 1\n\nparents = [0] * (N + 1)\nvalues = [0] * (N + 1)\nvalues_sum = [-1] * (N + 1)\n\nfor _ in range(Q):\n p, x = map(int, input().split())\n values[p] += x\n\n# solve\nvalues_sum[1] = values[1]\n\nqueue = deque([1])\nwhile len(queue) > 0:\n p = queue.popleft()\n for q in G[p].keys():\n if G[p][q] == 1:\n if values_sum[q] == -1:\n values_sum[q] = values_sum[p] + values[q]\n G[q][p] = 0\n queue.append(q)\n\nprint(*values_sum[1:])\n","fail":"from collections import defaultdict\n\nN, Q = map(int, input().split())\n\nG = defaultdict(list)\n\nfor _ in range(N - 1):\n a, b = map(int, input().split())\n G[a].append(b)\n G[b].append(a)\n\nparents = [0] * (N + 1)\nvalues = [0] * (N + 1)\nvalues_sum = [-1] * (N + 1)\n\nfor _ in range(Q):\n p, x = map(int, input().split())\n values[p] += x\n\n# solve\nvalues_sum[1] = values[1]\n\nqueue = [1]\nwhile len(queue) > 0:\n p = queue.pop()\n for q in G[p]:\n if values_sum[q] == -1:\n values_sum[q] = values_sum[p] + values[q]\n queue.append(q)\n\nprint(*values_sum[1:])\n","change":"replace","i1":0,"i2":33,"j1":0,"j2":29,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02936","language":"Python","original_status":"Runtime Error","pass":"# -*- coding: utf-8 -*-\n\nimport sys\n\n\ndef main():\n n, q = [int(x) for x in sys.stdin.readline().rstrip().split(\" \")]\n\n tree = {}\n data = [0 for x in range(n)]\n\n for _ in range(n - 1):\n a, b = [int(x) for x in sys.stdin.readline().rstrip().split(\" \")]\n if a not in tree:\n tree[a] = []\n tree[a].append(b)\n\n for _ in range(q):\n p, x = [int(x) for x in sys.stdin.readline().rstrip().split(\" \")]\n data[p - 1] += x\n\n def add(p, x):\n data[p - 1] += x\n if p not in tree:\n return\n for p2 in tree[p]:\n add(p2, data[p - 1])\n\n add(1, 0)\n\n print(\" \".join([str(x) for x in data]))\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"# -*- coding: utf-8 -*-\n\nimport sys\n\n\nsys.setrecursionlimit(10**6)\n\n\ndef main():\n n, q = map(int, sys.stdin.readline().split())\n\n tree = [[] for x in range(n + 1)]\n data = [0 for x in range(n + 1)]\n\n for _ in range(n - 1):\n a, b = map(int, sys.stdin.readline().split())\n tree[a].append(b)\n tree[b].append(a)\n\n for _ in range(q):\n p, x = map(int, sys.stdin.readline().split())\n data[p] += x\n\n def dfs(p, p2, x):\n data[p] += x\n for p3 in tree[p]:\n if p3 == p2:\n continue\n dfs(p3, p, data[p])\n\n dfs(1, 0, 0)\n\n print(\" \".join([str(x) for x in data[1:]]))\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":5,"i2":31,"j1":5,"j2":33,"error":"0","stderr":null,"stdout":"100 110 111 110\n"} {"problem_id":"p02936","language":"Python","original_status":"Time Limit Exceeded","pass":"import sys\n\nsys.setrecursionlimit(1000000)\nN, Q = map(int, input().split())\nA, B = [], []\n\nedges = [[] for _ in range(N + 1)]\nnums = [0 for _ in range(N + 1)]\nfor _ in range(N - 1):\n a, b = map(int, input().split())\n edges[a].append(b)\n edges[b].append(a)\n\nfor _ in range(Q):\n p, x = map(int, input().split())\n nums[p] += x\n\n\ndef dfs(now, parent):\n for i in edges[now]:\n if i != parent:\n nums[i] += nums[now]\n dfs(i, now)\n\n\ndfs(1, 0)\nfor n in nums[1:]:\n print(n)\n","fail":"import sys\n\nsys.setrecursionlimit(10**6)\nINF = float(\"inf\")\nMOD = 10**9 + 7\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef main():\n N, Q = map(int, input().split())\n\n edges = [[] for _ in range(N + 1)]\n nums = [0 for _ in range(N + 1)]\n for _ in range(N - 1):\n a, b = map(int, input().split())\n edges[a].append(b)\n edges[b].append(a)\n\n for _ in range(Q):\n p, x = map(int, input().split())\n nums[p] += x\n\n def dfs(now, parent):\n for i in edges[now]:\n if i != parent:\n nums[i] += nums[now]\n dfs(i, now)\n\n dfs(1, 0)\n for n in nums[1:]:\n print(n)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":2,"i2":28,"j1":2,"j2":38,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02937","language":"Python","original_status":"Time Limit Exceeded","pass":"def main():\n s = input()\n t = input()\n sletters = set()\n for i in s:\n sletters.add(i)\n\n for i in t:\n if i not in sletters:\n print(-1)\n return\n\n i = 0\n j = 0\n ans = 0\n while i < len(s) and j < len(t):\n if s[i] == t[j]:\n j += 1\n i += 1\n ans += 1\n if i == len(s):\n i = 0\n\n print(ans)\n\n\nmain()\n","fail":"import bisect\n\n\ndef main():\n s = input()\n t = input()\n sletters = [0] * 26\n for i in range(len(s)):\n x = ord(s[i]) - ord(\"a\")\n if sletters[x] == 0:\n sletters[x] = [i]\n else:\n sletters[x].append(i)\n\n ans = 0\n curr_index = -1\n for i in t:\n x = ord(i) - ord(\"a\")\n if sletters[x] == 0:\n print(-1)\n return\n index = bisect.bisect(sletters[x], curr_index)\n # print(sletters[x],i,curr_index,index)\n if index == len(sletters[x]):\n ans += len(s) - curr_index\n curr_index = sletters[x][0]\n ans += curr_index\n else:\n ans += sletters[x][index] - curr_index\n curr_index = sletters[x][index]\n\n print(ans)\n\n\nmain()\n","change":"replace","i1":0,"i2":22,"j1":0,"j2":30,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02937","language":"Python","original_status":"Time Limit Exceeded","pass":"# -*- coding: utf-8 -*-\n\ns = input()\nt = input()\n\nif not set(t) <= set(s):\n print(-1)\n exit()\n\nrepeat = 0\ns_idx = 0\nfor c in t:\n idx = s[s_idx:].find(c)\n if idx == -1:\n idx = s.find(c)\n repeat += 1\n else:\n idx = idx + s_idx\n s_idx = idx + 1\nelse:\n ans = repeat * len(s) + s_idx\n\nprint(ans)\n","fail":"# -*- coding: utf-8 -*-\n\nfrom bisect import bisect_left\n\ns = input()\nt = input()\n\nif not set(t) <= set(s):\n print(-1)\n exit()\n\ns_dict = {}\nfor i in range(len(s)):\n c = s[i]\n if c not in s_dict.keys():\n s_dict[c] = [i]\n else:\n s_dict[c].append(i)\n\nrepeat = 0\ns_idx = 0\nfor c in t:\n idx = bisect_left(s_dict[c], s_idx)\n if idx == len(s_dict[c]):\n s_idx = s_dict[c][0] + 1\n repeat += 1\n else:\n s_idx = s_dict[c][idx] + 1\nelse:\n ans = repeat * len(s) + s_idx\n\nprint(ans)\n","change":"replace","i1":1,"i2":19,"j1":1,"j2":28,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02937","language":"Python","original_status":"Time Limit Exceeded","pass":"def main():\n s = input()\n t = input()\n\n if not set(t) <= set(s):\n print(-1)\n return\n\n s_indexes = {c: [] for c in \"abcdefghijklmnopqrstuvwxyz\"}\n for i, s_c in enumerate(s):\n s_indexes[s_c].append(i)\n s_pointer = {c: 0 for c in \"abcdefghijklmnopqrstuvwxyz\"}\n s_length = {c: len(s_indexes[c]) for c in \"abcdefghijklmnopqrstuvwxyz\"}\n\n power = 0\n last_index = -1\n for i, t_c in enumerate(t):\n if s_length[t_c] <= s_pointer[t_c]:\n # reset\n s_pointer = {c: 0 for c in \"abcdefghijklmnopqrstuvwxyz\"}\n power += 1\n elif s_indexes[t_c][s_pointer[t_c]] <= last_index:\n for i, index in enumerate(s_indexes[t_c]):\n if last_index < index:\n s_pointer[t_c] = i\n break\n else:\n # reset\n s_pointer = {c: 0 for c in \"abcdefghijklmnopqrstuvwxyz\"}\n power += 1\n\n last_index = s_indexes[t_c][s_pointer[t_c]]\n s_pointer[t_c] += 1\n\n print(len(s) * power + last_index + 1)\n\n\nmain()\n","fail":"def main():\n s = input()\n t = input()\n\n if not set(t) <= set(s):\n print(-1)\n return\n\n s_indexes = {c: [] for c in \"abcdefghijklmnopqrstuvwxyz\"}\n for i, s_c in enumerate(s):\n s_indexes[s_c].append(i)\n s_pointer = {c: 0 for c in \"abcdefghijklmnopqrstuvwxyz\"}\n s_length = {c: len(s_indexes[c]) for c in \"abcdefghijklmnopqrstuvwxyz\"}\n\n power = 0\n last_index = -1\n for i, t_c in enumerate(t):\n if s_length[t_c] <= s_pointer[t_c]:\n # reset\n s_pointer = {c: 0 for c in \"abcdefghijklmnopqrstuvwxyz\"}\n power += 1\n elif s_indexes[t_c][s_pointer[t_c]] <= last_index:\n for j in range(s_pointer[t_c], s_length[t_c]):\n if last_index < s_indexes[t_c][j]:\n s_pointer[t_c] = j\n break\n else:\n # reset\n s_pointer = {c: 0 for c in \"abcdefghijklmnopqrstuvwxyz\"}\n power += 1\n\n last_index = s_indexes[t_c][s_pointer[t_c]]\n s_pointer[t_c] += 1\n\n print(len(s) * power + last_index + 1)\n\n\nmain()\n","change":"replace","i1":22,"i2":25,"j1":22,"j2":25,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02937","language":"Python","original_status":"Runtime Error","pass":"from collections import defaultdict\nimport bisect\n\nS = input()\nT = input()\n\nd = defaultdict(list)\nfor i, s in enumerate(S, start=1):\n d[s].append(i)\n\nans = 0\ni = 0\n\nfor t in T:\n if not d[t]:\n print(-1)\n exit()\n\n if i > d[t][-1]:\n ans += len(S)\n i = 0\n pos = bisect.bisect_right(d[t], i)\n i = d[t][pos]\n\nans += i\nprint(ans)\n","fail":"from collections import defaultdict\nimport bisect\n\nS = input()\nT = input()\n\nd = defaultdict(list)\nfor i, s in enumerate(S, start=1):\n d[s].append(i)\n\nans = 0\ni = 0\n\nfor t in T:\n if not d[t]:\n print(-1)\n exit()\n\n if i >= d[t][-1]:\n ans += len(S)\n i = d[t][0]\n continue\n\n pos = bisect.bisect_right(d[t], i)\n i = d[t][pos]\n\nans += i\nprint(ans)\n","change":"replace","i1":18,"i2":21,"j1":18,"j2":23,"error":"0","stderr":null,"stdout":10.0} {"problem_id":"p02937","language":"Python","original_status":"Runtime Error","pass":"N, *A = map(int, open(0).read().split())\n\nA = [0] + A\nB = [0] * (N + 1)\nsum_B = 0\nfor i in range(N, 0, -1):\n if sum(B[j] for j in range(i, N + 1, i)) % 2 != A[i]:\n B[i] = 1\n sum_B += 1\nprint(sum_B)\nprint(*[i for i, b in enumerate(B) if b])\n","fail":"from bisect import bisect_left\n\n\ndef solve():\n S = input()\n T = input()\n if not set(T) <= set(S):\n return -1\n\n pos = {c: [] for c in \"abcdefghijklmnopqrstuvwxyz\"}\n for i, c in enumerate(S):\n pos[c].append(i)\n ans = 0\n cur_pos = 0\n for t in T:\n nxt_idx = bisect_left(pos[t], cur_pos)\n if nxt_idx == len(pos[t]):\n ans += len(S)\n cur_pos = 0\n nxt_idx = bisect_left(pos[t], cur_pos)\n cur_pos = pos[t][nxt_idx] + 1\n else:\n cur_pos = pos[t][nxt_idx] + 1\n\n return ans + cur_pos\n\n\nprint(solve())\n","change":"replace","i1":0,"i2":11,"j1":0,"j2":28,"error":"ValueError: invalid literal for int() with base 10: 'contest'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02937\/Python\/s027416660.py\", line 1, in \n N, *A = map(int, open(0).read().split())\nValueError: invalid literal for int() with base 10: 'contest'\n","stdout":null} {"problem_id":"p02939","language":"Python","original_status":"Runtime Error","pass":"# https:\/\/atcoder.jp\/contests\/agc037\/tasks\/agc037_a\n\ns = input()\n\nans = 0\npre = s[0]\ni = 0\nwhile i < len(s):\n cur = s[i]\n if pre == cur:\n pre = s[i] + s[i + 1]\n i += 2\n else:\n pre = cur\n i += 1\n ans += 1\nprint(ans)\n","fail":"# https:\/\/atcoder.jp\/contests\/agc037\/tasks\/agc037_a\n\ns = input()\n\nans = 0\npre = \"\"\ncur = \"\"\nfor i in range(len(s)):\n pre += s[i]\n if pre != cur:\n ans += 1\n cur = pre\n pre = \"\"\nprint(ans)\n","change":"replace","i1":5,"i2":16,"j1":5,"j2":13,"error":"0","stderr":null,"stdout":4.0} {"problem_id":"p02939","language":"Python","original_status":"Time Limit Exceeded","pass":"from itertools import combinations\n\ns = input()\nn = len(s)\nap = list(range(1, n))\n\nset_s = set()\n\n\ndef check(k):\n if k == 1:\n return True\n\n rtn = False\n for v in combinations(ap, k - 1):\n can = True\n x_past = 0\n w_past = \"\"\n\n for x in v:\n w = s[x_past:x]\n if w == w_past:\n can = False\n break\n x_past = x\n w_past = w\n w_last = s[v[-1] :]\n if w == w_last:\n can = False\n\n if can is True:\n rtn = True\n break\n\n return rtn\n\n\nlow = 1\nhigh = n\nwhile low <= high:\n mid = (low + high) \/\/ 2\n if check(mid):\n low = mid + 1\n else:\n high = mid - 1\n\nprint(min(high, low))\n","fail":"s = input()\n\ncount = 0\nj = 0\npast_str = \"\"\n\nfor i in range(len(s)):\n now_str = s[j : i + 1]\n if now_str != past_str:\n count += 1\n j = i + 1\n past_str = now_str\n\nprint(count)\n","change":"replace","i1":0,"i2":47,"j1":0,"j2":14,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02939","language":"Python","original_status":"Runtime Error","pass":"from sys import stdin\n\n\ndef main():\n\n S = stdin.readline().rstrip()\n S_len = len(S)\n\n sum = 0\n s = S[0]\n x = 1\n\n while True:\n if len(s) == 1:\n if s == S[x]:\n s = s + S[x]\n else:\n sum += 1\n s = S[x]\n else:\n sum += 2\n x += 1\n s = S[x]\n x += 1\n\n if x >= S_len:\n sum += 1\n break\n\n print(sum)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"from sys import stdin\n\n\ndef main():\n\n S = stdin.readline().rstrip()\n S_len = len(S)\n\n sum = 0\n s = S[0]\n x = 1\n\n while True:\n if len(s) == 1:\n if s == S[x]:\n s = s + S[x]\n else:\n sum += 1\n s = S[x]\n else:\n sum += 2\n x += 1\n\n if x >= S_len:\n break\n s = S[x]\n x += 1\n\n if x >= S_len:\n sum += 1\n break\n\n print(sum)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"insert","i1":22,"i2":22,"j1":22,"j2":25,"error":"0","stderr":null,"stdout":4.0} {"problem_id":"p02941","language":"Python","original_status":"Time Limit Exceeded","pass":"from heapq import heapify, heappop, heappush\n\n\ndef solve(n, aaa, bbb):\n q = [(-b, i) for i, b in enumerate(bbb) if b != aaa[i]]\n heapify(q)\n ans = 0\n while q:\n b, i = heappop(q)\n b = -b\n b -= bbb[(i - 1) % n] + bbb[(i + 1) % n]\n if b <= 0:\n return -1\n bbb[i] = b\n ans += 1\n if b != aaa[i]:\n heappush(q, (-b, i))\n return ans\n\n\nn = int(input())\naaa = list(map(int, input().split()))\nbbb = list(map(int, input().split()))\nprint(solve(n, aaa, bbb))\n","fail":"from heapq import heapify, heappop, heappush\n\n\ndef solve(n, aaa, bbb):\n q = [(-b, i) for i, b in enumerate(bbb) if b != aaa[i]]\n heapify(q)\n ans = 0\n while q:\n b, i = heappop(q)\n b = -b - aaa[i]\n d, b = divmod(b, bbb[(i - 1) % n] + bbb[(i + 1) % n])\n if d == 0:\n return -1\n b += aaa[i]\n bbb[i] = b\n ans += d\n if b != aaa[i]:\n heappush(q, (-b, i))\n return ans\n\n\nn = int(input())\naaa = list(map(int, input().split()))\nbbb = list(map(int, input().split()))\nprint(solve(n, aaa, bbb))\n","change":"replace","i1":9,"i2":15,"j1":9,"j2":16,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02945","language":"Python","original_status":"Runtime Error","pass":"A = int(input())\nB = int(input())\nc = A + B\nd = A - B\ne = A * B\nf = [c, d, e]\nmaxvalue = c\nfor i in range(len(f)):\n if f[i] > maxvalue:\n maxvalue = f[i]\nprint(maxvalue)\n","fail":"A, B = map(int, input().split())\nc = A + B\nd = A - B\ne = A * B\nf = [c, d, e]\nmaxvalue = c\nfor i in range(len(f)):\n if f[i] > maxvalue:\n maxvalue = f[i]\nprint(maxvalue)\n","change":"replace","i1":0,"i2":2,"j1":0,"j2":1,"error":"ValueError: invalid literal for int() with base 10: '-13 3'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02945\/Python\/s027556545.py\", line 1, in \n A = int(input())\nValueError: invalid literal for int() with base 10: '-13 3'\n","stdout":null} {"problem_id":"p02945","language":"Python","original_status":"Runtime Error","pass":"N = int(input())\ns = [list(input()) for _ in range(N)]\nS = []\nfor i in range(N):\n S.append(\"\".join(sorted(s[i])))\nprint(S)\n\ncnt = 0\nfor i in range(N):\n cnt += S.count(S[i]) - 1\nprint(int(cnt \/ 2))\n","fail":"A, B = map(int, input().split())\nprint(max(A + B, A - B, A * B))\n","change":"replace","i1":0,"i2":11,"j1":0,"j2":2,"error":"ValueError: invalid literal for int() with base 10: '-13 3'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02945\/Python\/s567458637.py\", line 1, in \n N = int(input())\nValueError: invalid literal for int() with base 10: '-13 3'\n","stdout":null} {"problem_id":"p02945","language":"Python","original_status":"Runtime Error","pass":"A, B = int(input().split())\nlist = []\nlist.append(A + B)\nlist.append(A - B)\nlist.append(A * B)\nprint(max(list))\n","fail":"A, B = map(int, input().split())\nlist = []\nlist.append(A + B)\nlist.append(A - B)\nlist.append(A * B)\nprint(max(list))\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"TypeError: int() argument must be a string, a bytes-like object or a real number, not 'list'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02945\/Python\/s147643407.py\", line 1, in \n A, B = int(input().split())\nTypeError: int() argument must be a string, a bytes-like object or a real number, not 'list'\n","stdout":null} {"problem_id":"p02945","language":"Python","original_status":"Runtime Error","pass":"A = int(input())\nB = input()\n\nanswer = max(\n A + B,\n A - B,\n A * B,\n)\n\nprint(answer)\n","fail":"data = input()\ndata = data.split(\" \")\n\nA = int(data[0])\nB = int(data[1])\n\nanswer = max(\n A + B,\n A - B,\n A * B,\n)\n\nprint(answer)\n","change":"replace","i1":0,"i2":2,"j1":0,"j2":5,"error":"ValueError: invalid literal for int() with base 10: '-13 3'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02945\/Python\/s283924824.py\", line 1, in \n A = int(input())\nValueError: invalid literal for int() with base 10: '-13 3'\n","stdout":null} {"problem_id":"p02947","language":"Python","original_status":"Runtime Error","pass":"# \u3058\u3083\u3042\u5168\u90e8\u4fdd\u5b58\u3057\u3066\u3044\u3063\u3066\u3084\u308b\u3088\nn = int(input())\nd = {}\narr = []\nfor _ in range(n):\n x = list(sorted(input()))\n arr.append(x)\n if x not in d:\n d[x] = 1\n else:\n d[x] += 1\n\nc = 0\nfor a in arr[:0:-1]:\n if d[a] > 0:\n c += d[a] - 1\n d[a] -= 1\n\nprint(c)\n","fail":"# \u3058\u3083\u3042\u5168\u90e8\u4fdd\u5b58\u3057\u3066\u3044\u3063\u3066\u3084\u308b\u3088\n# atcoder\u306epython3\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u304c\u53e4\u3059\u304e\u3066(3.4.3)TypeError: unhashable type: 'list'\u306a\u308b\u306e\u3067\u305f\u3081\u606f\u3064\u304d\u306a\u304c\u3089\u76f4\u3057\u305f\n\nn = int(input())\nd = {}\narr = []\nfor _ in range(n):\n x = \"\".join(list(map(str, list(sorted(input())))))\n arr.append(x)\n if x not in d:\n d[x] = 1\n else:\n d[x] += 1\n\nc = 0\nfor a in arr[:0:-1]:\n if d[a] > 0:\n c += d[a] - 1\n d[a] -= 1\n\nprint(c)\n","change":"replace","i1":1,"i2":6,"j1":1,"j2":8,"error":"TypeError: unhashable type: 'list'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02947\/Python\/s642649306.py\", line 8, in \n if x not in d:\nTypeError: unhashable type: 'list'\n","stdout":null} {"problem_id":"p02947","language":"Python","original_status":"Time Limit Exceeded","pass":"from collections import Counter\nfrom itertools import combinations\n\nn = int(input())\ns = []\nfor _ in range(n):\n s.append(input())\n\ncnt = 0\nfor t, u in combinations(s, 2):\n if Counter(t) == Counter(u):\n cnt += 1\n\nprint(cnt)\n","fail":"from collections import Counter\nfrom math import factorial\n\n\ndef count_combinations(n, r):\n return factorial(n) \/\/ (factorial(r) * factorial(n - r))\n\n\nn = int(input())\ns = []\nfor _ in range(n):\n s.append(input())\n\nt = [\"\".join(sorted(str)) for str in s]\nc = Counter(t)\nll = [i for _, i in c.items() if i > 1]\ncnt = 0\nfor i in ll:\n cnt += count_combinations(i, 2)\n\nprint(cnt)\n","change":"replace","i1":1,"i2":12,"j1":1,"j2":19,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02947","language":"Python","original_status":"Time Limit Exceeded","pass":"def to_dict(text):\n d = {}\n for c in text:\n d[c] = d.get(c, 0) + 1\n return d\n\n\nn = int(input())\ncombination_count = 0\ns = []\nfor _ in range(n):\n si = to_dict(input())\n combination_count += sum(1 for old_si in s if old_si == si)\n s.append(si)\n\nprint(combination_count)\n","fail":"import collections\n\nn = int(input())\ncounter = collections.Counter(str(sorted(input())) for _ in range(n))\ncombination_count = sum((v - 1) * v \/\/ 2 for v in counter.values())\n\nprint(combination_count)\n","change":"replace","i1":0,"i2":14,"j1":0,"j2":5,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02947","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\ns = []\nfor _ in range(N):\n si = sorted(input())\n s.append(si)\nans = 0\nfor i in range(0, N - 1):\n for j in range(i + 1, N):\n if s[i] == s[j]:\n ans += 1\nprint(ans)\n","fail":"from collections import Counter\n\n\nN = int(input())\nc = Counter()\nfor _ in range(N):\n si = \"\".join(sorted(input()))\n c[si] += 1\n\nans = sum([n * (n - 1) \/\/ 2 for n in c.values()])\nprint(ans)\n","change":"replace","i1":0,"i2":10,"j1":0,"j2":10,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02947","language":"Python","original_status":"Time Limit Exceeded","pass":"from collections import Counter\n\n\ndef main():\n N = int(input())\n s = [Counter(input()) for _ in range(N)]\n ans = 0\n for i in range(N):\n for j in range(i + 1, N):\n if s[i] == s[j]:\n ans += 1\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"from collections import Counter\n\n\ndef main():\n N = int(input())\n s = [\"\".join(sorted(input())) for _ in range(N)]\n S = Counter(s)\n ans = 0\n for a in S.values():\n ans += sigma(a)\n print(ans)\n\n\ndef sigma(x):\n sum = 0\n for i in range(1, x):\n sum += i\n return sum\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":5,"i2":12,"j1":5,"j2":18,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02947","language":"Python","original_status":"Time Limit Exceeded","pass":"from collections import defaultdict\n\nn = int(input())\nd = []\ncount = 0\nt = [0] * n\nfor _ in range(n):\n s = input()\n dic = defaultdict(int)\n for c in s:\n dic[c] += 1\n for i in range(len(d)):\n if all(dic[key] == d[i][key] for key in dic):\n if t[i] != 0:\n count += t[i] + 1\n t[i] += 1\n break\n else:\n count += 1\n t[i] += 1\n d.append(dic)\n\n\nprint(count)\n","fail":"import collections\n\nn = int(input())\nS = []\ncount = 0\nfor _ in range(n):\n S.append(\"\".join(sorted(list(input()))))\n\nfor i, v in collections.Counter(S).items():\n for i in range(1, v):\n count += i\n\nprint(count)\n","change":"replace","i1":0,"i2":22,"j1":0,"j2":11,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02947","language":"Python","original_status":"Time Limit Exceeded","pass":"def main():\n N = int(input())\n S = [sorted(input()) for i in range(N)]\n ans = 0\n for i in range(N):\n for j in range(i + 1, N):\n if S[i] == S[j]:\n ans += 1\n\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"#!\/usr\/bin\/env python3\nimport collections\nimport math\n\n\ndef main():\n N = int(input())\n S = [\"\".join(sorted(input())) for i in range(N)]\n cnt = collections.Counter(S)\n ans = 0\n for v in cnt.values():\n if v != 1:\n ans += math.factorial(v) \/\/ (math.factorial(v - 2) * 2)\n\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":0,"i2":8,"j1":0,"j2":13,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02947","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\ncnt = 0\nsListSum = 0\nsList = [None] * n\n\nfor i in range(n):\n s = sorted(input())\n sListSum += sList.count(s)\n sList[i] = s\n\nprint(sListSum)\n","fail":"import sys\nimport collections\nimport bisect\n\n\ndef main():\n n = int(input())\n s = [\"\".join(sorted(list(input()))) for _ in range(n)]\n c = collections.Counter(s)\n cVals = c.values()\n cSum = 0\n for cVal in cVals:\n cSum += cVal * (cVal - 1) \/\/ 2\n print(cSum)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":0,"i2":11,"j1":0,"j2":18,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02947","language":"Python","original_status":"Runtime Error","pass":"import math\n\nN = int(input())\nS_lists = [input() for i in range(N)]\n\nS_dict = {}\n\nfor S in S_lists:\n S_list = list(S)\n S_list.sort()\n\n S_str = \"\".join(S_list)\n if S_str in S_dict.keys():\n S_dict[S_str] = S_dict[S_str] + 1\n else:\n S_dict[S_str] = 1\n\nanswer = 0\nfor v in S_dict.values():\n if v > 1:\n answer += int(math.factorial(v) \/ 2)\n\nprint(answer)\n","fail":"N = int(input())\nS_lists = [input() for i in range(N)]\n\nS_dict = {}\n\nfor S in S_lists:\n S_list = list(S)\n S_list.sort()\n\n S_str = \"\".join(S_list)\n if S_str in S_dict.keys():\n S_dict[S_str] = S_dict[S_str] + 1\n else:\n S_dict[S_str] = 1\n\nanswer = 0\nfor v in S_dict.values():\n if v > 1:\n answer += int(v * (v - 1) \/ 2)\n\nprint(answer)\n","change":"replace","i1":0,"i2":21,"j1":0,"j2":19,"error":"0","stderr":null,"stdout":1.0} {"problem_id":"p02947","language":"Python","original_status":"Time Limit Exceeded","pass":"# coding: utf-8\nn = int(input())\nlst = [input() for i in range(n)]\ncnt = 0\nfor j in range(n - 1):\n for k in range(j + 1, n):\n if sorted(list(lst[j])) == sorted(list(lst[k])):\n cnt += 1\n\nprint(cnt)\n","fail":"# coding: utf-8\nfrom collections import Counter\n\nn = int(input())\nlst = [input() for i in range(n)]\ncnt = Counter()\nans = 0\nfor i in lst:\n a = \"\".join(sorted(list(i)))\n if a in cnt:\n ans += cnt[a]\n cnt[a] += 1\n\nprint(ans)\n","change":"replace","i1":1,"i2":10,"j1":1,"j2":14,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02947","language":"Python","original_status":"Time Limit Exceeded","pass":"# -*- coding: utf-8 -*-\n# \u6574\u6570\u306e\u5165\u529b\n\n\ndef main():\n # a, b\n n = int(input())\n s = []\n for _ in range(n):\n s.append(sorted(input()))\n print(process(n, s))\n\n\ndef process(n, s):\n count = 0\n for i in range(0, n):\n for k in range(i, n):\n if i == k:\n continue\n if s[i] == s[k]:\n count += 1\n return count\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"# -*- coding: utf-8 -*-\n# \u6574\u6570\u306e\u5165\u529b\n\n\ndef main():\n # a, b\n n = int(input())\n s = []\n for _ in range(n):\n s.append(input())\n print(process(n, s))\n\n\ndef process(n, s):\n s = list(map(lambda s: \"\".join(sorted(s)), s))\n hash = {}\n\n count = 0\n for i in range(0, n):\n if s[i] in hash:\n hash[s[i]] += 1\n else:\n hash[s[i]] = 1\n count += hash[s[i]] - 1\n return count\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":9,"i2":21,"j1":9,"j2":24,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02947","language":"Python","original_status":"Time Limit Exceeded","pass":"# #!\/usr\/bin\/env python3\n# # -*- coding: utf-8 -*-\nfrom itertools import combinations\n\n\ndef main():\n N = int(input())\n S = [sorted(input()) for _ in range(N)]\n ptn = list(combinations(S, 2))\n result = 0\n\n for p in ptn:\n result += all([p[0] == p[1]])\n print(result)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"# #!\/usr\/bin\/env python3\n# # -*- coding: utf-8 -*-\nfrom collections import defaultdict\n\n\ndef main():\n N = int(input())\n dct = defaultdict(int)\n\n for i in range(N):\n s = input()\n sorted_s = \"\".join(sorted(s))\n dct[sorted_s] += 1\n\n ans = 0\n for k, v in dct.items():\n ans += v * (v - 1) \/\/ 2\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":2,"i2":14,"j1":2,"j2":18,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02947","language":"Python","original_status":"Time Limit Exceeded","pass":"import collections\nimport itertools\n\nN = int(input())\nmoji = [input() for _ in range(N)]\n\ncheck = [[0] * N for _ in range(N)]\n\n\ncnt = 0\nfor i in range(N):\n c = []\n x = collections.Counter(moji[i])\n\n c.append(i)\n\n for j in range(i + 1, N):\n if check[i][j] == 1:\n continue\n\n y = collections.Counter(moji[j])\n\n if x == y:\n c.append(j)\n\n if len(c) > 1:\n for u, v in itertools.combinations(c, 2):\n check[u][v] = 1\n cnt += 1\n\nprint(cnt)\n","fail":"N = int(input())\nmoji_lst = [input() for _ in range(N)]\n\ndic = {}\ncnt = 0\n\nfor moji in moji_lst:\n x = \"\".join(sorted(moji))\n\n if x in dic:\n dic[x] += 1\n cnt += dic[x]\n else:\n dic[x] = 0\n\n\nprint(cnt)\n","change":"replace","i1":0,"i2":30,"j1":0,"j2":16,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02947","language":"Python","original_status":"Time Limit Exceeded","pass":"import itertools\n\n\ndef main():\n n = int(input())\n s = [sorted(input()) for _ in range(n)]\n seq = list(itertools.combinations(s, 2))\n ans = 0\n for i in seq:\n if i[0] == i[1]:\n ans += 1\n\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"def main():\n n = int(input())\n s = [\"\".join(sorted(input())) for _ in range(n)]\n ans = 0\n dic = {}\n for i in s:\n if i not in dic:\n dic[i] = 0\n else:\n dic[i] += 1\n ans += dic[i]\n # print(ans)\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":0,"i2":12,"j1":0,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02947","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\n\nS = []\nfor _ in range(n):\n s = list(input())\n s.sort()\n S.append(\"\".join(s))\nS.sort()\n\nC = []\ni = 0\nwhile i < n:\n c = S.count(S[i])\n if c > 1:\n C.append(c)\n i += c\n\nans = 0\nfor c in C:\n ans += c * (c - 1) \/\/ 2\n\nprint(ans)\n","fail":"n = int(input())\n\nS = []\nfor _ in range(n):\n s = list(input())\n s.sort()\n S.append(\"\".join(s))\nS.sort()\n\nC = []\nc = 1\nfor i in range(n - 1):\n if S[i] == S[i + 1]:\n c += 1\n else:\n C.append(c)\n c = 1\nC.append(c)\n\nans = 0\nfor c in C:\n ans += c * (c - 1) \/\/ 2\n\nprint(ans)\n","change":"replace","i1":10,"i2":16,"j1":10,"j2":18,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02947","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\nstrs = list()\nfor _ in range(n):\n strs.append(sorted(list(input())))\n\ntotal = 0\nfor i in range(n):\n for j in range(i + 1, n):\n if strs[i] == strs[j]:\n total += 1\nprint(total)\n","fail":"n = int(input())\nd = {}\n\nfor _ in range(n):\n s = \"\".join(sorted(input()))\n if s in d:\n d[s] += 1\n else:\n d[s] = 1\n\nans = 0\nfor k, v in d.items():\n ans += (v * (v - 1)) \/ 2\n\nprint(int(ans))\n","change":"replace","i1":1,"i2":11,"j1":1,"j2":15,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02947","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\n\nL = [list(input()) for _ in range(N)]\n\ndic = []\nflag = {}\nres = 0\nfor i in range(N):\n L[i].sort()\n\n if L[i] in dic:\n flag[str(L[i])] += 1\n res += flag[str(L[i])]\n else:\n dic.append(L[i])\n flag[str(L[i])] = 0\n\nprint(res)\n","fail":"N = int(input())\n\nL = [list(input()) for _ in range(N)]\n\ndic = []\nflag = {}\nres = 0\nfor i in range(N):\n L[i].sort()\n\n if str(L[i]) in flag:\n flag[str(L[i])] += 1\n res += flag[str(L[i])]\n else:\n dic.append(L[i])\n flag[str(L[i])] = 0\n\nprint(res)\n","change":"replace","i1":10,"i2":11,"j1":10,"j2":11,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02947","language":"Python","original_status":"Runtime Error","pass":"from math import factorial\n\nN = int(input())\nd = {}\nfor _ in range(N):\n s = input()\n s_sorted = \"\".join(sorted(s))\n if not d.get(s_sorted):\n d[s_sorted] = 1\n else:\n d[s_sorted] += 1\n\nans = 0\nfor _, v in d.items():\n if v == 1:\n continue\n x = factorial(v) \/ factorial(2) \/ factorial(v - 2)\n ans += x\n\nprint(round(ans))\n","fail":"from math import factorial\n\nN = int(input())\nd = {}\nfor _ in range(N):\n s = input()\n s_sorted = \"\".join(sorted(s))\n if not d.get(s_sorted):\n d[s_sorted] = 1\n else:\n d[s_sorted] += 1\n\nans = 0\nfor _, v in d.items():\n if v == 1:\n continue\n ans += v * (v - 1) \/\/ 2\n\nprint(round(ans))\n","change":"replace","i1":16,"i2":18,"j1":16,"j2":17,"error":"0","stderr":null,"stdout":1.0} {"problem_id":"p02947","language":"Python","original_status":"Time Limit Exceeded","pass":"from itertools import combinations\n\nN = int(input())\nS = [sorted(input()) for _ in range(N)]\n\nprint(sum(1 if s1 == s2 else 0 for s1, s2 in combinations(S, 2)))\n","fail":"from collections import Counter\n\nN = int(input())\nS = [\"\".join(sorted(list(input()))) for _ in range(N)]\n\ncnt = Counter(S)\nprint(sum(v * (v - 1) \/\/ 2 for v in cnt.values()))\n","change":"replace","i1":0,"i2":6,"j1":0,"j2":7,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02947","language":"Python","original_status":"Time Limit Exceeded","pass":"x = []\ncnt = 0\nfor _ in range(int(input())):\n a = sorted(input())\n cnt += x.count(a)\n x.append(a)\nprint(cnt)\n","fail":"import collections\n\nn = int(input())\nx = [\"\".join(sorted(input())) for _ in range(n)]\na = collections.Counter(x)\nprint(sum(i * ~-i \/\/ 2 for i in a.values()))\n","change":"replace","i1":0,"i2":7,"j1":0,"j2":6,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02947","language":"Python","original_status":"Time Limit Exceeded","pass":"import sys\n\nn = int(input())\nalphabet = [chr(ord(\"a\") + i) for i in range(26)]\ncount = [[0] * 26 for _ in range(n)]\nfor i in range(n):\n for s in sys.stdin.readline().strip():\n count[i][alphabet.index(s)] += 1\n\nuniq = set(list(map(tuple, count)))\nans = 0\nfor u in uniq:\n n = count.count(list(u))\n ans += n * (n - 1) \/\/ 2\nprint(ans)\n","fail":"import sys\nimport collections\n\nn = int(input())\nlst = [None] * n\nfor i in range(n):\n lst[i] = \"\".join(sorted(list(sys.stdin.readline().strip())))\n\nans = 0\nfor v in collections.Counter(lst).values():\n ans += v * (v - 1) \/\/ 2\nprint(ans)\n","change":"replace","i1":1,"i2":14,"j1":1,"j2":11,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02947","language":"Python","original_status":"Time Limit Exceeded","pass":"from collections import defaultdict\n\nN = int(input())\n\nresult = 0\nstore = []\nfor _ in range(N):\n d = defaultdict(int)\n s = input()\n for c in set(s):\n d[c] += s.count(c)\n result += store.count(d)\n store.append(d)\nprint(result)\n","fail":"from collections import defaultdict\nimport sys\n\nreadline = sys.stdin.readline\n\nN = int(input())\n\nresult = 0\nd = defaultdict(int)\nfor _ in range(N):\n s = input()\n s = \"\".join(sorted(s))\n if s in d:\n d[s] += 1\n else:\n d[s] = 1\nprint(sum([int((v) * (v - 1) \/ 2) for k, v in d.items()]))\n","change":"replace","i1":1,"i2":14,"j1":1,"j2":17,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02947","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\ns = []\nans = 0\nfor _ in range(N):\n si = input()\n sortedSi = \"\".join(sorted(list(si)))\n ans += s.count(sortedSi)\n s.append(sortedSi)\n\nprint(ans)\n","fail":"N = int(input())\ndic = {}\nans = 0\nfor _ in range(N):\n si = input()\n sortedSi = \"\".join(sorted(si))\n if sortedSi in dic:\n dic[sortedSi] += 1\n else:\n dic[sortedSi] = 1\n\nfor val in dic.values():\n ans += val * (val - 1) \/\/ 2\n\nprint(ans)\n","change":"replace","i1":1,"i2":8,"j1":1,"j2":13,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02947","language":"Python","original_status":"Time Limit Exceeded","pass":"from collections import Counter\n\nn = int(input())\ns = [Counter(input()) for _ in range(n)]\n\nans = 0\nfor i in range(n):\n for j in range(i + 1, n):\n if s[i] == s[j]:\n ans += 1\n\nprint(ans)\n","fail":"from collections import Counter\n\nn = int(input())\ns = [list(input()) for _ in range(n)]\n\n\nfor i in range(n):\n s[i].sort()\n s[i] = \"\".join(s[i])\n\nc = Counter(s)\n\nans = 0\n\nfor v in c.values():\n ans += v * (v - 1) \/\/ 2\nprint(ans)\n","change":"replace","i1":3,"i2":11,"j1":3,"j2":16,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02947","language":"Python","original_status":"Time Limit Exceeded","pass":"import itertools\nimport collections\n\n\ndef resolve():\n N = int(input())\n s = [input() for _ in range(N)]\n ans = 0\n for tmp in itertools.combinations(s, 2):\n d1 = collections.defaultdict(int)\n d2 = collections.defaultdict(int)\n for ch in tmp[0]:\n d1[ch] += 1\n for ch in tmp[1]:\n d2[ch] += 1\n if d1 == d2:\n ans += 1\n print(ans)\n\n\nresolve()\n","fail":"def resolve():\n N = int(input())\n s = [input() for _ in range(N)]\n ans = 0\n chk = {}\n for tmp in s:\n d1 = \"\".join(sorted(list(tmp)))\n if d1 in chk.keys():\n ans += chk[d1]\n chk[d1] += 1\n else:\n chk[d1] = 1\n print(ans)\n\n\nresolve()\n","change":"replace","i1":0,"i2":17,"j1":0,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02947","language":"Python","original_status":"Time Limit Exceeded","pass":"# https:\/\/atcoder.jp\/contests\/abc137\/tasks\/abc137_c\n# C - Green Bin\nimport collections\nimport itertools\n\nn = int(input().split()[0])\ns_list = []\nc_list = []\n\nfor _ in range(n):\n s = input().split()[0]\n s_list.append(s)\n c_list.append(collections.Counter(s))\n\np = itertools.combinations(c_list, 2)\nans = sum([1 if a == b else 0 for a, b in list(p)])\nprint(ans)\n","fail":"# https:\/\/atcoder.jp\/contests\/abc137\/tasks\/abc137_c\n# C - Green Bin\nimport collections\nimport itertools\nimport math\n\nn = int(input().split()[0])\ns_list = []\nc_list = []\n\nfor _ in range(n):\n s = input().split()[0]\n s_list.append(\"\".join(sorted(s)))\n\ncounter = collections.Counter(s_list)\n\n\ndef C(n, k):\n return math.factorial(n) \/ (math.factorial(k) * math.factorial(n - k))\n\n\np_list = [C(value, 2) for key, value in counter.items() if value > 1]\nans = int(sum(p_list))\n\nprint(ans)\n","change":"replace","i1":4,"i2":16,"j1":4,"j2":24,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02947","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\ns = [sorted(input()) for _ in range(n)]\n\n\ndef is_anagram(s_i, s_j):\n for k in range(10):\n if s_i[k] != s_j[k]:\n return False\n return True\n\n\nnum = 0\nfor i in range(n):\n for j in range(i + 1, n):\n if is_anagram(s[i], s[j]):\n num += 1\nprint(num)\n","fail":"n = int(input())\ns = [sorted(input()) for _ in range(n)]\nsorted_s = sorted(s)\n\nnum = 0\nnum_same = 1\nprev = sorted_s[0]\nfor i in range(1, len(sorted_s)):\n if prev != sorted_s[i]:\n num += int(num_same * (num_same - 1) \/ 2)\n num_same = 1\n prev = sorted_s[i]\n else:\n num_same += 1\nnum += int(num_same * (num_same - 1) \/ 2)\nprint(num)\n","change":"replace","i1":2,"i2":16,"j1":2,"j2":15,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02947","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\n\ns = [\"\"] * n\nt = [\"\"] * n\n\ncnt = 0\n\nfor i in range(n):\n s[i] = input()\n t[i] = sorted(s[i])\n\nt = sorted(t)\n\nfor i in range(n - 1):\n for j in range(i + 1, n):\n if t[i] == t[j]:\n cnt += 1\n\nprint(cnt)\n","fail":"n = int(input())\n\ns = [\"\"] * n\nt = [\"\"] * n\n\ncnt = 0\nflg = 0\n\nfor i in range(n):\n s[i] = input()\n t[i] = sorted(s[i])\n\nt = sorted(t)\n\nfor i in range(n - 1):\n if t[i] == t[i + 1]:\n flg += 1\n cnt += flg\n else:\n flg = 0\n\nprint(cnt)\n","change":"replace","i1":6,"i2":17,"j1":6,"j2":20,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02947","language":"Python","original_status":"Time Limit Exceeded","pass":"from collections import Counter\n\nanagrams = []\nfor _ in range(int(input())):\n count = Counter(input())\n found = False\n for v in anagrams:\n if v[\"count\"] == count:\n found = True\n v[\"total\"] += 1\n break\n if not found:\n anagrams.append({\"count\": count, \"total\": 1})\n\ntotal = 0\nfor v in anagrams:\n n = v[\"total\"]\n total += n * (n - 1) \/ 2\n\nprint(int(total))\n","fail":"from collections import defaultdict\n\nanagrams = defaultdict(int)\nfor _ in range(int(input())):\n anagrams[str(sorted(input()))] += 1\n\ntotal = 0\nfor k, v in anagrams.items():\n total += v * (v - 1) \/ 2\n\nprint(int(total))\n","change":"replace","i1":0,"i2":18,"j1":0,"j2":9,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02947","language":"Python","original_status":"Time Limit Exceeded","pass":"qt = int(input())\nsl = [input() for i in range(qt)]\nls = []\ncount = 0\n\nfor s in sl:\n s = \"\".join(sorted(s))\n ls.append(s)\n\ni = 0\nj = 0\nkey = \"\"\n\nwhile len(ls) > i:\n while len(ls) > (j + 1):\n j += 1\n if ls[i] == ls[j]:\n count += 1\n i += 1\n j = i\n\nprint(count)\n","fail":"import math as m\n\nqt = int(input())\nsl = [input() for i in range(qt)]\nd = {}\ncount = 0\n\nfor s in sl:\n s = \"\".join(sorted(s))\n if s in d:\n d[s] += 1\n else:\n d[s] = 1\n\nfor e in d.values():\n if e > 1:\n count += m.factorial(e) \/\/ (m.factorial(e - 2) * 2)\n\nprint(count)\n","change":"replace","i1":0,"i2":20,"j1":0,"j2":17,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02947","language":"Python","original_status":"Time Limit Exceeded","pass":"import sys\nfrom functools import reduce\nfrom operator import mul\n\ninput = sys.stdin.readline\n\n\n# def c(num):\n# return reduce(mul, range(1, num + 1))\ndef cmb(n, r):\n r = min(n - r, r)\n if r <= 0:\n return 1\n over = reduce(mul, range(n, n - r, -1))\n under = reduce(mul, range(1, r + 1))\n return over \/\/ under\n\n\ndef main():\n n = int(input())\n lines = [\"\".join(sorted(input().strip())) for _ in range(n)]\n count = 0\n for text in set(lines):\n txt_cnt = lines.count(text)\n if txt_cnt == 1:\n continue\n count += cmb(txt_cnt, 2)\n print(count)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"import sys\nfrom functools import reduce\nfrom operator import mul\nfrom collections import Counter\n\ninput = sys.stdin.readline\n\n\ndef cmb(n, r):\n over = reduce(mul, range(n, n - r, -1))\n under = reduce(mul, range(1, r + 1))\n return over \/\/ under\n\n\ndef main():\n n = int(input())\n lines = [\"\".join(sorted(input().strip())) for _ in range(n)]\n count = 0\n for _, v in Counter(lines).most_common():\n if v == 1:\n break\n count += cmb(v, 2)\n print(count)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":3,"i2":27,"j1":3,"j2":22,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02947","language":"Python","original_status":"Runtime Error","pass":"import collections\nimport math\n\nn = int(input())\nsl = collections.Counter([str(sorted(input())) for _ in range(n)])\n\nret = 0\nfor _, v in sl.most_common():\n if 2 <= v:\n ret += int(math.factorial(v) \/ math.factorial(2) \/ math.factorial(v - 2))\n\nprint(ret)\n","fail":"import collections\n\nn = int(input())\nsl = collections.Counter([str(sorted(input())) for _ in range(n)])\n\nret = 0\nfor _, v in sl.most_common():\n if 2 <= v:\n ret += v * (v - 1) \/\/ 2\n\nprint(ret)\n","change":"replace","i1":1,"i2":10,"j1":1,"j2":9,"error":"0","stderr":null,"stdout":1.0} {"problem_id":"p02947","language":"Python","original_status":"Time Limit Exceeded","pass":"a = int(input())\nb = [sorted(list(input())) for _ in range(a)]\nb.sort()\ncnt = 0\nfor i in range(a):\n for j in range(i + 1, a):\n if b[i][0] == b[j][0]:\n if \"\".join(b[i]) == \"\".join(b[j]):\n cnt += 1\n else:\n break\nprint(cnt)\n","fail":"import collections\n\na = int(input())\nb = [\"\".join(sorted(list(input()))) for _ in range(a)]\nb = collections.Counter(b)\ntotal = 0\nfor i in b.values():\n for j in range(1, i):\n total += j\nprint(total)\n","change":"replace","i1":0,"i2":12,"j1":0,"j2":10,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02948","language":"Python","original_status":"Runtime Error","pass":"import sys\nimport heapq\n\nN, M = list(map(int, input().split()))\npossiblyValidJobs = {}\nfor line in sys.stdin:\n A, B = map(int, line.split())\n if A > M:\n continue\n\n if A in possiblyValidJobs:\n possiblyValidJobs[A] += 1\n else:\n possiblyValidJobs[A] = 1\n\nvalidJobsOnThisDay = []\nans = 0\nfor daysBeforeDeadline in range(1, M + 1):\n if daysBeforeDeadline in possiblyValidJobs:\n for wage in possiblyValidJobs[daysBeforeDeadline]:\n heapq.heappush(validJobsOnThisDay, -wage)\n if validJobsOnThisDay:\n ans += -heapq.heappop(validJobsOnThisDay)\nprint(ans)\n","fail":"import sys\nimport heapq\n\nN, M = list(map(int, input().split()))\npossiblyValidJobs = {}\nfor line in sys.stdin:\n A, B = map(int, line.split())\n if A > M:\n continue\n\n if A in possiblyValidJobs:\n possiblyValidJobs[A].append(B)\n else:\n possiblyValidJobs[A] = [B]\n\nvalidJobsOnThisDay = []\nans = 0\nfor daysBeforeDeadline in range(1, M + 1):\n if daysBeforeDeadline in possiblyValidJobs:\n for wage in possiblyValidJobs[daysBeforeDeadline]:\n heapq.heappush(validJobsOnThisDay, -wage)\n if validJobsOnThisDay:\n ans += -heapq.heappop(validJobsOnThisDay)\nprint(ans)\n","change":"replace","i1":11,"i2":14,"j1":11,"j2":14,"error":"TypeError: 'int' object is not iterable","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02948\/Python\/s294834943.py\", line 20, in \n for wage in possiblyValidJobs[daysBeforeDeadline]:\nTypeError: 'int' object is not iterable\n","stdout":null} {"problem_id":"p02948","language":"Python","original_status":"Runtime Error","pass":"n, m = map(int, input().split())\nab = [(map(int, input().split())) for _ in range(n)]\n\njobs = [(a, -b) for a, b in ab]\njobs.sort()\n\nans = 0\njob_index = 0\nfor i in range(m):\n while job_index < len(jobs):\n if jobs[job_index] + i < m:\n ans -= jobs[job_index][1]\n else:\n job_index += 1\nprint(ans)\n","fail":"from heapq import heappush, heappop\n\nn, m = map(int, input().split())\nab = [tuple(map(int, input().split())) for _ in range(n)]\n\n\njobs = [[] for _ in range(m)]\nfor a, b in ab:\n if a <= m:\n jobs[a - 1].append(-b)\n\nans = 0\navailable = []\nfor job in jobs:\n for jo in job:\n heappush(available, jo)\n\n if available:\n ans -= heappop(available)\n\nprint(ans)\n","change":"replace","i1":0,"i2":14,"j1":0,"j2":20,"error":"TypeError: can only concatenate tuple (not \"int\") to tuple","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02948\/Python\/s258753664.py\", line 11, in \n if jobs[job_index] + i < m:\nTypeError: can only concatenate tuple (not \"int\") to tuple\n","stdout":null} {"problem_id":"p02948","language":"Python","original_status":"Runtime Error","pass":"# -*- coding: utf-8 -*-\n\nn, m = map(int, input().split())\nab = [list(map(int, input().split())) for _ in range(n)]\n\nab.sort(reverse=True)\nab.sort(key=lambda x: x[1], reverse=True)\n\ndays_left = [1] * (m + 2)\nans = 0\nfor a, b in ab:\n i = a\n while days_left[i] == 0:\n i += 1\n if i == m + 1:\n continue\n days_left[i] = 0\n ans += b\n\nprint(ans)\n","fail":"# -*- coding: utf-8 -*-\n\nimport heapq\n\n\nclass MaxHeap:\n def __init__(self, li):\n self.heap = [-e for e in li]\n heapq.heapify(self.heap)\n\n def push(self, val):\n heapq.heappush(self.heap, -val)\n\n def pop(self):\n return -heapq.heappop(self.heap)\n\n def __len__(self):\n return len(self.heap)\n\n\nn, m = map(int, input().split())\nab = [list(map(int, input().split())) for _ in range(n)]\n\nab.sort()\n\nh = MaxHeap([])\n\ni = 0\nans = 0\nfor day in range(1, m + 1):\n while i < n and ab[i][0] <= day:\n h.push(ab[i][1])\n i += 1\n if len(h) == 0:\n continue\n ans += h.pop()\n\nprint(ans)\n","change":"replace","i1":1,"i2":18,"j1":1,"j2":36,"error":"0","stderr":null,"stdout":5.0} {"problem_id":"p02948","language":"Python","original_status":"Time Limit Exceeded","pass":"import heapq\n\nn, m = map(int, input().split())\nbaitos = []\nfor _ in range(n):\n baitos.append(list(map(int, input().split())))\n\nbaitos = sorted(baitos)\n# print(sorted(baitos))\n# print(baitos)\n\nmoney = 0\navail = []\nheapq.heapify(avail)\nfor day in range(m):\n while baitos:\n if baitos[0][0] > day + 1:\n break\n else:\n heapq.heappush(avail, -baitos[0][1])\n baitos.remove(baitos[0])\n # for baito in baitos:\n # print(baito)\n # if baito[0] > day + 1:\n # print(\"break\")\n # break\n # else:\n # heapq.heappush(avail, -baito[1])\n # baitos.remove(baito)\n # print(\"baitos\", baitos)\n # print(\"avail\", avail)\n if avail:\n\n money += -heapq.heappop(avail)\n # print(day, money)\n # money += max[1]\n # baitos.remove(max)\n\nprint(money)\n","fail":"import heapq\n\nn, m = map(int, input().split())\nbaitos = [list(map(int, input().split())) for _ in range(n)]\n\nbaitos = sorted(baitos)\n# print(sorted(baitos))\n# print(baitos)\n\nmoney = 0\navail = []\n# heapq.heapify(avail)\nindex = 0\nfor day in range(m):\n while index < n and baitos[index][0] <= day + 1:\n heapq.heappush(avail, -baitos[index][1])\n index += 1\n # baitos.remove(baitos[0])\n # for baito in baitos:\n # print(baito)\n # if baito[0] > day + 1:\n # print(\"break\")\n # break\n # else:\n # heapq.heappush(avail, -baito[1])\n # baitos.remove(baito)\n # print(\"baitos\", baitos)\n # print(\"avail\", avail)\n if avail:\n\n money += -heapq.heappop(avail)\n # print(day, money)\n # money += max[1]\n # baitos.remove(max)\n\nprint(money)\n","change":"replace","i1":3,"i2":21,"j1":3,"j2":18,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02948","language":"Python","original_status":"Time Limit Exceeded","pass":"from collections import defaultdict\n\nn, m = map(int, input().split())\nab = sorted([list(map(int, input().split())) for i in range(n)])\nc = [[]] * m\na, b = ab[0]\nlast = a\nad = [b]\nfor i in range(1, n):\n a, b = ab[i]\n if a == last:\n ad.append(b)\n else:\n if last <= m:\n c[last - 1] = ad\n ad = [b]\n last = a\nif a <= m:\n c[a - 1] = ad\nchoice = defaultdict(int)\nans = 0\nfor i in range(m):\n for j in c[i]:\n choice[j] += 1\n if choice:\n use = max(choice)\n ans += use\n choice[use] -= 1\n if choice[use] <= 0:\n del choice[use]\nprint(ans)\n","fail":"import heapq\n\nn, m = map(int, input().split())\nab = sorted([list(map(int, input().split())) for i in range(n)])\nc = [[]] * m\na, b = ab[0]\nlast = a\nad = [b]\nfor i in range(1, n):\n a, b = ab[i]\n if a == last:\n ad.append(b)\n else:\n if last <= m:\n c[last - 1] = ad\n ad = [b]\n last = a\nif a <= m:\n c[a - 1] = ad\na = [3, 0, 2, 6]\nchoice = []\nheapq.heapify(choice)\nans = 0\nfor i in range(m):\n for j in c[i]:\n heapq.heappush(choice, -j)\n if choice:\n ans -= heapq.heappop(choice)\nprint(ans)\n","change":"replace","i1":0,"i2":30,"j1":0,"j2":28,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02948","language":"Python","original_status":"Time Limit Exceeded","pass":"n, m = map(int, input().split(\" \"))\nxys = [tuple(map(int, input().split(\" \"))) for i in range(n)]\nxys = sorted(xys, key=lambda x: (x[0], -x[1]))\n\nans = 0\n\nfor i in range(1, m + 1):\n cm = -1\n cmi = -1\n for j in range(len(xys)):\n if xys[j][0] <= i and xys[j][1] > cm:\n cm = xys[j][1]\n cmi = j\n if cmi >= 0:\n ans += cm\n xys.pop(cmi)\n\nprint(ans)\n","fail":"from heapq import heappush, heappop\n\nn, m = map(int, input().split(\" \"))\nxys = [tuple(map(int, input().split(\" \"))) for i in range(n)]\nxys = sorted(xys, key=lambda x: (x[0], -x[1]))\n\nans = 0\n\nj = 0\nh = []\nfor i in range(1, m + 1):\n while j < len(xys) and xys[j][0] <= i:\n heappush(h, -xys[j][1])\n j += 1\n if h:\n x = -heappop(h)\n # print(\"Pick\", x)\n ans += x\n\nprint(ans)\n","change":"replace","i1":0,"i2":16,"j1":0,"j2":18,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02948","language":"Python","original_status":"Time Limit Exceeded","pass":"#!\/usr\/bin\/env python3\nn, m = map(int, input().split())\nba = [None] * n\nfor i in range(n):\n a, b = map(int, input().split())\n ba[i] = [b, a]\nba.sort(reverse=True)\nli = [0] * m\nfor i in range(n):\n b, a = ba[i]\n for j in range(m - a + 1)[::-1]:\n if li[j] == 0:\n li[j] = b\n break\nprint(sum(li))\n","fail":"#!\/usr\/bin\/env python3\nfrom queue import PriorityQueue\n\nn, m = map(int, input().split())\njobs = [[] for _ in range(m)]\nfor i in range(n):\n a, b = map(int, input().split())\n if a > m:\n continue\n jobs[m - a].append(b)\npq = PriorityQueue()\nans = 0\nfor i in range(m)[::-1]:\n for b in jobs[i]:\n pq.put(-b)\n if not pq.empty():\n ans += -pq.get()\nprint(ans)\n","change":"replace","i1":1,"i2":15,"j1":1,"j2":18,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02948","language":"Python","original_status":"Time Limit Exceeded","pass":"N, M = map(int, input().split())\nAB = [[0, 0] for _ in range(N)]\n\nfor n in range(N):\n AB[n][0], AB[n][1] = map(int, input().split())\n AB[n][1] = 0 - AB[n][1]\nAB.sort()\n\npop_list = []\n\nearn = 0\nfor m in range(1, M + 1):\n max_earn = 0\n max_i = 0\n for i in range(len(AB)):\n if m < AB[i][0]:\n break\n\n if max_earn > AB[i][1] and i not in pop_list:\n max_earn = AB[i][1]\n max_i = i\n\n if max_earn != 0:\n earn += AB[max_i][1]\n pop_list.append(max_i)\n\nprint(0 - earn)\n","fail":"import queue\n\nN, M = map(int, input().split())\nAB = [[] for _ in range(M + 1)]\n\nfor n in range(N):\n a, b = map(int, input().split())\n if a > M:\n continue\n AB[a].append(0 - b)\n\nearn = 0\nq = queue.PriorityQueue()\n\nfor m in range(1, M + 1):\n\n for job in AB[m]:\n q.put(job)\n\n if not q.empty():\n earn += q.get()\n\nprint(0 - earn)\n","change":"replace","i1":0,"i2":25,"j1":0,"j2":21,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02949","language":"Python","original_status":"Time Limit Exceeded","pass":"n, m, p = map(int, input().split())\nabc = [list(map(int, input().split())) for _ in range(m)]\n\n\ndef bellman_ford(s, g):\n # loop 0 - (n-1) : bellman ford\n # loop n - (2n-1): check g can be updated\n dist = [float(\"inf\")] * n\n dist[s] = 0\n negative = [False] * n\n for i in range(2 * n):\n for a, b, c in abc:\n a -= 1\n b -= 1\n cost = -(c - p)\n\n if dist[b] > dist[a] + cost:\n dist[b] = dist[a] + cost\n if i >= n:\n negative[b] = True\n\n if negative[g]:\n return -1\n\n else:\n return max(-dist[g], 0)\n\n\nans = bellman_ford(0, n - 1)\nprint(ans)\n","fail":"n, m, p = map(int, input().split())\nabc = [list(map(int, input().split())) for _ in range(m)]\n\n\ndef bellman_ford(s, g):\n # loop 0 - (n-1) : bellman ford\n # loop n - (2n-1): check g can be updated\n dist = [float(\"inf\")] * n\n dist[s] = 0\n for i in range(2 * n):\n for a, b, c in abc:\n a -= 1\n b -= 1\n cost = -(c - p)\n\n if dist[b] > dist[a] + cost:\n dist[b] = dist[a] + cost\n if i >= n:\n dist[b] = -float(\"inf\")\n\n if dist[g] == -float(\"inf\"):\n return -1\n\n else:\n return max(-dist[g], 0)\n\n\nans = bellman_ford(0, n - 1)\nprint(ans)\n","change":"replace","i1":9,"i2":22,"j1":9,"j2":21,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02949","language":"Python","original_status":"Runtime Error","pass":"from collections import defaultdict, deque\n\nN, M, P = map(int, input().split())\nG = defaultdict(lambda: defaultdict(lambda: 10000000))\nG_rev = defaultdict(lambda: defaultdict(lambda: 10000000))\n\nfor i in range(1, N + 1):\n G[i] = dict()\n G_rev[i] = dict()\n\nfor _ in range(M):\n A, B, C = map(int, input().split())\n G[A][B] = min(G[A][B], P - C)\n G_rev[B][A] = 1\n\nreachable_N = [0] * (N + 1)\nreachable_N[N] = 1\nqueue = deque([N])\n\nwhile len(queue) > 0:\n p = queue.popleft()\n for q in G_rev[p].keys():\n if reachable_N[q] == 0:\n reachable_N[q] = 1\n queue.append(q)\n\nreachable_1 = [0] * (N + 1)\nreachable_1[1] = 1\nqueue = deque([1])\n\nwhile len(queue) > 0:\n p = queue.popleft()\n for q in G[p].keys():\n if reachable_1[q] == 0:\n reachable_1[q] = 1\n queue.append(q)\n\nreachable = [reachable_1[i] * reachable_N[i] for i in range(N + 1)]\n\ndist = [10000000000 for i in range(N + 1)]\nres = 0\ndist[1] = 0\nqueue = deque([1])\ncnt = 0\n\nupdate = True\n\nwhile update:\n update = False\n for p in range(1, N + 1):\n if reachable[p] == 0:\n continue\n for q in G[p].keys():\n if reachable[q] == 0:\n pass\n elif dist[p] + G[p][q] < dist[q]:\n dist[q] = dist[p] + G[p][q]\n update = True\n cnt += 1\n if cnt > N:\n res = -1\n break\n\nif res == -1:\n print(res)\nelse:\n print(max(0, -dist[N]))\n","fail":"from collections import defaultdict, deque\n\nN, M, P = map(int, input().split())\nG = defaultdict(lambda: defaultdict(lambda: 10000000))\nG_rev = defaultdict(lambda: defaultdict(lambda: 10000000))\n\nfor _ in range(M):\n A, B, C = map(int, input().split())\n G[A][B] = min(G[A][B], P - C)\n G_rev[B][A] = 1\n\nreachable_N = [0] * (N + 1)\nreachable_N[N] = 1\nqueue = deque([N])\n\nwhile len(queue) > 0:\n p = queue.popleft()\n for q in G_rev[p].keys():\n if reachable_N[q] == 0:\n reachable_N[q] = 1\n queue.append(q)\n\nreachable_1 = [0] * (N + 1)\nreachable_1[1] = 1\nqueue = deque([1])\n\nwhile len(queue) > 0:\n p = queue.popleft()\n for q in G[p].keys():\n if reachable_1[q] == 0:\n reachable_1[q] = 1\n queue.append(q)\n\nreachable = [reachable_1[i] * reachable_N[i] for i in range(N + 1)]\n\ndist = [10000000000 for i in range(N + 1)]\nres = 0\ndist[1] = 0\nqueue = deque([1])\ncnt = 0\n\nupdate = True\n\nwhile update:\n update = False\n for p in range(1, N + 1):\n if reachable[p] == 0:\n continue\n for q in G[p].keys():\n if reachable[q] == 0:\n pass\n elif dist[p] + G[p][q] < dist[q]:\n dist[q] = dist[p] + G[p][q]\n update = True\n cnt += 1\n if cnt > N:\n res = -1\n break\n\nif res == -1:\n print(res)\nelse:\n print(max(0, -dist[N]))\n","change":"delete","i1":5,"i2":9,"j1":5,"j2":5,"error":"KeyError: 2","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02949\/Python\/s582998390.py\", line 13, in \n G[A][B] = min(G[A][B], P - C)\nKeyError: 2\n","stdout":null} {"problem_id":"p02950","language":"Python","original_status":"Time Limit Exceeded","pass":"import numpy as np\n\np = int(input())\naaa = list(map(int, input().split()))\n\nbins = [1]\nfor i in range(1, p):\n bins.append(bins[-1] * (p - i) * pow(i, p - 2, p) % p)\nbins = np.array(bins, dtype=np.int32)\n\ncoefs = np.zeros(p, dtype=np.int32)\n\nfor i, a in enumerate(aaa):\n if a == 0:\n continue\n\n coefs[0] += 1\n\n pows = [1]\n for _ in range(1, p):\n pows.append(pows[-1] * -i % p)\n pows.reverse()\n pows = np.array(pows, dtype=np.int32)\n\n coefs = (coefs - bins * pows) % p\n\nprint(*coefs)\n","fail":"import numpy as np\n\np = int(input())\naaa = list(map(int, input().split()))\n\nbins = [1]\nfor i in range(1, p):\n bins.append(bins[-1] * (p - i) * pow(i, p - 2, p) % p)\nbins = np.array(bins, dtype=np.int32)\n\npows_base = -np.arange(p, dtype=np.int32)\npows = np.zeros((p, p), dtype=np.int32)\npows[:, p - 1] = 1\nfor i in range(p - 2, -1, -1):\n pows[:, i] = pows[:, i + 1] * pows_base % p\n\ncoefs = np.zeros(p, dtype=np.int32)\n\nfor i, a in enumerate(aaa):\n if a == 0:\n continue\n\n coefs[0] += 1\n coefs = (coefs - bins * pows[i]) % p\n\nprint(*coefs)\n","change":"replace","i1":10,"i2":25,"j1":10,"j2":24,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02950","language":"Python","original_status":"Time Limit Exceeded","pass":"p = int(input())\na = list(map(int, input().split()))\nMOD = p\n\nP = p\nfact = [0] * P\nfact[0] = 1\nfor i in range(1, P):\n fact[i] = fact[i - 1] * i\n fact[i] %= MOD\n\nrfact = [0] * P\nrfact[P - 1] = pow(fact[P - 1], MOD - 2, MOD)\nfor i in range(P - 2, -1, -1):\n rfact[i] = rfact[i + 1] * (i + 1)\n rfact[i] %= MOD\n\n\ndef comb(n, k):\n return fact[n] * rfact[n - k] * rfact[k] % MOD\n\n\nb = [0] * p\nfor i in range(p):\n if a[i]:\n b[0] += 1\n b[0] %= MOD\n for j in range(p):\n b[j] -= comb(p - 1, j) * (-i) ** (p - 1 - j)\n b[j] %= MOD\n\nprint(*b)\n","fail":"import sys\n\ninput = sys.stdin.readline\np = int(input())\na = list(map(int, input().split()))\nMOD = p\n\nP = p\nfact = [0] * P\nfact[0] = 1\nfor i in range(1, P):\n fact[i] = fact[i - 1] * i\n fact[i] %= MOD\n\nrfact = [0] * P\nrfact[P - 1] = pow(fact[P - 1], MOD - 2, MOD)\nfor i in range(P - 2, -1, -1):\n rfact[i] = rfact[i + 1] * (i + 1)\n rfact[i] %= MOD\n\n\ndef comb(n, k):\n return fact[n] * rfact[n - k] * rfact[k] % MOD\n\n\nb = [0] * p\nfor i in range(p):\n if a[i]:\n b[0] += 1\n b[0] %= MOD\n s = 1\n for j in range(p - 1, -1, -1):\n b[j] -= comb(p - 1, j) * s\n b[j] %= MOD\n s *= -i\n s %= MOD\n\nprint(*b)\n","change":"replace","i1":0,"i2":30,"j1":0,"j2":36,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02951","language":"Python","original_status":"Runtime Error","pass":"i = list(map(int, input().split()))\nprint(i[2] - (i[0] - i[1]))\ni = list(map(int, input().split()))\nn = i[2] - (i[0] - i[1])\nif n > 0:\n print(n)\nelse:\n print(0)\n","fail":"i = list(map(int, input().split()))\nn = i[2] - (i[0] - i[1])\nif n > 0:\n print(n)\nelse:\n print(0)\n","change":"delete","i1":0,"i2":2,"j1":0,"j2":0,"error":"EOFError: EOF when reading a line","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02951\/Python\/s799517998.py\", line 3, in \n i = list(map(int, input().split()))\nEOFError: EOF when reading a line\n","stdout":1.0} {"problem_id":"p02951","language":"Python","original_status":"Runtime Error","pass":"a, b, c = map(int, (input().split()))\nprint(max(c - (a - b), 0))\na, b, c = map(int, (input().split()))\nprint(max(c - (a - b), 0))\na, b, c = map(int, (input().split()))\nprint(max(c - (a - b), 0))\na, b, c = map(int, (input().split()))\nprint(max(c - (a - b), 0))\na, b, c = map(int, (input().split()))\nprint(max(c - (a - b), 0))\na, b, c = map(int, (input().split()))\nprint(max(c - (a - b), 0))\na, b, c = map(int, (input().split()))\nprint(max(c - (a - b), 0))\na, b, c = map(int, (input().split()))\nprint(max(c - (a - b), 0))\na, b, c = map(int, (input().split()))\nprint(max(c - (a - b), 0))\na, b, c = map(int, (input().split()))\nprint(max(c - (a - b), 0))\n","fail":"a, b, c = map(int, (input().split()))\nprint(max(c - (a - b), 0))\n","change":"delete","i1":2,"i2":20,"j1":2,"j2":2,"error":"EOFError: EOF when reading a line","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02951\/Python\/s280962278.py\", line 3, in \n a, b, c = map(int, (input().split()))\nEOFError: EOF when reading a line\n","stdout":1.0} {"problem_id":"p02951","language":"Python","original_status":"Runtime Error","pass":"a, b, c = input().splita, b, c = [int(x) for x in input().strip().split()]\n\nwater = c - (a - b)\nif water < 0:\n print(0)\nelse:\n print(water)\n","fail":"a, b, c = [int(x) for x in input().strip().split()]\n\nwater = c - (a - b)\nif water < 0:\n print(0)\nelse:\n print(water)\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"EOFError: EOF when reading a line","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02951\/Python\/s087836716.py\", line 1, in \n a, b, c = input().splita, b, c = [int(x) for x in input().strip().split()]\nEOFError: EOF when reading a line\n","stdout":null} {"problem_id":"p02951","language":"Python","original_status":"Runtime Error","pass":"num = input().split()\na = num[0]\nb = num[1]\nc = num[2]\nans = b + c - a\nif ans > 0:\n print(ans)\nelse:\n print(0)\n","fail":"num = input().split()\na = int(num[0])\nb = int(num[1])\nc = int(num[2])\nans = b + c - a\nif ans > 0:\n print(ans)\nelse:\n print(0)\n","change":"replace","i1":1,"i2":4,"j1":1,"j2":4,"error":"TypeError: unsupported operand type(s) for -: 'str' and 'str'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02951\/Python\/s319382696.py\", line 5, in \n ans = b + c - a\nTypeError: unsupported operand type(s) for -: 'str' and 'str'\n","stdout":null} {"problem_id":"p02951","language":"Python","original_status":"Runtime Error","pass":"a, b, c = map(int, input().split())\nprint(max(c - (a - b)), 0)\n","fail":"a, b, c = map(int, input().split())\nprint(max(c - (a - b), 0))\n","change":"replace","i1":1,"i2":2,"j1":1,"j2":2,"error":"TypeError: 'int' object is not iterable","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02951\/Python\/s849480716.py\", line 2, in \n print(max(c - (a - b)), 0)\nTypeError: 'int' object is not iterable\n","stdout":null} {"problem_id":"p02952","language":"Python","original_status":"Runtime Error","pass":"def main(n):\n count = 0\n\n for i in range(n + 1):\n if str(i).__len__ % 2 == 1:\n count += 1\n\n print(count)\n\n\nif __name__ == \"__main__\":\n n = int(input())\n\n main(n)\n","fail":"def main(n):\n count = 0\n\n for i in range(1, n + 1):\n if len(str(i)) % 2 == 1:\n count += 1\n\n print(count)\n\n\nif __name__ == \"__main__\":\n n = int(input())\n\n main(n)\n","change":"replace","i1":3,"i2":5,"j1":3,"j2":5,"error":"TypeError: unsupported operand type(s) for %: 'method-wrapper' and 'int'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02952\/Python\/s049865581.py\", line 14, in \n main(n)\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02952\/Python\/s049865581.py\", line 5, in main\n if str(i).__len__ % 2 == 1:\nTypeError: unsupported operand type(s) for %: 'method-wrapper' and 'int'\n","stdout":null} {"problem_id":"p02952","language":"Python","original_status":"Runtime Error","pass":"n = int(input())\ncnt = 0\nfor i in range(1, n + 1):\n if str(i) % 2 == 1:\n cnt += 1\nprint(cnt)\n","fail":"n = int(input())\ncnt = 0\nfor i in range(1, n + 1):\n if len(str(i)) % 2 == 1:\n cnt += 1\nprint(cnt)\n","change":"replace","i1":3,"i2":4,"j1":3,"j2":4,"error":"TypeError: not all arguments converted during string formatting","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02952\/Python\/s429203628.py\", line 4, in \n if str(i) % 2 == 1:\nTypeError: not all arguments converted during string formatting\n","stdout":null} {"problem_id":"p02952","language":"Python","original_status":"Runtime Error","pass":"N = int(input())\nans = 0\nfor i in range(1, N + 1):\n if len(i) % 2 == 1:\n ans += 1\nprint(ans)\n","fail":"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","change":"replace","i1":3,"i2":4,"j1":3,"j2":4,"error":"TypeError: object of type 'int' has no len()","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02952\/Python\/s356122342.py\", line 4, in \n if len(i) % 2 == 1:\nTypeError: object of type 'int' has no len()\n","stdout":null} {"problem_id":"p02953","language":"Python","original_status":"Runtime Error","pass":"n = int(input())\nh = list(map(int, input().split()))\nx = h[-1]\nans = \"Yes\"\nfor i in reversed(range(n - 1)):\n print(h)\n hi = h[i]\n if hi <= x:\n pass\n else:\n if abs(x - hi) >= 2:\n ans = \"No\"\n else:\n h[i] -= 1\n x = hi\nprint(ans)\n","fail":"n = int(input())\nh = list(map(int, input().split()))\nx = h[-1]\nans = \"Yes\"\nfor i in reversed(range(n - 1)):\n hi = h[i]\n if hi <= x:\n pass\n else:\n if abs(x - hi) >= 2:\n ans = \"No\"\n else:\n h[i] -= 1\n x = h[i]\nprint(ans)\n","change":"replace","i1":5,"i2":15,"j1":5,"j2":14,"error":"WA","stderr":null,"stdout":"[1, 2, 1, 1, 3]\n[1, 2, 1, 1, 3]\n[1, 2, 1, 1, 3]\n[1, 1, 1, 1, 3]\nYes\n"} {"problem_id":"p02953","language":"Python","original_status":"Runtime Error","pass":"import sys\n\ninput = sys.stdin.readline\n\n\ndef main():\n n = int(input())\n H = [int(i) for i in input().split()]\n # \u30de\u30b9\u306e\u9ad8\u3055\u30921\u3064\u5f15\u304f\u304f\u3059\u308b\u3053\u3068\n # \u306a\u306b\u3082\u3057\u306a\u3044\n # \u5358\u8abf\u975e\u6e1b\u5c11\u3063\u3066\u306a\u3093\u3060\n # \u5de6\u3088\u308a\u4f4e\u304f\u306a\u3089\u306a\u3044\u3088\u3046\u306b\u3059\u308c\u3070\u826f\u3044\u3063\u307d\u3044\u306a\n # N = 10 ** 5\n # h = 10 ** 9\n # example:\n # 1 2 1 1 -> 1 1 1 1 -> Yes\n # 1 2 2 1 -> 1 2 1 1 -> No\n # 1 2 3 1 -> 1 2 2 1 -> No\n # 1 100 1 1 -> 1 99 1 1 -> No\n #\n\n cnt = 0\n # \u3068\u308a\u3042\u3048\u305a\u3001\u611a\u76f4\u306b\u66f8\u3044\u3066\u307f\u308b\n a = None\n b = H[0]\n for i in range(1, n + 1):\n c = H[i]\n sa = c - b\n if sa < -1:\n cnt = 2\n break\n elif sa < 0:\n if a and a == b:\n cnt = 2\n break\n cnt += 1\n a = b\n b = c\n if cnt > 1:\n break\n print(\"Yes\" if cnt <= 1 else \"No\")\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"import sys\n\ninput = sys.stdin.readline\n\n\ndef main():\n n = int(input())\n H = [int(i) for i in input().split()]\n\n flg = True\n max_ = -1\n for h in H:\n if h < max_:\n flg = False\n break\n if h == max_:\n continue\n max_ = h - 1\n print(\"Yes\" if flg else \"No\")\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":8,"i2":41,"j1":8,"j2":19,"error":"IndexError: list index out of range","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02953\/Python\/s934436551.py\", line 45, in \n main()\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02953\/Python\/s934436551.py\", line 27, in main\n c = H[i]\nIndexError: list index out of range\n","stdout":null} {"problem_id":"p02953","language":"Python","original_status":"Runtime Error","pass":"n = int(input())\nstair = list(map(int, input().split()))\n\nfor i in reversed(range(1, n)):\n d = stair[i] - stair[i - 1]\n if d > 1:\n print(\"No\")\n exit()\n elif d == 1:\n stair -= 1\nprint(\"Yes\")\n","fail":"n = int(input())\nstair = list(map(int, input().split()))\n\nfor i in reversed(range(1, n)):\n d = stair[i] - stair[i - 1]\n if d < -1:\n print(\"No\")\n exit()\n elif d == -1:\n stair[i - 1] -= 1\nprint(\"Yes\")\n","change":"replace","i1":5,"i2":10,"j1":5,"j2":10,"error":"WA","stderr":null,"stdout":"No\n"} {"problem_id":"p02953","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\n\nstairs = list(map(int, input().split(\" \")))\n\nfor i in range(N):\n stair = stairs[i]\n if stair - 2 >= min(stairs[i:]):\n print(\"No\")\n exit(0)\n\nprint(\"Yes\")\n","fail":"N = int(input())\n\nstairs = list(map(int, input().split(\" \")))\nmin = 0\n\nfor i in range(N):\n stair = stairs[i]\n if min > stair:\n print(\"No\")\n exit(0)\n if stair - 1 > min:\n min = stair - 1\n\nprint(\"Yes\")\n","change":"replace","i1":3,"i2":9,"j1":3,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02954","language":"Python","original_status":"Time Limit Exceeded","pass":"s = input()\nn = len(s)\n\nsquare = [0 for _ in range(n)]\nfor i in range(n):\n if s[i] == \"L\":\n add_num = -1\n else:\n add_num = 1\n j = i + add_num\n char = s[i]\n while j > -1 and j < n and char == s[j]:\n j += add_num\n if (i - j) % 2 == 0:\n square[j] += 1\n else:\n square[j - add_num] += 1\n\nprint(square[0], end=\"\")\nfor i in range(1, n):\n print(\" \", end=\"\")\n print(square[i], end=\"\")\n","fail":"s = input()\nn = len(s)\n\nsquare = [0 for _ in range(n)]\ni = 0\nwhile i < n:\n start = i\n char = s[i]\n i += 1\n while i < n and char == s[i]:\n i += 1\n\n if char == \"L\":\n num = i - start\n if num % 2 == 0:\n square[start - 1] += num \/\/ 2\n square[start] += num \/\/ 2\n else:\n square[start] += num \/\/ 2 + 1\n square[start - 1] += num \/\/ 2\n else: # R\n num = i - start\n if num % 2 == 0:\n square[i] += num \/\/ 2\n square[i - 1] += num \/\/ 2\n else:\n square[i] += num \/\/ 2\n square[i - 1] += num \/\/ 2 + 1\n # if i == n - 1:\n # i += 1\n\n\nprint(square[0], end=\"\")\nfor i in range(1, n):\n print(\" \", end=\"\")\n print(square[i], end=\"\")\n","change":"replace","i1":4,"i2":17,"j1":4,"j2":31,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02954","language":"Python","original_status":"Time Limit Exceeded","pass":"s = input()\nkids = [0] * len(s)\nfor i, c in enumerate(s):\n now = i\n if c == \"R\":\n while s[now + 1] == \"R\":\n now += 1\n diff = abs(now - i)\n if diff % 2:\n kids[now + 1] += 1\n else:\n kids[now] += 1\n else:\n while s[now - 1] == \"L\":\n now -= 1\n diff = abs(now - i)\n if diff % 2:\n kids[now - 1] += 1\n else:\n kids[now] += 1\nprint(\" \".join([str(k) for k in kids]))\n","fail":"s = list(input())\nkids = [0] * len(s)\n\nfor d in [\"R\", \"L\"]:\n c = 0\n for i in range(len(s)):\n if s[i] == d:\n c += 1\n else:\n kids[i] += c \/\/ 2\n kids[i - 1] += (c + 1) \/\/ 2\n c = 0\n s.reverse()\n kids.reverse()\n\nprint(\" \".join([str(k) for k in kids]))\n","change":"replace","i1":0,"i2":20,"j1":0,"j2":15,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02955","language":"Python","original_status":"Time Limit Exceeded","pass":"N, K = map(int, input().split())\nA = list(map(int, input().split()))\n\ndivs = []\nmaxA = sum(A)\nfor i in range(1, maxA + 1):\n if maxA % i == 0:\n divs.append(i)\n divs.append(maxA \/\/ i)\n\ndivs.sort(reverse=True)\n\nfor d in divs:\n rest = [a % d for a in A]\n rest.sort(reverse=True)\n restSum = sum(rest) \/\/ d\n cnt = 0\n for i in range(restSum):\n cnt += d - rest[i]\n if cnt <= K:\n print(d)\n exit()\n","fail":"N, K = map(int, input().split())\nA = list(map(int, input().split()))\n\ndivs = []\nmaxA = sum(A)\nfor i in range(1, int(maxA**0.5) + 1):\n if maxA % i == 0:\n divs.append(i)\n divs.append(maxA \/\/ i)\n\ndivs.sort(reverse=True)\n\nfor d in divs:\n rest = [a % d for a in A]\n rest.sort(reverse=True)\n restSum = sum(rest) \/\/ d\n cnt = 0\n for i in range(restSum):\n cnt += d - rest[i]\n if cnt <= K:\n print(d)\n exit()\n","change":"replace","i1":5,"i2":6,"j1":5,"j2":6,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02957","language":"Python","original_status":"Runtime Error","pass":"# -*- coding: utf-8 -*-\na, b = map(int, input().split())\nif isinstance((a + b) \/ 2):\n print((a + b) \/ 2)\nelse:\n print(\"IMPOSSIBLE\")\n","fail":"# -*- coding: utf-8 -*-\na, b = map(int, input().split())\nif (a + b) % 2 == 0:\n print((a + b) \/\/ 2)\nelse:\n print(\"IMPOSSIBLE\")\n","change":"replace","i1":2,"i2":4,"j1":2,"j2":4,"error":"TypeError: isinstance expected 2 arguments, got 1","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02957\/Python\/s456363956.py\", line 3, in \n if isinstance((a + b) \/ 2):\nTypeError: isinstance expected 2 arguments, got 1\n","stdout":null} {"problem_id":"p02957","language":"Python","original_status":"Runtime Error","pass":"#!\/bin\/python3\n\na, b = input().split(\" \")\n\nif a % 2 == b % 2:\n print((a + b) \/ 2)\nelse:\n print(\"IMPOSSIBLE\")\n","fail":"# -*- coding: utf-8 -*-\n\na, b = map(int, input().split(\" \"))\nif a % 2 == b % 2:\n print(int((a + b) \/ 2))\nelse:\n print(\"IMPOSSIBLE\")\n","change":"replace","i1":0,"i2":6,"j1":0,"j2":5,"error":"TypeError: not all arguments converted during string formatting","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02957\/Python\/s028842824.py\", line 5, in \n if a % 2 == b % 2:\nTypeError: not all arguments converted during string formatting\n","stdout":null} {"problem_id":"p02957","language":"Python","original_status":"Runtime Error","pass":"a = int(input())\nb = int(input())\n\nif (a + b) % 2 != 0:\n print(\"IMPOSSIBLE\")\nelse:\n if a < b:\n A = a\n B = b\n else:\n A = b\n B = a\n\n K = int(B - (B - A) \/ 2)\n print(str(K))\n","fail":"a, b = map(int, input().split())\n\nif a < b:\n A = a\n B = b\nelse:\n A = b\n B = a\n\nif (B - A) % 2 != 0:\n print(\"IMPOSSIBLE\")\nelse:\n K = int(B - (B - A) \/ 2)\n print(str(K))\n","change":"replace","i1":0,"i2":13,"j1":0,"j2":12,"error":"ValueError: invalid literal for int() with base 10: '2 16'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02957\/Python\/s043180059.py\", line 1, in \n a = int(input())\nValueError: invalid literal for int() with base 10: '2 16'\n","stdout":null} {"problem_id":"p02958","language":"Python","original_status":"Runtime Error","pass":"n = int(input())\np = list(map(int, input().split()))\nsorted_p = sorted(p)\ncnt = 0\nfor a, b in p, sorted_p:\n if a != b:\n cnt += 1\nif cnt > 2:\n print(\"NO\")\nelse:\n print(\"YES\")\n","fail":"n = int(input())\np = list(map(int, input().split()))\nsorted_p = sorted(p)\ncnt = 0\nfor a, b in zip(p, sorted_p):\n if a != b:\n cnt += 1\nif cnt > 2:\n print(\"NO\")\nelse:\n print(\"YES\")\n","change":"replace","i1":4,"i2":5,"j1":4,"j2":5,"error":"ValueError: too many values to unpack (expected 2)","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02958\/Python\/s135206060.py\", line 5, in \n for a, b in p, sorted_p:\nValueError: too many values to unpack (expected 2)\n","stdout":null} {"problem_id":"p02958","language":"Python","original_status":"Runtime Error","pass":"N = int(input())\np = list(map(int, input().split()))\nfor i in range(N):\n for j in range(i + 1, N):\n if p[j - 1] < p[i] < p[j + 1] and p[i - 1] < p[j] < p[i + 1]:\n print(\"YES\")\n exit()\n else:\n continue\nprint(\"NO\")\n","fail":"N = int(input())\np = list(map(int, input().split()))\ncount = 0\nfor i in range(N):\n if p[i] != i + 1:\n count += 1\nif count == 0 or count == 2:\n print(\"YES\")\nelse:\n print(\"NO\")\n","change":"replace","i1":2,"i2":10,"j1":2,"j2":10,"error":"IndexError: list index out of range","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02958\/Python\/s761577453.py\", line 5, in \n if p[j - 1] < p[i] < p[j + 1] and p[i - 1] < p[j] < p[i + 1]:\nIndexError: list index out of range\n","stdout":null} {"problem_id":"p02958","language":"Python","original_status":"Runtime Error","pass":"N = int(input())\np = list(map(int, input().split()))\nq = sorted(p)\nk = 0\nfor i in range(1, N + 1):\n if p[i] - q[i] != 0:\n k += 1\n\nif k > 2:\n print(\"NO\")\nelse:\n print(\"YES\")\n","fail":"N = int(input())\np = list(map(int, input().split()))\nq = sorted(p)\nk = 0\nfor i in range(N):\n if p[i] - q[i] != 0:\n k += 1\n\nif k > 2:\n print(\"NO\")\nelse:\n print(\"YES\")\n","change":"replace","i1":4,"i2":5,"j1":4,"j2":5,"error":"IndexError: list index out of range","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02958\/Python\/s083953128.py\", line 6, in \n if p[i] - q[i] != 0:\nIndexError: list index out of range\n","stdout":null} {"problem_id":"p02959","language":"Python","original_status":"Runtime Error","pass":"n = int(input())\na = list(map(int, input().split()))\na.append(0)\nb = list(map(int, input().split()))\n\ncount = 0\nfor i in range(n):\n if a[i] < b[i]:\n count += a[i]\n d = b[i] - a[i]\n\n if a[i + 1] < d:\n count += a[i + 1]\n a[i + i] = 0\n else:\n count += d\n a[i + 1] -= d\n\n else:\n count += b[i]\n\nprint(count)\n","fail":"n = int(input())\na = list(map(int, input().split()))\nb = list(map(int, input().split()))\n\ncount = 0\nfor i in range(n):\n if a[i] < b[i]:\n count += a[i]\n d = b[i] - a[i]\n\n if a[i + 1] < d:\n count += a[i + 1]\n a[i + 1] = 0\n else:\n count += d\n a[i + 1] -= d\n\n else:\n count += b[i]\n\nprint(count)\n","change":"replace","i1":2,"i2":14,"j1":2,"j2":13,"error":"0","stderr":null,"stdout":9.0} {"problem_id":"p02959","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\nmonster = list(map(int, input().split()))\nyuusha = list(map(int, input().split()))\na = sum(monster)\nfor i in range(n):\n while yuusha[i] != 0:\n if monster[i] > 0:\n yuusha[i] -= 1\n monster[i] -= 1\n elif monster[i + 1] > 0:\n yuusha[i] -= 1\n monster[i + 1] -= 1\n else:\n break\na -= sum(monster)\nprint(a)\n","fail":"n = int(input())\nmonster = list(map(int, input().split()))\nyuusha = list(map(int, input().split()))\na = sum(monster)\nfor i in range(n):\n if monster[i] < yuusha[i]:\n yuusha[i] -= monster[i]\n monster[i] = 0\n if monster[i + 1] < yuusha[i]:\n yuusha[i] -= monster[i + 1]\n monster[i + 1] = 0\n else:\n monster[i + 1] -= yuusha[i]\n yuusha[i] = 0\n else:\n monster[i] -= yuusha[i]\n yuusha[i] = 0\na -= sum(monster)\nprint(a)\n","change":"replace","i1":5,"i2":14,"j1":5,"j2":17,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02959","language":"Python","original_status":"Runtime Error","pass":"# coding:utf-8\nn = int(input())\na = list(map(int, input().split()))\nb = list(map(int, input().split()))\n\nans = 0\n\nfor i in range(n):\n if a[i] >= b[i]:\n ans += b[i]\n else:\n ans += a[i]\n b[i] -= a[i]\n if a[i + 1] >= b[i]:\n a[i + 1] -= b[i]\n ans += b[i]\n else:\n ans += a[i + i]\n a[i + 1] = 0\n\n\nprint(ans)\n","fail":"# coding:utf-8\nn = int(input())\na = list(map(int, input().split()))\nb = list(map(int, input().split()))\n\nans = 0\n\nfor i in range(n):\n if a[i] >= b[i]:\n ans += b[i]\n else:\n ans += a[i]\n b[i] -= a[i]\n if a[i + 1] >= b[i]:\n a[i + 1] -= b[i]\n ans += b[i]\n else:\n ans += a[i + 1]\n a[i + 1] = 0\n\n\nprint(ans)\n","change":"replace","i1":17,"i2":18,"j1":17,"j2":18,"error":"0","stderr":null,"stdout":9.0} {"problem_id":"p02959","language":"Python","original_status":"Runtime Error","pass":"n = int(input())\na = list(map(int, input().split()))\nb = list(map(int, input().split()))\n\ns1 = sum(a)\nfor i in range(n + 1):\n if i == 0:\n if a[i] < b[i]:\n b[i] -= a[i]\n a[i] = 0\n else:\n a[i] -= b[i]\n b[i] = 0\n elif i == n:\n if a[i] < b[i - 1]:\n a[i] = 0\n else:\n a[i] -= b[i - 1]\n b[i] = 0\n else:\n if a[i] < b[i - 1]:\n a[i] = 0\n else:\n a[i] -= b[i - 1]\n if a[i] < b[i]:\n b[i] -= a[i]\n a[i] = 0\n else:\n a[i] -= b[i]\n b[i] = 0\nprint(s1 - sum(a))\n","fail":"n = int(input())\na = list(map(int, input().split()))\nb = list(map(int, input().split()))\n\ns1 = sum(a)\nfor i in range(n + 1):\n if i == 0:\n if a[i] < b[i]:\n b[i] -= a[i]\n a[i] = 0\n else:\n a[i] -= b[i]\n b[i] = 0\n elif i == n:\n if a[i] < b[i - 1]:\n a[i] = 0\n else:\n a[i] -= b[i - 1]\n b[i - 1] = 0\n else:\n if a[i] < b[i - 1]:\n a[i] = 0\n else:\n a[i] -= b[i - 1]\n if a[i] < b[i]:\n b[i] -= a[i]\n a[i] = 0\n else:\n a[i] -= b[i]\n b[i] = 0\nprint(s1 - sum(a))\n","change":"replace","i1":18,"i2":19,"j1":18,"j2":19,"error":"IndexError: list assignment index out of range","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02959\/Python\/s937691477.py\", line 19, in \n b[i] = 0\nIndexError: list assignment index out of range\n","stdout":null} {"problem_id":"p02960","language":"Python","original_status":"Time Limit Exceeded","pass":"S = str(input())\nS_len = len(S)\n\nDP = [[0 for j in range(13)] for i in range(S_len + 1)]\nDP[S_len][0] = 1\n\nfor i in reversed(range(S_len)):\n\n num = 10 ** (S_len - 1 - i) % 13\n\n if S[i] != \"?\":\n for j in range(13):\n DP[i][(j + int(S[i]) * num) % 13] += DP[i + 1][j] % 1000000007\n else:\n for j in range(13):\n for k in range(10):\n DP[i][(j + k * num) % 13] += DP[i + 1][j] % 1000000007\n\nprint(DP[0][5] % 1000000007)\n","fail":"S = str(input())\nS_len = len(S)\n\nDP = [[0 for j in range(13)] for i in range(S_len + 1)]\nDP[S_len][0] = 1\nnum = 1\n\nfor i in reversed(range(S_len)):\n\n if S[i] != \"?\":\n for j in range(13):\n DP[i][(j + int(S[i]) * num) % 13] += DP[i + 1][j] % 1000000007\n else:\n for j in range(13):\n for k in range(10):\n DP[i][(j + k * num) % 13] += DP[i + 1][j] % 1000000007\n\n num = (num * 10) % 13\n\nprint(DP[0][5] % 1000000007)\n","change":"replace","i1":5,"i2":18,"j1":5,"j2":19,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02962","language":"Python","original_status":"Time Limit Exceeded","pass":"s = input()\nt = input()\n\nu = \"\"\nwhile len(u) < len(s) + len(t):\n u = s * (len(t) \/\/ len(s) + 1)\n\nt_add = t + \".\"\n\n\ndef partial_match_table(word):\n table = [0] * (len(word) + 1)\n table[0] = -1\n i, j = 0, 1\n\n while j < len(word):\n matched = word[i] == word[j]\n\n if not matched and i > 0:\n i = table[i]\n else:\n if matched:\n i += 1\n j += 1\n table[j] = i\n\n return table\n\n\ntable_tx = partial_match_table(t_add)\n\nmatch = [0] * len(s)\n\ni = j = 0\nwhile i < len(u) and j < len(t_add):\n if u[i] == t_add[j]:\n i += 1\n j += 1\n elif j == 0:\n i += 1\n else:\n j = table_tx[j]\n if j == len(t_add) - 1:\n match[(i - j) % len(s)] = 1\n\n\n# search\nsearched = [0] * len(s)\nlongest = 0\ninfinity = False\nfor i in range(len(s)):\n if searched[i]:\n continue\n searched[i] = 1\n p = i\n right = 0\n while match[p]:\n right += 1\n p = (p + len(t)) % len(s)\n searched[p] = 1\n if p == i:\n infinity = True\n break\n left = 0\n p = i\n while match[(p - len(t)) % len(s)]:\n left += 1\n p = (p - len(t)) % len(s)\n searched[p] = 1\n if p == i:\n infinity = True\n break\n if left + right > longest:\n longest = left + right\n\nif infinity:\n print(-1)\nelse:\n print(longest)\n","fail":"s = input()\nt = input()\n\nu = s * (len(t) \/\/ len(s) + 2)\n\nt_add = t + \".\"\n\n\ndef partial_match_table(word):\n table = [0] * (len(word) + 1)\n table[0] = -1\n i, j = 0, 1\n\n while j < len(word):\n matched = word[i] == word[j]\n\n if not matched and i > 0:\n i = table[i]\n else:\n if matched:\n i += 1\n j += 1\n table[j] = i\n\n return table\n\n\ntable_tx = partial_match_table(t_add)\n\nmatch = [0] * len(s)\n\ni = j = 0\nwhile i < len(u) and j < len(t_add):\n if u[i] == t_add[j]:\n i += 1\n j += 1\n elif j == 0:\n i += 1\n else:\n j = table_tx[j]\n if j == len(t_add) - 1:\n match[(i - j) % len(s)] = 1\n\n\n# search\nsearched = [0] * len(s)\nlongest = 0\ninfinity = False\nfor i in range(len(s)):\n if searched[i]:\n continue\n searched[i] = 1\n p = i\n right = 0\n while match[p]:\n right += 1\n p = (p + len(t)) % len(s)\n searched[p] = 1\n if p == i:\n infinity = True\n break\n left = 0\n p = i\n while match[(p - len(t)) % len(s)]:\n left += 1\n p = (p - len(t)) % len(s)\n searched[p] = 1\n if p == i:\n infinity = True\n break\n if left + right > longest:\n longest = left + right\n\nif infinity:\n print(-1)\nelse:\n print(longest)\n","change":"replace","i1":3,"i2":6,"j1":3,"j2":4,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02963","language":"Python","original_status":"Runtime Error","pass":"import math\n\ns = int(input())\n\nrot = int(math.sqrt(s) \/\/ 1)\nif s == rot**2:\n print(f\"0 0 0 {rot} 0 0 {rot}\")\n exit()\n\nrot += 1\nans = (rot**2) - s\nprint(f\"0 0 {rot} 1 {ans} {rot}\")\n","fail":"import math\n\ns = int(input())\n\nrot = int(math.sqrt(s) \/\/ 1)\nif s == rot**2:\n print(\"0 0 \" + str(rot) + \" 0 0 \" + str(rot))\n exit()\n\nrot += 1\nans = (rot**2) - s\nprint(\"0 0 \" + str(rot) + \" 1 \" + str(ans) + \" \" + str(rot))\n","change":"replace","i1":6,"i2":12,"j1":6,"j2":12,"error":"WA","stderr":null,"stdout":"0 0 2 1 1 2\n"} {"problem_id":"p02963","language":"Python","original_status":"Time Limit Exceeded","pass":"s = int(input())\n\nt = int(pow(s, 0.5))\nfor i in range(t, 0, -1):\n if s % i == 0:\n x = i\n y = s \/\/ i\n break\n\nans = [0, 0, 0, y, x, 0]\nprint(*ans)\n","fail":"s = int(input())\na = [0, 0]\n\na.append(10**9)\na.append(1)\n\nq, r = divmod(s, 10**9)\nif r > 0:\n q += 1\n r -= 10**9\n r *= -1\n\na.append(r)\na.append(q)\n\nprint(*a)\n","change":"replace","i1":1,"i2":11,"j1":1,"j2":16,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02965","language":"Python","original_status":"Time Limit Exceeded","pass":"from functools import lru_cache\n\n\ndef prepare(n, MOD):\n f = 1\n factorials = [1] * (n + 1)\n for m in range(1, n + 1):\n f = f * m % MOD\n factorials[m] = f\n inv = pow(f, MOD - 2, MOD)\n invs = [1] * (n + 1)\n invs[n] = inv\n for m in range(n, 1, -1):\n inv = inv * m % MOD\n invs[m - 1] = inv\n\n return factorials, invs\n\n\ndef get_nhr(n, facts, invs, MOD):\n @lru_cache(maxsize=None)\n def nhr(r):\n return facts[n + r - 1] * invs[r] * invs[n - 1] % MOD\n\n return nhr\n\n\ndef solve(n, m):\n MOD = 998244353\n facts, invs = prepare(n + 3 * m, MOD)\n fn = facts[n]\n nhr = get_nhr(n, facts, invs, MOD)\n ans = 0\n for odd in range(m % 2, min(m, n) + 1, 2):\n tmp = nhr((3 * m - odd) \/\/ 2)\n if odd > 0:\n tmp -= odd * nhr((m - odd) \/\/ 2)\n if odd < n and odd <= m - 2:\n tmp -= (n - odd) * nhr((m - odd - 2) \/\/ 2)\n ans = (ans + fn * invs[odd] * invs[n - odd] % MOD * tmp) % MOD\n return ans\n\n\nn, m = list(map(int, input().split()))\nprint(solve(n, m))\n","fail":"def prepare(n, MOD):\n f = 1\n factorials = [1] * (n + 1)\n for m in range(1, n + 1):\n f = f * m % MOD\n factorials[m] = f\n inv = pow(f, MOD - 2, MOD)\n invs = [1] * (n + 1)\n invs[n] = inv\n for m in range(n, 1, -1):\n inv = inv * m % MOD\n invs[m - 1] = inv\n\n return factorials, invs\n\n\ndef get_nhr(n, facts, invs, MOD):\n def nhr(r):\n return facts[n + r - 1] * invs[r] * invs[n - 1] % MOD\n\n return nhr\n\n\ndef solve(n, m):\n MOD = 998244353\n facts, invs = prepare(n + 3 * m, MOD)\n fn = facts[n]\n nhr = get_nhr(n, facts, invs, MOD)\n nm2 = min(n, m - 1)\n ans = 0\n for odd in range(m % 2, min(m, n) + 1, 2):\n tmp = nhr((3 * m - odd) \/\/ 2)\n if odd > 0:\n tmp -= odd * nhr((m - odd) \/\/ 2)\n if odd < nm2:\n tmp -= (n - odd) * nhr((m - odd - 2) \/\/ 2)\n ans = (ans + fn * invs[odd] * invs[n - odd] % MOD * tmp) % MOD\n return ans\n\n\nn, m = list(map(int, input().split()))\nprint(solve(n, m))\n","change":"replace","i1":0,"i2":38,"j1":0,"j2":35,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02969","language":"Python","original_status":"Runtime Error","pass":"r = input()\nprint(3 * r * r)\n","fail":"r = int(input())\nprint(3 * r * r)\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"TypeError: can't multiply sequence by non-int of type 'str'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02969\/Python\/s048208097.py\", line 2, in \n print(3 * r * r)\nTypeError: can't multiply sequence by non-int of type 'str'\n","stdout":null} {"problem_id":"p02970","language":"Python","original_status":"Runtime Error","pass":"#!\/usr\/bin\/env python3\n\nn = int(input())\nprint(int((n - 1) \/ 2) if n % 2 == 1 else int(n \/ 2) - 1)\n","fail":"#!\/usr\/bin\/env python3\n# https:\/\/atcoder.jp\/contests\/abc134\/tasks\/abc134_b\n\nimport math\n\nn, d = [int(x) for x in input().split()]\nprint(math.ceil(n \/ (d * 2 + 1)))\n","change":"replace","i1":1,"i2":4,"j1":1,"j2":7,"error":"ValueError: invalid literal for int() with base 10: '6 2'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02970\/Python\/s267140007.py\", line 3, in \n n = int(input())\nValueError: invalid literal for int() with base 10: '6 2'\n","stdout":null} {"problem_id":"p02970","language":"Python","original_status":"Runtime Error","pass":"n, d = map(int, input())\nprint(-(-n \/\/ (1 + d * 2)))\n","fail":"n, d = map(int, input().split())\nprint(-(-n \/\/ (1 + d * 2)))\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"ValueError: invalid literal for int() with base 10: ' '","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02970\/Python\/s626799708.py\", line 1, in \n n, d = map(int, input())\nValueError: invalid literal for int() with base 10: ' '\n","stdout":null} {"problem_id":"p02970","language":"Python","original_status":"Runtime Error","pass":"n, d = [int(x) for x in input().split()]\n\nfor i in range(n):\n if (2 * d + 1) * i >= n:\n ans = i\n break\nprint(ans)\n","fail":"n, d = [int(x) for x in input().split()]\n\nfor i in range(n + 1):\n if (2 * d + 1) * i >= n:\n ans = i\n break\n\nprint(ans)\n","change":"replace","i1":2,"i2":6,"j1":2,"j2":7,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p02970","language":"Python","original_status":"Runtime Error","pass":"import math\n\ninputted = list(map(int, input()))\nN = inputted[0]\nD = inputted[1]\n\nmonitor = (D + 1) * 2\nanswer = math.ceil(N \/ monitor)\n\nprint(answer)\n","fail":"import math\n\ninputted = list(map(int, input().split()))\nN = inputted[0]\nD = inputted[1]\n\nmonitor = D * 2 + 1\nanswer = math.ceil(N \/ monitor)\n\nprint(answer)\n","change":"replace","i1":2,"i2":7,"j1":2,"j2":7,"error":"ValueError: invalid literal for int() with base 10: ' '","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02970\/Python\/s590297145.py\", line 3, in \n inputted = list(map(int, input()))\nValueError: invalid literal for int() with base 10: ' '\n","stdout":null} {"problem_id":"p02971","language":"Python","original_status":"Time Limit Exceeded","pass":"# -*- coding: utf-8 -*-\n\nn = int(input())\na = [\"\" for _ in range(n)]\n\nfor i in range(n):\n a[i] = int(input())\n\n\nans = [\"\" for _ in range(n)]\nfor i in range(n):\n a_test = a[:]\n del a_test[i]\n ans[i] = max(a_test)\n\n\nfor i in range(n):\n print(ans[i])\n","fail":"# -*- coding: utf-8 -*-\n\nn = int(input())\na = [int(input()) for _ in range(n)]\n\nmax_a = max(a)\nb = a[:]\nb.remove(max_a)\nmax_b = max(b)\n\nif max_a == max_b:\n for i in range(n):\n print(max_a)\nelse:\n idx = a.index(max_a)\n for i in range(n):\n if idx == i:\n print(max_b)\n else:\n print(max_a)\n","change":"replace","i1":3,"i2":18,"j1":3,"j2":20,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02971","language":"Python","original_status":"Runtime Error","pass":"N = int(input())\na = []\nb = 0\na.append(int(input()))\n# for i in range(N):\n\nfor i in range(N):\n b = a[i]\n a[i] = 0\n print(max(a))\n a[i] = b\n","fail":"N = int(input())\na = []\nb = []\na_max = 0\na_second = 0\n\nfor i in range(N):\n a.append(int(input()))\n\nb = a[:]\na.sort(reverse=True)\n\na_max = a[0]\na_second = a[1]\n\nfor i in range(N):\n if b[i] == a_max:\n print(a_second)\n else:\n print(a_max)\n","change":"replace","i1":2,"i2":11,"j1":2,"j2":20,"error":"IndexError: list index out of range","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02971\/Python\/s053988240.py\", line 8, in \n b = a[i]\nIndexError: list index out of range\n","stdout":"0\n"} {"problem_id":"p02971","language":"Python","original_status":"Time Limit Exceeded","pass":"import sys\nimport numpy as np\n\ninput = sys.stdin.readline\nn = int(input())\ns = list(int(input()) for _ in range(n))\ni = 0\nmaxn = 0\ns2 = []\nfor i in range(n):\n s2 = s.copy()\n del s2[i]\n print(np.max(np.array(s2)))\n i += 1\n","fail":"n = int(input())\ns = list(int(input()) for _ in range(n))\ni = 0\nsort_s = sorted(s)\n\nfor i in s:\n if i == sort_s[-1]:\n print(sort_s[-2])\n else:\n print(sort_s[-1])\n","change":"replace","i1":0,"i2":14,"j1":0,"j2":10,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02971","language":"Python","original_status":"Time Limit Exceeded","pass":"def main(n: int, a: list):\n for i in range(n):\n t = a.copy()\n t[i] = 0\n\n print(max(t))\n\n\nif __name__ == \"__main__\":\n n = int(input())\n a = [int(input()) for _ in range(n)]\n\n main(n, a)\n","fail":"def main(n: int, a: list):\n a_max, a_second = sorted(a, reverse=True)[:2]\n\n for i in range(n):\n if a[i] != a_max:\n print(a_max)\n else:\n print(a_second)\n\n\nif __name__ == \"__main__\":\n n = int(input())\n a = [int(input()) for _ in range(n)]\n\n main(n, a)\n","change":"replace","i1":1,"i2":6,"j1":1,"j2":8,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02971","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = [int(input()) for _ in range(n)]\nb, c = sorted(a)[-2:]\nfor i in range(n):\n print(b if a.index(c) == i else c)\n","fail":"n = int(input())\na = [int(input()) for _ in range(n)]\nb, c = sorted(a)[-2:]\nj = a.index(c)\nfor i in range(n):\n print((c, b)[i == j])\n","change":"replace","i1":3,"i2":5,"j1":3,"j2":6,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02971","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = [int(input()) for _ in range(n)]\nmx = []\nfor i in range(n):\n x = a.pop(i)\n mx.append(max(a))\n a.insert(i, x)\nfor i in range(n):\n print(mx[i])\n","fail":"import copy\n\nn = int(input())\na = [int(input()) for _ in range(n)]\ns = copy.copy(a)\ns.sort(reverse=True)\nfirst = s[0]\nsecond = s[1]\nmx = []\nfor i in range(n):\n if a[i] == first:\n mx.append(second)\n else:\n mx.append(first)\nfor i in range(n):\n print(mx[i])\n","change":"replace","i1":0,"i2":7,"j1":0,"j2":14,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02971","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nL = [int(input()) for _ in range(N)]\n\nfor i in range(N):\n print(max(L[:i] + L[i + 1 :]))\n","fail":"N = int(input())\nL = [int(input()) for _ in range(N)]\n\nLs = sorted(L, reverse=True)\nfor i in range(N):\n if L[i] == Ls[0]:\n print(Ls[1])\n else:\n print(Ls[0])\n","change":"replace","i1":3,"i2":5,"j1":3,"j2":9,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02971","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = [int(input()) for _ in range(n)]\nb = []\nfor i in range(n):\n b = sorted(a.copy(), reverse=True)\n if a[i] == b[0]:\n print(b[1])\n else:\n print(b[0])\n","fail":"n = int(input())\na = [int(input()) for _ in range(n)]\nb = sorted(a.copy(), reverse=True)\nfor i in range(n):\n if a[i] == b[0]:\n print(b[1])\n else:\n print(b[0])\n","change":"replace","i1":2,"i2":5,"j1":2,"j2":4,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02971","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = [int(input()) for i in range(n)]\nb = sorted(a)\nfor i in range(n):\n\n if max(a) > a[i]:\n print(max(a))\n else:\n if a.count(a[i]) > 1:\n print(a[i])\n else:\n print(b[-2])\n","fail":"n = int(input())\na = [int(input()) for i in range(n)]\nb = sorted(a)\nmax_a = max(a)\nmax_cnt = a.count(max_a)\nfor i in range(n):\n\n if max_a > a[i]:\n print(max_a)\n else:\n if max_cnt > 1:\n print(a[i])\n else:\n print(b[-2])\n","change":"replace","i1":3,"i2":9,"j1":3,"j2":11,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02971","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = [int(input()) for _ in range(N)]\n\nfor i in range(N):\n A_copy = A[:]\n removed_A = A_copy.pop(i)\n print(max(A_copy))\n","fail":"N = int(input())\nA = [int(input()) for _ in range(N)]\nsorted_A = sorted(A[:])\n\nfor i in range(N):\n if A[i] == sorted_A[-1]:\n print(sorted_A[-2])\n else:\n print(sorted_A[-1])\n","change":"replace","i1":2,"i2":7,"j1":2,"j2":9,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02971","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = [int(input()) for _ in range(n)]\n\nfor i in range(n):\n t = a[:]\n t.pop(i)\n print(max(t))\n","fail":"n = int(input())\nmaxindex = maxvalue = 0\na = []\nfor i in range(n):\n _a = int(input())\n if maxvalue <= _a:\n maxvalue = _a\n maxindex = i\n a.append(_a)\n\nfor i in range(n):\n if i != maxindex:\n print(maxvalue)\n continue\n t = a[:]\n t.pop(i)\n print(max(t))\n","change":"replace","i1":1,"i2":4,"j1":1,"j2":14,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02971","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = []\nfor _ in range(n):\n a.append(int(input()))\n\nsa = sorted(a)\nfor i in range(n):\n val = a[i]\n idx = sa.index(val)\n sa.pop(idx)\n print(sa[-1])\n sa.insert(idx, val)\n","fail":"n = int(input())\na = []\nfor _ in range(n):\n a.append(int(input()))\n\nsa = sorted(a)\nmx = sa[-1]\nfor val in a:\n if val != mx:\n print(sa[-1])\n else:\n print(sa[-2])\n","change":"replace","i1":6,"i2":12,"j1":6,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02971","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\nA = [int(input()) for i in range(n)]\n\nfor i in range(n):\n tmp = A[:]\n del tmp[i]\n print(max(tmp))\n","fail":"n = int(input())\nA = [int(input()) for i in range(n)]\ntmp = sorted(A, reverse=True)\nMax = tmp[0]\nSecond = tmp[1]\nfor i in range(n):\n if A[i] != Max:\n print(Max)\n else:\n print(Second)\n","change":"replace","i1":2,"i2":7,"j1":2,"j2":10,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02971","language":"Python","original_status":"Time Limit Exceeded","pass":"# -*- coding: utf-8 -*-\nn = int(input())\na = [int(input()) for _ in range(n)]\na_unique = list(sorted(set(a), reverse=True))\nmax_value = max(a_unique)\nfor i in range(n):\n current_value = a.pop(i)\n if max_value in a:\n print(max_value)\n else:\n print(a_unique[1])\n a.insert(i, current_value)\n","fail":"# -*- coding: utf-8 -*-\nn = int(input())\na = [int(input()) for _ in range(n)]\na_unique = list(sorted(set(a), reverse=True))\nmax_value = a_unique[0]\nmax_value_count = a.count(max_value)\n\nif max_value_count == 1:\n for i in range(n):\n if a[i] == max_value:\n print(a_unique[1])\n else:\n print(max_value)\nelse:\n for i in range(n):\n print(max_value)\n","change":"replace","i1":4,"i2":12,"j1":4,"j2":16,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02971","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = [int(input()) for v in range(N)]\n\nfor i in range(N):\n L = A[:]\n A.pop(i)\n m = max(A)\n print(m)\n A = L[:]\n","fail":"N = int(input())\nA = [int(input()) for v in range(N)]\n\nL = A[:]\nm1 = max(A)\nm1i = A.index(m1)\nA.pop(m1i)\nm2 = max(A)\nm2i = A.index(m2)\nA.pop(m2i)\n\nfor i in range(N):\n if L[i] == m1:\n print(m2)\n else:\n print(m1)\n","change":"replace","i1":3,"i2":9,"j1":3,"j2":16,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02971","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\ninputs = [int(input()) for _ in range(N)]\n\nfor i in range(N):\n sorted_inputs = sorted(inputs, reverse=True)\n if sorted_inputs[0] == inputs[i]:\n print(sorted_inputs[1])\n else:\n print(sorted_inputs[0])\n","fail":"N = int(input())\ninputs = [int(input()) for _ in range(N)]\n\nsorted_inputs = sorted(inputs, reverse=True)\nfor i in range(N):\n if sorted_inputs[0] == inputs[i]:\n print(sorted_inputs[1])\n else:\n print(sorted_inputs[0])\n","change":"replace","i1":3,"i2":5,"j1":3,"j2":5,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02971","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = [int(input()) for i in range(n)]\n\nfor i in range(n):\n b = a[:]\n del b[i]\n print(max(b))\n","fail":"n = int(input())\na = [int(input()) for i in range(n)]\nb = sorted(a)\n\nfor A in a:\n if A == b[n - 1]:\n print(b[n - 2])\n else:\n print(b[n - 1])\n","change":"replace","i1":2,"i2":7,"j1":2,"j2":9,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02971","language":"Python","original_status":"Time Limit Exceeded","pass":"import copy\n\n\ndef main():\n n = int(input())\n a = []\n for _ in range(n):\n a.append(int(input()))\n for i in range(len(a)):\n b = copy.deepcopy(a)\n b.pop(i)\n print(max(b))\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"def main():\n n = int(input())\n a = []\n for _ in range(n):\n a.append(int(input()))\n b = sorted(a)\n for i in range(len(a)):\n if a[i] == b[-1]:\n print(b[-2])\n else:\n print(b[-1])\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":0,"i2":12,"j1":0,"j2":11,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02971","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = [int(input()) for _ in range(N)]\n\nfor i in range(N):\n A_num = A.pop(i)\n print(max(A))\n A.insert(i, A_num)\n","fail":"n = int(input())\na = [int(input()) for _ in range(n)]\nb = sorted(a)[::-1]\nmx = b[0]\nmx2 = b[1]\n\nfor i in a:\n if i == mx:\n print(mx2)\n else:\n print(mx)\n","change":"replace","i1":0,"i2":7,"j1":0,"j2":11,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02971","language":"Python","original_status":"Time Limit Exceeded","pass":"import copy\n\nn = int(input())\n\na = [0] * n\n\nfor i in range(n):\n a[i] = int(input())\n\n# a_s = set(a)\n\nfor i in range(n):\n tmp = copy.deepcopy(a)\n # tmp.discard(a[i])\n del tmp[i]\n print(max(tmp))\n","fail":"import copy\n\nn = int(input())\n\na = [0] * n\n\nfor i in range(n):\n a[i] = int(input())\n\na_sort = sorted(a, reverse=True)\n\nfor i in range(n):\n if a[i] == a_sort[0]:\n print(a_sort[1])\n else:\n print(a_sort[0])\n","change":"replace","i1":9,"i2":16,"j1":9,"j2":16,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02971","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = list(int(input()) for _ in range(N))\n\nA_sort = sorted(A)\n\nfor i in range(N):\n v = A[i]\n if v < max(A):\n print(max(A))\n else:\n print(A_sort[-2])\n","fail":"N = int(input())\nA = list(int(input()) for _ in range(N))\nm = max(A)\n\nA_sorted = sorted(A)\n\nfor i in range(N):\n v = A[i]\n if v < m:\n print(m)\n else:\n print(A_sorted[-2])\n","change":"replace","i1":2,"i2":11,"j1":2,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02971","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = [int(input()) for i in range(N)]\n\nfor i in range(N):\n max = 0\n for j in range(N):\n if i != j and A[j] > max:\n max = A[j]\n print(max)\n","fail":"N = int(input())\nA = [int(input()) for i in range(N)]\n\nNo1 = 0\nNo2 = 0\nfor i in range(N):\n if A[i] > No1:\n No2 = No1\n No1 = A[i]\n elif A[i] > No2:\n No2 = A[i]\n\nfor i in range(N):\n if A[i] == No1:\n print(No2)\n else:\n print(No1)\n","change":"replace","i1":3,"i2":9,"j1":3,"j2":17,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02971","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA_LIST = []\n\nfor _ in range(N):\n A = int(input())\n A_LIST.append(A)\n\nfor i in range(N):\n temp = A_LIST[i]\n A_LIST[i] = 0\n print(max(A_LIST))\n A_LIST[i] = temp\n","fail":"N = int(input())\nA_LIST = []\n\nfor _ in range(N):\n A = int(input())\n A_LIST.append(A)\n\nsorted_A_LIST = sorted(A_LIST)\nlargest = sorted_A_LIST[-1]\nsecond_largest = sorted_A_LIST[-2]\n\nfor i in range(N):\n if A_LIST[i] < largest:\n print(largest)\n else:\n print(second_largest)\n","change":"replace","i1":7,"i2":12,"j1":7,"j2":16,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02971","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = [int(input()) for i in range(N)]\n\nfor j in range(N):\n p = A.pop(j)\n print(max(A))\n A.insert(j, p)\n","fail":"N = int(input())\nA = [int(input()) for i in range(N)]\n\nmax1 = [A.index(max(A)), max(A)]\np = A.pop(A.index(max(A)))\nmax2 = max(A)\nans = [max2 if j == max1[0] else max1[1] for j in range(N)]\nfor k in range(N):\n print(ans[k])\n","change":"replace","i1":3,"i2":7,"j1":3,"j2":9,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02971","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\nnums = [None] * n\n\nfor i in range(n):\n nums[i] = int(input())\nsorted_nums = sorted(nums)\n\nfor i in range(n):\n if sorted_nums.index(nums[i]) == n - 1:\n max_val = sorted_nums[n - 2]\n else:\n max_val = sorted_nums[n - 1]\n print(max_val)\n","fail":"n = int(input())\nnums = [None] * n\n\nfor i in range(n):\n nums[i] = int(input())\nsorted_nums = sorted(nums)\n\nfor i in range(n):\n max_val = sorted_nums[n - 1]\n if nums[i] == max_val:\n max_val = sorted_nums[n - 2]\n print(max_val)\n","change":"replace","i1":8,"i2":12,"j1":8,"j2":11,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02971","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = [int(input()) for i in range(n)]\n\nfor i in range(n):\n temp = a[i]\n a[i] = 0\n print(max(a))\n a[i] = temp\n","fail":"n = int(input())\na = [int(input()) for i in range(n)]\n\naa = sorted(a)\nfirst = aa[-1]\nsecond = aa[-2]\n\nfor i in range(n):\n if a[i] != first:\n print(first)\n else:\n print(second)\n","change":"replace","i1":3,"i2":8,"j1":3,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02971","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\nm = 0\na = []\nfor _ in range(n):\n _a = int(input())\n m = max(m, _a)\n a.append(_a)\n\nfor i in range(n):\n if a[i] == m:\n t = a[:]\n t.pop(i)\n print(max(t))\n else:\n print(m)\n","fail":"n = int(input())\na = [int(input()) for _ in range(n)]\n\nt = sorted(a, reverse=True)\n\nfor i in range(n):\n if a[i] == t[0]:\n print(t[1])\n else:\n print(t[0])\n","change":"replace","i1":1,"i2":15,"j1":1,"j2":10,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02971","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = [int(input()) for _ in range(n)]\n\nfor i in range(n):\n ac = a.copy()\n del ac[i]\n print(max(ac))\n","fail":"n = int(input())\na = [int(input()) for _ in range(n)]\ns, f = sorted(a)[-2:]\n\nfor ai in a:\n print(f if ai != f else s)\n","change":"replace","i1":2,"i2":7,"j1":2,"j2":6,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02971","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\na = []\nfor _ in range(N):\n a.append(int(input()))\ntmp = 0\nidx = 0\nwhile idx < N:\n tmp, a[idx] = a[idx], tmp\n print(max(a))\n tmp, a[idx] = a[idx], tmp\n idx += 1\n","fail":"N = int(input())\na = []\nfor _ in range(N):\n a.append(int(input()))\na_sorted = sorted(a)\nmax_a = a_sorted.pop()\nsecond_a = a_sorted.pop()\nif max_a == second_a:\n for _ in range(N):\n print(max_a)\nelse:\n idx = 0\n while idx < N:\n if a[idx] == max_a:\n print(second_a)\n else:\n print(max_a)\n idx += 1\n","change":"replace","i1":4,"i2":11,"j1":4,"j2":18,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02971","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\nsemi_max = 0\naa = []\nfor i in range(n):\n a = int(input())\n if i > 0:\n if a >= semi_max and a < max(aa):\n semi_max = a\n elif a == max(aa):\n semi_max = max(aa)\n aa.append(a)\n # print(semi_max)\nfor each in aa:\n print(max(aa) if each <= semi_max else semi_max)\n","fail":"n = int(input())\naa = [int(input()) for _ in range(n)]\naho = sorted(aa)\nfor a in aa:\n print(aho[-1] if a < aho[-1] else aho[-2])\n","change":"replace","i1":1,"i2":14,"j1":1,"j2":5,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02971","language":"Python","original_status":"Runtime Error","pass":"from heapq import heappush, heappop\n\nN = int(input())\nA = [int(input()) for i in range(N)]\nhq = []\nfor i in range(N):\n heappush(hq, -A[i])\nmax1 = -heappop(hq)\nwhile True:\n max2 = -heappop(hq)\n if max2 != max1:\n break\nans = [0] * N\nfor i in range(N):\n if A[i] == max1:\n ans[i] = max2\n else:\n ans[i] = max1\nprint(*ans, sep=\"\\\\n\")\n","fail":"from heapq import heappush, heappop\n\nN = int(input())\nA = [int(input()) for i in range(N)]\nhq = []\nfor i in range(N):\n heappush(hq, -A[i])\nmax1 = -heappop(hq)\nmax2 = -heappop(hq)\nans = [0] * N\nfor i in range(N):\n if A[i] == max1:\n ans[i] = max2\n else:\n ans[i] = max1\nprint(*ans, sep=\"\\\\n\")\n","change":"replace","i1":8,"i2":12,"j1":8,"j2":9,"error":"0","stderr":null,"stdout":"4\n3\n4\n"} {"problem_id":"p02971","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = []\nfor _ in range(n):\n a.append(int(input()))\n\nfor _ in range(n):\n val = a.pop(0)\n print(max(a))\n a.append(val)\n","fail":"n = int(input())\na = []\nfor _ in range(n):\n a.append(int(input()))\n\ndesc = sorted(list(set(a)), reverse=True)\nmax = desc[0]\nlarge_2 = desc[1] if len(desc) > 1 else 0\n\nif a.count(max) == 1:\n for val in a:\n if val == max:\n print(large_2)\n else:\n print(max)\nelse:\n for _ in range(n):\n print(max)\n","change":"replace","i1":5,"i2":9,"j1":5,"j2":18,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02971","language":"Python","original_status":"Time Limit Exceeded","pass":"A = [int(input()) for i in range(int(input()))]\nmax_A = max(A)\nfor i in A:\n if i == max_A:\n print(sorted(A)[-2])\n else:\n print(max_A)\n","fail":"A = [int(input()) for i in range(int(input()))]\nfirst = max(A)\nsecond = sorted(A)[-2]\nfor i in A:\n if i == first:\n print(second)\n else:\n print(first)\n","change":"replace","i1":1,"i2":7,"j1":1,"j2":8,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02971","language":"Python","original_status":"Runtime Error","pass":"n = int(input())\na = [int(input()) for i in range(n)]\nmaxi = max(a)\nfor i in range(n):\n if a[i] != maxi:\n print(maxi)\n else:\n b = a.pop(a[i])\n print(max(a))\n","fail":"n = int(input())\na = [int(input()) for i in range(n)]\nmaxi = max(a)\ns = sorted(a, reverse=True)\n\nfor i in range(n):\n if a[i] != maxi:\n print(maxi)\n else:\n print(s[1])\n","change":"replace","i1":3,"i2":9,"j1":3,"j2":10,"error":"IndexError: pop index out of range","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02971\/Python\/s556962228.py\", line 8, in \n b = a.pop(a[i])\nIndexError: pop index out of range\n","stdout":"4\n"} {"problem_id":"p02971","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\n\nA = []\n\n[A.append(int(input())) for x in range(N)]\n\nmax_num = 0\n\nfor i in range(N):\n for j in range(N):\n if j != i and max_num < A[j]:\n max_num = A[j]\n print(max_num)\n max_num = 0\n","fail":"N = int(input())\n\nA = []\n\n[A.append(int(input())) for x in range(N)]\n\nmax_num = max(A)\nnum = A.index(max(A))\nA[num] = 0\n\nst_max_num = max(A)\n\nfor i in range(num):\n print(max_num)\nprint(st_max_num)\n\nfor i in range(num + 1, N):\n print(max_num)\n","change":"replace","i1":6,"i2":14,"j1":6,"j2":18,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02971","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = []\nfor _ in range(n):\n a.append(int(input()))\n\nfor i in range(n):\n _a = a.copy()\n _a.pop(i)\n print(max(_a))\n","fail":"n = int(input())\na = []\nfor _ in range(n):\n a.append(int(input()))\n\nm = max(a)\nidxs = [i for i, v in enumerate(a) if v == m]\n\nif len(idxs) > 1:\n for i in range(n):\n print(m)\n\nif len(idxs) == 1:\n idx = idxs[0]\n for i in range(n):\n if idx == i:\n _a = a.copy()\n _a.pop(i)\n print(max(_a))\n else:\n print(m)\n","change":"replace","i1":5,"i2":9,"j1":5,"j2":21,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02971","language":"Python","original_status":"Time Limit Exceeded","pass":"import copy\n\nN = int(input())\nA = []\nfor _ in range(N):\n A.append(int(input()))\n\nfor i in range(N):\n a = copy.deepcopy(A)\n a.remove(A[i])\n print(max(a))\n","fail":"import copy\n\nN = int(input())\nA = []\nfor _ in range(N):\n A.append(int(input()))\n\nresult = max(A)\nind = A.index(result)\n\nfor i in range(N):\n if i == ind:\n a = copy.deepcopy(A)\n a.remove(result)\n print(max(a))\n else:\n print(result)\n","change":"replace","i1":7,"i2":11,"j1":7,"j2":17,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02971","language":"Python","original_status":"Time Limit Exceeded","pass":"def solve():\n n = int(input())\n a = list(int(input()) for _ in range(n))\n for idx in range(n):\n d = max([v for i, v in enumerate(a) if i != idx])\n print(d)\n\n\nif __name__ == \"__main__\":\n solve()\n","fail":"def solve():\n n = int(input())\n a = list(int(input()) for _ in range(n))\n ranking = sorted(a)[::-1]\n first = ranking[0]\n second = ranking[1]\n first_idx = a.index(first)\n for idx in range(n):\n if idx == first_idx:\n print(second)\n else:\n print(first)\n\n\nif __name__ == \"__main__\":\n solve()\n","change":"replace","i1":3,"i2":6,"j1":3,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02971","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na_list = [int(input()) for i in range(n)]\nfor i in range(n):\n dum = a_list[i]\n a_list[i] = 0\n print(max(a_list))\n a_list[i] = dum\n","fail":"n = int(input())\na_list = [int(input()) for i in range(n)]\na_list_sort = sorted(a_list)\na_list_max1 = max(a_list)\na_list_max2 = a_list_sort[-2]\nfor i in range(n):\n if a_list_max1 == a_list[i]:\n print(a_list_max2)\n else:\n print(a_list_max1)\n","change":"replace","i1":2,"i2":7,"j1":2,"j2":10,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02971","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\nind = []\nm = 0\nk = 0\nfor i in range(n):\n a = int(input())\n if m == a:\n ind.append(i)\n k = a\n elif m < a:\n k, m = m, a\n ind = [i]\n elif k < a:\n k = a\nprint(\"\\\\n\".join(map(str, [k if i in ind else m for i in range(n)])))\n","fail":"n = int(input())\nind = []\nm = 0\nk = 0\nfor i in range(n):\n a = int(input())\n if m == a:\n ind = -1\n elif m < a:\n k, m = m, a\n ind = i\n elif k < a:\n k = a\nif ind == -1:\n print(\"\\\\n\".join(map(str, [m for i in range(n)])))\nelse:\n print(\"\\\\n\".join(map(str, [k if i == ind else m for i in range(n)])))\n","change":"replace","i1":7,"i2":15,"j1":7,"j2":17,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02971","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = [int(input()) for i in range(N)]\n# maxA = max(A)\nfor x in range(len(A)):\n a_tmp = A[x]\n A[x] = 0\n print(max(A))\n A[x] = a_tmp\n","fail":"N = int(input())\nA = [int(input()) for i in range(N)]\nmaxA = max(A)\ncopy_A = A[:]\ncopy_A.remove(maxA)\nsecondA = max(copy_A)\nfor x in A:\n if x == maxA:\n print(secondA)\n else:\n print(maxA)\n","change":"replace","i1":2,"i2":8,"j1":2,"j2":11,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02971","language":"Python","original_status":"Time Limit Exceeded","pass":"import numpy as np\n\nS = input()\nN = int(S)\n\nA = np.zeros([N])\nA_temp = np.zeros([N])\n\nfor i in range(0, N, 1):\n A[i] = int(input())\n\nmax = 0\n\nindex_max = np.argmax(A)\n\nfor i in range(0, N, 1):\n A_temp = np.copy(A)\n if index_max != i:\n print(int(A_temp[index_max]))\n else:\n A_temp[i] = 0\n print(int(np.amax(A_temp)))\n","fail":"import numpy as np\n\nS = input()\nN = int(S)\n\nA = np.zeros([N])\nA_temp = np.zeros([N])\n\nfor i in range(0, N, 1):\n A[i] = int(input())\n\nmax = 0\n\nindex_max = np.argmax(A)\nA_temp = np.copy(A)\nA_temp[index_max] = 0\nindex_max_second = np.argmax(A_temp)\n\nresult = np.full(N, A[index_max])\nresult[index_max] = A[index_max_second]\n\nfor i in range(0, N, 1):\n print(int(result[i]))\n","change":"replace","i1":14,"i2":22,"j1":14,"j2":23,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02971","language":"Python","original_status":"Time Limit Exceeded","pass":"#!\/usr\/bin\/env python3\n# -*- coding: utf-8 -*-\nfrom copy import copy\n\n\ndef main():\n N = int(input())\n A = [int(input()) for _ in range(N)]\n for i in range(N):\n tmp = copy(A)\n tmp[i] = 0\n print(max(tmp))\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"#!\/usr\/bin\/env python3\n# -*- coding: utf-8 -*-\nfrom copy import copy\n\n\ndef main():\n N = int(input())\n A = [int(input()) for _ in range(N)]\n A_max = copy(A)\n A_max.sort(reverse=True)\n\n for a in A:\n if a == A_max[0]:\n print(A_max[1])\n else:\n print(A_max[0])\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":8,"i2":12,"j1":8,"j2":16,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02971","language":"Python","original_status":"Time Limit Exceeded","pass":"import copy\n\nn = int(input())\nA = [int(input()) for _ in range(n)]\n\nfor i in range(n):\n tmp_list = copy.deepcopy(A)\n tmp_list.pop(i)\n print(max(tmp_list))\n","fail":"import copy\n\nn = int(input())\nA = [int(input()) for _ in range(n)]\n\nA_sorted = sorted(A, reverse=True)\n\nfor i in range(n):\n if A[i] == A_sorted[0]:\n print(A_sorted[1])\n else:\n print(A_sorted[0])\n","change":"replace","i1":5,"i2":9,"j1":5,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02971","language":"Python","original_status":"Time Limit Exceeded","pass":"# coding: utf-8\nN = int(input())\nA = [int(input()) for _ in range(N)]\nfor i in range(N):\n B = A[:]\n B.pop(i)\n print(max(B))\n","fail":"# coding: utf-8\nN = int(input())\nA = [] # value\nfor i in range(N):\n A.append(int(input()))\nB = A[:]\nB.sort()\none = B[-1]\ntwo = B[-2]\nfor i in range(N):\n if A[i] == one:\n print(two)\n else:\n print(one)\n","change":"replace","i1":2,"i2":7,"j1":2,"j2":14,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02971","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = [int(input()) for _ in range(N)]\nfor i in range(N):\n tmp = A.copy()\n tmp.pop(i)\n tmp.sort()\n print(tmp[-1])\n","fail":"N = int(input())\nA = [int(input()) for _ in range(N)]\nAs = sorted(A)\nfor i in range(N):\n if A[i] == As[-1]:\n print(As[-2])\n else:\n print(As[-1])\n","change":"replace","i1":2,"i2":7,"j1":2,"j2":8,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02971","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = [int(input()) for i in range(n)]\n\n\nfor i in range(n):\n ret = a[:]\n ret.pop(i)\n print(max(ret))\n","fail":"n = int(input())\na = [int(input()) for i in range(n)]\n\na_s = sorted(a, reverse=True)\nfor i in range(n):\n if a[i] == a_s[0]:\n print(a_s[1])\n else:\n print(a_s[0])\n","change":"replace","i1":3,"i2":8,"j1":3,"j2":9,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02971","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = [int(input()) for i in range(N)]\nB = []\nfor i in range(N):\n temp = A[i]\n A[i] = -999\n print(max(A))\n A[i] = temp\n","fail":"N = int(input())\nA = [int(input()) for i in range(N)]\nB = sorted(A)\n\nfor i in range(N):\n if B[-1] == A[i]:\n print(B[-2])\n else:\n print(B[-1])\n","change":"replace","i1":2,"i2":8,"j1":2,"j2":9,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02971","language":"Python","original_status":"Time Limit Exceeded","pass":"def test():\n n = int(input())\n a = [int(input()) for i in range(n)]\n s = 0\n for i in range(n):\n s = a[i]\n a[i] = 0\n print(max(a))\n a[i] = s\n\n\nif __name__ == \"__main__\":\n test()\n","fail":"def test():\n n = int(input())\n s = 0\n t = 0\n index_ = 0\n for i in range(n):\n a = int(input())\n if s < a:\n index_ = i\n s = a\n elif t < a and a <= s:\n t = a\n for i in range(n):\n if index_ == i:\n print(t)\n else:\n print(s)\n\n\nif __name__ == \"__main__\":\n test()\n","change":"replace","i1":2,"i2":9,"j1":2,"j2":17,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02971","language":"Python","original_status":"Time Limit Exceeded","pass":"import copy\n\nn = int(input())\nlst = []\nfor _ in range(n):\n lst.append(int(input()))\nclean_lst = copy.deepcopy(lst)\n\nfor i in clean_lst:\n lst.remove(i)\n print(max(lst))\n lst.append(i)\n","fail":"import copy\n\nn = int(input())\nlst = []\nfor _ in range(n):\n lst.append(int(input()))\nclean_lst = copy.deepcopy(lst)\n\nm1 = max(lst)\nlst.remove(m1)\nm2 = max(lst)\n\nfor i in clean_lst:\n print(m1 if i != m1 else m2)\n","change":"replace","i1":8,"i2":12,"j1":8,"j2":14,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02971","language":"Python","original_status":"Runtime Error","pass":"import itertools\n\nn = int(input())\na = [int(input()) for i in range(n)]\n\nmax_list = [0] + list(itertools.accumulate(a, func=max))\nmax_list_r = [0, *itertools.accumulate(reversed(a), func=max)][::-1]\n# print(max_list)\n# print(max_list_r)\nfor i in range(n):\n print(max(max_list[i], max_list_r[i + 1]))\n","fail":"import itertools\n\nn = int(input())\na = [int(input()) for i in range(n)]\n\nmax_list = [0] + list(itertools.accumulate(a, func=max))\nmax_list_r = ([0] + list(itertools.accumulate(reversed(a), func=max)))[::-1]\nfor i in range(n):\n print(max(max_list[i], max_list_r[i + 1]))\n","change":"replace","i1":6,"i2":9,"j1":6,"j2":7,"error":"0","stderr":null,"stdout":"4\n3\n4\n"} {"problem_id":"p02971","language":"Python","original_status":"Time Limit Exceeded","pass":"import numpy as np\n\nN = int(input())\nA = np.array([input() for i in range(N)])\n\nB = np.array([])\nfor i in range(N):\n print(max(np.delete(A.copy(), i)))\n","fail":"N = int(input())\nA = [int(input()) for i in range(N)]\n\na = max(A)\nb = sorted(A)[-2]\nfor i in A:\n print(b if i == a else a)\n","change":"replace","i1":0,"i2":8,"j1":0,"j2":7,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02971","language":"Python","original_status":"Time Limit Exceeded","pass":"# -*- coding: utf-8 -*-\nimport copy\n\n# input\nN = int(input())\nA = list()\nfor _ in range(N):\n A.append(int(input()))\n\n# solve & output\nfor i in range(N):\n tmp = copy.copy(A)\n del tmp[i]\n print(max(tmp))\n","fail":"# -*- coding: utf-8 -*-\nimport copy\n\n# input\nN = int(input())\nA = list()\nfor _ in range(N):\n A.append(int(input()))\n\n# solve & output\nans = copy.copy(A)\nans.sort()\nm = ans[-1]\nfor i in range(N):\n if A[i] != m:\n print(m)\n else:\n print(ans[N - 2])\n","change":"replace","i1":10,"i2":14,"j1":10,"j2":18,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02971","language":"Python","original_status":"Runtime Error","pass":"def main():\n N = int(input())\n A = [int(input()) for _ in range(N)]\n\n max_value = max(A)\n max_index = A.index(max_value)\n\n for i in range(N):\n if i != max_index:\n print(max_value)\n else:\n if i == 0:\n print(max(A[1:]))\n elif i == N:\n print(max(A[:N]))\n else:\n print(max(max(A[:i]), max(A[i + 1 :])))\n\n return\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"def main():\n N = int(input())\n A = [int(input()) for _ in range(N)]\n\n max_value = max(A)\n max_index = A.index(max_value)\n\n for i in range(N):\n if i != max_index:\n print(max_value)\n else:\n if i == 0:\n print(max(A[1:]))\n elif i == N - 1:\n print(max(A[: N - 1]))\n else:\n print(max(max(A[:i]), max(A[i + 1 :])))\n\n return\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":13,"i2":15,"j1":13,"j2":15,"error":"0","stderr":null,"stdout":"4\n3\n4\n"} {"problem_id":"p02971","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nnums = [int(input()) for _ in range(N)]\n\nall_max = max(nums)\nfor num in range(N):\n if nums[num] == all_max:\n new_nums = list(nums)\n new_nums.pop(num)\n print(max(new_nums))\n else:\n print(all_max)\n","fail":"N = int(input())\nnums = [int(input()) for _ in range(N)]\n\nall_max = max(nums)\n\nnew_nums = list(nums)\nnew_nums.remove(all_max)\n\nsecond_max = max(new_nums) # max\u95a2\u6570\u306ffor\u6587\u306e\u4e2d\u306b\u3044\u308c\u305a\u306b\u3001\u5148\u306b2\u756a\u76ee\u306e\u6700\u5927\u5024\u3092\u3082\u3068\u3081\u3066\u304a\u304f\n\nfor num in range(N):\n if nums[num] == all_max:\n print(second_max)\n else:\n print(all_max)\n","change":"replace","i1":4,"i2":9,"j1":4,"j2":13,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02972","language":"Python","original_status":"Runtime Error","pass":"def make_divisors(n: int) -> list:\n divisors = []\n\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\n return divisors\n\n\nN = int(input())\nA = [int(i) for i in input().split()]\n\nans = []\nfor i in reversed(range(N)):\n if A[i] == 1:\n ans.append(i + 1)\n divisors = make_divisors(i + 1)\n for j in divisors:\n A[j + 1] = (A[j + 1] + 1) % 2\n\nif A.count(1) != 0:\n print(len(ans))\n for i in reversed(range(len(ans))):\n print(ans[i])\nelse:\n print(-1)\n","fail":"N = int(input())\nA = [int(i) for i in input().split()]\nA.insert(0, 0)\n\nans = []\nfor i in reversed(range(1, N + 1)):\n if sum(A[i::i]) % 2 != A[i]:\n A[i] = (A[i] + 1) % 2\n if A[i] == 1:\n ans.append(i)\n\nprint(len(ans))\nif len(ans) > 0:\n print(*ans)\n","change":"replace","i1":0,"i2":29,"j1":0,"j2":14,"error":"0","stderr":null,"stdout":"1\n1\n"} {"problem_id":"p02972","language":"Python","original_status":"Runtime Error","pass":"#!\/usr\/bin\/env python3\n\nN = int(input().split()[0])\na_list = list(map(int, input().split()))\n\n# \u6700\u521d\u304c0\u304b\u3089\u59cb\u307e\u308b\u5834\u5408\nb_list = [0] * N\nb_list[-1] = a_list[-1]\n\nfor i in range(N):\n # \u5927\u304d\u3044\u65b9\u304b\u3089\u6c7a\u3081\u3066\u3044\u304f\n idx = N - (i + 1)\n total = 0\n for j in b_list[:: idx + 1]:\n # idx + 1\u306e\u500d\u6570\u306e\u30dc\u30fc\u30eb\u306e\u500b\u6570\u3092\u6570\u3048\u308b\n total += b_list[j]\n\n if total % (idx + 1) != a_list[idx]:\n b_list[idx] = 1\n\nidx_list = [str(i + 1) for i, b in enumerate(b_list) if b == 1]\nans = sum(b_list)\nprint(ans)\nprint(\" \".join(idx_list))\n","fail":"#!\/usr\/bin\/env python3\n\nN = int(input().split()[0])\na_list = list(map(int, input().split()))\n\n# \u6700\u521d\u304c0\u304b\u3089\u59cb\u307e\u308b\u5834\u5408\na_list = [0] + a_list\nb_list = [0] * (N + 1)\n# \u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u304c\u305a\u308c\u308b\u306e\u304c\u3084\u3084\u3053\u3057\u3044\u306e\u3067\u3001\n# b_list[0]\u306f\u6b20\u756a\u3068\u3057\u30661\u59cb\u307e\u308a\u3067\u8003\u3048\u3066\u3044\u304f\n\nfor i in range(N):\n # \u5927\u304d\u3044\u65b9\u304b\u3089\u6c7a\u3081\u3066\u3044\u304f\n idx = N - i\n total = sum(b_list[idx : N + 1 : idx])\n\n if total % 2 != a_list[idx]:\n b_list[idx] = 1\n\nidx_list = [str(i) for i, b in enumerate(b_list) if b == 1]\nans = sum(b_list[1:])\nprint(ans)\nif ans != 0:\n print(\" \".join(idx_list))\n","change":"replace","i1":6,"i2":24,"j1":6,"j2":24,"error":"0","stderr":null,"stdout":"1\n1\n"} {"problem_id":"p02972","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nai = list(map(int, input().split()))\n\nbox = [0] * N\nv = N \/\/ 2 # \u5f8c\u534a\u90e8\u306e\u6700\u521d\u306eindex\n\nfor i in range(v, N):\n if ai[i] == 0:\n box[i] = 0\n else:\n box[i] = 1\n\nfor i in range(v - 1, -1, -1):\n s = [ai[x] == 1 for x in range(i + 1, N) if (x + 1) % (i + 1) == 0]\n cnt = s.count(True)\n if cnt & 1 == 1:\n box[i] = 0 if ai[i] & 1 == 1 else 1\n else:\n box[i] = 0 if ai[i] & 1 == 0 else 1\n\nprint(box.count(1))\nfor x in box:\n if x == 1:\n print(x)\n","fail":"N = int(input())\nai = list(map(int, input().split()))\n\nbox = [0] * N\nv = N \/\/ 2 # \u5f8c\u534a\u90e8\u306e\u6700\u521d\u306eindex\n\nfor i in range(v, N):\n if ai[i] == 0:\n box[i] = 0\n else:\n box[i] = 1\n\nfor i in range(v - 1, -1, -1):\n value = i + 1\n sum = 0\n for j in range(value * 2 - 1, N, value):\n sum += box[j]\n if sum & 1 == 1:\n box[i] = 0 if ai[i] & 1 == 1 else 1\n else:\n box[i] = 0 if ai[i] & 1 == 0 else 1\nprint(box.count(1))\nfor i in range(N):\n if box[i] == 1:\n print(i + 1)\n","change":"replace","i1":13,"i2":24,"j1":13,"j2":25,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02972","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = list(map(int, input().split()))\na = [None] + a\n\nans = set()\ncnt = [0] * (n + 1)\n\nfor i in range(n, 0, -1):\n if cnt[i] % 2 != a[i] % 2:\n ans.add(i)\n\n st = set()\n j = 1\n while j * j <= i:\n if i % j == 0:\n st.add(j)\n st.add(i \/\/ j)\n j += 1\n for d in st:\n cnt[d] += 1\n\nprint(len(ans))\nprint(*ans)\n","fail":"import sys\n\ninput = sys.stdin.readline\n\nn = int(input())\na = list(map(int, input().split()))\na = [None] + a\na = tuple(a)\n\nans = set()\ncnt = [0] * (n + 1)\n\nfor i in range(n, 0, -1):\n if cnt[i] % 2 != a[i] % 2:\n ans.add(i)\n\n st = set()\n j = 1\n while j * j <= i:\n if i % j == 0:\n st.add(j)\n st.add(i \/\/ j)\n j += 1\n for d in st:\n cnt[d] += 1\n\nprint(len(ans))\nprint(*ans)\n","change":"replace","i1":0,"i2":3,"j1":0,"j2":8,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02972","language":"Python","original_status":"Time Limit Exceeded","pass":"from sys import stdin\n\nN = int(stdin.readline().rstrip())\na = [int(x) for x in stdin.readline().rstrip().split()]\n\nans = []\nfor k in reversed(range(1, N + 1)):\n if k == 1:\n if len(ans) % 2 != a[k - 1]:\n ans.append(k)\n continue\n t = N \/\/ k\n cnt = 0\n for i in range(1, t + 1):\n if i * k in ans:\n cnt += 1\n if cnt % 2 != a[k - 1]:\n ans.append(k)\n\nx = len(ans)\nprint(x)\nif x >= 0:\n print(*ans)\n","fail":"from sys import stdin\n\nN = int(stdin.readline().rstrip())\na = [int(x) for x in stdin.readline().rstrip().split()]\n\nans = []\nfor k in reversed(range(1, N + 1)):\n if a[k - 1] == 1:\n ans.append(k)\n tmp = 1\n while tmp * tmp <= k:\n if k % tmp == 0:\n a[tmp - 1] ^= 1\n if tmp != k \/\/ tmp:\n a[k \/\/ tmp - 1] ^= 1\n tmp += 1\n\nx = len(ans)\nprint(x)\nif x >= 0:\n print(*ans)\n","change":"replace","i1":7,"i2":18,"j1":7,"j2":16,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02973","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = [int(input()) for i in range(N)]\n\nans = 1\nX = [-1]\nfor i in range(N):\n for j in range(ans):\n if X[j] < A[i]:\n X[j] = A[i]\n break\n elif j == ans - 1:\n X.append(A[i])\n ans += 1\n\nprint(ans)\n","fail":"import bisect\n\nN = int(input())\nA = [int(input()) for i in range(N)]\n\nans = 1\nX = [-A[0]]\nfor i in range(1, N):\n if -X[ans - 1] >= A[i]:\n X.append(-A[i])\n ans += 1\n else:\n pos = bisect.bisect_right(X, -A[i])\n X[pos] = -A[i]\n\nprint(ans)\n","change":"replace","i1":0,"i2":13,"j1":0,"j2":14,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02973","language":"Python","original_status":"Time Limit Exceeded","pass":"import bisect\nfrom sys import stdin\n\n\ndef main():\n N = int(stdin.readline().rstrip())\n As = [int(stdin.readline().rstrip()) for x in range(N)]\n array = []\n for A in As:\n idx = bisect.bisect_left(array, A)\n if idx == 0:\n array = [A] + array\n else:\n array[idx - 1] = A\n print(len(array))\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"import bisect\nfrom collections import deque\nfrom sys import stdin\n\n\ndef main():\n N = int(stdin.readline().rstrip())\n As = [int(stdin.readline().rstrip()) for x in range(N)]\n dq = deque([])\n for A in As:\n idx = bisect.bisect_left(dq, A)\n if idx == 0:\n dq.appendleft(A)\n else:\n dq[idx - 1] = A\n print(len(dq))\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":1,"i2":15,"j1":1,"j2":16,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02973","language":"Python","original_status":"Time Limit Exceeded","pass":"# -*- coding: utf-8 -*-\n\nN = int(input())\n\nlasts = []\n\nbefore = [int(input())]\nlasts.append(before)\n\nfor _ in range(N - 1):\n current = int(input())\n if before[0] < current:\n before[0] = current\n continue\n try:\n low = next(x for x in lasts if x[0] < current)\n low[0] = current\n except StopIteration:\n lasts.append([current])\n\nprint(len(lasts))\n","fail":"# -*- coding: utf-8 -*-\nfrom bisect import bisect_right\n\nN = int(input())\n\ncolumns = []\n\n\nfor _ in range(N):\n current = -int(input())\n index = bisect_right(columns, current)\n if len(columns) <= index:\n columns.append(current)\n else:\n columns[index] = current\n\nprint(len(columns))\n","change":"replace","i1":1,"i2":21,"j1":1,"j2":17,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02973","language":"Python","original_status":"Time Limit Exceeded","pass":"from bisect import bisect_left\n\nN = int(input())\nA = [int(input()) for _ in range(N)]\n\nt = [A[0]]\nfor a in A[1:]:\n i = bisect_left(t, a) - 1\n if i == -1:\n t = [a] + t\n else:\n t[i] = a\n t.sort()\nprint(len(t))\n","fail":"N = int(input())\nA = [int(input()) for _ in range(N)]\n\nt = [A[0]]\nfor a in A[1:]:\n if t[-1] >= a:\n t.append(a)\n continue\n ok = len(t) - 1\n ng = -1\n while ok - ng > 1:\n m = (ok + ng) \/\/ 2\n if t[m] < a:\n ok = m\n else:\n ng = m\n t[ok] = a\nprint(len(t))\n","change":"replace","i1":0,"i2":13,"j1":0,"j2":17,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02973","language":"Python","original_status":"Time Limit Exceeded","pass":"import sys\n\nn = int(input())\naaa = list(map(int, sys.stdin.readlines()))\n\ndp = [-1]\nfor a in aaa:\n for i, m in enumerate(dp):\n if m < a:\n dp[i] = a\n break\n else:\n dp.append(a)\nprint(len(dp))\n","fail":"import sys\nfrom bisect import bisect\n\nn = int(input())\naaa = list(map(int, sys.stdin.readlines()))\n\ndp = [1]\nfor a in aaa:\n a *= -1\n i = bisect(dp, a)\n if i < len(dp):\n dp[i] = a\n else:\n dp.append(a)\nprint(len(dp))\n","change":"replace","i1":1,"i2":11,"j1":1,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02973","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = [int(input()) for _ in range(N)]\n\nc = 0\ncolored = [False for _ in range(N)]\nLs = []\nfor a in A:\n\n k = -1\n for i, l in enumerate(Ls):\n if l < a and a > k:\n ind = i\n k = a\n if k != -1:\n Ls[ind] = a\n else:\n Ls.append(a)\n\n\nprint(len(Ls))\n","fail":"from bisect import bisect_right, bisect_left\n\nN = int(input())\nA = [int(input()) for _ in range(N)]\n\ndp = [1] * N\n\nfor a in A:\n ia = bisect_right(dp, -a)\n if dp[ia] == 1:\n dp[ia] = -a\n else:\n ib = bisect_left(dp, -a + 1)\n dp[ib] = -a\n # print(dp)\n\nans = 0\nfor i in range(N):\n if dp[i] != 1:\n ans += 1\nprint(ans)\n","change":"replace","i1":0,"i2":20,"j1":0,"j2":21,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02973","language":"Python","original_status":"Time Limit Exceeded","pass":"import bisect\n\nN = int(input())\nA = [int(input()) for i in range(N)]\n\ncolors = [A[0]]\nfor i in range(1, N):\n index = bisect.bisect_left(colors, A[i])\n if index == 0:\n colors.insert(0, A[i])\n else:\n colors[index - 1] = A[i]\nprint(len(colors))\n","fail":"from collections import deque\nimport bisect\n\nN = int(input())\nA = [int(input()) for i in range(N)]\n\ncolors = deque()\nfor i in range(N):\n index = bisect.bisect_left(colors, A[i])\n if index == 0:\n colors.appendleft(A[i])\n else:\n colors[index - 1] = A[i]\nprint(len(colors))\n","change":"replace","i1":0,"i2":10,"j1":0,"j2":11,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02973","language":"Python","original_status":"Time Limit Exceeded","pass":"from bisect import bisect_right\n\nn = int(input())\na = [int(input()) for _ in range(n)]\n\nc = []\nc.append(a[0])\nfor ai in a[1:]:\n ci = bisect_right(c, ai)\n if ci == 0 or c[ci - 1] == ai:\n c.append(ai)\n c.sort()\n else:\n c[ci - 1] = ai\n c.sort()\n\nprint(len(c))\n","fail":"from bisect import bisect_left\n\nn = int(input())\na = [int(input()) for _ in range(n)]\n\nc = [0] * n\nend = n\n\nfor ai in a:\n ci = bisect_left(c, ai, end, n)\n c[ci - 1] = ai\n if ci <= end:\n end -= 1\nprint(n - end)\n","change":"replace","i1":0,"i2":17,"j1":0,"j2":14,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02973","language":"Python","original_status":"Runtime Error","pass":"from bisect import bisect\n\nn = int(input())\nma = [-int(input()) for _ in range(n)]\n\nans = [ma[0]]\nfor ai in ma[1:]:\n tmp = bisect(ans, ai)\n if tmp == len(ans):\n ans.append(ai)\n elif tmp < len(ans):\n ans[tmp] = ai\n print(ans)\nprint(len(ans))\n","fail":"from bisect import bisect\n\nn = int(input())\nma = [-int(input()) for _ in range(n)]\n\nans = [ma[0]]\nfor ai in ma[1:]:\n tmp = bisect(ans, ai)\n if tmp == len(ans):\n ans.append(ai)\n elif tmp < len(ans):\n ans[tmp] = ai\nprint(len(ans))\n","change":"delete","i1":12,"i2":13,"j1":12,"j2":12,"error":"WA","stderr":null,"stdout":"[-2, -1]\n[-4, -1]\n[-5, -1]\n[-5, -3]\n2\n"} {"problem_id":"p02973","language":"Python","original_status":"Time Limit Exceeded","pass":"import bisect\n\nN = int(input())\nA = [int(input()) for _ in range(N)]\n\nx = []\n\nfor i, a in enumerate(A):\n if i == 0:\n x.append(a)\n else:\n r = bisect.bisect_left(x, a)\n if r == 0:\n x.insert(0, a)\n else:\n x[r - 1] = a\n\nprint(len(x))\n","fail":"import bisect\nimport collections\n\nN = int(input())\nA = [int(input()) for _ in range(N)]\n\nx = collections.deque()\n\nfor i, a in enumerate(A):\n if i == 0:\n x.append(a)\n else:\n r = bisect.bisect_left(x, a)\n if r == 0:\n x.appendleft(a)\n else:\n x[r - 1] = a\n\nprint(len(x))\n","change":"replace","i1":1,"i2":14,"j1":1,"j2":15,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02981","language":"Python","original_status":"Runtime Error","pass":"i = input().spli(\" \")\npeople = int(i[0])\ntrain_fee = int(i[1])\ntaxi_fee = int(i[2])\n\ntrain_sum = people * train_fee\nif train_sum > taxi_fee:\n print(train_sum)\nelse:\n print(taxi_fee)\n","fail":"i = input().split(\" \")\npeople = int(i[0])\ntrain_fee = int(i[1])\ntaxi_fee = int(i[2])\n\ntrain_sum = people * train_fee\nif train_sum > taxi_fee:\n print(taxi_fee)\nelse:\n print(train_sum)\n","change":"replace","i1":0,"i2":10,"j1":0,"j2":10,"error":"AttributeError: 'str' object has no attribute 'spli'. Did you mean: 'split'?","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02981\/Python\/s062191758.py\", line 1, in \n i = input().spli(\" \")\nAttributeError: 'str' object has no attribute 'spli'. Did you mean: 'split'?\n","stdout":null} {"problem_id":"p02981","language":"Python","original_status":"Runtime Error","pass":"# -*- coding: utf-8 -*-\nimport itertools\nimport math\n\nN, D = map(int, input().split())\n\nX = [[0 for x in range(D)] for y in range(N)]\n\nfor n in range(N):\n X[n] = list(map(int, input().split()))\n\nans = 0\nfor target in itertools.combinations(X, 2):\n res = sum([(y - z) ** 2 for y, z in zip(target[0], target[1])])\n res = math.sqrt(res)\n if res.is_integer():\n ans += 1\n\nprint(ans)\n","fail":"N, A, B = map(int, input().split())\n\nprint(min(N * A, B))\n","change":"replace","i1":0,"i2":19,"j1":0,"j2":3,"error":"ValueError: too many values to unpack (expected 2)","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02981\/Python\/s901912140.py\", line 5, in \n N, D = map(int, input().split())\nValueError: too many values to unpack (expected 2)\n","stdout":null} {"problem_id":"p02981","language":"Python","original_status":"Runtime Error","pass":"N, A, B = map(int, input().split())\nans = []\nfor i in range(1, N):\n ans.append(A * i + B \/ N * (N - i))\nprint(min(ans))\n","fail":"N, A, B = map(int, input().split())\nif A * N < B:\n print(A * N)\nelse:\n print(B)\n","change":"replace","i1":1,"i2":5,"j1":1,"j2":5,"error":"WA","stderr":null,"stdout":8.25} {"problem_id":"p02981","language":"Python","original_status":"Runtime Error","pass":"N = int(input())\nA = int(input())\nB = int(input())\nc = N * A\nif c < B:\n print(c)\nelse:\n print(B)\n","fail":"n, a, b = map(int, input().split())\nc = n * a\nif c < b:\n print(c)\nelse:\n print(b)\n","change":"replace","i1":0,"i2":8,"j1":0,"j2":6,"error":"ValueError: invalid literal for int() with base 10: '4 2 9'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02981\/Python\/s146594722.py\", line 1, in \n N = int(input())\nValueError: invalid literal for int() with base 10: '4 2 9'\n","stdout":null} {"problem_id":"p02981","language":"Python","original_status":"Runtime Error","pass":"A, B, N = map(int, input().split())\n\ntotal_price = A + (N * B)\n\nprint(total_price - max(total_price))\n","fail":"N, A, B = map(int, input().split())\n\n# N\u4eba*A\u5186\u304cB\u5186\u3088\u308a\u5927\u304d\u3044\u5834\u5408\nif N * A > B:\n print(B)\nelse:\n print(N * A)\n","change":"replace","i1":0,"i2":5,"j1":0,"j2":7,"error":"TypeError: 'int' object is not iterable","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02981\/Python\/s985942585.py\", line 5, in \n print(total_price - max(total_price))\nTypeError: 'int' object is not iterable\n","stdout":null} {"problem_id":"p02982","language":"Python","original_status":"Runtime Error","pass":"import numpy as np\n\nN, D = list(map(int, input().split()))\nX = []\nfor i in range(D):\n x_i = [int(i) for i in input().split()]\n X.append(i)\nX = np.array(X)\n\nans = 0\nfor i in range(D):\n for j in range(i + 1, D):\n if np.sqrt(np.sum(X[i] - X[j]) ** 2).is_integer():\n ans += 1\nprint(ans)\n","fail":"import numpy as np\n\nN, D = list(map(int, input().split()))\nX = []\nfor i in range(N):\n x_i = [int(i) for i in input().split()]\n X.append(x_i)\nX = np.array(X)\n\nans = 0\nfor i in range(N):\n for j in range(i + 1, N):\n if np.sqrt(np.sum((X[i] - X[j]) ** 2)).is_integer():\n ans += 1\nprint(ans)\n","change":"replace","i1":4,"i2":13,"j1":4,"j2":13,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02983","language":"Python","original_status":"Runtime Error","pass":"l, r = map(int, input().split())\na = []\nif r - l >= 2019:\n print(0)\nelse:\n for i in range(r - l + 1):\n a.append((l + i) % 2019)\n# print(a)\na.sort()\nprint(a[0] * a[1])\n","fail":"l, r = map(int, input().split())\na = []\n\ndata = 2019\n\nif r - l + 1 >= 2019:\n print(0)\n exit()\n\nelse:\n for i in range(l, r + 1):\n for j in range(i + 1, r + 1):\n data = min(data, i * j % 2019)\n\nprint(data)\n","change":"replace","i1":2,"i2":10,"j1":2,"j2":15,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p02983","language":"Python","original_status":"Time Limit Exceeded","pass":"#!\/usr\/bin\/env python3\n# -*- coding: utf-8 -*-\n\n\ndef main():\n L, R = map(int, input().split())\n result = []\n for i in range(L, R + 1):\n for j in range(i + 1, R + 1):\n result.append(i * j % 2019)\n print(min(result))\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"#!\/usr\/bin\/env python3\n# -*- coding: utf-8 -*-\n\n\ndef main():\n L, R = map(int, input().split())\n mod = 2019\n\n min_mod = float(\"inf\")\n\n for i in range(L, min(R, L + mod)):\n for j in range(i + 1, min(R + 1, i + 1 + mod)):\n curr_mod = i * j % mod\n min_mod = min(min_mod, curr_mod)\n if min_mod == 0:\n break\n\n print(min_mod)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":6,"i2":11,"j1":6,"j2":18,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02983","language":"Python","original_status":"Time Limit Exceeded","pass":"L, R = [int(i) for i in input().split()]\nR = min(R, L + 4038)\ndiff = R - L\nans = 2018\nfor i in range(L, R + 1):\n for j in range(i + 1, R + 1):\n x = i * j % 2019\n ans = min(ans, x)\nprint(ans)\n","fail":"L, R = [int(i) for i in input().split()]\nR = min(R, L + 4038)\nans = 2018\nfor i in range(L, R + 1):\n for j in range(i + 1, R + 1):\n x = (i * j) % 2019\n if x == 0:\n ans = 0\n break\n ans = min(ans, x)\nprint(ans)\n","change":"replace","i1":2,"i2":7,"j1":2,"j2":9,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02983","language":"Python","original_status":"Time Limit Exceeded","pass":"l, r = map(int, input().split())\nx = []\nfor i in range(l, r):\n for j in range(i + 1, r + 1):\n mod = i * j % 2019\n x.append(mod)\nprint(min(x))\n","fail":"l, r = map(int, input().split())\nx = []\nfor i in range(l, r):\n for j in range(i + 1, r + 1):\n mod = i * j % 2019\n x.append(mod)\n if mod == 0:\n print(0)\n exit()\nprint(min(x))\n","change":"insert","i1":6,"i2":6,"j1":6,"j2":9,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02983","language":"Python","original_status":"Time Limit Exceeded","pass":"L, R = map(int, input().split())\na = 0\nb = 2019\nfor i in range(L, R):\n for j in range(i + 1, R + 1):\n a = i * j % 2019\n if a <= b:\n b = a\n\nprint(b)\n","fail":"L, R = map(int, input().split())\na = 0\nb = 2019\nif R - L >= 2018:\n b = 0\nelse:\n for i in range(L, R):\n for j in range(i + 1, R + 1):\n a = i * j % 2019\n if a <= b:\n b = a\n\nprint(b)\n","change":"replace","i1":3,"i2":8,"j1":3,"j2":11,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02983","language":"Python","original_status":"Runtime Error","pass":"L, R = map(int, input().split())\n\nnum_list = list(range(L, R + 1))\n\nnum_list = [i % 2019 for i in num_list]\nnum_list.sort()\n\nprint((num_list[0] * num_list[1]) % 2019)\n","fail":"L, R = map(int, input().split())\nif (L <= 673 <= R and R - L >= 3) or (R - L >= 673):\n print(0)\nelse:\n mods = []\n mods_append = mods.append\n for i in range(L, R):\n for j in range(i + 1, R + 1):\n m = (i * j) % 2019\n mods_append(m)\n if m == 2:\n break\n\n print(min(mods))\n","change":"replace","i1":1,"i2":8,"j1":1,"j2":14,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p02983","language":"Python","original_status":"Time Limit Exceeded","pass":"def main():\n l, r = map(int, input().split())\n res = 1 << 30\n for i in range(l, r):\n for j in range(i + 1, r + 1):\n res = min(res, (i * j) % 2019)\n if res == 0:\n break\n print(res)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"def main():\n l, r = map(int, input().split())\n res = 1 << 30\n for i in range(l, r):\n for j in range(i + 1, r + 1):\n res = min(res, (i * j) % 2019)\n if res == 0:\n print(res)\n return\n print(res)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":7,"i2":8,"j1":7,"j2":9,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02983","language":"Python","original_status":"Runtime Error","pass":"import numpy as np\n\nL, R = map(int, input().split())\n\nif L - R >= 2019:\n ans = 0\nelse:\n A = np.arange(L, R + 1)\n A = np.sort(A % 2019)\n ans = A[0] * A[1]\n\nprint(ans % 2019)\n","fail":"L, R = map(int, input().split())\n\nif R - L >= 2019:\n ans = 0\nelse:\n ans = 2019\n for i in range(L, R):\n x = i % 2019\n for j in range(i + 1, R + 1):\n a = x * j\n ans = min(a % 2019, ans)\n\nprint(ans)\n","change":"replace","i1":0,"i2":12,"j1":0,"j2":13,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02983","language":"Python","original_status":"Time Limit Exceeded","pass":"L, R = map(int, input().split())\nans = 2018\nfor i in range(L, R):\n for j in range(i + 1, R + 1):\n ans = min(ans, (i * j) % 2019)\n if ans == 0:\n break\nprint(ans)\n","fail":"L, R = map(int, input().split())\nans = 2018\nfor i in range(L, R):\n for j in range(i + 1, R + 1):\n ans = min(ans, (i * j) % 2019)\n if ans == 0:\n print(ans)\n exit()\nprint(ans)\n","change":"replace","i1":6,"i2":7,"j1":6,"j2":8,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02983","language":"Python","original_status":"Time Limit Exceeded","pass":"L, R = map(int, input().split())\nmin_mod = 10**9\nfor i in range(L, R):\n for j in range(i + 1, min(L + 2019, R + 1)):\n min_mod = min(min_mod, (i * j) % 2019)\nprint(min_mod)\n","fail":"L, R = map(int, input().split())\nmin_mod = 10**9\nfor i in range(L, min(L + 2019, R + 1)):\n for j in range(i + 1, min(L + 2019, R + 1)):\n min_mod = min(min_mod, (i * j) % 2019)\nprint(min_mod)\n","change":"replace","i1":2,"i2":3,"j1":2,"j2":3,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02983","language":"Python","original_status":"Runtime Error","pass":"L, R = map(int, input().split())\nMOD = 2019\nL %= MOD\nR %= MOD\nprint(min(i * j % 2019 for i in range(L, R) for j in range(i + 1, R + 1)))\n","fail":"L, R = map(int, input().split())\nMOD = 2019\nans = float(\"inf\")\nfor i in range(L, R):\n for j in range(i + 1, R + 1):\n ans = min(ans, i * j % MOD)\n if ans == 0:\n print(0)\n exit()\nprint(ans)\n","change":"replace","i1":2,"i2":5,"j1":2,"j2":10,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p02983","language":"Python","original_status":"Runtime Error","pass":"L, R = [int(_) for _ in input().split()]\n\ndiff = R - L\nif diff >= 2019:\n print(\"0\")\nelse:\n ans = min([i * j % 2019 for j in range(L + 1, R) for i in range(L, R)])\n print(ans)\n","fail":"L, R = [int(_) for _ in input().split()]\n\ndiff = R - L\nif diff >= 2019:\n print(\"0\")\nelse:\n ans = min([i * j % 2019 for j in range(L + 1, R + 1) for i in range(L, R)])\n print(ans)\n","change":"replace","i1":6,"i2":7,"j1":6,"j2":7,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p02983","language":"Python","original_status":"Time Limit Exceeded","pass":"L, R = map(int, input().split())\n\nres = float(\"inf\")\nfor i in range(L, R + 1):\n for j in range(i + 1, R + 1):\n res = min(res, (i * j) % 2019)\nprint(res)\n","fail":"L, R = map(int, input().split())\n\nif R - L >= 2019:\n res = 0\nelse:\n res = float(\"inf\")\n L = L % 2019\n R = R % 2019\n for i in range(L, R + 1):\n for j in range(i + 1, R + 1):\n res = min(res, (i * j) % 2019)\nprint(res)\n","change":"replace","i1":2,"i2":6,"j1":2,"j2":11,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02983","language":"Python","original_status":"Time Limit Exceeded","pass":"def make_list(L, R):\n mod_list = list()\n\n if R - L <= 2019:\n for i in range(L, R):\n for j in range(i + 1, R + 1):\n mod_list.append((i * j) % 2019)\n else:\n for i in range(L, R):\n for j in range(i + 1, i + 2021):\n mod_list.append((i * j) % 2019)\n\n return mod_list\n\n\ndef main():\n L, R = map(int, input().split())\n\n mod_list = make_list(L, R)\n\n print(min(mod_list))\n\n return\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"def make_list(L, R):\n mod_list = list()\n\n if R - L <= 2019:\n for i in range(L, R):\n for j in range(i + 1, R + 1):\n mod_list.append((i * j) % 2019)\n else:\n for i in range(L, L + 2020):\n for j in range(i + 1, i + 2021):\n mod_list.append((i * j) % 2019)\n\n return mod_list\n\n\ndef main():\n L, R = map(int, input().split())\n\n mod_list = make_list(L, R)\n\n print(min(mod_list))\n\n return\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":8,"i2":9,"j1":8,"j2":9,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02983","language":"Python","original_status":"Time Limit Exceeded","pass":"L, R = map(int, input().split(\" \"))\n\nR = min(R, L + 4038)\n\ni = L\nres = 2019\nwhile i < R:\n j = i + 1\n while j <= R:\n res = min(res, i * j % 2019)\n j += 1\n i += 1\n\nprint(res)\n","fail":"L, R = map(int, input().split(\" \"))\n\nans = 2019\n\nR = min(R, L + 2019)\nfor l in range(L, R):\n for r in range(l + 1, R + 1):\n ans = min(ans, (l * r) % 2019)\nprint(ans)\n","change":"replace","i1":2,"i2":14,"j1":2,"j2":9,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02983","language":"Python","original_status":"Time Limit Exceeded","pass":"L, R = map(int, input().split())\n\ntmp = R - L + 1\nif tmp >= 2019:\n print(0)\n exit()\nelse:\n start = L % 2019\n end = R % 2019\n candidate = []\n for i in range(start, end + 1):\n candidate.append(i % 2019)\n candidate.sort()\n ans = []\n for i in range(len(candidate)):\n for j in range(len(candidate)):\n if i == j:\n continue\n else:\n ans.append((candidate[i] * candidate[j]) % 2019)\n ans.sort()\n print(ans[0])\n","fail":"L, R = map(int, input().split())\n\ntmp = R - L + 1\nif tmp >= 2019:\n print(0)\n exit()\nelse:\n start = L % 2019\n end = R % 2019\n candidate = []\n for i in range(start, end + 1):\n candidate.append(i % 2019)\n candidate.sort()\n ans = []\n for i in range(len(candidate)):\n if i == (len(candidate) - 1):\n continue\n for j in range(i + 1, len(candidate)):\n if i == j:\n continue\n else:\n ans.append((candidate[i] * candidate[j]) % 2019)\n ans.sort()\n print(ans[0])\n","change":"replace","i1":15,"i2":16,"j1":15,"j2":18,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02984","language":"Python","original_status":"Time Limit Exceeded","pass":"from collections import deque\n\nn = int(input())\nA = list(map(int, input().split()))\n\nsum_even = sum(A[::2])\nsum_odd = sum(A[1::2]) + A[0]\nANS = A[:]\nA = deque(A)\nminus = False\nfor _ in range(n - 1):\n A.rotate(-1)\n for i in range(n):\n if minus:\n ANS[i] -= A[i]\n else:\n ANS[i] += A[i]\n minus = not minus\nANS = deque(ANS)\nANS.rotate()\nprint(*ANS)\n","fail":"from collections import deque\n\nn = int(input())\nA = list(map(int, input().split()))\n\nB = [0] * n\nB[0] = A[0]\nB[1] = A[1]\nfor i in range(2, n):\n B[i] = B[i - 2] + A[i]\n\nANS = [0] * n\nfor i in range(n):\n ans = 0\n if i % 2 == 0:\n ans += B[-1] - B[-2]\n else:\n ans += B[-2] - B[-1]\n\n if i - 2 >= 0:\n ans -= B[i - 2] * 2\n\n if i - 1 >= 0:\n ans += B[i - 1] * 2\n\n ANS[i] = ans\n\nprint(*ANS)\n","change":"replace","i1":5,"i2":20,"j1":5,"j2":27,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02984","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\nlis = list(map(int, input().split()))\na = n \/\/ 2\nres = sum(lis)\n\n\ndef dams(i, a, lis):\n su = 0\n for j in range(a):\n b = (i + (2 * j + 1)) % len(lis)\n su += lis[b]\n return su\n\n\nans = []\nfor i in range(n):\n ans.append(res - 2 * dams(i, a, lis))\nprint(*ans)\n","fail":"import sys\n\ninput = sys.stdin.readline\n\nn = int(input())\nlis = list(map(int, input().split()))\nres = sum(lis)\nsu = [0] * n\n\nfor i in range(n):\n if i < 2:\n su[i] = lis[i]\n else:\n su[i] = su[i - 2] + lis[i]\n\nans = []\nans_a = ans.append\n\nfor i in range(n):\n if i == 0:\n b = su[-2]\n ans_a(res - 2 * b)\n elif i == 1:\n b = su[-1] - su[i - 1]\n ans_a(res - 2 * b)\n elif i == n:\n b = su[-1] - lis[-1]\n ans_a(res - 2 * b)\n elif i % 2 == 0:\n b = su[-2] - su[i - 1] + su[i - 2]\n ans_a(res - 2 * b)\n else:\n b = su[-1] - su[i - 1] + su[i - 2]\n ans_a(res - 2 * b)\nprint(*ans)\n","change":"replace","i1":0,"i2":17,"j1":0,"j2":34,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02984","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = list(map(int, input().split()))\nb = sum(a) \/ 2\np = int((n - 1) \/ 2)\n\nx = []\n\nfor i in range(n):\n t = b\n for j in range(p):\n t -= a[(2 * j + i + 1) % n]\n x.append(t * 2)\n\nfor i in range(n):\n print(int(x[i]), end=\" \")\n","fail":"n = int(input())\na = list(map(int, input().split()))\nb = sum(a) \/ 2\np = int((n - 1) \/ 2)\n\nx = []\n\nt = b\nfor j in range(p):\n t -= a[2 * j + 1]\nx.append(t * 2)\n\nfor i in range(n - 1):\n t = a[i] - x[i] \/ 2\n x.append(t * 2)\n\nfor i in range(n):\n print(int(x[i]), end=\" \")\n","change":"replace","i1":7,"i2":11,"j1":7,"j2":14,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02984","language":"Python","original_status":"Time Limit Exceeded","pass":"from sys import stdin\n\nN = int(stdin.readline().rstrip())\nA = [int(x) for x in stdin.readline().rstrip().split()]\n\nS = sum(A)\nans = []\ns = 0\nfor k in range(int((N - 1) \/ 2)):\n s += A[2 * k + 1] * 2\nans.append(S - s)\nfor k in range(N - 1):\n ans.insert(0, A[k] * 2 - ans[0])\nans.reverse()\nprint(*ans)\n","fail":"from sys import stdin\n\nN = int(stdin.readline().rstrip())\nA = [int(x) for x in stdin.readline().rstrip().split()]\n\nS = sum(A)\nans = [0 for _ in range(N)]\ns = 0\nfor k in range(int((N - 1) \/ 2)):\n s += A[2 * k + 1] * 2\nans[0] = S - s\nfor k in range(1, N):\n ans[k] = A[k - 1] * 2 - ans[k - 1]\nprint(*ans)\n","change":"replace","i1":6,"i2":14,"j1":6,"j2":13,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02984","language":"Python","original_status":"Time Limit Exceeded","pass":"from sys import stdin, setrecursionlimit\n\n\ndef main():\n input = stdin.buffer.readline\n n = int(input())\n a = list(map(int, input().split()))\n x_sum = sum(a) \/\/ 2\n x = [0] * n\n for i in range(n):\n tmp = x_sum\n idx = (i + 1) % n\n for _ in range((n - 1) \/\/ 2):\n tmp -= a[idx]\n idx += 2\n idx %= n\n x[i] = 2 * tmp\n print(*x)\n\n\nif __name__ == \"__main__\":\n setrecursionlimit(10000)\n main()\n","fail":"from sys import stdin, setrecursionlimit\n\n\ndef main():\n input = stdin.buffer.readline\n n = int(input())\n a = list(map(int, input().split()))\n x_sum = sum(a) \/\/ 2\n x = [0] * n\n tmp = x_sum\n idx = 1\n for _ in range((n - 1) \/\/ 2):\n tmp -= a[idx]\n idx += 2\n idx %= n\n x[0] = 2 * tmp\n for i in range(n - 1):\n x[i + 1] = 2 * (a[i] - x[i] \/\/ 2)\n print(*x)\n\n\nif __name__ == \"__main__\":\n setrecursionlimit(10000)\n main()\n","change":"replace","i1":9,"i2":17,"j1":9,"j2":18,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02984","language":"Python","original_status":"Runtime Error","pass":"import sys\nimport numpy as np\n\n\ndef input():\n return sys.stdin.readline().rstrip()\n\n\ndef main():\n n = int(input())\n a = [int(e) for e in input().split()]\n va = np.array(a)\n m = np.identity(n, dtype=int)\n for i in range(n):\n if i < n - 1:\n m[i][i + 1] = 1\n else:\n m[i][0] = 1\n vx = np.linalg.solve(m, va).astype(np.int) * 2\n print(*vx)\n\n\nmain()\n","fail":"import sys\nimport numpy as np\n\n\ndef input():\n return sys.stdin.readline().rstrip()\n\n\ndef main():\n n = int(input())\n a = [int(e) for e in input().split()]\n x = [0 for _ in range(n)]\n x[0] = sum(a) - (sum(a[1:n:2]) * 2)\n for i in range(2, n, 2):\n x[i] = x[i - 2] + ((a[i - 1] - a[i - 2]) * 2)\n x[1] = sum(a) - (sum(a[2:n:2]) * 2)\n for i in range(3, n, 2):\n x[i] = x[i - 2] + ((a[i - 1] - a[i - 2]) * 2)\n print(*x)\n\n\nmain()\n","change":"replace","i1":11,"i2":20,"j1":11,"j2":19,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02984","language":"Python","original_status":"Time Limit Exceeded","pass":"from scipy.sparse import lil_matrix, csr_matrix\nfrom scipy.sparse.linalg import spsolve\nimport numpy as np\n\nN = int(input())\nA = np.array(input().split(), dtype=int)\n\nmat = lil_matrix((N, N))\nfor i in range(N):\n j = (i + 1) % N\n mat[i, i] = 1\n mat[i, j] = 1\nmat = csr_matrix(mat)\n\nans = (spsolve(mat, A) * 2).astype(int)\nprint(*ans)\n","fail":"from scipy.sparse import csr_matrix\nfrom scipy.sparse.linalg import spsolve\nimport numpy as np\n\nN = int(input())\nb = np.array(input().split(), dtype=int)\n\ndata = np.ones(2 * N, dtype=int)\ncol = np.arange(2 * N) \/\/ 2\nrow = np.zeros(2 * N, dtype=int)\nrow[0] = N - 1\nrow[1:] = col[:-1]\n\nA = csr_matrix((data, (row, col)), shape=(N, N))\n\nans = (spsolve(A, b) * 2).astype(int)\nprint(*ans)\n","change":"replace","i1":0,"i2":15,"j1":0,"j2":16,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02984","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = list(map(int, input().split()))\n\nans = [0 for _ in range(N)]\n\nfor i in range(N):\n sign = 1\n\n for a in A:\n ans[i] += sign * a\n sign *= -1\n\n t = A.pop(0)\n A.append(t)\n\nprint(*ans)\n\n\"\"\"\n\u30c0\u30e01: 2( a1 - a2 + a3 )\n\u30c0\u30e02: 2( a2 - a3 + a1 )\n\u30c0\u30e03: 2( a3 - a1 + a2 )\n\"\"\"\n","fail":"N = int(input())\nA = list(map(int, input().split()))\n\nans = [0 for _ in range(N)]\n\nsign = 1\nfor a in A:\n ans[0] += sign * a\n sign *= -1\n\n\nfor i in range(1, N):\n ans[i] = 2 * A[0] - ans[i - 1]\n\n t = A.pop(0)\n A.append(t)\n\nprint(*ans)\n","change":"replace","i1":5,"i2":22,"j1":5,"j2":18,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02984","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = list(map(int, input().split()))\nsum_rain = sum(a) \/\/ 2\na += a\nans_rain = []\n\nfor i in range(n):\n rest_rain = 0\n for j in range(i + 1, i + n, 2):\n rest_rain += a[j]\n ans_rain.append((sum_rain - rest_rain) * 2)\n\nprint(*ans_rain)\n","fail":"n = int(input())\na = list(map(int, input().split()))\nsum_rain = sum(a) \/\/ 2\n\nrest_rain = 0\nfor i in range(1, n, 2):\n rest_rain += a[i]\nfirst_ans = (sum_rain - rest_rain) * 2\n\nres = []\n\nres.append(first_ans)\nprev_ans = first_ans\n\nfor i in range(n - 1):\n ans = (a[i] - prev_ans \/\/ 2) * 2\n res.append(ans)\n prev_ans = ans\n\nprint(*res)\n","change":"replace","i1":3,"i2":13,"j1":3,"j2":20,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02984","language":"Python","original_status":"Time Limit Exceeded","pass":"#!\/usr\/bin\/env python3\n\nN = int(input().split()[0])\na_list = list(map(int, input().split()))\nstart_w = a_list[0] * 2\n\n# \u4e00\u756a\u5c0f\u3055\u3044\u3082\u306e\u304b\u3089\u6c7a\u3081\u3066\u3044\u304f\uff1f\nfor sw in range(start_w + 1):\n w_list = []\n if a_list[0] < sw \/\/ 2:\n continue\n w_list.append(sw)\n for i in range(1, N):\n w_list.append((a_list[i - 1] - w_list[i - 1] \/\/ 2) * 2)\n\n if a_list[-1] == (w_list[0] + w_list[-1]) \/\/ 2:\n break\n\nans = \" \".join([str(w) for w in w_list])\nprint(ans)\n","fail":"#!\/usr\/bin\/env python3\n\nN = int(input().split()[0])\na_list = list(map(int, input().split()))\n\nr_list = []\ntotal = 0\n\nfor i in range(1, N, 2):\n total += a_list[i]\n\nr_list.append(sum(a_list) - total * 2)\n\nfor i in range(1, N):\n r = a_list[i - 1] * 2 - r_list[i - 1]\n r_list.append(r)\n\nans = \" \".join([str(w) for w in r_list])\nprint(ans)\n","change":"replace","i1":4,"i2":19,"j1":4,"j2":18,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02987","language":"Python","original_status":"Runtime Error","pass":"from collections import Counter\n\n\ns = input()\nc = Counter(s)\nif len(c) == 2 and c.most_common(1)[1] == 2:\n print(\"Yes\")\nelse:\n print(\"No\")\n","fail":"from collections import Counter\n\n\ns = input()\nc = Counter(s)\nif len(c) == 2 and c.most_common(1)[0][1] == 2:\n print(\"Yes\")\nelse:\n print(\"No\")\n","change":"replace","i1":5,"i2":6,"j1":5,"j2":6,"error":"IndexError: list index out of range","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02987\/Python\/s756840059.py\", line 6, in \n if len(c) == 2 and c.most_common(1)[1] == 2:\nIndexError: list index out of range\n","stdout":null} {"problem_id":"p02987","language":"Python","original_status":"Runtime Error","pass":"s = input()\ns.sort()\nans = \"No\"\nif s[0] == s[1] and s[2] == s[3]:\n if s[1] != s[2]:\n ans = \"Yes\"\nprint(ans)\n","fail":"s = list(input())\ns.sort()\nans = \"No\"\nif s[0] == s[1] and s[2] == s[3]:\n if s[1] != s[2]:\n ans = \"Yes\"\nprint(ans)\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"AttributeError: 'str' object has no attribute 'sort'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02987\/Python\/s791520641.py\", line 2, in \n s.sort()\nAttributeError: 'str' object has no attribute 'sort'\n","stdout":null} {"problem_id":"p02987","language":"Python","original_status":"Runtime Error","pass":"a = input()\na = a.replace(a[0], \"\")\na = a.replace(a[0], \"\")\nif len(a) == 0:\n print(\"Yes\")\nelse:\n print(\"No\")\n","fail":"a = input()\na = a.replace(a[0], \"\")\nif len(a) == 0:\n print(\"No\")\nelse:\n a = a.replace(a[0], \"\")\n if len(a) == 0:\n print(\"Yes\")\n else:\n print(\"No\")\n","change":"replace","i1":2,"i2":7,"j1":2,"j2":10,"error":"0","stderr":null,"stdout":"Yes\n"} {"problem_id":"p02987","language":"Python","original_status":"Runtime Error","pass":"S = input()\nS = S.strip(S[0])\n\nif len(S[0]) > 0:\n S = S.strip(S[0])\n if len(S) == 0:\n print(\"Yes\")\n else:\n print(\"No\")\nelse:\n print(\"No\")\n","fail":"S = input()\nS = S.replace(S[0], \"\")\nif len(S) > 0:\n S = S.replace(S[0], \"\")\n if len(S) == 0:\n print(\"Yes\")\n else:\n print(\"No\")\nelse:\n print(\"No\")\n","change":"replace","i1":1,"i2":5,"j1":1,"j2":4,"error":"0","stderr":null,"stdout":"Yes\n"} {"problem_id":"p02987","language":"Python","original_status":"Runtime Error","pass":"import sys\n\n\ns = sys.argv[1]\n\nif len(s) == 4:\n if s.count(s[0]) == 2:\n if s.count(s[1]) == 2:\n if s.count(s[2]) == 2:\n if s.count(s[3]) == 2:\n print(\"Yes\")\n exit()\nprint(\"No\")\nexit()\n","fail":"import sys\n\n\n# s = sys.argv[1]\ns = input()\nif len(s) == 4:\n if s.count(s[0]) == 2:\n if s.count(s[1]) == 2:\n if s.count(s[2]) == 2:\n if s.count(s[3]) == 2:\n print(\"Yes\")\n exit()\nprint(\"No\")\nexit()\n","change":"replace","i1":3,"i2":5,"j1":3,"j2":5,"error":"IndexError: list index out of range","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02987\/Python\/s870683023.py\", line 4, in \n s = sys.argv[1]\nIndexError: list index out of range\n","stdout":null} {"problem_id":"p02988","language":"Python","original_status":"Runtime Error","pass":"n = int(input())\np = list(map(int, input().split()))\ncount = 0\nfor i in range(1, n):\n if p[i - 1] < p[i] < p[i + 1]:\n count += 1\nprint(count)\n","fail":"n = int(input())\np = list(map(int, input().split()))\ncount = 0\nfor i in range(1, n - 1):\n if p[i - 1] < p[i] < p[i + 1]:\n count += 1\n elif p[i + 1] < p[i] < p[i - 1]:\n count += 1\nprint(count)\n","change":"replace","i1":3,"i2":6,"j1":3,"j2":8,"error":"WA","stderr":null,"stdout":1} {"problem_id":"p02989","language":"Python","original_status":"Runtime Error","pass":"N = int(input())\nd = list(map(int, input().split()))\n\nsame = N \/ 2\n\n# d.sort()\n\n# distribution = [0] * d[len(d) - 1]\n# total = 0\n# for di in d:\n# num = d.count(di)\n# distribution[di - 1] = num\n\ntable = {}\nfor di in d:\n table[di] = 0 if table[di] is None else table[di] + 1\n\n# total = 0\n# totals = [0] * d[len(d) - 1]\n# num = 0\n# for i in range(len(distribution)):\n# total += distribution[i]\n# totals[i] = total\n\n# if totals[i] == same:\n# num += 1\n# elif num >= 1:\n# break\n\nprint(1)\n","fail":"N = int(input())\nd = list(map(int, input().split()))\n\nsame = N \/ 2\n\n# d.sort()\n\n# distribution = [0] * d[len(d) - 1]\n# total = 0\n# for di in d:\n# num = d.count(di)\n# distribution[di - 1] = num\n\ntable = {}\nfor di in d:\n table[di] = 1 if table.get(di) is None else table.get(di) + 1\ntable = sorted(table.items())\n\ntotal = 0\nstart = 0\nend = 0\nfor difficulty, num in table:\n total += num\n\n if start == 0 and total == same:\n start = difficulty\n elif start != 0:\n end = difficulty\n break\n\n# print(table, start, end)\n\nanswer = end - start\nprint(answer)\n","change":"replace","i1":15,"i2":30,"j1":15,"j2":34,"error":"KeyError: 9","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02989\/Python\/s072989017.py\", line 16, in \n table[di] = 0 if table[di] is None else table[di] + 1\nKeyError: 9\n","stdout":null} {"problem_id":"p02989","language":"Python","original_status":"Runtime Error","pass":"N = int(input())\nD = list(map(int, input().split())).sort()\nprint(D[N \/\/ 2] - D[(N \/\/ 2) - 1])\n","fail":"N = int(input())\nD = sorted(list(map(int, input().split())))\nprint(D[N \/\/ 2] - D[(N \/\/ 2) - 1])\n","change":"replace","i1":1,"i2":2,"j1":1,"j2":2,"error":"TypeError: 'NoneType' object is not subscriptable","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02989\/Python\/s599840912.py\", line 3, in \n print(D[N \/\/ 2] - D[(N \/\/ 2) - 1])\nTypeError: 'NoneType' object is not subscriptable\n","stdout":null} {"problem_id":"p02989","language":"Python","original_status":"Runtime Error","pass":"N = int(input())\nD = list(map(int, input().split()))\nD.sort()\n\ncount = 0\ncur = 0\nfor i in range(10**5 + 1):\n if cur == N \/ 2:\n count += 1\n if cur > N \/ 2:\n break\n if D[cur] < i and cur < N:\n cur += 1\n while D[cur - 1] == D[cur]:\n cur += 1\nprint(count)\n","fail":"N = int(input())\nD = list(map(int, input().split()))\nD.sort()\n\nans = D[int(N \/ 2)] - D[int((N \/ 2) - 1)]\nprint(ans)\n","change":"replace","i1":4,"i2":16,"j1":4,"j2":6,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p02989","language":"Python","original_status":"Runtime Error","pass":"N = input()\n\nD = sorted([int(v) for v in input().split()])\narc = N \/\/ 2\nabc = arc - 1\nprint(D[arc] - D[abc])\n","fail":"N = int(input())\n\nD = sorted([int(v) for v in input().split()])\narc = N \/\/ 2\nabc = arc - 1\nprint(D[arc] - D[abc])\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"TypeError: unsupported operand type(s) for \/\/: 'str' and 'int'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02989\/Python\/s961124695.py\", line 4, in \n arc = N \/\/ 2\nTypeError: unsupported operand type(s) for \/\/: 'str' and 'int'\n","stdout":null} {"problem_id":"p02989","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\np = list(map(int, input().split()))\nans = 0\nfor k in range(1, max(p) + 1):\n abc = 0\n arc = 0\n for i in p:\n if i < k:\n abc += 1\n else:\n arc += 1\n if abc == arc:\n ans += 1\nprint(ans)\n","fail":"n = int(input())\np = sorted(list(map(int, input().split())))\na = int(len(p) \/ 2)\nif p[a - 1] == p[a]:\n print(0)\nelse:\n print(p[a] - p[a - 1])\n","change":"replace","i1":1,"i2":14,"j1":1,"j2":7,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02990","language":"Python","original_status":"Runtime Error","pass":"from math import factorial\n\nN, K = list(map(int, input().split()))\n\nx = 1000000007\n\nnum = factorial(N - K + 1) * factorial(K - 1)\n\nfor i in range(1, K + 1):\n if N - K < i - 1:\n print(0)\n\n denom = factorial(i) * factorial(N - K + 1 - i) * factorial(i - 1) * factorial(K - i)\n v = num \/\/ denom\n\n print(v % x)\n","fail":"from math import factorial\n\nN, K = list(map(int, input().split()))\n\nx = 1000000007\n\nnum = factorial(N - K + 1) * factorial(K - 1)\n\nfor i in range(1, K + 1):\n if N - K < i - 1:\n print(0)\n else:\n denom = (\n factorial(i) * factorial(N - K + 1 - i) * factorial(i - 1) * factorial(K - i)\n )\n v = num \/\/ denom\n\n print(v % x)\n","change":"replace","i1":11,"i2":16,"j1":11,"j2":18,"error":"0","stderr":null,"stdout":"3\n6\n1\n"} {"problem_id":"p02990","language":"Python","original_status":"Time Limit Exceeded","pass":"N, K = map(int, input().split())\n\nc = [[0] * 4000 for _ in range(4000)]\nc[0][0] = 1\nfor i in range(1, 4000):\n ci = c[i]\n ci1 = c[i - 1]\n ci[0] = 1\n for j in range(1, i + 1):\n ci[j] = (ci1[j - 1] + ci1[j]) % 1000000007\n\nfor i in range(1, K + 1):\n print(c[K - 1][i - 1] * c[N - K + 1][i] % 1000000007)\n","fail":"N, K = map(int, input().split())\n\nc = [[0] * 2001 for _ in range(2001)]\nc[0][0] = 1\nfor i in range(1, 2001):\n ci = c[i]\n ci1 = c[i - 1]\n ci[0] = 1\n for j in range(1, i + 1):\n ci[j] = (ci1[j - 1] + ci1[j]) % 1000000007\n\nfor i in range(1, K + 1):\n print(c[K - 1][i - 1] * c[N - K + 1][i] % 1000000007)\n","change":"replace","i1":2,"i2":5,"j1":2,"j2":5,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02990","language":"Python","original_status":"Runtime Error","pass":"N, K = map(int, input().split())\nans = N - K + 1\nfor i in range(1, K + 1):\n if i > N - K + 1:\n ans = 0\n print(int(ans % 1000000007))\n ans = ans * (N - K + 1 - i) \/ (i + 1) * (K - i) \/ i\n","fail":"N, K = map(int, input().split())\nans = N - K + 1\nfor i in range(1, K + 1):\n if i > N - K + 1:\n ans = 0\n print(ans % 1000000007)\n ans = ans * (N - K + 1 - i) * (K - i)\n ans = ans \/\/ ((i + 1) * i)\n","change":"replace","i1":5,"i2":7,"j1":5,"j2":8,"error":"0","stderr":null,"stdout":"3\n6\n1\n"} {"problem_id":"p02990","language":"Python","original_status":"Runtime Error","pass":"import math\n\nn, k = map(int, input().split())\n\n\ndef combinations_count(n, r):\n return math.factorial(n) \/\/ (math.factorial(n - r) * math.factorial(r))\n\n\nfor i in range(1, k + 1):\n tmp1 = combinations_count(k - 1, i - 1) % 1000000007\n tmp2 = combinations_count(n - k + 1, i) % 1000000007\n ans = (tmp1 * tmp2) % 1000000007\n print(ans)\n if ans == 1:\n exit()\n","fail":"import math\n\nn, k = map(int, input().split())\n\n\ndef combinations_count(n, r):\n return math.factorial(n) \/\/ (math.factorial(n - r) * math.factorial(r))\n\n\nfor i in range(1, k + 1):\n if n - k + 1 >= i:\n tmp1 = combinations_count(k - 1, i - 1) % 1000000007\n tmp2 = combinations_count(n - k + 1, i) % 1000000007\n ans = (tmp1 * tmp2) % 1000000007\n print(ans)\n else:\n print(0)\n","change":"replace","i1":10,"i2":16,"j1":10,"j2":17,"error":"0","stderr":null,"stdout":"3\n6\n1\n"} {"problem_id":"p02990","language":"Python","original_status":"Runtime Error","pass":"from operator import mul\nfrom functools import reduce\n\n\ndef cmb(n, r):\n r = min(n - r, r)\n if r == 0:\n return 1\n over = reduce(mul, range(n, n - r, -1))\n under = reduce(mul, range(1, r + 1))\n return over \/\/ under\n\n\nN, K = map(int, input().split())\n\nfor i in range(1, K + 1):\n if N == K:\n print(0)\n else:\n print((cmb(N - K + 1, i) % (10**9 + 7)) * (cmb(K - 1, i - 1) % (10**9 + 7)))\n","fail":"from operator import mul\nfrom functools import reduce\n\n\ndef cmb(n, r):\n r = min(n - r, r)\n if r == 0:\n return 1\n over = reduce(mul, range(n, n - r, -1))\n under = reduce(mul, range(1, r + 1))\n return over \/\/ under\n\n\nN, K = map(int, input().split())\n\nfor i in range(1, K + 1):\n if N - K + 1 < i:\n print(0)\n else:\n print((cmb(N - K + 1, i) * cmb(K - 1, i - 1)) % (10**9 + 7))\n","change":"replace","i1":16,"i2":20,"j1":16,"j2":20,"error":"0","stderr":null,"stdout":"3\n6\n1\n"} {"problem_id":"p02991","language":"Python","original_status":"Time Limit Exceeded","pass":"from scipy.sparse.csgraph import dijkstra\nfrom scipy.sparse import csr_matrix\n\nn, m = map(int, input().split())\nuv = [list(map(int, input().split())) for _ in range(m)]\ns, t = map(int, input().split())\n\nrow = []\ncol = []\nfor u, v in uv:\n for i in range(3):\n uu = u + i * n\n vv = v + ((i + 1) % 3) * n\n row.append(uu)\n col.append(vv)\n\ncost = [1] * len(row)\nN = 3 * (n + 1)\n\ng = csr_matrix((cost, (row, col)), shape=(N, N))\ndist = dijkstra(g, indices=s).astype(int)\nans = dist[t]\nif ans < 0:\n ans = -1\nelse:\n ans \/\/= 3\nprint(ans)\n","fail":"from collections import deque\n\nn, m = map(int, input().split())\nuv = [list(map(int, input().split())) for _ in range(m)]\ns, t = map(int, input().split())\n\nN = 3 * (n + 1)\nadj = [[] for _ in range(N)]\nfor u, v in uv:\n for i in range(3):\n uu = u + i * n\n vv = v + ((i + 1) % 3) * n\n adj[uu].append(vv)\n\ndq = deque([s])\nd = [-1] * N\nd[s] = 0\nwhile dq:\n u = dq.popleft()\n for v in adj[u]:\n if d[v] == -1:\n d[v] = d[u] + 1\n dq.append(v)\n\nans = d[t] \/\/ 3\nprint(ans)\n","change":"replace","i1":0,"i2":26,"j1":0,"j2":25,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02991","language":"Python","original_status":"Time Limit Exceeded","pass":"import sys\nfrom collections import deque\n\n\ndata = sys.stdin.readlines()\nN, M = map(int, data[0].split())\nedge = [[] for _ in range(N)]\nfor i in range(1, M + 1):\n u, v = map(int, data[i].split())\n u -= 1\n v -= 1\n edge[u].append(v)\nS, T = map(lambda x: int(x) - 1, data[M + 1].split())\n\n\ndef bfs1(s):\n q = deque()\n q.append((s, 0))\n\n while len(q) > 0:\n v, step = q.popleft()\n if step == 3:\n edge3[s].append(v)\n else:\n for nv in edge[v]:\n q.append((nv, step + 1))\n\n\ndef bfs2(n):\n global T\n q = deque()\n status[n] = 0\n q.append(n)\n\n while len(q) > 0:\n v = q.popleft()\n for nv in edge3[v]:\n if status[nv] == -1:\n status[nv] = status[v] + 1\n q.append(nv)\n\n\nedge3 = [[] for _ in range(N)]\nfor i in range(N):\n bfs1(i)\n\n\nstatus = [-1] * N\nstatus[S] = 0\nbfs2(S)\nprint(status[T])\n","fail":"import sys\nfrom collections import deque\n\n\ndata = sys.stdin.readlines()\nN, M = map(int, data[0].split())\nedge = [[] for _ in range(N)]\nfor i in range(1, M + 1):\n u, v = map(int, data[i].split())\n u -= 1\n v -= 1\n edge[u].append(v)\nS, T = map(lambda x: int(x) - 1, data[M + 1].split())\n\nvisited = set()\nq = deque()\nq.append((0, S))\nans = 10**10\nwhile len(q) > 0:\n c, v = q.popleft()\n key = (c % 3, v)\n if key in visited:\n continue\n visited.add(key)\n if v == T and c % 3 == 0:\n ans = min(ans, c \/\/ 3)\n else:\n for e in edge[v]:\n newKey = (c + 1, e)\n q.append(newKey)\n\nif ans == 10**10:\n print(-1)\nelse:\n print(ans)\n","change":"replace","i1":14,"i2":51,"j1":14,"j2":35,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02993","language":"Python","original_status":"Runtime Error","pass":"cord = list(input())\ncord_len = len(cord)\nfor i in range(cord - 1):\n if cord[i] == cord[i + 1]:\n print(\"Bad\")\n break\nelse:\n print(\"Good\")\n","fail":"cord = list(input())\ncord_len = len(cord)\nfor i in range(cord_len - 1):\n if cord[i] == cord[i + 1]:\n print(\"Bad\")\n break\nelse:\n print(\"Good\")\n","change":"replace","i1":2,"i2":3,"j1":2,"j2":3,"error":"TypeError: unsupported operand type(s) for -: 'list' and 'int'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02993\/Python\/s564571845.py\", line 3, in \n for i in range(cord - 1):\nTypeError: unsupported operand type(s) for -: 'list' and 'int'\n","stdout":null} {"problem_id":"p02993","language":"Python","original_status":"Runtime Error","pass":"s = int(input())\n\nans = \"Good\"\n\ns_temp = 99\n\nfor num in s:\n if int(num) == s_temp:\n ans = \"Bad\"\n break\n else:\n s_temp = int(num)\n\nprint(ans)\n","fail":"s = input()\n\nans = \"Good\"\n\ns_temp = 99\n\nfor num in s:\n if int(num) == s_temp:\n ans = \"Bad\"\n break\n else:\n s_temp = int(num)\n\nprint(ans)\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"TypeError: 'int' object is not iterable","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02993\/Python\/s013728744.py\", line 7, in \n for num in s:\nTypeError: 'int' object is not iterable\n","stdout":null} {"problem_id":"p02993","language":"Python","original_status":"Runtime Error","pass":"import sys\n\n\ndef input():\n return sys.stdin.readline()[:-1]\n\n\ndef main():\n n = input()\n if n[1] == n[2] or n[2] == n[3] or n[3] == n[4]:\n print(\"Bad\")\n\n else:\n print(\"Good\")\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"import sys\n\n\ndef input():\n return sys.stdin.readline()[:-1]\n\n\ndef main():\n n = input()\n if n[1] == n[2] or n[2] == n[3] or n[1] == n[0]:\n print(\"Bad\")\n\n else:\n print(\"Good\")\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":9,"i2":10,"j1":9,"j2":10,"error":"0","stderr":null,"stdout":"Bad\n"} {"problem_id":"p02993","language":"Python","original_status":"Runtime Error","pass":"S = input()\nif S[1] == S[2] or S[2] == S[3] or S[3] == S[4]:\n print(\"Bad\")\nelse:\n print(\"Good\")\n","fail":"S = input()\nif S[0] == S[1] or S[1] == S[2] or S[2] == S[3]:\n print(\"Bad\")\nelse:\n print(\"Good\")\n","change":"replace","i1":1,"i2":2,"j1":1,"j2":2,"error":"0","stderr":null,"stdout":"Bad\n"} {"problem_id":"p02994","language":"Python","original_status":"Runtime Error","pass":"def main():\n N, L = map(int, input().split())\n a = sum([L + n for n in range(N)])\n if L > 0:\n print(a - a[0])\n elif abs(L) >= N:\n print(a - a[-1])\n else:\n print(a)\n\n\nmain()\n","fail":"def main():\n N, L = map(int, input().split())\n a = [L + n for n in range(N)]\n if L > 0:\n print(sum(a) - a[0])\n elif abs(L) >= N:\n print(sum(a) - a[-1])\n else:\n print(sum(a))\n\n\nmain()\n","change":"replace","i1":2,"i2":9,"j1":2,"j2":9,"error":"TypeError: 'int' object is not subscriptable","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02994\/Python\/s496114130.py\", line 12, in \n main()\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02994\/Python\/s496114130.py\", line 5, in main\n print(a - a[0])\nTypeError: 'int' object is not subscriptable\n","stdout":null} {"problem_id":"p02995","language":"Python","original_status":"Runtime Error","pass":"import math\n\na, b, c, d = [int(ch) for ch in input().strip().split()]\n\n\n# upper \u4ee5\u4e0b\u3067 div \u3067\u5272\u308a\u5207\u308c\u308b\u3082\u306e\u306e\u500b\u6570\ndef num_divisor(upper, div):\n return upper \/\/ div\n\n\n# upper \u4ee5\u4e0b\u3067 c \u3067\u3082 d \u3067\u3082\u5272\u308a\u5207\u308c\u306a\u3044\u3082\u306e\u306e\u500b\u6570\ndef num_divisor_c_d(upper, c, d):\n gcd_cd = c * d \/\/ math.gcd(c, d)\n\n n1 = num_divisor(upper, c)\n n2 = num_divisor(upper, d)\n n12 = num_divisor(upper, gcd_cd)\n\n return upper - (n1 + n2 - n12)\n\n\nans = num_divisor_c_d(b, c, d) - num_divisor_c_d(a - 1, c, d)\n\nprint(ans)\n","fail":"# import math\nimport fractions\n\na, b, c, d = [int(ch) for ch in input().strip().split()]\n\n\n# upper \u4ee5\u4e0b\u3067 div \u3067\u5272\u308a\u5207\u308c\u308b\u3082\u306e\u306e\u500b\u6570\ndef num_divisor(upper, div):\n return upper \/\/ div\n\n\n# upper \u4ee5\u4e0b\u3067 c \u3067\u3082 d \u3067\u3082\u5272\u308a\u5207\u308c\u306a\u3044\u3082\u306e\u306e\u500b\u6570\ndef num_divisor_c_d(upper, c, d):\n # gcd_cd = c * d \/\/ math.gcd(c, d)\n gcd_cd = c * d \/\/ fractions.gcd(c, d)\n\n n1 = num_divisor(upper, c)\n n2 = num_divisor(upper, d)\n n12 = num_divisor(upper, gcd_cd)\n\n return upper - (n1 + n2 - n12)\n\n\nans = num_divisor_c_d(b, c, d) - num_divisor_c_d(a - 1, c, d)\n\nprint(ans)\n","change":"replace","i1":0,"i2":13,"j1":0,"j2":15,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p02995","language":"Python","original_status":"Runtime Error","pass":"import math\n\nA, B, C, D = map(int, input().split())\n\nstart = A \/\/ C\nend = B \/\/ C\nif A % C != 0:\n start = start + 1\nC_num = end - start + 1\n\nstart = A \/\/ D\nend = B \/\/ D\nif A % D != 0:\n start = start + 1\nD_num = end - start + 1\n\nCD = C * D \/\/ math.gcd(C, D)\nstart = A \/\/ CD\nend = B \/\/ CD\nif A % CD != 0:\n start = start + 1\nCD_num = end - start + 1\n\nans = (B - A + 1) - (C_num + D_num - CD_num)\n\nprint(ans)\n","fail":"def gcd(a, b): # a < b\n while True:\n c = b % a\n if c == 0:\n break\n b = a\n a = c\n\n return a\n\n\nA, B, C, D = map(int, input().split())\n\nstart = A \/\/ C\nend = B \/\/ C\nif A % C != 0:\n start = start + 1\nC_num = end - start + 1\n\nstart = A \/\/ D\nend = B \/\/ D\nif A % D != 0:\n start = start + 1\nD_num = end - start + 1\n\nCD = C * D \/\/ gcd(C, D)\nstart = A \/\/ CD\nend = B \/\/ CD\nif A % CD != 0:\n start = start + 1\nCD_num = end - start + 1\n\nans = (B - A + 1) - (C_num + D_num - CD_num)\n\nprint(ans)\n","change":"replace","i1":0,"i2":17,"j1":0,"j2":26,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p02995","language":"Python","original_status":"Runtime Error","pass":"import math\n\n\ndef solve():\n a, b, c, d = map(int, input().split())\n lcm = c * d \/\/ math.gcd(c, d)\n div_c = b \/\/ c - (a - 1) \/\/ c\n div_d = b \/\/ d - (a - 1) \/\/ d\n div_cd = b \/\/ lcm - (a - 1) \/\/ lcm\n return (b - a + 1) - div_c - div_d + div_cd\n\n\nif __name__ == \"__main__\":\n print(solve())\n","fail":"import fractions\n\n\ndef solve():\n a, b, c, d = map(int, input().split())\n lcm = c * d \/\/ fractions.gcd(c, d)\n div_c = b \/\/ c - (a - 1) \/\/ c\n div_d = b \/\/ d - (a - 1) \/\/ d\n div_cd = b \/\/ lcm - (a - 1) \/\/ lcm\n return (b - a + 1) - div_c - div_d + div_cd\n\n\nif __name__ == \"__main__\":\n print(solve())\n","change":"replace","i1":0,"i2":6,"j1":0,"j2":6,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p02995","language":"Python","original_status":"Runtime Error","pass":"from math import gcd\n\na, b, c, d = map(int, input().split())\n\n\ndef cnt_div(a, b, x):\n q, r = divmod(a, x)\n\n if r == 0:\n m = q - 1\n else:\n m = q\n\n n = b \/\/ x\n\n return n - m\n\n\nnum_c = cnt_div(a, b, c)\nnum_d = cnt_div(a, b, d)\nlcm = int((c * d) \/ gcd(c, d))\nnum_c_d_gcd = cnt_div(a, b, lcm)\n\nprint((b - a + 1) - (num_c + num_d - num_c_d_gcd))\n","fail":"from fractions import gcd\n\na, b, c, d = map(int, input().split())\n\n\ndef cnt_div(a, b, x):\n q, r = divmod(a, x)\n\n if r == 0:\n m = q - 1\n else:\n m = q\n\n n = b \/\/ x\n\n return n - m\n\n\nnum_c = cnt_div(a, b, c)\nnum_d = cnt_div(a, b, d)\nlcm = int((c * d) \/ gcd(c, d))\nnum_c_d_gcd = cnt_div(a, b, lcm)\n\nprint((b - a + 1) - (num_c + num_d - num_c_d_gcd))\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p02995","language":"Python","original_status":"Time Limit Exceeded","pass":"a, b, c, d = map(int, input().split())\n\nx, y = max(c, d), min(c, d)\nr = x - y\nwhile r != 0:\n x, y = max(y, r), min(y, r)\n r = x - y\ngcd = x\nlcm = c * d \/\/ gcd\n\nnc = b \/\/ c - (a - 1) \/\/ c\nnd = b \/\/ d - (a - 1) \/\/ d\nnlcm = b \/\/ lcm - (a - 1) \/\/ lcm\n\nprint((b - a + 1) - (nc + nd - nlcm))\n","fail":"a, b, c, d = map(int, input().split())\n\nx, y = c, d\nr = x % y\nwhile r != 0:\n x, y = y, r\n r = x % y\ngcd = y\nlcm = c * d \/\/ gcd\n\nnc = b \/\/ c - (a - 1) \/\/ c\nnd = b \/\/ d - (a - 1) \/\/ d\nnlcm = b \/\/ lcm - (a - 1) \/\/ lcm\n\nprint((b - a + 1) - (nc + nd - nlcm))\n","change":"replace","i1":2,"i2":8,"j1":2,"j2":8,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02995","language":"Python","original_status":"Runtime Error","pass":"from math import gcd\n\nA, B, C, D = map(int, input().split())\nG = gcd(C, D)\nL = C * D \/\/ G\nca = (A - 1) \/\/ C\ncb = B \/\/ C\nda = (A - 1) \/\/ D\ndb = B \/\/ D\nla = (A - 1) \/\/ L\nlb = B \/\/ L\ndiv = cb + db - (ca + da) - (lb - la)\nprint(B - (A - 1) - div)\n","fail":"from fractions import gcd\n\nA, B, C, D = map(int, input().split())\nG = gcd(C, D)\nL = C * D \/\/ G\nca = (A - 1) \/\/ C\ncb = B \/\/ C\nda = (A - 1) \/\/ D\ndb = B \/\/ D\nla = (A - 1) \/\/ L\nlb = B \/\/ L\ndiv = cb + db - (ca + da) - (lb - la)\nprint(B - (A - 1) - div)\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p02995","language":"Python","original_status":"Runtime Error","pass":"import math\n\nA, B, C, D = map(int, input().split(\" \"))\nr = B - A + 1\nn_C = round(r \/ C)\nn_D = round(r \/ D)\nn_CD = round(r \/ ((C * D) \/\/ math.gcd(C, D)))\nprint(r - (n_C + n_D - n_CD))\n","fail":"from fractions import gcd\n\n\ndef wari(x, c, d):\n nc = x \/\/ c\n nd = x \/\/ d\n ncd = x \/\/ ((c * d) \/\/ gcd(c, d))\n return x - nc - nd + ncd\n\n\nA, B, C, D = map(int, input().split())\n\nnb = wari(B, C, D)\nna = wari(A - 1, C, D)\nprint(nb - na)\n","change":"replace","i1":0,"i2":8,"j1":0,"j2":15,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p02995","language":"Python","original_status":"Runtime Error","pass":"import math\n\nS = input().split()\n\nA = int(S[0])\nB = int(S[1])\nC = int(S[2])\nD = int(S[3])\n\nCD = (C * D) \/\/ math.gcd(C, D)\n\ncount_B = B - (B \/\/ C) - (B \/\/ D) + (B \/\/ CD)\ncount_A = A - 1 - ((A - 1) \/\/ C) - ((A - 1) \/\/ D) + ((A - 1) \/\/ CD)\n\nprint(count_B - count_A)\n","fail":"def gcd(a, b):\n while b:\n a, b = b, a % b\n return a\n\n\nS = input().split()\n\nA = int(S[0])\nB = int(S[1])\nC = int(S[2])\nD = int(S[3])\n\nCD = (C * D) \/\/ gcd(C, D)\n\ncount_B = B - (B \/\/ C) - (B \/\/ D) + (B \/\/ CD)\ncount_A = A - 1 - ((A - 1) \/\/ C) - ((A - 1) \/\/ D) + ((A - 1) \/\/ CD)\n\nprint(count_B - count_A)\n","change":"replace","i1":0,"i2":10,"j1":0,"j2":14,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p02995","language":"Python","original_status":"Runtime Error","pass":"from math import gcd\n\nA, B, C, D = [int(x) for x in input().split(\" \")]\n\nc = (B \/\/ C) - (A \/\/ C) + int(A % C == 0)\nd = (B \/\/ D) - (A \/\/ D) + int(A % D == 0)\nlcm_cd = (C * D) \/\/ gcd(C, D)\ncd = (B \/\/ (lcm_cd)) - (A \/\/ (lcm_cd)) + int(A % (lcm_cd) == 0)\n\nc_or_d = c + d - cd\n\nprint((B - A + 1) - c_or_d)\n","fail":"from fractions import gcd\n\nA, B, C, D = [int(x) for x in input().split(\" \")]\n\nc = (B \/\/ C) - (A \/\/ C) + int(A % C == 0)\nd = (B \/\/ D) - (A \/\/ D) + int(A % D == 0)\nlcm_cd = (C * D) \/\/ gcd(C, D)\ncd = (B \/\/ (lcm_cd)) - (A \/\/ (lcm_cd)) + int(A % (lcm_cd) == 0)\n\nc_or_d = c + d - cd\n\nprint((B - A + 1) - c_or_d)\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p02995","language":"Python","original_status":"Runtime Error","pass":"import math\n\na, b, c, d = list(map(int, input().split()))\n\nc_n = (b \/\/ c) - ((a - 1) \/\/ c)\nd_n = (b \/\/ d) - ((a - 1) \/\/ d)\n\nlcm = (c * d) \/\/ math.gcd(c, d)\nlcm_n = (b \/\/ lcm) - ((a - 1) \/\/ lcm)\n\nans = (b - a + 1) - (c_n + d_n - lcm_n)\nprint(ans)\n","fail":"import fractions\n\na, b, c, d = list(map(int, input().split()))\n\nc_n = (b \/\/ c) - ((a - 1) \/\/ c)\nd_n = (b \/\/ d) - ((a - 1) \/\/ d)\n\nlcm = (c * d) \/\/ fractions.gcd(c, d)\nlcm_n = (b \/\/ lcm) - ((a - 1) \/\/ lcm)\n\nans = (b - a + 1) - (c_n + d_n - lcm_n)\nprint(ans)\n","change":"replace","i1":0,"i2":8,"j1":0,"j2":8,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p02995","language":"Python","original_status":"Runtime Error","pass":"import math\n\na, b, c, d = map(int, input().split())\n\n\ndef lcm(x, y):\n return x * y \/\/ math.gcd(x, y)\n\n\na1 = a - 1\ndiv_a = (a1 \/\/ c) + (a1 \/\/ d) - (a1 \/\/ lcm(c, d))\ndiv_b = (b \/\/ c) + (b \/\/ d) - (b \/\/ lcm(c, d))\n\nprint((b - a + 1) - (div_b - div_a))\n","fail":"# import math\nimport fractions\n\n\na, b, c, d = map(int, input().split())\n\n\ndef lcm(x, y):\n # DeprecationWarning: fractions.gcd() is deprecated. Use math.gcd() instead.\n return x * y \/\/ fractions.gcd(x, y)\n\n\na1 = a - 1\ndiv_a = (a1 \/\/ c) + (a1 \/\/ d) - (a1 \/\/ lcm(c, d))\ndiv_b = (b \/\/ c) + (b \/\/ d) - (b \/\/ lcm(c, d))\n\nprint((b - a + 1) - (div_b - div_a))\n","change":"replace","i1":0,"i2":7,"j1":0,"j2":10,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p02995","language":"Python","original_status":"Runtime Error","pass":"import math\n\nA, B, C, D = map(int, input().split())\nlcm = C * D \/\/ math.gcd(C, D)\n\ncount = 0\ndiv_C = B \/\/ C - math.ceil(A \/ C) + 1\ndiv_D = B \/\/ D - math.ceil(A \/ D) + 1\ndiv_C_D = B \/\/ lcm - math.ceil(A \/ lcm) + 1\n\n\nprint(B - A + 1 - div_C - div_D + div_C_D)\n","fail":"import math\nimport fractions\n\nA, B, C, D = map(int, input().split())\nlcm = C * D \/\/ fractions.gcd(C, D)\n\ncount = 0\nif A % C == 0:\n div_C = B \/\/ C - A \/\/ C + 1\nelse:\n div_C = B \/\/ C - A \/\/ C\n\nif A % D == 0:\n div_D = B \/\/ D - A \/\/ D + 1\nelse:\n div_D = B \/\/ D - A \/\/ D\n\nif A % lcm == 0:\n div_C_D = B \/\/ lcm - A \/\/ lcm + 1\nelse:\n div_C_D = B \/\/ lcm - A \/\/ lcm\n\nprint(B - A + 1 - div_C - div_D + div_C_D)\n","change":"replace","i1":1,"i2":10,"j1":1,"j2":21,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p02995","language":"Python","original_status":"Runtime Error","pass":"import math\n\na, b, c, d = map(int, input().split())\nran = b - a + 1\nif a % c == 0:\n count1 = math.ceil(ran \/ c)\nelse:\n count1 = math.ceil((ran - (c - a % c)) \/ c)\nif a % d == 0:\n count2 = math.ceil(ran \/ d)\nelse:\n count2 = math.ceil((ran - (d - a % d)) \/ d)\ne = c * d \/ math.gcd(c, d)\nif a % e == 0:\n count3 = math.ceil(ran \/ e)\nelse:\n count3 = math.ceil((ran - (e - a % e)) \/ e)\nprint(ran - (count1 + count2 - count3))\n","fail":"import math\n\n\ndef gcd(a, b):\n while b != 0:\n a, b = b, a % b\n return a\n\n\ndef lcm(a, b):\n return a \/\/ gcd(a, b) * b\n\n\na, b, c, d = map(int, input().split())\nran = b - a + 1\n\n\ndef count(x):\n r = ran if a % x == 0 else ran - (x - a % x)\n return r \/\/ x if r % x == 0 else r \/\/ x + 1\n\n\ncount1 = count(c)\ncount2 = count(d)\ne = lcm(c, d)\ncount3 = count(e)\nprint(ran - (count1 + count2 - count3))\n","change":"replace","i1":1,"i2":17,"j1":1,"j2":26,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p02995","language":"Python","original_status":"Runtime Error","pass":"from fractions import gcd\nimport math\n\na, b, c, d = map(int, input().split())\n\n\ndef lcm(x, y):\n if math.gcd(x, y) == 0:\n return x * y\n return x * y \/\/ gcd(x, y)\n\n\ndef cantdiv(x):\n return x - x \/\/ c - x \/\/ d + x \/\/ lcm(c, d)\n\n\nprint(cantdiv(b) - cantdiv(a - 1))\n","fail":"from fractions import gcd\n\na, b, c, d = map(int, input().split())\n\n\ndef lcm(x, y):\n if gcd(x, y) == 0:\n return x * y\n return x * y \/\/ gcd(x, y)\n\n\ndef cantdiv(x):\n return x - x \/\/ c - x \/\/ d + x \/\/ lcm(c, d)\n\n\nprint(cantdiv(b) - cantdiv(a - 1))\n","change":"replace","i1":1,"i2":8,"j1":1,"j2":7,"error":"ImportError: cannot import name 'gcd' from 'fractions' (\/usr\/lib\/python3.10\/fractions.py)","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02995\/Python\/s662817319.py\", line 1, in \n from fractions import gcd\nImportError: cannot import name 'gcd' from 'fractions' (\/usr\/lib\/python3.10\/fractions.py)\n","stdout":null} {"problem_id":"p02995","language":"Python","original_status":"Runtime Error","pass":"import math\n\n\ndef func(n, c, d):\n x = n \/\/ c\n y = n \/\/ d\n z = n \/\/ (c * d \/\/ math.gcd(c, d))\n\n return n - x - y + z\n\n\na, b, c, d = map(int, input().split())\n\nprint(func(b, c, d) - func(a - 1, c, d))\n","fail":"import fractions\n\n\ndef func(n, c, d):\n x = n \/\/ c\n y = n \/\/ d\n z = n \/\/ (c * d \/\/ fractions.gcd(c, d))\n\n return n - x - y + z\n\n\na, b, c, d = map(int, input().split())\n\nprint(func(b, c, d) - func(a - 1, c, d))\n","change":"replace","i1":0,"i2":7,"j1":0,"j2":7,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p02995","language":"Python","original_status":"Runtime Error","pass":"import math\nimport sys\n\ninput = sys.stdin.readline\n\n\ndef main():\n A, B, C, D = [int(i) for i in input().split()]\n # X : A\u3068B\u306e\u9593\u306e\u6574\u6570\u306e\u6570\n X = B - A + 1\n # Y : A\u3068B\u306e\u9593\u3067C\u306e\u500d\u6570\u306e\u6570\n Y = (B \/\/ C) - ((A - 1) \/\/ C)\n # Z : A\u3068B\u306e\u9593\u3067D\u306e\u500d\u6570\u306e\u6570\n Z = (B \/\/ D) - ((A - 1) \/\/ D)\n # V : C\u3068D\u306e\u6700\u5c0f\u516c\u500d\u6570\n V = (C * D) \/\/ math.gcd(C, D)\n # W : A\u3068B\u306e\u9593\u3067V\u306e\u500d\u6570\u306e\u6570\n W = (B \/\/ V) - ((A - 1) \/\/ V)\n print(X - Y - Z + W)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"import sys\n\ninput = sys.stdin.readline\n\n\ndef gcd(*args):\n a = max(args)\n b = min(args)\n while b != 0:\n a, b = b, a % b\n return a\n\n\ndef main():\n A, B, C, D = [int(i) for i in input().split()]\n # X : A\u3068B\u306e\u9593\u306e\u6574\u6570\u306e\u6570\n X = B - A + 1\n # Y : A\u3068B\u306e\u9593\u3067C\u306e\u500d\u6570\u306e\u6570\n Y = (B \/\/ C) - ((A - 1) \/\/ C)\n # Z : A\u3068B\u306e\u9593\u3067D\u306e\u500d\u6570\u306e\u6570\n Z = (B \/\/ D) - ((A - 1) \/\/ D)\n # V : C\u3068D\u306e\u6700\u5c0f\u516c\u500d\u6570\n V = (C * D) \/\/ gcd(C, D)\n # W : A\u3068B\u306e\u9593\u3067V\u306e\u500d\u6570\u306e\u6570\n W = (B \/\/ V) - ((A - 1) \/\/ V)\n print(X - Y - Z + W)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":0,"i2":16,"j1":0,"j2":23,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p02995","language":"Python","original_status":"Runtime Error","pass":"import math\n\n\ndef lcm(x, y):\n return (x * y) \/\/ math.gcd(x, y)\n\n\nA, B, C, D = map(int, input().split())\n\n# B\u4ee5\u4e0b\u3067\u5272\u308a\u5207\u308c\u308b\nUB_C = B \/\/ C\nUB_D = B \/\/ D\nUB_CD = B \/\/ lcm(C, D)\n\nUB = B - (UB_C + UB_D - UB_CD)\n\n# A\u4ee5\u4e0b\u3067\u5272\u308a\u5207\u308c\u308b\nUA_C = A \/\/ C\nUA_D = A \/\/ D\nUA_CD = A \/\/ lcm(C, D)\n\nUA = A - (UA_C + UA_D - UA_CD)\n\nans = UB - UA\n\nif A % C != 0 and A % D != 0:\n ans += 1\n\nprint(ans)\n","fail":"def gcd(a, b):\n while b:\n a, b = b, a % b\n return a\n\n\ndef lcm(x, y):\n return (x * y) \/\/ gcd(x, y)\n\n\nA, B, C, D = map(int, input().split())\n\n# B\u4ee5\u4e0b\u3067\u5272\u308a\u5207\u308c\u308b\nUB_C = B \/\/ C\nUB_D = B \/\/ D\nUB_CD = B \/\/ lcm(C, D)\n\nUB = B - (UB_C + UB_D - UB_CD)\n\n# A\u4ee5\u4e0b\u3067\u5272\u308a\u5207\u308c\u308b\nUA_C = A \/\/ C\nUA_D = A \/\/ D\nUA_CD = A \/\/ lcm(C, D)\n\nUA = A - (UA_C + UA_D - UA_CD)\n\nans = UB - UA\n\nif A % C != 0 and A % D != 0:\n ans += 1\n\nprint(ans)\n","change":"replace","i1":0,"i2":5,"j1":0,"j2":8,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p02995","language":"Python","original_status":"Runtime Error","pass":"import math\n\na, b, c, d = map(int, input().split(\" \"))\n\n\ndef lcm(x, y):\n return (x * y) \/\/ math.gcd(x, y)\n\n\ndef sj(base, i1, i2):\n cz = base \/\/ i1\n dz = base \/\/ i2\n cd = base \/\/ lcm(i1, i2)\n return base - (cz + dz - cd)\n\n\nprint(sj(b, c, d) - sj(a - 1, c, d))\n","fail":"from fractions import gcd\n\na, b, c, d = map(int, input().split(\" \"))\n\n\ndef lcm(x, y):\n return (x * y) \/\/ gcd(x, y)\n\n\ndef sj(base, i1, i2):\n cz = base \/\/ i1\n dz = base \/\/ i2\n cd = base \/\/ lcm(i1, i2)\n return base - (cz + dz - cd)\n\n\nprint(sj(b, c, d) - sj(a - 1, c, d))\n","change":"replace","i1":0,"i2":7,"j1":0,"j2":7,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p02995","language":"Python","original_status":"Runtime Error","pass":"import math\n\n\ndef lcm(x, y):\n return (x * y) \/\/ math.gcd(x, y)\n\n\na, b, c, d = map(int, input().split())\ne = b - int(b \/ c) - int(b \/ d) + int(b \/ lcm(c, d))\nf = (a - 1) - int((a - 1) \/ c) - int((a - 1) \/ d) + int((a - 1) \/ lcm(c, d))\nprint(e - f)\n","fail":"def gcd(x, y):\n while y != 0:\n x, y = y, x % y\n return x\n\n\ndef lcm(x, y):\n return x * y \/\/ gcd(x, y)\n\n\na, b, c, d = map(int, input().split())\na = a - 1\ne = b - b \/\/ c - b \/\/ d + b \/\/ lcm(c, d)\nf = a - a \/\/ c - a \/\/ d + a \/\/ lcm(c, d)\nprint(e - f)\n","change":"replace","i1":0,"i2":10,"j1":0,"j2":14,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p02995","language":"Python","original_status":"Runtime Error","pass":"import math\n\na, b, c, d = map(int, input().split())\nr = 0\nbc = b \/\/ c\nbd = b \/\/ d\nbcd = b \/\/ ((c * d) \/\/ math.gcd(c, d))\nac = -(-a \/\/ c)\nad = -(-a \/\/ d)\nacd = -(-a \/\/ ((c * d) \/\/ math.gcd(c, d)))\nprint(b - a + 1 - bc + ac - 1 - bd + ad - 1 + bcd - acd + 1)\n","fail":"def gcd(a, b):\n while b:\n a, b = b, a % b\n return a\n\n\ndef lcm(a, b):\n return a * b \/\/ gcd(a, b)\n\n\na, b, c, d = map(int, input().split())\nr = 0\nbc = b \/\/ c\nbd = b \/\/ d\nbcd = b \/\/ lcm(c, d)\nac = -(-a \/\/ c)\nad = -(-a \/\/ d)\nacd = -(-a \/\/ lcm(c, d))\nprint(b - a + 1 - bc + ac - 1 - bd + ad - 1 + bcd - acd + 1)\n","change":"replace","i1":0,"i2":10,"j1":0,"j2":18,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p02995","language":"Python","original_status":"Runtime Error","pass":"from fractions import gcd\n\nA, B, C, D = map(int, input().split())\n\nif B < C and B < D:\n print(B - A + 1)\n exit()\n\nCD_lcm = C * D \/\/ gcd(C, D)\n\nn_cant_divs = []\nfor target in [C, D, CD_lcm]:\n if A <= target <= B:\n t_cant_div = target - A\n can_div = B \/\/ target\n t_cant_div2 = (B - target + 1) - can_div\n n_cant_divs.append(t_cant_div + t_cant_div2)\n elif target < A:\n can_div_w_over = B \/\/ target\n correction = (A - 1) \/\/ target\n actual_can_div = can_div_w_over - correction\n t_cant_div = (B - A + 1) - actual_can_div\n n_cant_divs.append(t_cant_div)\n\nprint(n_cant_divs[0] + n_cant_divs[1] - n_cant_divs[2])\n","fail":"from fractions import gcd\n\nA, B, C, D = map(int, input().split())\n\nCD_lcm = (C * D) \/\/ gcd(C, D)\n\n\ndef divided(a, b, target):\n return b \/\/ target - (a - 1) \/\/ target\n\n\nall_num = B - A + 1\n\ndiv_t1 = divided(A, B, C)\ndiv_t2 = divided(A, B, D)\ndiv_extra = divided(A, B, CD_lcm)\n\nprint(all_num - div_t1 - div_t2 + div_extra)\n","change":"replace","i1":4,"i2":25,"j1":4,"j2":18,"error":"ImportError: cannot import name 'gcd' from 'fractions' (\/usr\/lib\/python3.10\/fractions.py)","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02995\/Python\/s290829222.py\", line 1, in \n from fractions import gcd\nImportError: cannot import name 'gcd' from 'fractions' (\/usr\/lib\/python3.10\/fractions.py)\n","stdout":null} {"problem_id":"p02995","language":"Python","original_status":"Runtime Error","pass":"# -*- coding: utf-8 -*-\n# \u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u30a4\u30f3\u30dd\u30fc\u30c8\nimport math\n\n# \u6a19\u6e96\u5165\u529b\u306e\u53d6\u5f97\nA, B, C, D = list(map(int, input().split()))\n\n\ndef lcm(x: int, y: int) -> int:\n return (x * y) \/\/ math.gcd(x, y)\n\n\n# \u6c42\u89e3\u51e6\u7406\ndiv_C = (B \/\/ C) - ((A - 1) \/\/ C)\ndiv_D = (B \/\/ D) - ((A - 1) \/\/ D)\nlcm_CD = lcm(C, D)\ndiv_lcm_CD = (B \/\/ lcm_CD) - ((A - 1) \/\/ lcm_CD)\nresult = (B - A + 1) - div_C - div_D + div_lcm_CD\n\n# \u7d50\u679c\u51fa\u529b\nprint(result)\n","fail":"# -*- coding: utf-8 -*-\n# \u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u30a4\u30f3\u30dd\u30fc\u30c8\nfrom fractions import gcd\n\n# \u6a19\u6e96\u5165\u529b\u306e\u53d6\u5f97\nA, B, C, D = list(map(int, input().split()))\n\n\ndef lcm(x: int, y: int) -> int:\n return (x * y) \/\/ gcd(x, y)\n\n\n# \u6c42\u89e3\u51e6\u7406\ndiv_C = (B \/\/ C) - ((A - 1) \/\/ C)\ndiv_D = (B \/\/ D) - ((A - 1) \/\/ D)\nlcm_CD = lcm(C, D)\ndiv_lcm_CD = (B \/\/ lcm_CD) - ((A - 1) \/\/ lcm_CD)\nresult = (B - A + 1) - div_C - div_D + div_lcm_CD\n\n# \u7d50\u679c\u51fa\u529b\nprint(result)\n","change":"replace","i1":2,"i2":10,"j1":2,"j2":10,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p02995","language":"Python","original_status":"Runtime Error","pass":"import math\n\na, b, c, d = map(int, input().split())\n# print(b - a + 1)\ne = c * d \/\/ math.gcd(c, d)\ncMax = math.ceil(a \/ c)\ncMin = math.floor(b \/ c)\n# print(cMin - cMax + 1)\ndMax = math.ceil(a \/ d)\ndMin = math.floor(b \/ d)\n# print(dMin - dMax + 1)\neMax = math.ceil(a \/ e)\neMin = math.floor(b \/ e)\n# print(eMin - eMax + 1)\n\nprint(b - a + 1 + eMin - eMax + 1 - (cMin - cMax + 1) - (dMin - dMax + 1))\n","fail":"import math\n\na, b, c, d = map(int, input().split())\ncd = (c * d) \/\/ math.gcd(c, d)\nu = b \/\/ c + b \/\/ d - b \/\/ cd\nl = (a - 1) \/\/ c + (a - 1) \/\/ d - (a - 1) \/\/ cd\n\nprint(b - a + 1 - u + l)\n","change":"replace","i1":3,"i2":16,"j1":3,"j2":8,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p02995","language":"Python","original_status":"Runtime Error","pass":"import math\n\n\ndef main():\n A, B, C, D = map(int, input().split())\n lcm = (C * D) \/\/ math.gcd(C, D)\n bc = B \/\/ C\n ac = A \/\/ C\n if A % C == 0:\n ac -= 1\n bd = B \/\/ D\n ad = A \/\/ D\n if A % D == 0:\n ad -= 1\n blcm = B \/\/ lcm\n alcm = A \/\/ lcm\n if A % lcm == 0:\n alcm -= 1\n print(B - A + 1 - ((bc - ac) + (bd - ad) - (blcm - alcm)))\n\n\nmain()\n","fail":"import fractions\n\n\ndef main():\n A, B, C, D = map(int, input().split())\n lcm = (C * D) \/\/ fractions.gcd(C, D)\n bc = B \/\/ C\n ac = A \/\/ C\n if A % C == 0:\n ac -= 1\n bd = B \/\/ D\n ad = A \/\/ D\n if A % D == 0:\n ad -= 1\n blcm = B \/\/ lcm\n alcm = A \/\/ lcm\n if A % lcm == 0:\n alcm -= 1\n print(B - A + 1 - ((bc - ac) + (bd - ad) - (blcm - alcm)))\n\n\nmain()\n","change":"replace","i1":0,"i2":6,"j1":0,"j2":6,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p02995","language":"Python","original_status":"Runtime Error","pass":"from math import gcd\n\nA, B, C, D = map(int, input().split())\nC_div = B \/\/ C - (A - 1) \/\/ C\nD_div = B \/\/ D - (A - 1) \/\/ D\nCD = C * D \/\/ gcd(C, D)\nCD_div = B \/\/ CD - (A - 1) \/\/ CD\nprint(B - A + 1 - C_div - D_div + CD_div)\n","fail":"from fractions import gcd\n\nA, B, C, D = map(int, input().split())\nC_div = B \/\/ C - (A - 1) \/\/ C\nD_div = B \/\/ D - (A - 1) \/\/ D\nCD = C * D \/\/ gcd(C, D)\nCD_div = B \/\/ CD - (A - 1) \/\/ CD\nprint(B - A + 1 - C_div - D_div + CD_div)\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p02995","language":"Python","original_status":"Runtime Error","pass":"from sys import stdin\nimport math\n\nA, B, C, D = [int(x) for x in stdin.readline().rstrip().split()]\n\n\ndef div(n, x, y):\n lcs = int(x * y \/ math.gcd(x, y))\n return n - int(n \/\/ x) - int(n \/\/ y) + int(n \/\/ lcs)\n\n\nprint(div(B, C, D) - div(A - 1, C, D))\n","fail":"from sys import stdin\nimport fractions\n\nA, B, C, D = [int(x) for x in stdin.readline().rstrip().split()]\n\n\ndef div(n, x, y):\n lcs = int(x * y \/ fractions.gcd(x, y))\n return n - int(n \/\/ x) - int(n \/\/ y) + int(n \/\/ lcs)\n\n\nprint(div(B, C, D) - div(A - 1, C, D))\n","change":"replace","i1":1,"i2":8,"j1":1,"j2":8,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p02995","language":"Python","original_status":"Runtime Error","pass":"import math\n\nA, B, C, D = map(int, input().split())\n\ncntC = B \/\/ C - A \/\/ C + int(A % C == 0)\ncntD = B \/\/ D - A \/\/ D + int(A % D == 0)\n\nlcm = C * D \/\/ math.gcd(C, D)\ncntCD = B \/\/ lcm - A \/\/ lcm + int(A % lcm == 0)\n\nprint((B - A + 1) - (cntC + cntD - cntCD))\n","fail":"import fractions\n\nA, B, C, D = map(int, input().split())\n\ncntC = B \/\/ C - A \/\/ C + int(A % C == 0)\ncntD = B \/\/ D - A \/\/ D + int(A % D == 0)\n\nlcm = C * D \/\/ fractions.gcd(C, D)\ncntCD = B \/\/ lcm - A \/\/ lcm + int(A % lcm == 0)\n\nprint((B - A + 1) - (cntC + cntD - cntCD))\n","change":"replace","i1":0,"i2":8,"j1":0,"j2":8,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p02995","language":"Python","original_status":"Runtime Error","pass":"import math\n\n\ndef lcm(x, y):\n return (x * y) \/\/ math.gcd(x, y)\n\n\ndef main():\n A, B, C, D = map(int, input().split())\n first = B \/\/ C - A \/\/ C\n first += 1 if A % C == 0 else 0\n second = B \/\/ D - A \/\/ D\n second += 1 if A % D == 0 else 0\n tmp = lcm(C, D)\n both = B \/\/ tmp - A \/\/ tmp\n both += 1 if A % tmp == 0 else 0\n print(B - A + 1 - first - second + both)\n return\n\n\nmain()\n","fail":"# \u30d0\u30fc\u30b8\u30e7\u30f3 3.4.X \u4ee5\u524d\nimport fractions\n\n# \u30d0\u30fc\u30b8\u30e7\u30f3 3.5 \u4ee5\u964d\n# mport math\n\n\ndef lcm(x, y):\n return (x * y) \/\/ fractions.gcd(x, y)\n\n\ndef main():\n A, B, C, D = map(int, input().split())\n first = B \/\/ C - A \/\/ C\n first += 1 if A % C == 0 else 0\n second = B \/\/ D - A \/\/ D\n second += 1 if A % D == 0 else 0\n tmp = lcm(C, D)\n both = B \/\/ tmp - A \/\/ tmp\n both += 1 if A % tmp == 0 else 0\n print(B - A + 1 - first - second + both)\n return\n\n\nmain()\n","change":"replace","i1":0,"i2":5,"j1":0,"j2":9,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p02995","language":"Python","original_status":"Runtime Error","pass":"from math import gcd\n\n\ndef main():\n A, B, C, D = map(int, input().split())\n Q_AC, R_AC = A \/\/ C, A % C\n Q_AD, R_AD = A \/\/ D, A % D\n Q_BC, R_BC = B \/\/ C, B % C\n Q_BD, R_BD = B \/\/ D, B % D\n Q_ACD, R_ACD = A \/\/ lcm(C, D), A % lcm(C, D)\n Q_BCD, R_BCD = B \/\/ lcm(C, D), B % lcm(C, D)\n N_C = num_baisu(Q_AC, Q_BC, R_AC, R_BC)\n N_D = num_baisu(Q_AD, Q_BD, R_AD, R_BD)\n N_CD = num_baisu(Q_ACD, Q_BCD, R_ACD, R_BCD)\n print(B - A + 1 - (N_C + N_D - N_CD))\n return\n\n\ndef lcm(x, y):\n return (x * y) \/\/ gcd(x, y)\n\n\ndef num_baisu(Q_A, Q_B, R_A, R_B):\n if R_A == 0 and R_B == 0:\n return Q_B - Q_A + 1\n elif R_A == 0 and R_B != 0:\n return Q_B - Q_A + 1\n elif R_A != 0 and R_B == 0:\n return Q_B - (Q_A + 1) + 1\n else:\n return Q_B - (Q_A + 1) + 1\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"from fractions import gcd\n\n\ndef main():\n A, B, C, D = map(int, input().split())\n Q_AC, R_AC = A \/\/ C, A % C\n Q_AD, R_AD = A \/\/ D, A % D\n Q_BC, R_BC = B \/\/ C, B % C\n Q_BD, R_BD = B \/\/ D, B % D\n Q_ACD, R_ACD = A \/\/ lcm(C, D), A % lcm(C, D)\n Q_BCD, R_BCD = B \/\/ lcm(C, D), B % lcm(C, D)\n N_C = num_baisu(Q_AC, Q_BC, R_AC, R_BC)\n N_D = num_baisu(Q_AD, Q_BD, R_AD, R_BD)\n N_CD = num_baisu(Q_ACD, Q_BCD, R_ACD, R_BCD)\n print(B - A + 1 - (N_C + N_D - N_CD))\n return\n\n\ndef lcm(x, y):\n return (x * y) \/\/ gcd(x, y)\n\n\ndef num_baisu(Q_A, Q_B, R_A, R_B):\n if R_A == 0 and R_B == 0:\n return Q_B - Q_A + 1\n elif R_A == 0 and R_B != 0:\n return Q_B - Q_A + 1\n elif R_A != 0 and R_B == 0:\n return Q_B - (Q_A + 1) + 1\n else:\n return Q_B - (Q_A + 1) + 1\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p02995","language":"Python","original_status":"Runtime Error","pass":"import math\n\n\nclass AntiDivision:\n def __init__(self):\n self.A, self.B, self.C, self.D = map(int, input().split())\n\n def cal(self):\n a_b_count = self.B - self.A + 1\n lcm = (self.C * self.D) \/\/ math.gcd(self.C, self.D)\n c_count = self.B \/\/ self.C - (self.A - 1) \/\/ self.C\n d_count = self.B \/\/ self.D - (self.A - 1) \/\/ self.D\n lcm_count = self.B \/\/ lcm - (self.A - 1) \/\/ lcm\n\n print(a_b_count - c_count - d_count + lcm_count)\n\n\nantiDivision = AntiDivision()\nantiDivision.cal()\n","fail":"import fractions\n\n\nclass AntiDivision:\n def __init__(self):\n self.A, self.B, self.C, self.D = map(int, input().split())\n\n def cal(self):\n a_b_count = self.B - self.A + 1\n lcm = (self.C * self.D) \/\/ fractions.gcd(self.C, self.D)\n c_count = self.B \/\/ self.C - (self.A - 1) \/\/ self.C\n d_count = self.B \/\/ self.D - (self.A - 1) \/\/ self.D\n lcm_count = self.B \/\/ lcm - (self.A - 1) \/\/ lcm\n\n print(a_b_count - c_count - d_count + lcm_count)\n\n\nantiDivision = AntiDivision()\nantiDivision.cal()\n","change":"replace","i1":0,"i2":10,"j1":0,"j2":10,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p02996","language":"Python","original_status":"Time Limit Exceeded","pass":"def dec(X, d):\n X[1] -= d\n return X\n\n\nN = int(input())\ntask = [list(map(int, input().split())) for _ in range(N)]\n\ntask.sort(key=lambda x: x[1])\n\nwhile task:\n if task[0][1] - task[0][0] < 0:\n print(\"No\")\n exit()\n task = list(map(lambda x: dec(x, task[0][0]), task[1:]))\n\nprint(\"Yes\")\n","fail":"def dec(X, d):\n X[1] -= d\n return X\n\n\nN = int(input())\ntask = [list(map(int, input().split())) for _ in range(N)]\n\ntask.sort(key=lambda x: x[1])\ntime = 0\nfor i in range(N):\n time += task[i][0]\n if time > task[i][1]:\n print(\"No\")\n exit()\n\nprint(\"Yes\")\n","change":"replace","i1":9,"i2":15,"j1":9,"j2":15,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02997","language":"Python","original_status":"Runtime Error","pass":"from itertools import combinations\n\nn, k = map(int, input().split())\nstar = []\nmax_k = (n - 1) * (n - 2) \/\/ 2\ndelta = max_k - k\ncnt = 0\nif k <= max_k:\n ans = []\n for i in range(2, n + 1):\n star.append((1, i))\n cnt += 1\n\n if delta > 0:\n kumiawase = list(combinations(range(2, n), 2))\n for j in range(delta):\n kumi = kumiawase[j]\n star.append(kumi)\n cnt += 1\n print(cnt)\n for pair in star:\n print(*pair, sep=\" \")\nelse:\n print(-1)\n","fail":"from itertools import combinations\n\nn, k = map(int, input().split())\nstar = []\nmax_k = (n - 1) * (n - 2) \/\/ 2\ndelta = max_k - k\ncnt = 0\nif k <= max_k:\n ans = []\n for i in range(2, n + 1):\n star.append((1, i))\n cnt += 1\n\n if delta > 0:\n kumiawase = list(combinations(range(2, n + 1), 2))\n for j in range(delta):\n kumi = kumiawase[j]\n star.append(kumi)\n cnt += 1\n print(cnt)\n for pair in star:\n print(*pair, sep=\" \")\nelse:\n print(-1)\n","change":"replace","i1":14,"i2":15,"j1":14,"j2":15,"error":"WA","stderr":null,"stdout":"7\n1 2\n1 3\n1 4\n1 5\n2 3\n2 4\n3 4\n"} {"problem_id":"p02997","language":"Python","original_status":"Runtime Error","pass":"n, k = map(int, input().split())\n\nif k <= (n - 1) * (n - 2) \/\/ 2:\n raise Exception\nelse:\n print(-1)\n","fail":"n, k = map(int, input().split())\n\nif k <= (n - 1) * (n - 2) \/\/ 2:\n g = [0] * (n * n)\n for i in range(n * n):\n u = i \/\/ n\n v = i % n\n if u < v:\n g[i] = 1\n\n i = 0\n for _ in range(k):\n while g[i] == 0 or i % n == n - 1:\n i += 1\n g[i] = 0\n\n cnt = sum(g)\n print(cnt)\n for i, e in enumerate(g):\n if e:\n u = i \/\/ n + 1\n v = i % n + 1\n print(u, v)\n\nelse:\n print(-1)\n","change":"replace","i1":3,"i2":4,"j1":3,"j2":24,"error":"1","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02997\/Python\/s244694894.py\", line 4, in \n raise Exception\nException\n","stdout":null} {"problem_id":"p02997","language":"Python","original_status":"Runtime Error","pass":"N, K = map(int, input().split())\n\nif K > (N - 1)(N - 2) \/\/ 2:\n print(-1)\nelse:\n M = N * (N - 1) \/\/ 2 - K\n cnt = 0\n ans = []\n for i in range(N - 1):\n for j in range(i + 1, N):\n ans.append((i + 1, j + 1))\n cnt += 1\n if M == cnt:\n break\n else:\n continue\n break\n print(M)\n for edge in ans:\n print(*edge)\n","fail":"N, K = map(int, input().split())\n\nif K > (N - 1) * (N - 2) \/\/ 2:\n print(-1)\nelse:\n M = N * (N - 1) \/\/ 2 - K\n cnt = 0\n ans = []\n for i in range(N - 1):\n for j in range(i + 1, N):\n ans.append((i + 1, j + 1))\n cnt += 1\n if M == cnt:\n break\n else:\n continue\n break\n print(M)\n for edge in ans:\n print(*edge)\n","change":"replace","i1":2,"i2":3,"j1":2,"j2":3,"error":"TypeError: 'int' object is not callable","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02997\/Python\/s559992185.py\", line 3, in \n if K > (N - 1)(N - 2) \/\/ 2:\nTypeError: 'int' object is not callable\n","stdout":null} {"problem_id":"p02997","language":"Python","original_status":"Runtime Error","pass":"N, K = map(int, input().split())\n\nmax_num = (N - 1) * (N - 2) \/\/ 2\n\nfor i in range(2, N + 1):\n print(1, i)\n\nadd = max_num - K\n\nedges = []\nfor i in range(2, N):\n for j in range(i + 1, N + 1):\n edges.append(i, j)\n\nfor i in range(add):\n print(edges[i])\n","fail":"N, K = map(int, input().split())\n\nmax_num = (N - 1) * (N - 2) \/\/ 2\n\nif K > max_num:\n print(-1)\nelse:\n edges = []\n for i in range(2, N + 1):\n edges.append(\n (\n 1,\n i,\n )\n )\n\n add = max_num - K\n\n candidates = []\n for i in range(2, N):\n for j in range(i + 1, N + 1):\n candidates.append(\n (\n i,\n j,\n )\n )\n\n for i in range(add):\n edges.append(candidates[i])\n\n print(len(edges))\n for edge in edges:\n print(\" \".join(map(str, edge)))\n","change":"replace","i1":4,"i2":16,"j1":4,"j2":34,"error":"TypeError: list.append() takes exactly one argument (2 given)","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02997\/Python\/s568785222.py\", line 13, in \n edges.append(i, j)\nTypeError: list.append() takes exactly one argument (2 given)\n","stdout":"1 2\n1 3\n1 4\n1 5\n"} {"problem_id":"p02997","language":"Python","original_status":"Runtime Error","pass":"from e import resolve\nimport sys\nfrom io import StringIO\nimport unittest\n\n\nclass TestClass(unittest.TestCase):\n def assertIO(self, input, output):\n stdout, stdin = sys.stdout, sys.stdin\n sys.stdout, sys.stdin = StringIO(), StringIO(input)\n resolve()\n sys.stdout.seek(0)\n out = sys.stdout.read()[:-1]\n sys.stdout, sys.stdin = stdout, stdin\n self.assertEqual(out, output)\n\n def test_\u5165\u529b\u4f8b_1(self):\n input = \"\"\"5 3\"\"\"\n output = \"\"\"5\n4 3\n1 2\n3 1\n4 5\n2 3\"\"\"\n self.assertIO(input, output)\n\n def test_\u5165\u529b\u4f8b_2(self):\n input = \"\"\"5 8\"\"\"\n output = \"\"\"-1\"\"\"\n self.assertIO(input, output)\n\n def test_\u5165\u529b\u4f8b_3(self):\n input = \"\"\"5 1\"\"\"\n output = \"\"\"-1\"\"\"\n self.assertIO(input, output)\n\n def test_\u5165\u529b\u4f8b_4(self):\n input = \"\"\"5 0\"\"\"\n output = \"\"\"-1\"\"\"\n self.assertIO(input, output)\n\n\nif __name__ == \"__main__\":\n unittest.main()\n","fail":"import bisect, collections, copy, heapq, itertools, math, string, sys\n\ninput = lambda: sys.stdin.readline().rstrip()\nsys.setrecursionlimit(10**7)\nINF = float(\"inf\")\n\n\ndef I():\n return int(input())\n\n\ndef F():\n return float(input())\n\n\ndef SS():\n return input()\n\n\ndef LI():\n return [int(x) for x in input().split()]\n\n\ndef LI_():\n return [int(x) - 1 for x in input().split()]\n\n\ndef LF():\n return [float(x) for x in input().split()]\n\n\ndef LSS():\n return input().split()\n\n\ndef resolve():\n N, K = LI()\n\n # K\u306e\u4e0a\u754c\u3068\u3057\u3066\u3001\u5168\u3066\u306e\u9802\u70b9\u5bfe\u306e\u6570\u304c\u3042\u308b\u3002\n # \u30b0\u30e9\u30d5\u304c\u9023\u7d50\u306a\u306e\u3067\u9802\u70b9\u6570-1\u500b\u306e\u9802\u70b9\u5bfe\u306f\u6700\u77ed\u8ddd\u96e21\u306b\u306a\u308b\u3002\n # \u3088\u3063\u3066K\u306e\u6700\u5927\u5024\u306fNC2-(N-1)\n max_K = N * (N - 1) \/\/ 2 - (N - 1)\n if K <= max_K:\n # K\u304c\u6700\u5927\u5024\u3092\u53d6\u308b\u306e\u306f\u30b9\u30bf\u30fc\u578b\n # \u305d\u3053\u304b\u3089\u8449\u540c\u58eb\u3092\u304f\u3063\u3064\u3051\u3066\u6e1b\u3089\u3057\u3066\u3044\u304f\n print((N - 1) + max_K - K)\n for i in range(1, N):\n print(i, N)\n cnt = max_K\n for i, j in itertools.combinations(range(1, N), 2):\n if cnt == K:\n break\n print(i, j)\n cnt -= 1\n else:\n print(-1)\n\n\nif __name__ == \"__main__\":\n resolve()\n","change":"replace","i1":0,"i2":44,"j1":0,"j2":60,"error":"ModuleNotFoundError: No module named 'e'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02997\/Python\/s904121924.py\", line 1, in \n from e import resolve\nModuleNotFoundError: No module named 'e'\n","stdout":null} {"problem_id":"p02997","language":"Python","original_status":"Runtime Error","pass":"n, k = map(int, input().split())\nans = []\nc = (n - 1) * (n - 2) \/\/ 2 - k\nif c < k:\n print(-1)\n exit(1)\nfor i in range(1, n):\n ans.append((0, i))\ncnt = 0\nflg = 0\nfor i in range(1, n):\n if flg:\n break\n for j in range(1, n):\n if i == j:\n continue\n ans.append((i, j))\n cnt += 1\n if cnt >= c:\n flg = 1\n break\nprint(len(ans))\nfor a, b in ans:\n print(a, b)\n","fail":"n, k = map(int, input().split())\nans = []\nc = (n - 1) * (n - 2) \/\/ 2 - k\nif c < 0:\n print(-1)\n exit(0)\nfor i in range(1, n):\n ans.append((0, i))\ncnt = 0\nflg = 0\nfor i in range(1, n):\n if flg:\n break\n for j in range(i + 1, n):\n if cnt >= c:\n flg = 1\n break\n ans.append((i, j))\n cnt += 1\nprint(len(ans))\nfor a, b in ans:\n print(a + 1, b + 1)\n","change":"replace","i1":3,"i2":24,"j1":3,"j2":22,"error":"WA","stderr":null,"stdout":"7\n0 1\n0 2\n0 3\n0 4\n1 2\n1 3\n1 4\n"} {"problem_id":"p02998","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\nxy = [list(map(int, input().split())) for _ in range(n)]\nxtoy = {}\nytox = {}\nfor x, y in xy:\n if x not in xtoy:\n xtoy[x] = []\n xtoy[x].append(y)\n if y not in ytox:\n ytox[y] = []\n ytox[y].append(x)\nret = 0\nwhile len(xtoy) > 0:\n q = [(next(iter(xtoy)), None)]\n xs = set()\n ys = set()\n while len(q) > 0:\n (x, y) = q.pop(0)\n if x is not None and x not in xs:\n xs.add(x)\n for y in xtoy.pop(x):\n q.append((None, y))\n if y is not None and y not in ys:\n ys.add(y)\n for x in ytox.pop(y):\n q.append((x, None))\n ret += len(xs) * len(ys)\nprint(ret - n)\n","fail":"n = int(input())\nxy = [list(map(int, input().split())) for _ in range(n)]\nxtoy = {}\nytox = {}\nfor x, y in xy:\n if x not in xtoy:\n xtoy[x] = []\n xtoy[x].append(y)\n if y not in ytox:\n ytox[y] = []\n ytox[y].append(x)\nret = 0\nwhile len(xtoy) > 0:\n x = next(iter(xtoy))\n xs = set()\n ys = set()\n xs.add(x)\n q = [(x, None)]\n while len(q) > 0:\n (xx, yy) = q.pop(0)\n if xx is not None:\n for y in xtoy.pop(xx):\n if y not in ys:\n ys.add(y)\n q.append((None, y))\n if yy is not None:\n for x in ytox.pop(yy):\n if x not in xs:\n xs.add(x)\n q.append((x, None))\n ret += len(xs) * len(ys)\nprint(ret - n)\n","change":"replace","i1":13,"i2":26,"j1":13,"j2":30,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p02999","language":"Python","original_status":"Runtime Error","pass":"x, a = map(int, input())\nif x < a:\n print(0)\nelse:\n print(10)\n","fail":"x, a = map(int, input().split())\nif x < a:\n print(0)\nelse:\n print(10)\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"ValueError: invalid literal for int() with base 10: ' '","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02999\/Python\/s478583937.py\", line 1, in \n x, a = map(int, input())\nValueError: invalid literal for int() with base 10: ' '\n","stdout":null} {"problem_id":"p02999","language":"Python","original_status":"Runtime Error","pass":"x, a = map(int, input())\nif x < a:\n print(0)\nelse:\n print(10)\n","fail":"# A Rounding\n\nx, a = map(int, input().split())\nif x < a:\n print(0)\nelse:\n print(10)\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":3,"error":"ValueError: invalid literal for int() with base 10: ' '","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02999\/Python\/s947229710.py\", line 1, in \n x, a = map(int, input())\nValueError: invalid literal for int() with base 10: ' '\n","stdout":null} {"problem_id":"p02999","language":"Python","original_status":"Runtime Error","pass":"# -*- coding: utf-8 -*-\n\nx, a = int(input()), int(input())\n\nif x < a:\n print(\"0\")\nelse:\n print(\"10\")\n","fail":"# -*- coding: utf-8 -*-\n\nx, a = map(int, input().split())\n\nif x < a:\n print(\"0\")\nelse:\n print(\"10\")\n","change":"replace","i1":2,"i2":3,"j1":2,"j2":3,"error":"ValueError: invalid literal for int() with base 10: '3 5'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02999\/Python\/s027313793.py\", line 3, in \n x, a = int(input()), int(input())\nValueError: invalid literal for int() with base 10: '3 5'\n","stdout":null} {"problem_id":"p02999","language":"Python","original_status":"Runtime Error","pass":"X, A = map(int, input())\nif X < A:\n print(0)\nelse:\n print(10)\n","fail":"X, A = map(int, input().split())\nif X < A:\n print(0)\nelse:\n print(10)\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"ValueError: invalid literal for int() with base 10: ' '","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p02999\/Python\/s897076551.py\", line 1, in \n X, A = map(int, input())\nValueError: invalid literal for int() with base 10: ' '\n","stdout":null} {"problem_id":"p03000","language":"Python","original_status":"Runtime Error","pass":"N, X = map(int, input().split())\npositions = list(map(int, input().split()))\n\n\nans = 1\nD = 0\nfor i in range(N + 1):\n if D + positions[i] <= X:\n D += positions[i]\n ans += 1\n else:\n print(ans)\n exit()\nprint(ans)\n","fail":"N, X = map(int, input().split())\npositions = list(map(int, input().split()))\n\n\nans = 1\nD = 0\nfor i in range(N):\n if D + positions[i] <= X:\n D += positions[i]\n ans += 1\n else:\n print(ans)\n exit()\nprint(ans)\n","change":"replace","i1":6,"i2":7,"j1":6,"j2":7,"error":"0","stderr":null,"stdout":2} {"problem_id":"p03000","language":"Python","original_status":"Runtime Error","pass":"a, b = map(int, input().split())\nc = list(map(int, input().split()))\nd = 1\ne = 0\nfor i in range(a):\n e += c[i]\n if e <= b:\n d += 1\nprint(d)\na, b = map(int, input().split())\nc = list(map(int, input().split()))\nd = 1\ne = 0\nfor i in range(a):\n e += c[i]\n if e <= b:\n d += 1\n else:\n break\nprint(d)\n","fail":"a, b = map(int, input().split())\nc = list(map(int, input().split()))\nd = 1\ne = 0\nfor i in range(a):\n e += c[i]\n if e <= b:\n d += 1\n else:\n break\nprint(d)\n","change":"delete","i1":0,"i2":9,"j1":0,"j2":0,"error":"EOFError: EOF when reading a line","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03000\/Python\/s443147037.py\", line 10, in \n a, b = map(int, input().split())\nEOFError: EOF when reading a line\n","stdout":2} {"problem_id":"p03000","language":"Python","original_status":"Runtime Error","pass":"N, X = map(int, input().split())\nL = list(map(int, input().split()))\nx = 0\ni = 0\nwhile x <= X:\n x += L[i]\n i += 1\nprint(i)\n","fail":"N, X = map(int, input().split())\nL = list(map(int, input().split()))\nx = 0\nans = 1\nfor i in range(N):\n x += L[i]\n if x > X:\n break\n else:\n ans += 1\nprint(ans)\n","change":"replace","i1":3,"i2":8,"j1":3,"j2":11,"error":"0","stderr":null,"stdout":2} {"problem_id":"p03000","language":"Python","original_status":"Runtime Error","pass":"def li():\n return list(map(int, input().split()))\n\n\nif __name__ == \"__main__\":\n [n, x] = li()\n l_list = li()\n\n bound = 0\n bound_x = 0\n index = 0\n while bound_x <= x:\n bound = bound + 1\n bound_x = bound_x + l_list[index]\n index = index + 1\n print(bound)\n","fail":"def li():\n return list(map(int, input().split()))\n\n\nif __name__ == \"__main__\":\n [n, x] = li()\n l_list = li()\n\n bound = 0\n bound_x = 0\n index = 0\n bound = bound + 1\n while bound_x + l_list[index] <= x:\n bound = bound + 1\n bound_x = bound_x + l_list[index]\n index = index + 1\n if index >= len(l_list):\n break\n\n print(bound)\n","change":"replace","i1":11,"i2":15,"j1":11,"j2":19,"error":"0","stderr":null,"stdout":2} {"problem_id":"p03000","language":"Python","original_status":"Runtime Error","pass":"n, x = map(int, input().split())\nls = list(map(int, input().split()))\n\nd = 0\ncount = 0\nwhile d <= x:\n d += ls[count]\n count += 1\n\nprint(count)\n","fail":"n, x = map(int, input().split())\nls = list(map(int, input().split()))\n\nd = 0\ncount = 1\nfor a in ls:\n d += a\n if d <= x:\n count += 1\n\nprint(count)\n","change":"replace","i1":4,"i2":8,"j1":4,"j2":9,"error":"0","stderr":null,"stdout":2} {"problem_id":"p03000","language":"Python","original_status":"Runtime Error","pass":"# \u5165\u529b\u306e\u53d6\u5f97(1\u884c\u76ee\u3002\u6570\u5024)\ni = list(map(int, input().split()))\n\n# \u5909\u6570\u30bb\u30c3\u30c8\nboundCnt = i[0]\nlimit = i[1]\n\n# \u5165\u529b\u306e\u53d6\u5f97(2\u884c\u76ee\u3002\u6570\u5024)\nlandpoints = list(map(int, input().split()))\n\nnowCnt = 0\nnowLandpoints = 0\nfor i in range(boundCnt + 1):\n if nowLandpoints > limit:\n break\n nowCnt += 1\n nowLandpoints += landpoints[i]\n\nprint(nowCnt)\n","fail":"# \u5165\u529b\u306e\u53d6\u5f97(1\u884c\u76ee\u3002\u6570\u5024)\ni = list(map(int, input().split()))\n\n# \u5909\u6570\u30bb\u30c3\u30c8\nboundCnt = i[0]\nlimit = i[1]\n\n# \u5165\u529b\u306e\u53d6\u5f97(2\u884c\u76ee\u3002\u6570\u5024)\nlandpoints = list(map(int, input().split()))\n# 1\u56de\u76ee\u306e\u30d0\u30a6\u30f3\u30c9\u60c5\u5831\u3092\u52a0\u7b97(0\u5ea7\u6a19)\nlandpoints.insert(0, 0)\nboundCnt += 1\n\nnowCnt = 0\nnowLandpoints = 0\n\nfor i in range(boundCnt):\n\n nowLandpoints += landpoints[i]\n if nowLandpoints > limit:\n break\n\n nowCnt += 1\n\nprint(nowCnt)\n","change":"replace","i1":9,"i2":17,"j1":9,"j2":23,"error":"0","stderr":null,"stdout":2} {"problem_id":"p03000","language":"Python","original_status":"Runtime Error","pass":"N, X = map(int, input().split())\nL = list(map(int, input().split()))\n\ni = 0\nD = 0\n\nif L[0] > X:\n print(1)\n exit()\nelif L[0] == X:\n print(2)\n exit()\n\nwhile D <= X and i <= N:\n D += L[i]\n i += 1\n\nprint(i)\n","fail":"N, X = map(int, input().split())\nL = list(map(int, input().split()))\n\ni = 0\nD = 0\ncnt = 1\n\nfor i in range(N):\n D += L[i]\n if D <= X:\n cnt += 1\nprint(cnt)\n","change":"replace","i1":5,"i2":18,"j1":5,"j2":12,"error":"0","stderr":null,"stdout":2} {"problem_id":"p03000","language":"Python","original_status":"Runtime Error","pass":"def main():\n N, X = map(int, input().split())\n L = list(map(int, input().split()))\n cnt = 1\n D = 0\n\n while True:\n if D > X:\n cnt -= 1\n break\n if cnt > N + 1:\n cnt -= 1\n break\n D += L[cnt - 1]\n cnt += 1\n\n print(cnt)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"def main():\n N, X = map(int, input().split())\n L = list(map(int, input().split()))\n D = 0\n\n for cnt in range(2, N + 2):\n D += L[cnt - 2]\n if D > X:\n cnt -= 1\n break\n\n print(cnt)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":3,"i2":15,"j1":3,"j2":10,"error":"0","stderr":null,"stdout":2} {"problem_id":"p03001","language":"Python","original_status":"Runtime Error","pass":"import sys\n\ninput = sys.stdin.readline\n\nw, h, x, y = map(int, input().split())\n\nif w == h:\n print(f\"{w * h \/ 2} 1\")\nelse:\n print(f\"{w * h \/ 2} 0\")\n","fail":"import sys\n\ninput = sys.stdin.readline\n\nw, h, x, y = map(int, input().split())\n\nif w % 2 == 0 and h % 2 == 0 and w \/\/ 2 == x and h \/\/ 2 == y:\n print(str(w * h \/ 2) + \" \" + \"1\")\nelse:\n print(str(w * h \/ 2) + \" \" + \"0\")\n","change":"replace","i1":6,"i2":10,"j1":6,"j2":10,"error":"WA","stderr":null,"stdout":"3.0 0\n"} {"problem_id":"p03001","language":"Python","original_status":"Runtime Error","pass":"# \u771f\u3093\u4e2d\u3092\u901a\u308c\u3070\u5fc5\u305a\u4e8c\u5206\u3067\u304d\u3066\u3053\u308c\u304c\u6700\u5927\u5024\u3060\u304c\u3001\u81ea\u5206\u81ea\u8eab\u304c\u771f\u3093\u4e2d\u306e\u5ea7\u6a19\u306e\u5834\u5408\u306f\u81ea\u5206\u81ea\u4fe1\u3092\u901a\u308b\u3069\u3093\u306a\u76f4\u7dda\u3082\u4e8c\u5206\u3067\u304d\u308b\nw, h, x, y = map(int, input().split())\nans1 = (w * h) \/ 2.0\nans2 = 1 if w \/\/ x == h \/\/ y == 2 else 0\nprint(ans1, ans2)\n","fail":"# \u771f\u3093\u4e2d\u3092\u901a\u308c\u3070\u5fc5\u305a\u4e8c\u5206\u3067\u304d\u3066\u3053\u308c\u304c\u6700\u5927\u5024\u3060\u304c\u3001\u81ea\u5206\u81ea\u8eab\u304c\u771f\u3093\u4e2d\u306e\u5ea7\u6a19\u306e\u5834\u5408\u306f\u81ea\u5206\u81ea\u4fe1\u3092\u901a\u308b\u3069\u3093\u306a\u76f4\u7dda\u3082\u4e8c\u5206\u3067\u304d\u308b\nw, h, x, y = map(int, input().split())\nans1 = (w * h) \/ 2.0\nans2 = 1 if w \/ 2 == x and h \/ 2 == y else 0\nprint(ans1, ans2)\n","change":"replace","i1":3,"i2":4,"j1":3,"j2":4,"error":"WA","stderr":null,"stdout":"3.0 0\n"} {"problem_id":"p03001","language":"Python","original_status":"Runtime Error","pass":"W, H, x, y = map(int, input().split())\njufuku = 0\nif x == 0 and y == 0:\n if y \/ x == H \/ W:\n naname = W * H \/ 2\n jufuku = 1\n kiri = naname\nelse:\n # \u7e26\n tate = min((W - x) * H, x * H)\n # \u6a2a\n yoko = min(W * (H - y), W * y)\n if tate == yoko:\n jufuku = 1\n kiri = max(tate, yoko)\nprint(kiri, jufuku)\n","fail":"W, H, x, y = map(int, input().split())\njufuku = 0\nif W \/ 2 == x and H \/ 2 == y:\n jufuku = 1\nprint(W * H \/ 2, jufuku)\n","change":"replace","i1":2,"i2":16,"j1":2,"j2":5,"error":"WA","stderr":null,"stdout":"3 0\n"} {"problem_id":"p03001","language":"Python","original_status":"Runtime Error","pass":"W, H, x, y = map(int, input().split())\nprint(W * H \/ 2, 1 if W \/ x == 2 and H \/ y == 2 else 0)\n","fail":"W, H, x, y = map(int, input().split())\nprint(W * H \/ 2, 1 if x != 0 and y != 0 and W \/ x == 2 and H \/ y == 2 else 0)\n","change":"replace","i1":1,"i2":2,"j1":1,"j2":2,"error":"WA","stderr":null,"stdout":"3.0 0\n"} {"problem_id":"p03001","language":"Python","original_status":"Runtime Error","pass":"W, H, x, y = map(int, input().split())\n\ns = W * H\nif W % x == 0 and H % y == 0:\n print(\"{0} {1}\".format(W * H \/\/ 2, 1))\nelse:\n a = W * y\n b = H * x\n p = 1 if a == b else 0\n print(\"{0} {1}\".format(min(a, b), p))\n","fail":"W, H, x, y = map(int, input().split())\nif W \/ 2 == x and H \/ 2 == y:\n p = 1\nelse:\n p = 0\n\nprint(\"{} {}\".format(W * H \/ 2, p))\n","change":"replace","i1":1,"i2":10,"j1":1,"j2":7,"error":"WA","stderr":null,"stdout":"3 0\n"} {"problem_id":"p03003","language":"Python","original_status":"Time Limit Exceeded","pass":"N, M = map(int, input().split())\nS = list(map(int, input().split()))\nT = list(map(int, input().split()))\nMOD = 10**9 + 7\ndp = [[0] * (M + 2) for _ in range(N + 2)]\nsdp = [[0] * (M + 2) for _ in range(N + 2)]\ndp[0][0] = 1\nsdp[1][1] = 1\nfor i in range(N + 1):\n for j in range(M + 1):\n if i - 1 >= 0 and j - 1 >= 0 and S[i - 1] == T[j - 1]:\n dp[i][j] = sdp[i][j]\n sdp[i + 1][j + 1] = sdp[i + 1][j] + sdp[i][j + 1] - sdp[i][j] + dp[i][j]\n sdp[i + 1][j + 1] %= MOD\n sdp[i + 1][j + 1] %= MOD\nprint(sdp[N + 1][M + 1])\n","fail":"# dp[i][j] S\u3068T\u306e\u6700\u5f8c\u306e\u6587\u5b57\u3092\u63a1\u7528\u3059\u308b\u3088\u3046\u306a\u6587\u5b57\u5217\u306e\u500b\u6570\u3002\u3053\u308c\u306b\u3088\u308a\u5404DP\u30c6\u30fc\u30d6\u30eb\u306e\u5024\u304c\u6392\u53cd\u306b\u306a\u308b\u3002\u5143\u306e\u6587\u5b57\u5217\u306e\u6700\u5f8c\u3092\u5fc5\u305a\u63a1\u7528\u3059\u308b\u306e\u3067\nN, M = map(int, input().split())\nS = list(map(int, input().split()))\nT = list(map(int, input().split()))\nMOD = 10**9 + 7\ndp = [[0] * (M + 2) for _ in range(N + 2)]\nsdp = [[0] * (M + 2) for _ in range(N + 2)]\ndp[0][0] = 1\nsdp[1][1] = 1\nfor i in range(N + 1):\n for j in range(M + 1):\n if i - 1 >= 0 and j - 1 >= 0 and S[i - 1] == T[j - 1]:\n dp[i][j] = sdp[i][j]\n sdp[i + 1][j + 1] = sdp[i + 1][j] + sdp[i][j + 1] - sdp[i][j] + dp[i][j]\n sdp[i + 1][j + 1] %= MOD\n sdp[i + 1][j + 1] %= MOD\nprint(sdp[N + 1][M + 1])\n","change":"insert","i1":0,"i2":0,"j1":0,"j2":1,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03006","language":"Python","original_status":"Runtime Error","pass":"from itertools import permutations\nfrom collections import Counter\n\n\nn = int(input())\nballs = []\n\nfor _ in range(n):\n x, y = map(int, input().split())\n balls.append((x, y))\n\ncounter = Counter()\nfor b1, b2 in permutations(balls, 2):\n p, q = b1[0] - b2[0], b1[1] - b2[1]\n counter[(p, q)] += 1\n\n(p, q), val = counter.most_common(1)[0]\nprint(n - val)\n","fail":"from itertools import permutations\nfrom collections import Counter\n\n\nn = int(input())\nballs = []\n\nfor _ in range(n):\n x, y = map(int, input().split())\n balls.append((x, y))\n\nif n == 1:\n print(1)\nelse:\n counter = Counter()\n for b1, b2 in permutations(balls, 2):\n p, q = b1[0] - b2[0], b1[1] - b2[1]\n counter[(p, q)] += 1\n\n (p, q), val = counter.most_common(1)[0]\n print(n - val)\n","change":"replace","i1":11,"i2":18,"j1":11,"j2":21,"error":"0","stderr":null,"stdout":1.0} {"problem_id":"p03006","language":"Python","original_status":"Runtime Error","pass":"import sys\nfrom collections import Counter\n\nN = int(input())\npoints = []\nfor i, line in enumerate(sys.stdin):\n x, y = map(int, line.split())\n points.append([x, y])\n if i == N - 1:\n break\n\ncounts = []\nfor i in range(N):\n for j in range(N):\n if i == j:\n continue\n p = points[j][0] - points[i][0]\n q = points[j][1] - points[i][1]\n counts.append((p, q))\n\npq = Counter(counts).most_common()[0][1]\ncost = N - pq\nprint(cost)\n","fail":"import sys\nfrom collections import Counter\n\nN = int(input())\npoints = []\nfor i, line in enumerate(sys.stdin):\n x, y = map(int, line.split())\n points.append([x, y])\n if i == N - 1:\n break\nif len(points) == 1:\n print(1)\n sys.exit(0)\n\ncounts = []\nfor i in range(N):\n for j in range(N):\n if i == j:\n continue\n p = points[j][0] - points[i][0]\n q = points[j][1] - points[i][1]\n counts.append((p, q))\n\npq = Counter(counts).most_common()[0][1]\ncost = N - pq\nprint(cost)\n","change":"insert","i1":10,"i2":10,"j1":10,"j2":13,"error":"0","stderr":null,"stdout":1.0} {"problem_id":"p03006","language":"Python","original_status":"Runtime Error","pass":"# https:\/\/atcoder.jp\/contests\/diverta2019-2\/tasks\/diverta2019_2_b\n# \u554f\u984c\u6587\u306f\u3088\u304f\u8aad\u3082\u3046\u306d\uff01\n\n# \u5b9f\u969b\u306b\u30dc\u30fc\u30eb\u3092\u62fe\u3063\u3066\u3044\u304f\u30b7\u30df\u30e5\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u3057\u3066\u3044\u3063\u3066\u3082\u5341\u5206\u9593\u306b\u5408\u3046\n\nfrom itertools import combinations\nfrom collections import defaultdict\nfrom operator import itemgetter\n\nN = int(input())\npoints = [tuple(map(int, input().split())) for _ in range(N)]\nans = 0\n\n\ndef is_online(x0, y0, xa, ya, p, q):\n # x0,y0\u3092\u901a\u308b\u76f4\u7dda\u304cp,q\u3067\u4e0e\u3048\u3089\u308c\u305f\u3068\u304d\u306b\u3001xa,ya\u304c\u305d\u306e\u7dda\u4e0a\u306b\u3042\u308b\u304b\u5224\u5225\n dx = xa - x0\n dy = ya - y0\n if dx == 0 and dy == 0:\n return True\n elif dx == 0 or dy == 0:\n return False\n # print(x0, y0, xa, ya, p, q)\n return (dy \/ dx) == (q \/ p) # \u50be\u304d\u304c\u540c\u3058\u306a\u3089\u3070\u7dda\u4e0a\u306b\u3042\u308b\n\n\ndef pickballs(balls):\n # cnt most frequent p,q\n global ans\n\n # \u6700\u9069\u306apq\u63a2\u7d22\n cnts = defaultdict(lambda: 0)\n for pa, pb in combinations(balls, 2):\n dx = pa[0] - pb[0]\n dy = pa[1] - pb[1]\n if dx == 0 or dy == 0:\n continue\n if dx < 0:\n dx *= -1\n dy *= -1\n cnts[(dx, dy)] += 1\n p, q = max(cnts.items(), key=itemgetter(1))[0]\n\n # \u6700\u9069\u306a\u6700\u521d\u306epickball\u63a2\u7d22\n cnts = defaultdict(lambda: 0)\n for p0 in balls:\n for p1 in balls:\n if p0 == p1:\n continue\n if is_online(p0[0], p0[1], p1[0], p1[1], p, q):\n cnts[p0] += 1\n x, y = max(cnts.items(), key=itemgetter(1))[0]\n\n # \u5b9f\u969b\u306bpickball\n ans += 1\n ret = []\n for p1 in balls:\n if is_online(x, y, p1[0], p1[1], p, q):\n continue\n ret.append(p1)\n return ret\n\n\nwhile points:\n points = pickballs(points)\nprint(ans)\n","fail":"# https:\/\/atcoder.jp\/contests\/diverta2019-2\/tasks\/diverta2019_2_b\n\n\nfrom itertools import combinations\nfrom collections import defaultdict\n\nN = int(input())\npoints = [tuple(map(int, input().split())) for _ in range(N)]\n\nif N == 1:\n print(1)\n exit()\n\n# points.sort() # \u5148\u306b\u30bd\u30fc\u30c8\u3057\u3066\u304a\u304f\u3068\u5927\u5c0f\u95a2\u4fc2\u306e\u51e6\u7406\u304c\u697d\n\ncnts = defaultdict(lambda: 0)\nfor pa, pb in combinations(points, 2):\n dx = pa[0] - pb[0]\n dy = pa[1] - pb[1]\n if dx < 0: # \u4e8b\u524d\u306b\u30bd\u30fc\u30c8\u3057\u3066\u304a\u304f\u3068\u30b3\u30b3\u3089\u3078\u3093\u306e\u51e6\u7406\u304c\u3044\u3089\u306a\u304f\u306a\u308b\u3088\n dx *= -1\n dy *= -1\n if dx == 0:\n dy = max(dy, -dy)\n if dy == 0:\n dx = max(dx, -dx)\n cnts[(dx, dy)] += 1\n\nprint(N - max(cnts.values()))\n","change":"replace","i1":1,"i2":66,"j1":1,"j2":29,"error":"0","stderr":null,"stdout":1.0} {"problem_id":"p03006","language":"Python","original_status":"Runtime Error","pass":"n = int(input())\na = [tuple(map(int, input().split())) for i in range(n)]\nt = set(a)\nminans = 1000000000000\nfor i in range(n):\n for j in range(i + 1, n):\n r = t.copy()\n p = a[i][0] - a[j][0]\n q = a[i][1] - a[j][1]\n curans = 0\n while r:\n curans += 1\n m = r.pop()\n z = m.copy()\n while (m[0] + p, m[1] + q) in r:\n m = (m[0] + p, m[1] + q)\n r.remove(m)\n m = z.copy()\n while (m[0] - p, m[1] - q) in r:\n m = (m[0] - p, m[1] - q)\n r.remove(m)\n minans = min(minans, curans)\nprint(minans)\n","fail":"n = int(input())\na = [tuple(map(int, input().split())) for i in range(n)]\nt = set(a)\nassert len(t) == len(a)\nminans = 1000000000000\nfor i in range(n):\n for j in range(i + 1, n):\n r = t.copy()\n p = a[i][0] - a[j][0]\n q = a[i][1] - a[j][1]\n curans = 0\n while r:\n curans += 1\n m = r.pop()\n z = m\n while (m[0] + p, m[1] + q) in r:\n m = (m[0] + p, m[1] + q)\n r.remove(m)\n m = z\n while (m[0] - p, m[1] - q) in r:\n m = (m[0] - p, m[1] - q)\n r.remove(m)\n minans = min(minans, curans)\nif minans == 1000000000000:\n print(1)\nelse:\n print(minans)\n","change":"replace","i1":3,"i2":23,"j1":3,"j2":27,"error":"AttributeError: 'tuple' object has no attribute 'copy'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03006\/Python\/s146476051.py\", line 14, in \n z = m.copy()\nAttributeError: 'tuple' object has no attribute 'copy'\n","stdout":null} {"problem_id":"p03006","language":"Python","original_status":"Runtime Error","pass":"import collections\n\n\ndef calc(balla, ballb):\n xa, ya = balla\n xb, yb = ballb\n return xa - xb, ya - yb\n\n\nn = int(input())\nballs = [tuple(map(int, input().split())) for _ in range(n)]\n\na = []\nfor i in range(0, n - 1):\n for j in range(i + 1, n):\n tmp = calc(balls[i], balls[j])\n a += [tmp, tuple(-i for i in tmp)]\ncounts = collections.Counter(a)\n\nprint(n - max(counts.values()))\n","fail":"import collections\n\n\ndef calc(balla, ballb):\n xa, ya = balla\n xb, yb = ballb\n return xa - xb, ya - yb\n\n\nn = int(input())\nballs = [tuple(map(int, input().split())) for _ in range(n)]\n\nif n == 1:\n print(1)\n exit()\n\na = []\nfor i in range(0, n - 1):\n for j in range(i + 1, n):\n tmp = calc(balls[i], balls[j])\n a += [tmp, tuple(-i for i in tmp)]\ncounts = collections.Counter(a)\n\nprint(n - max(counts.values()))\n","change":"insert","i1":12,"i2":12,"j1":12,"j2":16,"error":"0","stderr":null,"stdout":1.0} {"problem_id":"p03006","language":"Python","original_status":"Runtime Error","pass":"n = int(input())\nxy = set(tuple(map(int, input().split())) for _ in range(n))\n\ncosts = []\nfor a in xy:\n besides_a = xy - {a}\n for b in besides_a:\n p = b[0] - a[0]\n q = b[1] - a[1]\n arrow_num = 0\n for c in xy:\n if (c[0] + p, c[1] + q) in xy:\n arrow_num += 1\n cost = n - arrow_num\n costs.append(cost)\n\nprint(min(costs))\n","fail":"n = int(input())\nxy = set(tuple(map(int, input().split())) for _ in range(n))\n\ncosts = []\nfor a in xy:\n besides_a = xy - {a}\n for b in besides_a:\n p = b[0] - a[0]\n q = b[1] - a[1]\n arrow_num = 0\n for c in xy:\n if (c[0] + p, c[1] + q) in xy:\n arrow_num += 1\n cost = n - arrow_num\n costs.append(cost)\n\nif n == 1:\n print(1)\nelse:\n print(min(costs))\n","change":"replace","i1":16,"i2":17,"j1":16,"j2":20,"error":"0","stderr":null,"stdout":1.0} {"problem_id":"p03006","language":"Python","original_status":"Runtime Error","pass":"from collections import Counter\n\nN = int(input())\npoints = [tuple(map(int, input().split())) for _ in range(N)]\ncounter = Counter()\n\nfor i, a in enumerate(points):\n for j in range(N):\n if j == i:\n continue\n b = points[j]\n dx = b[0] - a[0]\n dy = b[1] - a[1]\n counter[(dx, dy)] += 1\n\nvec, _ = counter.most_common()[0]\ndx, dy = vec\nvisited = set()\ncost = 0\n\nfor p in points:\n if p in visited:\n continue\n x, y = p\n visited.add(p)\n if (x + dx, y + dy) in visited or (x - dx, y - dy) in visited:\n continue\n cost += 1\n\nprint(cost)\n","fail":"from collections import Counter\n\n\ndef main():\n N = int(input())\n points = [tuple(map(int, input().split())) for _ in range(N)]\n counter = Counter()\n\n if N == 1:\n print(1)\n return\n\n for i in range(N):\n for j in range(N):\n if j == i:\n continue\n a = points[i]\n b = points[j]\n dx = b[0] - a[0]\n dy = b[1] - a[1]\n counter[(dx, dy)] += 1\n\n vec, _ = counter.most_common()[0]\n dx, dy = vec\n visited = set()\n pointset = set(points)\n cost = 0\n\n for p in points:\n if p in visited:\n continue\n visited.add(p)\n x, y = p\n cost += 1\n\n i = 1\n while True:\n n = (x + i * dx, y + i * dy)\n i += 1\n if n in pointset:\n visited.add(n)\n else:\n break\n i = 1\n while True:\n n = (x - i * dx, y - i * dy)\n i += 1\n if n in pointset:\n visited.add(n)\n else:\n break\n\n print(cost)\n\n\nmain()\n","change":"replace","i1":2,"i2":30,"j1":2,"j2":56,"error":"0","stderr":null,"stdout":1.0} {"problem_id":"p03006","language":"Python","original_status":"Runtime Error","pass":"N = int(input())\nxy = []\nfor _ in range(N):\n x, y = map(int, input().split())\n xy.append((x, y))\n\nd = {}\nfor i in range(N):\n tmp = set()\n for j in range(N):\n if i == j:\n continue\n dx = xy[i][0] - xy[j][0]\n dy = xy[i][1] - xy[j][1]\n\n if (dx, dy) in tmp:\n continue\n if (dx, dy) not in d:\n d[(dx, dy)] = 1\n else:\n d[(dx, dy)] += 1\n tmp.add((dx, dy))\n\nd = sorted(d.items(), key=lambda x: x[1], reverse=True)\ncnt = d[0][1]\nprint(N - cnt)\n","fail":"def main():\n N = int(input())\n if N == 1:\n print(1)\n return\n xy = []\n for _ in range(N):\n x, y = map(int, input().split())\n xy.append((x, y))\n\n d = {}\n for i in range(N):\n tmp = set()\n for j in range(N):\n if i == j:\n continue\n dx = xy[i][0] - xy[j][0]\n dy = xy[i][1] - xy[j][1]\n\n if (dx, dy) in tmp:\n continue\n if (dx, dy) not in d:\n d[(dx, dy)] = 1\n else:\n d[(dx, dy)] += 1\n tmp.add((dx, dy))\n\n d = sorted(d.items(), key=lambda x: x[1], reverse=True)\n cnt = d[0][1]\n print(N - cnt)\n\n\nmain()\n","change":"replace","i1":0,"i2":26,"j1":0,"j2":33,"error":"0","stderr":null,"stdout":1.0} {"problem_id":"p03006","language":"Python","original_status":"Runtime Error","pass":"from itertools import combinations\n\nN = int(input())\nP = []\nfor _ in range(N):\n x, y = map(int, input().split())\n P.append((x, y))\n\nmemo = dict()\nfor (a, b) in combinations(P, 2):\n p, q = a[0] - b[0], a[1] - b[1]\n if p < 0:\n p, q = -p, -q\n elif p == 0 and q < 0:\n q = -q\n if (p, q) in memo:\n memo[(p, q)] += 1\n else:\n memo[(p, q)] = 1\n\nprint(N - max(memo.values()))\n","fail":"from itertools import combinations\n\nN = int(input())\nP = []\nfor _ in range(N):\n x, y = map(int, input().split())\n P.append((x, y))\n\nmemo = dict()\nfor (a, b) in combinations(P, 2):\n p, q = a[0] - b[0], a[1] - b[1]\n if p < 0:\n p, q = -p, -q\n elif p == 0 and q < 0:\n q = -q\n if (p, q) in memo:\n memo[(p, q)] += 1\n else:\n memo[(p, q)] = 1\n\nprint(N - max(memo.values()) if N > 1 else 1)\n","change":"replace","i1":20,"i2":21,"j1":20,"j2":21,"error":"0","stderr":null,"stdout":1.0} {"problem_id":"p03006","language":"Python","original_status":"Runtime Error","pass":"from fractions import Fraction\nfrom collections import Counter\n\n\nclass PickingUp:\n def __init__(self):\n self.N = int(input())\n self.points = []\n for n in range(self.N):\n self.points.append([int(n) for n in input().split()])\n\n def main(self):\n pattern_list = []\n slope_list = []\n for s in range(self.N):\n for e in range(s + 1, self.N):\n slope = self.__cal_slope(self.points[s], self.points[e])\n slope_list.append(slope)\n\n c = Counter(slope_list)\n most = c.most_common()[0][1]\n\n if self.N == 1:\n pattern_list.append(1)\n else:\n print(self.N - most)\n\n def __cal_slope(self, s, e):\n if s[0] != e[0]:\n return Fraction((s[1] - e[1]), (s[0] - e[0]))\n else:\n return None\n\n def __cal_section(self, slope, point):\n if slope is not None:\n return point[1] - slope * point[0]\n else:\n return point[0]\n\n\npickingUp = PickingUp()\npickingUp.main()\n","fail":"from collections import Counter\n\n\nclass PickingUp:\n def __init__(self):\n self.N = int(input())\n self.points = []\n for n in range(self.N):\n self.points.append([int(n) for n in input().split()])\n\n def main(self):\n dif_list = []\n\n if self.N == 1:\n print(1)\n return\n\n for s in range(self.N):\n for e in range(self.N):\n if s == e:\n continue\n dif = self.__cal_dif(self.points[s], self.points[e])\n dif_list.append(\"{},{}\".format(dif[0], dif[1]))\n\n c = Counter(dif_list)\n most = c.most_common()[0][1]\n\n print(self.N - most)\n\n def __cal_dif(self, s, e):\n dif_x = s[0] - e[0]\n dif_y = s[1] - e[1]\n return [dif_x, dif_y]\n\n\npickingUp = PickingUp()\npickingUp.main()\n","change":"replace","i1":0,"i2":38,"j1":0,"j2":33,"error":"0","stderr":null,"stdout":1.0} {"problem_id":"p03006","language":"Python","original_status":"Runtime Error","pass":"import itertools\nfrom collections import defaultdict\n\nN = int(input())\nballs = sorted([tuple(map(int, input().split())) for _ in range(N)])\n\nd = defaultdict(int)\nfor i, j in itertools.combinations(range(N), 2):\n d[(balls[j][0] - balls[i][0], balls[j][1] - balls[i][1])] += 1\nprint(N - max(d.values()))\n","fail":"import itertools\nfrom collections import defaultdict\nfrom sys import exit\n\nN = int(input())\nballs = sorted([tuple(map(int, input().split())) for _ in range(N)])\n\nif N == 1:\n print(1)\n exit()\n\nd = defaultdict(int)\nfor i, j in itertools.combinations(range(N), 2):\n d[(balls[j][0] - balls[i][0], balls[j][1] - balls[i][1])] += 1\nprint(N - max(d.values()))\n","change":"replace","i1":2,"i2":5,"j1":2,"j2":10,"error":"0","stderr":null,"stdout":1.0} {"problem_id":"p03006","language":"Python","original_status":"Runtime Error","pass":"from collections import Counter\nfrom operator import itemgetter\n\nN = int(input())\np = []\nfor _ in range(N):\n p.append(tuple(map(int, input().split())))\np.sort(key=itemgetter(0), reverse=True)\n\nd = []\nfor i, pp1 in enumerate(p):\n for j in range(i + 1, N):\n pp2 = p[j]\n d.append((pp1[0] - pp2[0], pp1[1] - pp2[1]))\n\nc = Counter(d)\n\nprint(N - c.most_common()[0][1])\n","fail":"from collections import defaultdict\nfrom operator import itemgetter\n\nN = int(input())\np = []\nfor _ in range(N):\n p.append(tuple(map(int, input().split())))\np.sort(key=itemgetter(0), reverse=True)\n\nif N == 1:\n print(1)\nelse:\n d = defaultdict(int)\n for i, pp1 in enumerate(p):\n for j in range(i + 1, N):\n pp2 = p[j]\n d[(pp1[0] - pp2[0], pp1[1] - pp2[1])] += 1\n # print(d)\n\n cnt = 0\n keys = tuple(d.keys())\n for k in keys:\n x, y = k\n cnt = max(cnt, d[k] + d[(-x, -y)])\n\n print(N - cnt)\n","change":"replace","i1":0,"i2":18,"j1":0,"j2":26,"error":"0","stderr":null,"stdout":1.0} {"problem_id":"p03006","language":"Python","original_status":"Runtime Error","pass":"from collections import Counter\n\nN = int(input())\n\np = []\nfor _ in range(N):\n p.append(tuple(map(int, input().split())))\n\nd = []\nfor i, p1 in enumerate(p):\n for j, p2 in enumerate(p):\n if i == j:\n continue\n x = p1[0] - p2[0]\n y = p1[1] - p2[1]\n d.append((x, y))\n\nc = Counter(d)\n# print(c)\nprint(N - c.most_common()[0][1])\n","fail":"from collections import Counter\n\nN = int(input())\n\np = []\nfor _ in range(N):\n p.append(tuple(map(int, input().split())))\n\nif N == 1:\n print(1)\n exit()\n\nd = []\nfor i, p1 in enumerate(p):\n for j, p2 in enumerate(p):\n if i == j:\n continue\n x = p1[0] - p2[0]\n y = p1[1] - p2[1]\n d.append((x, y))\n\nc = Counter(d)\n# print(c)\nprint(N - c.most_common()[0][1])\n","change":"insert","i1":7,"i2":7,"j1":7,"j2":11,"error":"0","stderr":null,"stdout":1.0} {"problem_id":"p03006","language":"Python","original_status":"Runtime Error","pass":"import collections\n\nN = int(input())\nx_y = []\nfor _ in range(N):\n x_y.append(list(map(int, input().split())))\n\nx_y.sort(key=lambda x: (x[0], x[1]))\npq_cand = []\nfor i in range(N):\n for j in range(i + 1, N):\n pq_cand.append((x_y[j][0] - x_y[i][0], x_y[j][1] - x_y[i][1]))\n\npqc = collections.Counter(pq_cand)\n_, x = max(pqc.items(), key=lambda x: x[1])\nprint(N - 1 - x + 1)\n","fail":"import collections\n\nN = int(input())\n\nif N == 1:\n print(1)\n exit()\n\nx_y = []\nfor _ in range(N):\n x_y.append(list(map(int, input().split())))\n\nx_y.sort(key=lambda x: (x[0], x[1]))\npq_cand = []\nfor i in range(N):\n for j in range(i + 1, N):\n pq_cand.append((x_y[j][0] - x_y[i][0], x_y[j][1] - x_y[i][1]))\n\npqc = collections.Counter(pq_cand)\n_, x = max(pqc.items(), key=lambda x: x[1])\nprint(N - 1 - x + 1)\n","change":"insert","i1":3,"i2":3,"j1":3,"j2":8,"error":"0","stderr":null,"stdout":1.0} {"problem_id":"p03006","language":"Python","original_status":"Runtime Error","pass":"from collections import Counter\n\nN = int(input())\n\nxys = []\nfor _ in range(N):\n xys.append(tuple(map(int, input().split())))\n\nsub = []\nfor x1, y1 in xys:\n for x2, y2 in xys:\n if x1 != x2 or y1 != y2:\n sub.append((x1 - x2, y1 - y2))\n\nc = Counter(sub)\nm = max(c.values())\n\nprint(N - m)\n","fail":"from collections import Counter\n\nN = int(input())\n\nxys = []\nfor _ in range(N):\n xys.append(tuple(map(int, input().split())))\n\nsub = []\nfor x1, y1 in xys:\n for x2, y2 in xys:\n if x1 != x2 or y1 != y2:\n sub.append((x1 - x2, y1 - y2))\n\nif not sub:\n print(1)\n exit(0)\n\nc = Counter(sub)\nm = max(c.values())\n\nprint(N - m)\n","change":"insert","i1":14,"i2":14,"j1":14,"j2":18,"error":"0","stderr":null,"stdout":1.0} {"problem_id":"p03006","language":"Python","original_status":"Runtime Error","pass":"import itertools\n\nn = int(input())\nxy_list = [list(map(int, input().split())) for _ in range(n)]\ncounts = dict()\nfor (x1, y1), (x2, y2) in itertools.combinations(xy_list, 2):\n for pq in ((x2 - x1, y2 - y1), (x1 - x2, y1 - y2)):\n counts.setdefault(pq, 0)\n counts[pq] += 1\nmax_count = max(counts.values())\nprint(n - max_count)\n","fail":"import sys\nimport itertools\n\nn = int(input())\nxy_list = [list(map(int, input().split())) for _ in range(n)]\nif n == 1:\n print(1)\n sys.exit()\n\ncounts = dict()\nfor (x1, y1), (x2, y2) in itertools.combinations(xy_list, 2):\n for pq in ((x2 - x1, y2 - y1), (x1 - x2, y1 - y2)):\n counts.setdefault(pq, 0)\n counts[pq] += 1\nmax_count = max(counts.values())\nprint(n - max_count)\n","change":"replace","i1":0,"i2":4,"j1":0,"j2":9,"error":"0","stderr":null,"stdout":1.0} {"problem_id":"p03006","language":"Python","original_status":"Runtime Error","pass":"from collections import defaultdict\n\nn = int(input())\nz = [list(map(int, input().split())) for _ in range(n)]\nd = defaultdict(int)\nfor i in range(n):\n xi, yi = z[i]\n for j in range(n):\n if i == j:\n continue\n xj, yj = z[j]\n d[(xi - xj, yi - yj)] += 1\nprint(n - max(d.values()))\n","fail":"from collections import defaultdict\n\nn = int(input())\nz = [list(map(int, input().split())) for _ in range(n)]\nif n == 1:\n ans = 1\nelse:\n d = defaultdict(int)\n for i in range(n):\n xi, yi = z[i]\n for j in range(n):\n if i == j:\n continue\n xj, yj = z[j]\n d[(xi - xj, yi - yj)] += 1\n ans = n - max(d.values())\nprint(ans)\n","change":"replace","i1":4,"i2":13,"j1":4,"j2":17,"error":"0","stderr":null,"stdout":1.0} {"problem_id":"p03006","language":"Python","original_status":"Runtime Error","pass":"N = int(input())\ninputs = [[int(i) for i in input().split()] for _ in range(N)]\n\nans = 1\nrates = {}\nfor i in range(N):\n for j in range(N):\n if i == j:\n continue\n vector = (inputs[i][0] - inputs[j][0], inputs[i][1] - inputs[j][1])\n rates[vector] = rates.get(vector, 0) + 1\n\nprint(N - max(rates.values()))\n","fail":"N = int(input())\ninputs = [[int(i) for i in input().split()] for _ in range(N)]\n\nans = 1\nrates = {0: 0}\nfor i in range(N):\n for j in range(N):\n if i == j:\n continue\n vector = (inputs[i][0] - inputs[j][0], inputs[i][1] - inputs[j][1])\n rates[vector] = rates.get(vector, 0) + 1\n\nprint(N - max(rates.values()))\n","change":"replace","i1":4,"i2":5,"j1":4,"j2":5,"error":"0","stderr":null,"stdout":1.0} {"problem_id":"p03006","language":"Python","original_status":"Runtime Error","pass":"from collections import defaultdict\n\n\ndef main():\n N = int(input())\n XY = [list(map(int, input().split())) for _ in range(N)]\n\n dd = defaultdict(int)\n for i in range(N - 1):\n for j in range(i + 1, N):\n a = (XY[j][0] - XY[i][0], XY[j][1] - XY[i][1])\n dd[a] += 1\n\n pq = max(dd, key=dd.get)\n\n cnt = 0\n for x, y in XY:\n if [x + pq[0], y + pq[1]] in XY:\n cnt += 1\n\n print(N - cnt)\n\n\nmain()\n","fail":"import itertools\nfrom collections import defaultdict\n\n\ndef main():\n N = int(input())\n if N == 1:\n print(1)\n\n else:\n XY = [list(map(int, input().split())) for _ in range(N)]\n\n dd = defaultdict(int)\n\n for xy1, xy2 in itertools.combinations(XY, 2):\n a = (xy2[0] - xy1[0], xy2[1] - xy1[1])\n b = (-a[0], -a[1])\n dd[a] += 1\n dd[b] += 1\n\n print(N - max(dd.values()))\n\n\nmain()\n","change":"replace","i1":0,"i2":21,"j1":0,"j2":21,"error":"0","stderr":null,"stdout":1.0} {"problem_id":"p03006","language":"Python","original_status":"Runtime Error","pass":"import sys\nfrom collections import defaultdict\nfrom itertools import combinations\n\ninput = sys.stdin.readline\n\n\ndef main():\n N = int(input())\n x = [0] * N\n y = [0] * N\n for i in range(N):\n x[i], y[i] = map(int, input().split())\n\n vector = defaultdict(int)\n for a, b in combinations(range(N), 2):\n dx = x[a] - x[b]\n dy = y[a] - y[b]\n if dx == 0:\n vector[(0, abs(dy))] += 1\n elif dx > 0:\n vector[(dx, dy)] += 1\n else:\n vector[(-dx, -dy)] += 1\n\n ans = N - max(vector.values())\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"import sys\nfrom collections import defaultdict\nfrom itertools import combinations\n\ninput = sys.stdin.readline\n\n\ndef main():\n N = int(input())\n x = [0] * N\n y = [0] * N\n for i in range(N):\n x[i], y[i] = map(int, input().split())\n\n if N == 1:\n print(1)\n sys.exit()\n\n vector = defaultdict(int)\n for a, b in combinations(range(N), 2):\n dx = x[a] - x[b]\n dy = y[a] - y[b]\n if dx == 0:\n vector[(0, abs(dy))] += 1\n elif dx > 0:\n vector[(dx, dy)] += 1\n else:\n vector[(-dx, -dy)] += 1\n\n ans = N - max(vector.values())\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"insert","i1":13,"i2":13,"j1":13,"j2":17,"error":"0","stderr":null,"stdout":1.0} {"problem_id":"p03007","language":"Python","original_status":"Runtime Error","pass":"# \u30af\u30bd\u30b6\u30b3\u30ca\u30e1\u30af\u30b8\n\n# \u8ca0\u6570\u3092\u6700\u5f8c\u307e\u3067\u592a\u3089\u305b\u3066\u3001\u6700\u5f8c\u306b\u6b63\u306e\u6570\u306e\u4e00\u756a\u5c0f\u3055\u3044\u3084\u3064\u306b\u5f15\u304f\uff08\u7b26\u53f7\u304c\u3072\u3063\u304f\u308a\u304b\u3048\u308b\u306e\u3067\u52a0\u3048\u308b\u3053\u3068\u306b\u306a\u308b\uff09\nN = int(input())\nA = map(int, input().split())\nplus, minus = [], []\nfor a in A:\n if a < 0:\n minus.append(a)\n else:\n plus.append(a)\n\nplus = list(sorted(plus))\nminus = list(reversed(sorted(minus)))\n\nans = 0\nans_list = []\n\nif len(minus) == 0:\n # \u592a\u3089\u305b\u308b\u8981\u7d20\u304c\u306a\u3044\u306e\u3067\u6b63\u306e\u6570\u304b\u3089\u4f5c\u308b\n # \u521d\u56de \u6700\u3082\u5c0f\u3055\u3044\u6570 - \u6700\u3082\u5927\u304d\u3044\u6570 \u3057\u3066\u6700\u5927\u306e\u8ca0\u6570\u3092\u3064\u304f\u308b\n # \u3042\u3068\u306f\u6b8b\u3063\u3066\u308b\u3084\u3064\u304b\u3089\u300c\u5f15\u304f\u300d\u3092\u52a0\u3048\u7d9a\u3051\u3066\u6700\u5f8c\u306e\u4e00\u56de\u3067\u81ea\u3089\u3092\u300c\u5f15\u304f\u300d\n a, b = plus[0], plus[-1]\n plus = plus[1:-1]\n if len(plus) > 0:\n ans_list.append([a, b])\n ans = a - b\n for p in plus[1:]:\n ans_list.append([ans, p])\n ans -= p\n ans_list.append([plus[0], ans])\n ans = plus[0] - ans\n else:\n ans_list.append([b, a])\n ans = b - a\nelse:\n # \u6b8b\u308a\u306e\u8ca0\u6570\u304b\u3089\u6700\u5927\u306e\u8ca0\u6570\u3092\u4f5c\u308b\u3002\u307e\u305a\uff08\u6b63\u65b9\u5411\u306b\uff09\u6700\u5927 - \uff08\u6b63\u65b9\u5411\u306b\uff09\u6700\u5c0f\u3059\u308b\u3053\u3068\u3067\u6700\u5927\u306e\u6b63\u306e\u6570\u304c\u30c7\u30ad\u308b\u306e\u3067\u3001\n # \u3042\u3068\u306f\uff08\u6b63\u65b9\u5411\u306b\uff09\u6700\u5c0f\u306e\u4e00\u3064\u524d\u307e\u3067 \u5f15\u304f\u3092\u52a0\u3048\u3066\u3044\u304d\u3001\u6700\u5f8c\u306b\u9006\u306b\u81ea\u5206\u81ea\u8eab\u3092\u52a0\u3048\u308b\n if len(minus) == 1:\n ans = minus[0]\n elif len(minus) == 2:\n a, b = minus[0], minus[-1]\n ans_list.append([b, a])\n ans = b - a\n else:\n a, b = minus[0], minus[-1]\n ans = b\n ans_list.append([a, b])\n for m in minus[1:-2]:\n ans_list.append([ans, m])\n ans += m * (-1)\n ans_list.append([minus[-1], ans])\n ans = minus[-1] - ans\n\n # \u6b63\u306e\u3084\u3064\u3092\u98df\u3046\n for p in plus[1:]:\n ans_list.append([ans, p])\n ans = ans - p\n # \u4ed5\u4e0a\u3052\n ans_list.append([plus[0], ans])\n ans = -1 * ans + plus[0]\n\n # \u3082\u30461\u30d1\u30bf\u30fc\u30f3\u3042\u3063\u305f\u308f\n ans_list2, ans2 = [], 0\n ans2 = plus[-1]\n for m in minus:\n ans_list2.append([ans2, m])\n ans2 = ans2 - m\n plus[-1] = ans2\n\n a, b = plus[0], plus[-1]\n tmp_ans = 0\n plus = plus[1:-1]\n if len(plus) > 0:\n ans_list2.append([a, b])\n tmp_ans = a - b\n for p in plus[1:]:\n ans_list2.append([tmp_ans, p])\n tmp_ans -= p\n ans_list2.append([plus[0], tmp_ans])\n tmp_ans = plus[0] - tmp_ans\n else:\n ans_list2.append([b, a])\n tmp_ans = b - a\n\n if ans < ans2:\n ans = ans2\n ans_list = ans_list2\n\nprint(ans)\nfor a in ans_list:\n print(a[0], a[1])\n","fail":"# \u6b63\u6574\u6570\u3060\u3051\u5b58\u5728\u3059\u308b\u5834\u5408\u306f\u3069\u3046\u306a\u308b\u3060\u308d\u3046\u304b\n# abs\u3058\u3083\u306a\u3044\u306e\u304c\u5473\u564c\u3067\u3001\u6700\u5f8c\u306ey\u306f\u8ca0\u6570\u3060\u3068\u304a\u5f97\n# \u306a\u306e\u3067\u305d\u308c\u307e\u3067\u306b\u3067\u304d\u308b\u3060\u3051\u8ca0\u306e\u65b9\u5411\u306b\u30c7\u30ab\u3044y\u3092\u4f5c\u3063\u3066\u307f\u308b\n# 1 2 4 4 5 8 \u307f\u305f\u3044\u306a\u3068\u304d 1\u3092\u51fa\u767a\u70b9\u3068\u3057\u3066\u6b8b\u308a\u306f\u5168\u90e8\u5f15\u3044\u3066\u3044\u3051\u308b\u306e\u3067\u3001\u6700\u5f8c\u3067\u306fy=1-(2+4+4+5)=-14\u306b\u3067\u304d\u308b \u3093\u3067\u6700\u5f8c\u306b\u6700\u5927\u5024\u304b\u3089\u5f15\u304f\u3053\u3068\u3067 8-(-14)\u304c\u9054\u6210\u53ef\u80fd\n# \u8ca0\u6570\u3060\u3051\u306e\u5834\u5408\n# \u4e0a\u8a18\u3092\u8e0f\u307e\u3048\u308b\u3068\u552f\u4e00\u306e\u8ca0\u6570\u306f\u6b63\u6570\u3067\u80b2\u3066\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u304c\u3001\u8907\u6570\u3042\u308b\u5834\u5408\u306f\u3069\u3046\u306a\u308b\u3060\u308d\u3046\u304b\n# -6 -4 -3 -1 -1 \u307f\u305f\u3044\u306a\u3068\u304d\n# \u4e00\u5ea6\u3067\u3082\u6b63\u6570\u304c\u4f5c\u308c\u308c\u3070\u3044\u3044\u306e\u3067-1-(-6-4-3-1)=13\u304b\uff1f\n\n# -1 1 2 \u306e\u3068\u304d\n# \u6700\u5c0f\u5024\u3060\u3051\u3067\u6b63\u6570\u3092\u9054\u6210\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u306a\u3044 \u306a\u306e\u3067\u6700\u5f8c\u306e\u624b\u756a\u307e\u3067\u306b\u3067\u304d\u308b\u3060\u3051\u30c7\u30ab\u3044\u8ca0\u3092\u4f5c\u3063\u3066\u6700\u5f8c\u306b\u5f15\u304f\u3092\u3059\u308b\n# -4 -2 -1 3 4 \u306e\u3068\u304d \u8ca0\u6570\u3067\u6b63\u3092\u4f5c\u308b\u3068-1-(-2-4)=5, [3 4 5]\u306b\u306a\u3063\u3066\u3057\u307e\u3044\u306a\u3093\u304b\u5c0f\u3055\u304f\u306a\u308a\u305d\u3046\n# \u8ca0\u6570\u3092\u80b2\u3066\u308b\u3068-4-3-4=-11, -1-(-11)=10, 10-(-2)=12\u304c\u3067\u304d\u305d\u3046\u3067\u3001\u3053\u3063\u3061\u306e\u307b\u3046\u304c\u3044\u3044\n# \u6b63\u306e\u6570\u304c\u6700\u5f8c\u306e1\u3064\u306b\u306a\u308b\u307e\u3067\u8ca0\u3092\u592a\u3089\u305b\u3001\u3042\u3068\u306f\u8ca0\u305f\u3061\u3092\u6b63\u304b\u3089\u5f15\u304f\u3053\u3068\u3067\u3042\u307e\u3059\u3053\u3068\u306a\u304f\u3044\u305f\u3060\u3051\u308b\n\nn = int(input())\na = sorted(list(map(int, input().split())))\nif n == 2:\n print(a[1] - a[0])\n print(a[1], a[0])\n exit()\nans = []\ntmp = 0\nif a[0] >= 0:\n tmp = a[0]\n for i in range(1, n - 1):\n ans.append(f\"{tmp} {a[i]}\")\n tmp -= a[i]\n ans.append(f\"{a[-1]} {tmp}\")\n tmp = a[-1] - tmp\nelif a[-1] <= 0:\n tmp = a[-1]\n for i in range(n - 2, -1, -1):\n ans.append(f\"{tmp} {a[i]}\")\n tmp -= a[i]\nelse:\n ok, ng = 0, n\n while abs(ok - ng) > 1:\n mid = (ok + ng) \/\/ 2\n if a[mid] < 0:\n ok = mid\n else:\n ng = mid\n plus = a[ok + 1 :]\n minus = a[: ok + 1]\n tmp = minus[0]\n idx = 0\n while idx < len(plus) - 1:\n ans.append(f\"{tmp} {plus[idx]}\")\n tmp -= plus[idx]\n idx += 1\n ans.append(f\"{plus[idx]} {tmp}\")\n tmp = plus[idx] - tmp\n for i in range(1, len(minus)):\n ans.append(f\"{tmp} {minus[i]}\")\n tmp -= minus[i]\n\nprint(tmp)\nfor av in ans:\n print(av)\n","change":"replace","i1":0,"i2":92,"j1":0,"j2":60,"error":"WA","stderr":null,"stdout":"4\n-1 2\n1 -3\n"} {"problem_id":"p03007","language":"Python","original_status":"Runtime Error","pass":"#!\/usr\/bin\/env python3\n# -*- coding: utf-8 -*-\nimport sys\n\n\ndef main():\n N = int(input())\n A = sorted(list(map(int, input().split())))\n if A[0] > 0:\n printAllPlus(A)\n sys.exit()\n elif A[N - 1] < 0:\n printAllMinus(A)\n sys.exit()\n\n i = -1\n for k, n in enumerate(A):\n if n >= 0:\n i = k\n break\n plus = A[i:]\n minus = A[:i]\n print(sum(plus) - sum(minus))\n while len(plus) > 1:\n p = plus.pop()\n m = minus.pop()\n print(m, p)\n minus.append(m - p)\n p0 = plus.pop()\n for m in minus:\n print(p0, m)\n p0 -= m\n\n\ndef printAllPlus(nums):\n ans = sum(nums) - 2 * nums[0]\n print(ans)\n tmp = nums[0]\n for n in nums[1:-1]:\n print(tmp, n)\n tmp -= n\n print(nums[-1], tmp)\n\n\ndef printAllMinus(nums):\n nums.reverse()\n ans = -sum(nums) + 2 * nums[0]\n print(ans)\n tmp = nums[0]\n for n in nums[1:]:\n print(tmp, n)\n tmp -= n\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"#!\/usr\/bin\/env python3\n# -*- coding: utf-8 -*-\n\n\ndef main():\n N = int(input())\n A = sorted(list(map(int, input().split())))\n if A[0] >= 0:\n printAllPlus(A)\n elif A[-1] <= 0:\n printAllMinus(A)\n else:\n printMixed(A)\n\n\ndef printMixed(nums):\n i = -1\n for k, n in enumerate(nums):\n if n >= 0:\n i = k\n break\n plus = nums[i:]\n minus = nums[:i]\n print(sum(plus) - sum(minus))\n while len(plus) > 1:\n p = plus.pop()\n m = minus.pop()\n print(m, p)\n minus.append(m - p)\n p0 = plus.pop()\n for m in minus:\n print(p0, m)\n p0 -= m\n\n\ndef printAllPlus(nums):\n ans = sum(nums) - 2 * nums[0]\n print(ans)\n tmp = nums[0]\n for n in nums[1:-1]:\n print(tmp, n)\n tmp -= n\n print(nums[-1], tmp)\n\n\ndef printAllMinus(nums):\n nums.reverse()\n ans = -sum(nums) + 2 * nums[0]\n print(ans)\n tmp = nums[0]\n for n in nums[1:]:\n print(tmp, n)\n tmp -= n\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":2,"i2":22,"j1":2,"j2":23,"error":"WA","stderr":null,"stdout":"4\n-1 2\n1 -3\n"} {"problem_id":"p03008","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = [int(_) for _ in input().split()]\nB = [int(_) for _ in input().split()]\n\n\ndef count(n, a, b):\n a0, a1, a2 = a\n b0, b1, b2 = b\n dp = [0] * (n + 1)\n for i in range(n + 1):\n c0 = dp[i - a0] + b0 if i - a0 >= 0 else 0\n c1 = dp[i - a1] + b1 if i - a1 >= 0 else 0\n c2 = dp[i - a2] + b2 if i - a2 >= 0 else 0\n dp[i] = max([i, c0, c1, c2])\n return dp[n]\n\n\nprint(count(count(N, A, B), B, A))\n","fail":"N = int(input())\nA = [int(_) for _ in input().split()]\nB = [int(_) for _ in input().split()]\n\n\ndef count(n, a, b):\n a0, a1, a2 = a\n b0, b1, b2 = b\n dp = [0] * (n + 1)\n for i in range(n + 1):\n c0 = dp[i - a0] + b0 if i - a0 >= 0 else 0\n c1 = dp[i - a1] + b1 if i - a1 >= 0 else 0\n c2 = dp[i - a2] + b2 if i - a2 >= 0 else 0\n dp[i] = max(i, c0, c1, c2)\n return dp[n]\n\n\nprint(count(count(N, A, B), B, A))\n","change":"replace","i1":13,"i2":14,"j1":13,"j2":14,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03008","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\na = tuple(map(int, input().split()))\nb = tuple(map(int, input().split()))\n\n# 1 \u5468\u76ee : dp[\u5de3\u304b\u3089\u6301\u3063\u3066\u304d\u305f\u30c9\u30f3\u30b0\u30ea\u6570] = \u53d6\u5f15\u6240 B \u3067\u6301\u3066\u308b\u6700\u5927\u30c9\u30f3\u30b0\u30ea\u6570\ndp = list(range(N + 1))\nmas = tuple(zip(a, b))\nfor i in range(N + 1):\n for to_metal, to_acorn in mas:\n if i >= to_metal:\n dp[i] = max(dp[i], dp[i - to_metal] + to_acorn)\nN = dp[N]\n\n# 2 \u5468\u76ee : dp[\u53d6\u5f15\u6240 B \u304b\u3089\u6301\u3063\u3066\u304d\u305f\u30c9\u30f3\u30b0\u30ea\u6570] = \u5de3\u306b\u6301\u3061\u5e30\u308c\u308b\u6700\u5927\u30c9\u30f3\u30b0\u30ea\u6570\ndp = list(range(N + 1))\nmas = tuple(zip(b, a))\nfor i in range(N + 1):\n for to_metal, to_acorn in mas:\n if i >= to_metal:\n dp[i] = max(dp[i], dp[i - to_metal] + to_acorn)\nprint(dp[N])\n","fail":"def main():\n N = int(input())\n ga, sa, ba = map(int, input().split())\n gb, sb, bb = map(int, input().split())\n\n # A : \u30c9\u30f3\u30b0\u30ea\u3068\u91d1\u5c5e\u306b\u5909\u3048\u308b\n # B : \u5168\u90e8\u30c9\u30f3\u30b0\u30ea\u306b\u5909\u3048\u308b\n # B : \u30c9\u30f3\u30b0\u30ea\u3068\u91d1\u5c5e\u306b\u5909\u3048\u308b\uff08\u7121\u99c4\u306a\u64cd\u4f5c\u3067\u30ed\u30b9\u304c\u306a\u3044\u306e\u3067\u3001\u3044\u3063\u305f\u3093\u30c9\u30f3\u30b0\u30ea\u5316\u3057\u3066\u3088\u3044\uff09\n # A : \u30c9\u30f3\u30b0\u30ea\u306b\u5909\u3048\u308b\n\n dp1 = list(range(N + 1)) # dp1[\u5de3\u304b\u3089\u6301\u3063\u3066\u304d\u305f\u30c9\u30f3\u30b0\u30ea\u6570] = \u53d6\u5f15\u6240 B \u3067\u6301\u3066\u308b\u6700\u5927\u30c9\u30f3\u30b0\u30ea\u6570\n dp1[0] = 0\n for i in range(N + 1):\n if i >= ga:\n dp1[i] = max(dp1[i], dp1[i - ga] + gb)\n if i >= sa:\n dp1[i] = max(dp1[i], dp1[i - sa] + sb)\n if i >= ba:\n dp1[i] = max(dp1[i], dp1[i - ba] + bb)\n\n N = dp1[N]\n dp2 = list(range(N + 1)) # dp2[\u53d6\u5f15\u6240 B \u304b\u3089\u6301\u3063\u3066\u304d\u305f\u30c9\u30f3\u30b0\u30ea\u6570] = \u5de3\u306b\u6301\u3061\u5e30\u308c\u308b\u6700\u5927\u30c9\u30f3\u30b0\u30ea\u6570\n for i in range(N + 1):\n if i >= gb:\n dp2[i] = max(dp2[i], dp2[i - gb] + ga)\n if i >= sb:\n dp2[i] = max(dp2[i], dp2[i - sb] + sa)\n if i >= bb:\n dp2[i] = max(dp2[i], dp2[i - bb] + ba)\n print(dp2[N])\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":0,"i2":21,"j1":0,"j2":34,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03008","language":"Python","original_status":"Time Limit Exceeded","pass":"import os\nimport sys\n\nif os.getenv(\"LOCAL\"):\n sys.stdin = open(\"_in.txt\", \"r\")\n\nsys.setrecursionlimit(2147483647)\nINF = float(\"inf\")\n\nN = int(sys.stdin.readline())\nGA, SA, BA = list(map(int, sys.stdin.readline().split()))\nGB, SB, BB = list(map(int, sys.stdin.readline().split()))\n\nvalues = []\nweights = []\nif GB \/ GA > 1:\n values.append(GB - GA)\n weights.append(GA)\nif SB \/ SA > 1:\n values.append(SB - SA)\n weights.append(SA)\nif BB \/ BA > 1:\n values.append(BB - BA)\n weights.append(BA)\n# dp[i]: \u91cd\u3055 i \u4ee5\u4e0b\u3067\u9078\u3076\u306e\u306e\u4fa1\u5024\u306e\u6700\u5927\u5024\ndp = [0] * (N + 1)\ndp[0] = N\nif values:\n for i in range(1, N + 1):\n x = dp[i - 1]\n for w, v in zip(weights, values):\n if i - w >= 0:\n x = max(x, dp[i - w] + v)\n dp[i] = x\n N = dp[N]\n\nvalues = []\nweights = []\nif GA \/ GB > 1:\n values.append(GA - GB)\n weights.append(GB)\nif SA \/ SB > 1:\n values.append(SA - SB)\n weights.append(SB)\nif BA \/ BB > 1:\n values.append(BA - BB)\n weights.append(BB)\n# dp[i]: \u91cd\u3055 i \u4ee5\u4e0b\u3067\u9078\u3076\u306e\u306e\u4fa1\u5024\u306e\u6700\u5927\u5024\ndp = [0] * (N + 1)\ndp[0] = N\nif values:\n for i in range(1, N + 1):\n x = dp[i - 1]\n for w, v in zip(weights, values):\n if i - w >= 0:\n x = max(x, dp[i - w] + v)\n dp[i] = x\n N = dp[N]\nprint(int(N))\n","fail":"import math\nimport os\nimport sys\n\nif os.getenv(\"LOCAL\"):\n sys.stdin = open(\"_in.txt\", \"r\")\n\nsys.setrecursionlimit(2147483647)\nINF = float(\"inf\")\n\nN = int(sys.stdin.readline())\nGA, SA, BA = list(map(int, sys.stdin.readline().split()))\nGB, SB, BB = list(map(int, sys.stdin.readline().split()))\n\nvalues = []\nweights = []\nif GB \/ GA > 1:\n values.append(GB - GA)\n weights.append(GA)\nif SB \/ SA > 1:\n values.append(SB - SA)\n weights.append(SA)\nif BB \/ BA > 1:\n values.append(BB - BA)\n weights.append(BA)\n# dp[i]: \u91cd\u3055 i \u4ee5\u4e0b\u3067\u9078\u3076\u306e\u306e\u4fa1\u5024\u306e\u6700\u5927\u5024\ndp = [0] * (N + 1)\ndp[0] = N\nif values:\n for i in range(1, N + 1):\n x = dp[i - 1]\n for w, v in zip(weights, values):\n if i - w >= 0:\n x = max(x, dp[i - w] + v)\n dp[i] = x\n N = dp[N]\n\nvalues = []\nweights = []\nif GA \/ GB > 1:\n values.append(GA - GB)\n weights.append(GB)\nif SA \/ SB > 1:\n values.append(SA - SB)\n weights.append(SB)\nif BA \/ BB > 1:\n values.append(BA - BB)\n weights.append(BB)\n# dp[i]: \u91cd\u3055 i \u4ee5\u4e0b\u3067\u9078\u3076\u306e\u306e\u4fa1\u5024\u306e\u6700\u5927\u5024\ndp = [0] * (N + 1)\ndp[0] = N\nif len(values) == 3:\n for i in range(1, N + 1):\n x = dp[i - 1]\n for w, v in zip(weights, values):\n if i - w >= 0:\n x = max(x, dp[i - w] + v)\n dp[i] = x\n N = dp[N]\nif len(values) == 2:\n w1, w2 = weights\n v1, v2 = values\n if (v1 + w1) \/ w1 < (v2 + w2) \/ w2:\n v1, v2 = v2, v1\n w1, w2 = w2, w1\n c1 = N \/\/ w1\n c2 = (N - w1 * c1) \/\/ w2\n ret = N + v1 * c1 + v2 * c2\n while c1 >= 0:\n a = N - w1 * c1 - w2 * c2\n c1 -= max(1, math.ceil((w2 - a) \/ w1))\n c2 = (N - w1 * c1) \/\/ w2\n ret = max(ret, N + v1 * c1 + v2 * c2)\n if w1 * c1 + w2 * c2 == N:\n break\n N = ret\nif len(values) == 1:\n N += N \/\/ weights[0] * values[0]\nprint(int(N))\n","change":"replace","i1":0,"i2":58,"j1":0,"j2":78,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03011","language":"Python","original_status":"Runtime Error","pass":"p, q, r = map(int, input().split())\nsorted_list = sorted(list[p, q, r])\nans = sorted_list[0] + sorted_list[1]\nprint(ans)\n","fail":"p, q, r = map(int, input().split())\nsorted_list = sorted([p, q, r])\nans = sorted_list[0] + sorted_list[1]\nprint(ans)\n","change":"replace","i1":1,"i2":2,"j1":1,"j2":2,"error":"TypeError: 'types.GenericAlias' object is not iterable","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03011\/Python\/s382927375.py\", line 2, in \n sorted_list = sorted(list[p, q, r])\nTypeError: 'types.GenericAlias' object is not iterable\n","stdout":null} {"problem_id":"p03011","language":"Python","original_status":"Runtime Error","pass":"p, q, r = map(int, input().split())\n\nprint(sum[p, q, r] - max[p, q, r])\n","fail":"p, q, r = map(int, input().split())\ntime = [p, q, r]\n\nprint(sum(time) - max(time))\n","change":"replace","i1":1,"i2":3,"j1":1,"j2":4,"error":"TypeError: 'builtin_function_or_method' object is not subscriptable","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03011\/Python\/s963953736.py\", line 3, in \n print(sum[p, q, r] - max[p, q, r])\nTypeError: 'builtin_function_or_method' object is not subscriptable\n","stdout":null} {"problem_id":"p03011","language":"Python","original_status":"Runtime Error","pass":"s = map(int, input().split())\ns.sort()\nprint(s[0] + s[1])\n","fail":"s = list(map(int, input().split()))\ns.sort()\nprint(s[0] + s[1])\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"AttributeError: 'map' object has no attribute 'sort'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03011\/Python\/s230336688.py\", line 2, in \n s.sort()\nAttributeError: 'map' object has no attribute 'sort'\n","stdout":null} {"problem_id":"p03011","language":"Python","original_status":"Runtime Error","pass":"A = [int(input()) for i in range(3)]\n\nans = sum(A) - max(A)\nprint(ans)\n","fail":"A = list(map(int, input().split()))\nans = sum(A) - max(A)\nprint(ans)\n","change":"replace","i1":0,"i2":2,"j1":0,"j2":1,"error":"ValueError: invalid literal for int() with base 10: '1 3 4'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03011\/Python\/s647136581.py\", line 1, in \n A = [int(input()) for i in range(3)]\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03011\/Python\/s647136581.py\", line 1, in \n A = [int(input()) for i in range(3)]\nValueError: invalid literal for int() with base 10: '1 3 4'\n","stdout":null} {"problem_id":"p03011","language":"Python","original_status":"Runtime Error","pass":"p = list(map(int, input().split()))\nprint(p[0] + p[1] + [2] - max(p))\n","fail":"p = list(map(int, input().split()))\nprint(p[0] + p[1] + p[2] - max(p))\n","change":"replace","i1":1,"i2":2,"j1":1,"j2":2,"error":"TypeError: unsupported operand type(s) for +: 'int' and 'list'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03011\/Python\/s411748384.py\", line 2, in \n print(p[0] + p[1] + [2] - max(p))\nTypeError: unsupported operand type(s) for +: 'int' and 'list'\n","stdout":null} {"problem_id":"p03011","language":"Python","original_status":"Runtime Error","pass":"# coding: utf-8\n\np, q, r = [int(x) for x in input().rstrip().split(\" \")]\n\ns = []\ns[0] = p + q\ns[1] = q + r\ns[2] = r + p\n\nprint(min(s))\n","fail":"# coding: utf-8\n\np, q, r = [int(x) for x in input().rstrip().split(\" \")]\n\ns = [0, 0, 0]\ns[0] = p + q\ns[1] = q + r\ns[2] = r + p\n\nprint(min(s))\n","change":"replace","i1":4,"i2":5,"j1":4,"j2":5,"error":"IndexError: list assignment index out of range","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03011\/Python\/s517518252.py\", line 6, in \n s[0] = p + q\nIndexError: list assignment index out of range\n","stdout":null} {"problem_id":"p03012","language":"Python","original_status":"Runtime Error","pass":"N = input()\nW = list(map(int, input().split()))\nprint(min([abs(sum(W[:i]) - sum(W[i:])) for i in range(N)]))\n","fail":"N = int(input())\nW = list(map(int, input().split()))\nprint(min([abs(sum(W[:i]) - sum(W[i:])) for i in range(N)]))\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"TypeError: 'str' object cannot be interpreted as an integer","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03012\/Python\/s648426101.py\", line 3, in \n print(min([abs(sum(W[:i]) - sum(W[i:])) for i in range(N)]))\nTypeError: 'str' object cannot be interpreted as an integer\n","stdout":null} {"problem_id":"p03013","language":"Python","original_status":"Runtime Error","pass":"N, M = map(int, input().split())\n\nA = []\n\nfor _ in range(M):\n A[int(input())] = True\n\nstep = [0] * (N + 1)\n\nstep[0] = 1\n\nfor s in range(1, N + 1):\n if A[s]:\n step[s] = 0\n continue\n if s == 1:\n step[s] = 1\n continue\n else:\n step[s] = step[s - 1] + step[s - 2]\n step[s] %= 1000000007\n\nprint(step[N])\n","fail":"N, M = map(int, input().split())\n\nA = [False] * (N + 1)\n\nfor _ in range(M):\n A[int(input())] = True\n\nstep = [0] * (N + 1)\n\nstep[0] = 1\n\nfor s in range(1, N + 1):\n if A[s]:\n step[s] = 0\n continue\n if s == 1:\n step[s] = 1\n continue\n else:\n step[s] = step[s - 1] + step[s - 2]\n step[s] %= 1000000007\n\nprint(step[N])\n","change":"replace","i1":2,"i2":3,"j1":2,"j2":3,"error":"IndexError: list assignment index out of range","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03013\/Python\/s337394668.py\", line 6, in \n A[int(input())] = True\nIndexError: list assignment index out of range\n","stdout":null} {"problem_id":"p03013","language":"Python","original_status":"Time Limit Exceeded","pass":"n, m = map(int, input().split())\n\na = [int(input()) for i in range(m)]\n\ndp = [0] * (n + 1)\nfor i in range(n + 1):\n if i in a:\n dp[i] = 0\n else:\n if i == 0:\n dp[i] = 1\n elif i == 1:\n dp[i] = 1\n else:\n dp[i] = (dp[i - 1] + dp[i - 2]) % 1000000007\nprint(dp[n])\n","fail":"n, m = map(int, input().split())\n\na = set()\nfor i in range(m):\n a_tmp = int(input())\n a.add(a_tmp)\n\n# a = [int(input()) for i in range(m)]\n\ndp = [0] * (n + 1)\nfor i in range(n + 1):\n if i in a:\n dp[i] = 0\n else:\n if i == 0:\n dp[i] = 1\n elif i == 1:\n dp[i] = 1\n else:\n dp[i] = (dp[i - 1] + dp[i - 2]) % 1000000007\nprint(dp[n])\n","change":"replace","i1":2,"i2":3,"j1":2,"j2":8,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03013","language":"Python","original_status":"Runtime Error","pass":"import numpy as np\n\nN, M = map(int, input().split())\nA = np.array([int(input()) for _ in range(M)])\nq = 1000000007\n\ncost = np.zeros(N + 1, dtype=np.int64)\ncost[0] = 1\ncost[1] = 1\ncost[A] = 0\ncost[2] = cost[0] + cost[1]\n\nfor i in range(1, N + 1):\n cost[A] = 0\n cost[i] = (cost[i - 1] + cost[i - 2]) % q\n\nprint(cost[-1])\n","fail":"N, M = map(int, input().split())\nA = [int(input()) for _ in range(M)]\nq = 1000000007\n\nif N == 1:\n if M == 0:\n print(1)\n elif M == 1:\n print(0)\nelse:\n cost = [0 for _ in range(N + 1)]\n cost[0] = 1\n\n cnt = 0\n A.append([0])\n for i in range(1, N + 1):\n if i == A[cnt]:\n cost[i] = 0\n cnt += 1\n else:\n cost[i] = (cost[i - 1] + cost[i - 2]) % q\n\n print(cost[-1])\n","change":"replace","i1":0,"i2":17,"j1":0,"j2":23,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03013","language":"Python","original_status":"Runtime Error","pass":"N, M = map(int, input().split())\nbroken_step = [0] * N\nfor _ in range(M):\n n = int(input())\n broken_step[n - 1] = 1\n\ndp = [0] * N\n\ndp[0] = 0 if broken_step[0] == 1 else 1\ndp[1] = 0 if broken_step[1] == 1 else (1 + dp[0])\n\nfor i in range(2, N):\n if broken_step[i] == 1:\n dp[i] = 0\n else:\n dp[i] = dp[i - 1] + dp[i - 2]\n\nprint(dp[-1] % 1000000007)\n","fail":"N, M = map(int, input().split())\nbroken_step = [0] * (N + 1)\nfor _ in range(M):\n n = int(input())\n broken_step[n] = 1\n\ndp = [1] * (N + 1)\ndp[1] = 0 if broken_step[1] == 1 else dp[0]\n\nfor i in range(2, N + 1):\n if broken_step[i] == 1:\n dp[i] = 0\n else:\n dp[i] = dp[i - 1] + dp[i - 2]\n\nprint(dp[-1] % 1000000007)\n","change":"replace","i1":1,"i2":12,"j1":1,"j2":10,"error":"0","stderr":null,"stdout":"4\n"} {"problem_id":"p03013","language":"Python","original_status":"Time Limit Exceeded","pass":"INF = 1_000_000_007\n\n\ndef comb(n, k):\n k = min(n - k, k)\n if n == 0 or k == 0:\n return 1\n a = n\n for i in range(n - 1, n - k, -1):\n a *= i\n b = 1\n for i in range(2, k + 1):\n b *= i\n return a \/\/ b\n\n\nN, M = list(map(int, input().split()))\nA = [-1] + [int(input()) for _ in range(M)] + [N + 1]\nres = 1\nfor i in range(M + 1):\n t = A[i + 1] - A[i] - 2\n if t < 0:\n res = 0\n else:\n _t = 0\n for i in range(t \/\/ 2 + 1):\n _t += comb(t - i, i)\n res *= _t\nprint(res % INF)\n","fail":"MOD = 10**9 + 7\nN, M = list(map(int, input().split()))\nB = [True] * (N + 1)\nD = [1] + [0] * N\nfor _ in range(M):\n a = int(input())\n B[a] = False\nfor i in range(N):\n for j in range(i + 1, min(N, i + 2) + 1):\n if B[j]:\n D[j] = (D[j] + D[i]) % MOD\nprint(D[N])\n","change":"replace","i1":0,"i2":29,"j1":0,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03013","language":"Python","original_status":"Time Limit Exceeded","pass":"MOD = 1000000007\n\nn, m = map(int, input().split())\na = [int(input()) for i in range(m)]\n\nf = [0] * (n + 1)\nf[0] = 1\n\nif 1 not in a:\n f[1] = 1\n\nfor i in range(2, n + 1):\n if i in a:\n continue\n f[i] = f[i - 1] + f[i - 2]\n if f[i] >= MOD:\n f[i] -= MOD\n\nprint(f[-1])\n","fail":"import sys\n\nread = sys.stdin.buffer.read\nreadline = sys.stdin.buffer.readline\nreadlines = sys.stdin.buffer.readlines\n\nN, M, *A = map(int, read().split())\n\nMOD = 10**9 + 7\n\ndp = [0] * (N + 10)\ndp[0] = 1\nis_broken = [False] * (N + 1)\n\nfor x in A:\n is_broken[x] = True\n\nfor n in range(1, N + 1):\n if is_broken[n]:\n continue\n x = dp[n - 1] + dp[n - 2]\n if x >= MOD:\n x -= MOD\n dp[n] = x\n\nanswer = dp[N]\nprint(answer)\n","change":"replace","i1":0,"i2":19,"j1":0,"j2":27,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03013","language":"Python","original_status":"Time Limit Exceeded","pass":"div = 1000000007\n\nn, m = map(int, input().split())\na = [int(input()) for i in range(m)]\n\nf = [0] * (n + 1)\nf[0] = 1\n\nif 1 not in a:\n f[1] = 1\n\nfor i in range(2, n + 1):\n if i in a:\n continue\n f[i] = (f[i - 1] + f[i - 2]) % div\n\nprint(f[-1])\n","fail":"div = 1000000007\n\nn, m, *b = map(int, open(0).read().split())\na = set(b)\n\nf = [0] * (n + 1)\nf[0] = 1\n\nif 1 not in a:\n f[1] = 1\n\nfor i in range(2, n + 1):\n if i in a:\n continue\n f[i] = (f[i - 1] + f[i - 2]) % div\n\nprint(f[-1])\n","change":"replace","i1":2,"i2":4,"j1":2,"j2":4,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03013","language":"Python","original_status":"Time Limit Exceeded","pass":"n, m = map(int, input().split())\na = [int(input()) for i in range(m)]\n\nf = [0] * (n + 1)\nf[0] = 1\n\nfor i in range(1, n + 1):\n if i in a:\n continue\n f[i] = (f[i - 1] + f[i - 2]) % 1000000007\n\nprint(f[n])\n","fail":"def main():\n N, M, *a = map(int, open(0).read().split())\n div = 1000000007\n broken = set(a)\n\n comb_list = [0] * (N + 1)\n comb_list[0] = 1\n if 1 not in broken:\n comb_list[1] = 1\n\n for i in range(2, N + 1):\n if i in broken:\n continue\n comb_list[i] = (comb_list[i - 1] + comb_list[i - 2]) % div\n\n print(comb_list[-1])\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":0,"i2":12,"j1":0,"j2":20,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03013","language":"Python","original_status":"Runtime Error","pass":"n, m = map(int, input().split())\n\nstairs = []\nis_continuous = False\nfor i in range(m):\n stairs.append(int(input()))\n if i > 0 and stairs[i] - 1 == stairs[i - 1]:\n is_continuous = True\n break\n\nif is_continuous:\n print(0)\nelse:\n countup_num = [0] * (n + 1)\n countup_num[0] = 1\n countup_num[1] = 1\n for i in range(2, n + 1):\n countup_num[i] = (countup_num[i - 1] + countup_num[i - 2]) % 1000000007\n res = 1\n diff = 0\n now = 0\n for i in range(m):\n diff = stairs[i] - now - 1\n now = stairs[i] + 1\n res *= (countup_num[diff]) % 1000000007\n # print(res, now)\n diff = n - stairs[-1] - 1\n res *= (countup_num[diff]) % 1000000007\n\n res %= 1000000007\n # print(countup_num)\n print(res)\n","fail":"n, m = map(int, input().split())\n\nstairs = []\nis_continuous = False\nfor i in range(m):\n stairs.append(int(input()))\n if i > 0 and stairs[i] - 1 == stairs[i - 1]:\n is_continuous = True\n break\n\nif is_continuous:\n print(0)\nelse:\n countup_num = [0] * (n + 1)\n countup_num[0] = 1\n countup_num[1] = 1\n for i in range(2, n + 1):\n countup_num[i] = (countup_num[i - 1] + countup_num[i - 2]) % 1000000007\n res = 1\n diff = 0\n now = 0\n for i in range(m):\n diff = stairs[i] - now - 1\n now = stairs[i] + 1\n res *= (countup_num[diff]) % 1000000007\n # print(res, now)\n if m == 0:\n res = countup_num[n]\n else:\n diff = n - stairs[-1] - 1\n res *= (countup_num[diff]) % 1000000007\n\n res %= 1000000007\n # print(countup_num)\n print(res)\n","change":"replace","i1":26,"i2":28,"j1":26,"j2":31,"error":"0","stderr":null,"stdout":"4\n"} {"problem_id":"p03013","language":"Python","original_status":"Time Limit Exceeded","pass":"def inputs(num_of_input):\n ins = [input() for i in range(num_of_input)]\n return ins\n\n\ndef solve(inputs):\n [N, M] = list(map(lambda x: int(x), inputs[0].split()))\n broke_steps = list(map(lambda x: int(x), inputs[1:]))\n\n SSSS = 1000000007\n\n patterns = [1]\n for step in range(1, N + 1):\n if step in broke_steps:\n ap = 0\n elif step == 1:\n ap = 1\n else:\n ap = (patterns[step - 1] + patterns[step - 2]) % SSSS\n patterns.append(ap)\n\n return patterns[-1]\n\n\nif __name__ == \"__main__\":\n first = input()\n [N, M] = list(map(lambda x: int(x), first.split()))\n inputs_str = inputs(M)\n inputs_str.insert(0, first)\n ret = solve(inputs_str)\n print(ret)\n","fail":"def inputs(num_of_input):\n ins = [input() for i in range(num_of_input)]\n return ins\n\n\ndef solve(inputs):\n [N, M] = list(map(lambda x: int(x), inputs[0].split()))\n broke_steps = {}\n for b in map(lambda x: int(x), inputs[1:]):\n broke_steps[b] = True\n\n SSSS = 1000000007\n\n patterns = [1]\n for step in range(1, N + 1):\n if step in broke_steps:\n ap = 0\n elif step == 1:\n ap = 1\n else:\n ap = (patterns[step - 1] + patterns[step - 2]) % SSSS\n patterns.append(ap)\n\n return patterns[-1]\n\n\nif __name__ == \"__main__\":\n first = input()\n [N, M] = list(map(lambda x: int(x), first.split()))\n inputs_str = inputs(M)\n inputs_str.insert(0, first)\n ret = solve(inputs_str)\n print(ret)\n","change":"replace","i1":7,"i2":8,"j1":7,"j2":10,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03013","language":"Python","original_status":"Runtime Error","pass":"n, m = map(int, input().split())\n\ns = [0] * (n + 1)\ns[-1] = 1\nfor _ in range(m):\n a = int(input())\n s[a] = None\n\nif s[0] is None and s[1] is None:\n print(0)\n exit()\n\nfor i in range(n - 1, -1, -1):\n if s[i] is None:\n continue\n if i + 1 < len(s) and s[i + 1] is not None:\n s[i] += s[i + 1]\n if i + 2 < len(s) and s[i + 2] is not None:\n s[i] += s[i + 2]\n\nprint(s[0] % 1_000_000_007)\n","fail":"n, m = map(int, input().split())\n\ns = [0] * (n + 1)\ns[-1] = 1\nfor _ in range(m):\n a = int(input())\n s[a] = None\n\nif s[0] is None and s[1] is None:\n print(0)\n exit()\n\nfor i in range(n - 1, -1, -1):\n if s[i] is None:\n continue\n if i + 1 < len(s) and s[i + 1] is not None:\n s[i] += s[i + 1]\n if i + 2 < len(s) and s[i + 2] is not None:\n s[i] += s[i + 2]\n\nprint(s[0] % 1000000007)\n","change":"replace","i1":20,"i2":21,"j1":20,"j2":21,"error":"0","stderr":null,"stdout":"4\n"} {"problem_id":"p03013","language":"Python","original_status":"Time Limit Exceeded","pass":"mod = 10**9 + 7\n\nn, m = list(map(int, input().split()))\na = [int(input()) for _ in range(m)]\n\ndp = {}\nfor i in range(n + 1):\n dp[i] = 1\ndp[1] = 0 if 1 in a else 1\nfor i in range(2, n + 1):\n if i in a:\n dp[i] = 0\n else:\n dp[i] = dp[i - 1] % mod + dp[i - 2] % mod\n dp[i] %= mod\n\nprint(dp[n] % mod)\n","fail":"mod = 10**9 + 7\n\nn, m = list(map(int, input().split()))\na = set([int(input()) for _ in range(m)])\n\ndp = {}\nfor i in range(n + 1):\n dp[i] = 1\ndp[1] = 0 if 1 in a else 1\nfor i in range(2, n + 1):\n if i in a:\n dp[i] = 0\n else:\n dp[i] = dp[i - 1] % mod + dp[i - 2] % mod\n dp[i] %= mod\n\nprint(dp[n] % mod)\n","change":"replace","i1":3,"i2":4,"j1":3,"j2":4,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03013","language":"Python","original_status":"Runtime Error","pass":"n, m = map(int, input().split())\na = [int(input()) for _ in range(m)]\nb = [0, 1]\nc = []\nans = 1\n\nfor _ in range(n):\n b.append(b[-1] + b[-2])\n\nc.append(a[0])\nfor i in range(m - 1):\n c.append(a[i + 1] - a[i] - 1)\nc.append(n - a[m - 1])\n\nfor i in c:\n ans *= b[i]\n\nprint(ans % 1000000007)\n","fail":"n, m = map(int, input().split())\na = [int(input()) for _ in range(m)]\nb = [0, 1]\nc = []\nans = 1\n\nfor _ in range(n):\n b.append(b[-1] + b[-2])\n\nif m == 0:\n ans = b[n + 1]\nelse:\n c.append(a[0])\n for i in range(m - 1):\n c.append(a[i + 1] - a[i] - 1)\n c.append(n - a[m - 1])\n\n for i in c:\n ans *= b[i]\n\nprint(ans % 1000000007)\n","change":"replace","i1":9,"i2":16,"j1":9,"j2":19,"error":"0","stderr":null,"stdout":"4\n"} {"problem_id":"p03013","language":"Python","original_status":"Time Limit Exceeded","pass":"#!\/usr\/bin\/env python3\nimport sys\n\nsys.setrecursionlimit(1000000)\n\n\ndef count(n):\n if n < 2:\n return 1\n return count(n - 1) + count(n - 2)\n\n\nn, m, *a = map(int, open(0).read().split())\nif sum(a[i + 1] == a[i] + 1 for i in range(m - 1)) > 0:\n print(0)\n exit()\n\na.append(n + 1)\nc = -1\nans = 1\nfor i in a:\n ans = ans * count(i - c - 2) % (10**9 + 7)\n c = i\nprint(ans)\n","fail":"#!\/usr\/bin\/env python3\nimport sys\n\nsys.setrecursionlimit(1000000)\n\n\nmemo = [0] * (10**5 + 1)\n\n\ndef count(n):\n if n < 2:\n return 1\n if memo[n] != 0:\n return memo[n]\n memo[n] = count(n - 1) + count(n - 2)\n return memo[n]\n\n\nn, m, *a = map(int, open(0).read().split())\nif sum(a[i + 1] == a[i] + 1 for i in range(m - 1)) > 0:\n print(0)\n exit()\n\na.append(n + 1)\nc = -1\nans = 1\nfor i in a:\n ans = ans * count(i - c - 2) % (10**9 + 7)\n c = i\nprint(ans)\n","change":"replace","i1":6,"i2":10,"j1":6,"j2":16,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03013","language":"Python","original_status":"Time Limit Exceeded","pass":"from math import factorial\n\nn, m = map(int, input().split())\nA = [0] * m\nfor i in range(m):\n A[i] = int(input())\nB = []\nif m > 1:\n for i in range(m - 1):\n if A[i + 1] - A[i] == 1:\n print(0)\n exit()\nif m:\n B.append(A[0])\n A.append(n + 1)\n for i in range(len(A) - 2, -1, -1):\n B.append(A[i + 1] - A[i] - 1)\nelse:\n B.append(n + 1)\ndiv = 1000000007\nans = 1\nfor b in B:\n if b < 3:\n continue\n c = b - 1\n two_max = c \/\/ 2\n a = 0\n for two in range(two_max + 1):\n one = c - (2 * two)\n a += factorial(one + two) \/\/ (factorial(one) * factorial(two))\n ans *= a\n ans %= div\nprint(ans)\n","fail":"def generate_range_combinations(n):\n C = [1] * n\n for i in range(2, n):\n C[i] = (C[i - 1] + C[i - 2]) % DIV\n return C\n\n\ndef solve(n, m, A):\n from collections import defaultdict\n\n if m == 0:\n C = generate_range_combinations(n + 1)\n return C[-1]\n\n D = defaultdict(lambda: 0)\n for i in range(m - 1):\n d = A[i + 1] - A[i] - 1\n if d == 0:\n return 0\n D[d] += 1\n D[A[0]] += 1\n D[n - A[-1]] += 1\n\n ans = 1\n C = generate_range_combinations(max(D.keys()))\n for k, v in D.items():\n ans *= C[k - 1] ** v\n ans %= DIV\n return ans\n\n\nDIV = 1000000007\nn, m = map(int, input().split())\nA = [int(input()) for _ in range(m)]\nprint(solve(n, m, A))\n","change":"replace","i1":0,"i2":33,"j1":0,"j2":35,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03013","language":"Python","original_status":"Time Limit Exceeded","pass":"N, M = list(map(int, input().split()))\na = [int(input()) for i in range(M)]\n\ndp = [0, 1]\n\nfor i in range(1, N + 1):\n if i in a:\n dp.append(0)\n continue\n dp.append(dp[i - 1] + dp[i])\n\nprint(dp[N + 1] % 1000000007)\n","fail":"N, M = list(map(int, input().split()))\na = [int(input()) for i in range(M)]\na.append(0)\ndp = [0, 1]\na_flag = 0\n\nfor i in range(1, N + 1):\n if i == a[a_flag]:\n dp.append(0)\n a_flag += 1\n continue\n dp.append(dp[i - 1] + dp[i])\n\nprint(dp[N + 1] % 1000000007)\n","change":"replace","i1":2,"i2":8,"j1":2,"j2":10,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03013","language":"Python","original_status":"Time Limit Exceeded","pass":"#!\/usr\/bin\/env python3\n# -*- coding: utf-8 -*-\n\n\ndef main():\n N, M = map(int, input().split())\n A = [int(input()) for _ in range(M)]\n\n mod = 10**9 + 7\n dp = [0] * (N + 1)\n dp[0] = 1\n\n for i in range(1, N + 1):\n if i in A:\n continue\n\n if i == 1:\n dp[1] = dp[0]\n continue\n\n dp[i] = dp[i - 1] + dp[i - 2]\n dp[i] %= mod\n\n print(dp[N])\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"#!\/usr\/bin\/env python3\n# -*- coding: utf-8 -*-\n\n\ndef main():\n N, M = map(int, input().split())\n A = set([int(input()) for _ in range(M)])\n\n mod = 10**9 + 7\n dp = [0] * (N + 1)\n dp[0] = 1\n\n for i in range(1, N + 1):\n if i in A:\n continue\n\n if i == 1:\n dp[1] = dp[0]\n continue\n\n dp[i] = dp[i - 1] + dp[i - 2]\n dp[i] %= mod\n\n print(dp[N])\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":6,"i2":7,"j1":6,"j2":7,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03013","language":"Python","original_status":"Time Limit Exceeded","pass":"N, M = map(int, input().split())\nA = [int(input()) for _ in range(M)]\n\nB = [0] * (N + 1)\nB[0] = 1\nif 1 not in A:\n B[1] = 1\nelse:\n B[1] = 0\nmod = 10**9 + 7\n\nfor i in range(2, N + 1):\n if i != 2 and i - 1 in A and i - 2 in A:\n print(0)\n exit()\n elif i - 2 in A:\n B[i] = B[i - 1]\n elif i - 1 in A:\n B[i] = B[i - 2]\n else:\n B[i] = B[i - 1] + B[i - 2]\n B[i] %= mod\nprint(B[N] % mod)\n","fail":"import sys\n\ninput = sys.stdin.readline\n\n\ndef binary_search(l, value):\n low = 0\n high = len(l) - 1\n while low <= high:\n mid = (low + high) \/\/ 2\n if l[mid] == value:\n return True\n elif l[mid] < value:\n low = mid + 1\n else:\n high = mid - 1\n return False\n\n\nN, M = map(int, input().split())\nA = [int(input()) for _ in range(M)]\n\nA.append(10**6)\nA.append(10**6)\nB = [0] * (N + 1)\nB[0] = 1\nif binary_search(A, 1) is True:\n B[1] = 0\nelse:\n B[1] = 1\nmod = 10**9 + 7\n\nfor i in range(2, N + 1):\n if i != 2 and binary_search(A, i - 1) is True and binary_search(A, i - 2) is True:\n print(0)\n exit()\n elif binary_search(A, i - 2) is True:\n B[i] = B[i - 1]\n elif binary_search(A, i - 1) is True:\n B[i] = B[i - 2]\n else:\n B[i] = B[i - 1] + B[i - 2]\n B[i] %= mod\nprint(B[N] % mod)\n","change":"replace","i1":0,"i2":18,"j1":0,"j2":39,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03013","language":"Python","original_status":"Time Limit Exceeded","pass":"#!\/usr\/bin\/env python3\nimport sys\n\nsys.setrecursionlimit(1000000)\n\nn, m, *a = map(int, open(0).read().split())\ndp = [0] * (n + 1)\nok = [True] * (n + 1)\n\nfor i in a:\n ok[i] = False\n\n\ndef count(n):\n if ok[n]:\n if n < 2:\n return 1\n if dp[n] != 0:\n return dp[n]\n dp[n] = (count(n - 1) + count(n - 2)) % (10**9 + 7)\n return dp[n]\n else:\n return 0\n\n\nprint(count(n))\n","fail":"#!\/usr\/bin\/env python3\nimport sys\n\nsys.setrecursionlimit(1000000)\nn, m, *a = map(int, open(0).read().split())\ndp = [1] + [-1] * n\ndp[1] = 1\nfor i in a:\n dp[i] = 0\n\n\ndef count(n):\n if dp[n] != -1:\n return dp[n]\n dp[n] = (count(n - 1) + count(n - 2)) % (10**9 + 7)\n return dp[n]\n\n\nprint(count(n))\n","change":"replace","i1":4,"i2":23,"j1":4,"j2":16,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03013","language":"Python","original_status":"Runtime Error","pass":"N, M = map(int, input().split())\na = set([int(input()) for _ in range(M)])\n\nMOD = 1000000007\n\ndp = [0] * (N + 1)\ndp[0] = 1\n\nif 1 not in a:\n dp[1] = 1\nelse:\n dp[1] = 0\n\nfor i in range(2, N + 1):\n print(f\"i: {i}, dp: {dp}\")\n\n if i in a:\n continue\n dp[i] = dp[i - 1] + dp[i - 2]\n dp[i] %= MOD\nprint(f\"i: {i}, dp: {dp}\")\n\nprint(dp[N])\n","fail":"N, M = map(int, input().split())\na = set([int(input()) for _ in range(M)])\n\nMOD = 1000000007\n\ndp = [0] * (N + 1)\ndp[0] = 1\n\nif 1 not in a:\n dp[1] = 1\nelse:\n dp[1] = 0\n\nfor i in range(2, N + 1):\n if i in a:\n continue\n dp[i] = dp[i - 1] + dp[i - 2]\n dp[i] %= MOD\n\nprint(dp[N])\n","change":"replace","i1":14,"i2":21,"j1":14,"j2":18,"error":"WA","stderr":null,"stdout":"i: 2, dp: [1, 1, 0, 0, 0, 0, 0]\ni: 3, dp: [1, 1, 2, 0, 0, 0, 0]\ni: 4, dp: [1, 1, 2, 0, 0, 0, 0]\ni: 5, dp: [1, 1, 2, 0, 2, 0, 0]\ni: 6, dp: [1, 1, 2, 0, 2, 2, 0]\ni: 6, dp: [1, 1, 2, 0, 2, 2, 4]\n4\n"} {"problem_id":"p03013","language":"Python","original_status":"Runtime Error","pass":"N, M = map(int, input().split())\nsteps = [True] * (N + 1)\nfor _ in range(M):\n steps[int(input())] = False\ndp = [0] * (N + 1)\ndp[0] = 1\nfor prev in range(N):\n for now in range(prev + 1, min(N, prev + 2) + 1):\n if steps[now]:\n dp[now] += dp[prev]\n dp[now] %= 1_000_000_007\nprint(dp[N])\n","fail":"N, M = map(int, input().split())\nsteps = [True] * (N + 1)\nfor _ in range(M):\n steps[int(input())] = False\ndp = [0] * (N + 1)\ndp[0] = 1\nfor prev in range(N):\n for now in range(prev + 1, min(N, prev + 2) + 1):\n if steps[now]:\n dp[now] += dp[prev]\n dp[now] %= 10**9 + 7\nprint(dp[N])\n","change":"replace","i1":10,"i2":11,"j1":10,"j2":11,"error":"0","stderr":null,"stdout":"4\n"} {"problem_id":"p03013","language":"Python","original_status":"Time Limit Exceeded","pass":"MOD = 1000000007\nN = 100001\n\nfibo = [1, 1] + [0] * N\nfor i in range(2, N):\n fibo[i] = (fibo[i - 1] + fibo[i - 2]) % MOD\n\nn, m = list(map(int, input().split(\" \")))\na_list = [int(input()) for _ in range(m)]\nngs = [i in a_list for i in range(n)]\nngs.append(False)\nfor i in range(n):\n if ngs[i] and ngs[i + 1]:\n print(0)\n exit()\ncnts = []\ncnt = 0\n\nfor ng in ngs:\n if ng:\n cnts.append(cnt)\n cnt = 0\n continue\n cnt += 1\ncnts.append(cnt)\nans = 1\nfor c in cnts:\n if c != 0:\n ans *= fibo[c - 1]\n# print(ngs)\n# print(cnts)\nprint(ans % MOD)\n","fail":"MOD = 1000000007\nN = 100001\n\nfibo = [1, 1] + [0] * N\nfor i in range(2, N):\n fibo[i] = (fibo[i - 1] + fibo[i - 2]) % MOD\n\nn, m = list(map(int, input().split(\" \")))\na_list = [int(input()) for _ in range(m)]\nis_ngs = [0] * (n + 2)\nfor a in a_list:\n is_ngs[a] = 1\nfor i in range(n):\n if is_ngs[i] and is_ngs[i + 1]:\n print(0)\n exit()\ncnts = []\ncnt = 0\n\nfor i in range(n + 1):\n if is_ngs[i]:\n cnts.append(cnt)\n cnt = 0\n continue\n cnt += 1\ncnts.append(cnt)\nans = 1\nfor c in cnts:\n if c != 0:\n ans *= fibo[c - 1]\n# print(is_ngs)\n# print(cnts)\nprint(ans % MOD)\n","change":"replace","i1":9,"i2":30,"j1":9,"j2":31,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03013","language":"Python","original_status":"Time Limit Exceeded","pass":"def main():\n N, M = map(int, input().split())\n A = [int(input()) for _ in range(M)]\n dp = [0] * (N + 2)\n dp[-2] = 1\n for i in range(N - 1, -1, -1):\n if i in A:\n continue\n elif i + 1 in A:\n dp[i] = dp[i + 2]\n elif i + 2 in A:\n dp[i] = dp[i + 1]\n elif i + 1 in A and i + 2 in A:\n break\n else:\n dp[i] = dp[i + 1] + dp[i + 2]\n print(dp[0] % 1000000007)\n\n\nmain()\n","fail":"def main():\n N, M = map(int, input().split())\n A = [0] * (N + 2)\n for _ in range(M):\n A[int(input())] = 1\n dp = [0] * (N + 2)\n dp[-2] = 1\n for i in range(N - 1, -1, -1):\n if A[i] == 1:\n continue\n dp[i] = dp[i + 1] + dp[i + 2]\n print(dp[0] % 1000000007)\n\n\nmain()\n","change":"replace","i1":2,"i2":16,"j1":2,"j2":11,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03013","language":"Python","original_status":"Runtime Error","pass":"n, m = map(int, input().split())\nhole_ids = {int(input()) - 1: 0 for _ in range(m)}\nX = 1000000007\n\n\ndef solve(n, hole_ids):\n nums = []\n # nums = [0] * n\n for i in range(n):\n if i in hole_ids:\n nums.append(0)\n # nums[i] = 0\n continue\n\n if i == 0:\n nums.append(1)\n # nums[i] = 1\n elif i == 1:\n # 1\u3064\u524d\u304b\u30891\u6bb5\u4e0a\u304c\u308b\u304b\u30892\u3064\u524d\u304b\u30892\u500b\u98db\u3070\u3057\n nums.append(nums[-1] + 1)\n # nums[i] = nums[i-1] + 1\n else:\n nums.append((nums[-1] % X + nums[-2] % X) % X)\n # nums[i] = (nums[i-1] + nums[i-2]) % X\n return nums[-1]\n\n\nprint(solve(n, hole_ids))\nn, m = map(int, input().split())\nhole_ids = {int(input()) - 1: 0 for _ in range(m)}\nX = 1000000007\n\n\ndef solve(n, hole_ids):\n nums = []\n # nums = [0] * n\n for i in range(n):\n if i in hole_ids:\n nums.append(0)\n # nums[i] = 0\n continue\n\n if i == 0:\n nums.append(1)\n # nums[i] = 1\n elif i == 1:\n # 1\u3064\u524d\u304b\u30891\u6bb5\u4e0a\u304c\u308b\u304b\u30892\u3064\u524d\u304b\u30892\u500b\u98db\u3070\u3057\n nums.append(nums[-1] + 1)\n # nums[i] = nums[i-1] + 1\n else:\n nums.append((nums[-1] % X + nums[-2] % X) % X)\n # nums[i] = (nums[i-1] + nums[i-2]) % X\n return nums[-1]\n\n\nprint(solve(n, hole_ids))\n","fail":"n, m = map(int, input().split())\nhole_ids = {int(input()) - 1: 0 for _ in range(m)}\nX = 1000000007\n\n\ndef solve(n, hole_ids):\n nums = []\n # nums = [0] * n\n for i in range(n):\n if i in hole_ids:\n nums.append(0)\n # nums[i] = 0\n continue\n\n if i == 0:\n nums.append(1)\n # nums[i] = 1\n elif i == 1:\n # 1\u3064\u524d\u304b\u30891\u6bb5\u4e0a\u304c\u308b\u304b\u30892\u3064\u524d\u304b\u30892\u500b\u98db\u3070\u3057\n nums.append(nums[-1] + 1)\n # nums[i] = nums[i-1] + 1\n else:\n nums.append((nums[-1] % X + nums[-2] % X) % X)\n # nums[i] = (nums[i-1] + nums[i-2]) % X\n return nums[-1]\n\n\nprint(solve(n, hole_ids))\n","change":"delete","i1":28,"i2":56,"j1":28,"j2":28,"error":"EOFError: EOF when reading a line","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03013\/Python\/s744106332.py\", line 29, in \n n, m = map(int, input().split())\nEOFError: EOF when reading a line\n","stdout":"4\n"} {"problem_id":"p03013","language":"Python","original_status":"Time Limit Exceeded","pass":"N, M = [int(s) for s in input().split()]\nA = []\nfor _ in range(M):\n A.append(int(input()))\n\ncounts = [0] * (N + 1)\nfor i in range(N + 1):\n if i == 0:\n counts[i] = 1\n elif i == 1:\n if i not in A:\n counts[i] = 1\n else:\n for j in [i - 2, i - 1]:\n if j not in A and i not in A:\n counts[i] += counts[j]\n counts[i] %= 1000000007\n\nprint(counts[N])\n","fail":"N, M = [int(s) for s in input().split()]\nA = []\nfor _ in range(M):\n A.append(int(input()))\nA = set(A)\n\ncounts = [0] * (N + 1)\nfor i in range(N + 1):\n if i == 0:\n counts[i] = 1\n elif i == 1:\n if i not in A:\n counts[i] = 1\n else:\n if i not in A:\n for j in [i - 2, i - 1]:\n if j not in A:\n counts[i] += counts[j]\n counts[i] %= 1000000007\n\nprint(counts[N])\n","change":"replace","i1":4,"i2":17,"j1":4,"j2":19,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03014","language":"Python","original_status":"Time Limit Exceeded","pass":"import sys\n\ninput = sys.stdin.readline\n\n\ndef main():\n H, W = map(int, input().split())\n S = [None] * (H + 2)\n S[0] = S[-1] = \"#\" * (W + 2)\n for i in range(1, H + 1):\n S[i] = \"\".join([\"#\", input().rstrip(), \"#\"])\n\n U = [[-1] * (W + 2) for _ in range(H + 2)]\n D = [[-1] * (W + 2) for _ in range(H + 2)]\n L = [[-1] * (W + 2) for _ in range(H + 2)]\n R = [[-1] * (W + 2) for _ in range(H + 2)]\n for h in range(1, H + 1):\n for w in range(1, W + 1):\n if S[h][w] == \"#\":\n continue\n if U[h][w] == -1:\n U[h][w] = 0\n d = 0\n while True:\n d += 1\n if S[h + d][w] == \"#\":\n break\n U[h + d][w] = d\n if L[h][w] == -1:\n L[h][w] = 0\n d = 0\n while True:\n d += 1\n if S[h][w + d] == \"#\":\n break\n L[h][w + d] = d\n\n for h in reversed(range(1, H + 1)):\n for w in reversed(range(1, W + 1)):\n if S[h][w] == \"#\":\n continue\n if D[h][w] == -1:\n D[h][w] = 0\n d = 0\n while True:\n d += 1\n if S[h - d][w] == \"#\":\n break\n D[h - d][w] = d\n if R[h][w] == -1:\n R[h][w] = 0\n d = 0\n while True:\n d += 1\n if S[h][w - d] == \"#\":\n break\n R[h][w - d] = d\n\n ans = 0\n for h in range(1, H + 1):\n for w in range(1, W + 1):\n dist = U[h][w] + D[h][w] + L[h][w] + R[h][w] + 1\n if ans < dist:\n ans = dist\n\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"import sys\n\nimport numba as nb\nimport numpy as np\n\ninput = sys.stdin.readline\n\n\n@nb.njit(\"i8(i8,i8,b1[:,:])\", cache=True)\ndef solve(H, W, S):\n U = np.full(shape=(H + 2, W + 2), fill_value=-1, dtype=np.int64)\n D = np.full(shape=(H + 2, W + 2), fill_value=-1, dtype=np.int64)\n L = np.full(shape=(H + 2, W + 2), fill_value=-1, dtype=np.int64)\n R = np.full(shape=(H + 2, W + 2), fill_value=-1, dtype=np.int64)\n for h in range(1, H + 1):\n for w in range(1, W + 1):\n if not S[h][w]:\n continue\n if U[h][w] == -1:\n U[h][w] = 0\n d = 0\n while True:\n d += 1\n if not S[h + d][w]:\n break\n U[h + d][w] = d\n if L[h][w] == -1:\n L[h][w] = 0\n d = 0\n while True:\n d += 1\n if not S[h][w + d]:\n break\n L[h][w + d] = d\n\n for h in range(H + 1, 0, -1):\n for w in range(W + 1, 0, -1):\n if not S[h][w]:\n continue\n if D[h][w] == -1:\n D[h][w] = 0\n d = 0\n while True:\n d += 1\n if not S[h - d][w]:\n break\n D[h - d][w] = d\n if R[h][w] == -1:\n R[h][w] = 0\n d = 0\n while True:\n d += 1\n if not S[h][w - d]:\n break\n R[h][w - d] = d\n\n dist = U + D + L + R + 1\n ans = np.max(dist)\n return ans\n\n\ndef main():\n H, W = map(int, input().split())\n S = np.zeros(shape=(H + 2, W + 2), dtype=np.bool)\n for i in range(1, H + 1):\n S[i][1:-1] = [s == \".\" for s in input().rstrip()]\n\n ans = solve(H, W, S)\n\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":1,"i2":64,"j1":1,"j2":68,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03014","language":"Python","original_status":"Time Limit Exceeded","pass":"H, W = map(int, input().split())\nMAP = [[] for _ in range(H)]\nL = [[[] for h in range(W)] for _ in range(H)]\nR = [[[] for h in range(W)] for _ in range(H)]\nD = [[[] for h in range(W)] for _ in range(H)]\nU = [[[] for h in range(W)] for _ in range(H)]\n\nfor i in range(H):\n MAP[i] = list(input())\n\nfor i in range(H):\n for j in range(W):\n if MAP[i][j] == \"#\":\n L[i][j] = 0\n elif j == 0:\n L[i][j] = 1\n else:\n L[i][j] = L[i][j - 1] + 1\n\n if MAP[i][W - j - 1] == \"#\":\n R[i][W - j - 1] = 0\n elif j == 0:\n R[i][W - j - 1] = 1\n else:\n R[i][W - j - 1] = R[i][W - j] + 1\n\nfor j in range(W):\n for i in range(H):\n if MAP[i][j] == \"#\":\n U[i][j] = 0\n elif i == 0:\n U[i][j] = 1\n else:\n U[i][j] = U[i - 1][j] + 1\n\n if MAP[H - i - 1][j] == \"#\":\n D[H - i - 1][j] = 0\n elif i == 0:\n D[H - i - 1][j] = 1\n else:\n D[H - i - 1][j] = D[H - i][j] + 1\nresult = 0\nfor i in range(H):\n for j in range(W):\n result = max(result, U[i][j] + D[i][j] + L[i][j] + R[i][j] - 3)\n\nprint(result)\n","fail":"H, W = map(int, input().split())\nMAP = [list(input()) for _ in range(H)]\nL = [[0] * W for _ in range(H)]\nR = [[0] * W for _ in range(H)]\nD = [[0] * W for _ in range(H)]\nU = [[0] * W for _ in range(H)]\n\nfor i in range(H):\n for j in range(W):\n if MAP[i][j] == \"#\":\n L[i][j] = 0\n elif j == 0:\n L[i][j] = 1\n else:\n L[i][j] = L[i][j - 1] + 1\n\n if MAP[i][W - j - 1] == \"#\":\n R[i][W - j - 1] = 0\n elif j == 0:\n R[i][W - j - 1] = 1\n else:\n R[i][W - j - 1] = R[i][W - j] + 1\n\nfor j in range(W):\n for i in range(H):\n if MAP[i][j] == \"#\":\n U[i][j] = 0\n elif i == 0:\n U[i][j] = 1\n else:\n U[i][j] = U[i - 1][j] + 1\n\n if MAP[H - i - 1][j] == \"#\":\n D[H - i - 1][j] = 0\n elif i == 0:\n D[H - i - 1][j] = 1\n else:\n D[H - i - 1][j] = D[H - i][j] + 1\nresult = 0\nfor i in range(H):\n for j in range(W):\n result = max(result, U[i][j] + D[i][j] + L[i][j] + R[i][j] - 3)\n\nprint(result)\n","change":"replace","i1":1,"i2":9,"j1":1,"j2":6,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03014","language":"Python","original_status":"Time Limit Exceeded","pass":"h, w = map(int, input().split())\nGRID = [input() for _ in range(h)]\n\nHORIZONTAL = [[0] * w for _ in range(h)]\nfor i in range(h):\n COUNTS = []\n count = 0\n for j in range(w):\n if GRID[i][j] == \".\":\n count += 1\n else:\n COUNTS.append(count)\n count = 0\n COUNTS.append(count)\n k = 0\n for j in range(w):\n if GRID[i][j] == \".\":\n HORIZONTAL[i][j] = COUNTS[k]\n else:\n k += 1\n\nVERTICAL = [[0] * w for _ in range(h)]\nfor j in range(w):\n COUNTS = []\n count = 0\n for i in range(h):\n if GRID[i][j] == \".\":\n count += 1\n else:\n COUNTS.append(count)\n count = 0\n COUNTS.append(count)\n k = 0\n for i in range(h):\n if GRID[i][j] == \".\":\n VERTICAL[i][j] = COUNTS[k]\n else:\n k += 1\n\nLIGHTED = []\nfor i in range(h):\n for j in range(w):\n LIGHTED.append(HORIZONTAL[i][j] + VERTICAL[i][j] - 1)\n\nans = max(LIGHTED)\nprint(ans)\n","fail":"import sys\n\ninput = sys.stdin.readline\nimport numpy as np\n\n\nh, w = map(int, input().split())\n\nGRID = []\nfor _ in range(h):\n S = [0] + [0 if c == \"#\" else 1 for c in input().strip()] + [0]\n GRID.append(S)\nGRID.insert(0, [0] * (w + 2))\nGRID.append([0] * (w + 2))\ngrid = np.array(GRID)\n\ntop = np.zeros((h + 2, w + 2), dtype=np.int)\nbottom = np.zeros((h + 2, w + 2), dtype=np.int)\nleft = np.zeros((h + 2, w + 2), dtype=np.int)\nright = np.zeros((h + 2, w + 2), dtype=np.int)\n\nfor i in range(1, h + 1):\n top[i] = (top[i - 1] + 1) * grid[i]\nfor i in range(h, 0, -1):\n bottom[i] = (bottom[i + 1] + 1) * grid[i]\nfor j in range(1, w + 1):\n left[:, j] = (left[:, j - 1] + 1) * grid[:, j]\nfor j in range(w, 0, -1):\n right[:, j] = (right[:, j + 1] + 1) * grid[:, j]\n\ncolumn = (top + bottom - 1) * grid\nrow = (left + right - 1) * grid\nlighted = (column + row - 1) * grid\n\nans = lighted.max()\nprint(ans)\n","change":"replace","i1":0,"i2":45,"j1":0,"j2":35,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03014","language":"Python","original_status":"Runtime Error","pass":"import numpy as np\n\nH, W = map(int, input().split())\ns = [list(input()) for _ in range(H)]\n\nX = np.zeros((W, H))\nfor i in range(H):\n start = 0\n cnt = 0\n for j in range(W):\n if s[i][j] == \".\" and j == W - 1:\n cnt += 1\n for k in range(start, W):\n if s[i][k] == \".\":\n X[i][k] = cnt\n elif s[i][j] == \".\":\n cnt += 1\n elif s[i][j] == \"#\":\n for k in range(start, j):\n if s[i][k] == \".\":\n X[i][k] = cnt\n start = j\n cnt = 0\n\nY = np.zeros((W, H))\nfor i in range(W):\n start = 0\n cnt = 0\n for j in range(H):\n if s[j][i] == \".\" and j == H - 1:\n cnt += 1\n for k in range(start, H):\n if s[k][i] == \".\":\n Y[k][i] = cnt\n elif s[j][i] == \".\":\n cnt += 1\n elif s[j][i] == \"#\":\n for k in range(start, j):\n if s[k][i] == \".\":\n Y[k][i] = cnt\n start = j\n cnt = 0\n\nXY = X + Y - 1\nprint(int(np.max(XY)))\n","fail":"H, W = map(int, input().split())\ns = [list(input()) for _ in range(H)]\n\nX = [[0] * W for _ in range(H)]\nfor i in range(H):\n start = 0\n cnt = 0\n for j in range(W):\n if s[i][j] == \".\" and j == W - 1:\n cnt += 1\n for k in range(start, W):\n if s[i][k] == \".\":\n X[i][k] = cnt\n elif s[i][j] == \".\":\n cnt += 1\n elif s[i][j] == \"#\":\n for k in range(start, j):\n if s[i][k] == \".\":\n X[i][k] = cnt\n start = j\n cnt = 0\n\nY = [[0] * W for _ in range(H)]\nfor i in range(W):\n start = 0\n cnt = 0\n for j in range(H):\n if s[j][i] == \".\" and j == H - 1:\n cnt += 1\n for k in range(start, H):\n if s[k][i] == \".\":\n Y[k][i] = cnt\n elif s[j][i] == \".\":\n cnt += 1\n elif s[j][i] == \"#\":\n for k in range(start, j):\n if s[k][i] == \".\":\n Y[k][i] = cnt\n start = j\n cnt = 0\n\nXY = []\nfor i in range(H):\n for j in range(W):\n XY.append(X[i][j] + Y[i][j] - 1)\n\nprint(max(XY))\n","change":"replace","i1":0,"i2":45,"j1":0,"j2":47,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03014","language":"Python","original_status":"Time Limit Exceeded","pass":"from itertools import groupby\n\n[H, W] = map(int, input().split())\nSs = [list(input()) for _ in range(H)]\n\nres = 0\ncount = [[-1 * int(Ss[i][j] == \".\") for j in range(W)] for i in range(H)]\nfor i in range(H):\n j = 0\n for x in groupby(Ss[i]):\n k = len(list(x[1]))\n for _ in range(k):\n count[i][j] += k * (x[0] == \".\")\n j += 1\n\nfor j in range(W):\n i = 0\n for x in groupby([Ss[i][j] for i in range(H)]):\n k = len(list(x[1]))\n for _ in range(k):\n new_res = count[i][j] + k * (x[0] == \".\")\n if res < new_res:\n res = new_res\n i += 1\n\nprint(res)\n","fail":"from itertools import groupby\n\n[H, W] = map(int, input().split())\nSs = [list(map(lambda x: int(x == \".\"), list(input()))) for _ in range(H)]\n\nres = 0\ncount = [[-Ss[i][j] for j in range(W)] for i in range(H)]\nfor i in range(H):\n j = 0\n for x in groupby(Ss[i]):\n k = len(list(x[1]))\n for _ in range(k):\n count[i][j] += k * x[0]\n j += 1\n\nfor j in range(W):\n i = 0\n for x in groupby([Ss[i][j] for i in range(H)]):\n k = len(list(x[1]))\n for _ in range(k):\n new_res = count[i][j] + k * x[0]\n if res < new_res:\n res = new_res\n i += 1\n\nprint(res)\n","change":"replace","i1":3,"i2":21,"j1":3,"j2":21,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03018","language":"Python","original_status":"Runtime Error","pass":"s = input()\nif \"BC\" in s:\n s = s.replace(\"BC\", \"D\")\nelse:\n print(0)\n quit()\n\npos = 0\nstr_len = len(s)\ncount = 0\nseq_a = 0\nseq_d = 0\n\nwhile pos < str_len:\n if s[pos] == \"A\":\n while pos < str_len and s[pos] == \"A\":\n seq_a += 1\n pos += 1\n if s[pos] == \"D\":\n while pos < str_len and s[pos] == \"D\":\n seq_d += 1\n pos += 1\n count += seq_a * seq_d\n if pos < str_len and s[pos] != \"A\":\n seq_a = 0\n seq_d = 0\n else:\n pos += 1\n seq_a = 0\n else:\n pos += 1\n seq_a = 0\n\nprint(count)\n","fail":"s = input()\npos = 0\nstr_len = len(s)\ncount = 0\nseq_a = 0\nseq_bc = 0\n\nwhile pos < str_len:\n if s[pos] == \"A\":\n while pos < str_len and s[pos] == \"A\":\n seq_a += 1\n pos += 1\n if pos + 1 < str_len and s[pos] == \"B\" and s[pos + 1] == \"C\":\n while (\n pos < str_len\n and s[pos] == \"B\"\n and pos + 1 < str_len\n and s[pos + 1] == \"C\"\n ):\n seq_bc += 1\n pos += 2\n count += seq_a * seq_bc\n if pos < str_len and s[pos] != \"A\":\n seq_a = 0\n seq_bc = 0\n else:\n pos += 1\n seq_a = 0\n else:\n pos += 1\n seq_a = 0\n\nprint(count)\n","change":"replace","i1":1,"i2":26,"j1":1,"j2":25,"error":"0","stderr":null,"stdout":3.0} {"problem_id":"p03018","language":"Python","original_status":"Time Limit Exceeded","pass":"s = input()\n\n# step1: pre-process \"BC\" \u3092 X\u306b\u7f6e\u304d\u63db\u3048\u308b\ntmp = \"\"\nflag = False # skip\u7528\nfor i in range(1, len(s)):\n if flag:\n flag = False\n continue\n elif s[i - 1] + s[i] == \"BC\":\n tmp += \"X\"\n flag = True\n else:\n tmp += s[i - 1]\n\nif not flag:\n tmp += s[-1]\n\ncnt = 0\nans = 0\n# step:2 X\u3088\u308a\u5de6\u5074\u306b\u3042\u308bA\u306e\u6570\u3092\u6570\u3048\u308b\u3002\n# \u305f\u3060\u3057\u3001B\u3001C\u304c\u73fe\u308c\u308b\u3068\u3001\u30ab\u30a6\u30f3\u30bf\u30fc\u30ea\u30bb\u30c3\u30c8\n# \uff08\u305d\u306eB\u3001C\u3092\u8d8a\u3048\u3066Swap\u3067\u304d\u306a\u3044\u305f\u3081\uff09\nfor i in range(len(tmp)):\n if tmp[i] == \"A\":\n cnt += 1\n elif tmp[i] == \"B\" or tmp[i] == \"C\":\n cnt = 0\n elif tmp[i] == \"X\":\n ans += cnt\n\nprint(ans)\n","fail":"s = input()\n\ntmp = \"\"\ncnt = 0\nans = 0\nflag = False # skip\u7528\nfor i in range(0, len(s) - 1):\n if flag:\n flag = False\n continue\n if s[i] == \"A\":\n cnt += 1\n elif s[i] + s[i + 1] == \"BC\":\n ans += cnt\n flag = True\n else:\n cnt = 0\n\nprint(ans)\n","change":"replace","i1":2,"i2":30,"j1":2,"j2":17,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03018","language":"Python","original_status":"Runtime Error","pass":"s = list(input())\n\ni = 0\nres = 0\ncnt = 0\nwhile i != len(s) - 2:\n if s[i] == \"A\" and s[i + 1] == \"A\":\n cnt += 1\n i += 1\n elif s[i] == \"A\" and s[i + 1] == \"B\" and s[i + 2] == \"C\":\n res += cnt + 1\n s[i], s[i + 1], s[i + 2] = \"B\", \"C\", \"A\"\n cnt = 0\n i += 1\n else:\n cnt = 0\n i += 1\nprint(res)\n","fail":"s = input()\ns = s.replace(\"BC\", \"D\")\n\nans = a = 0\nfor i in s:\n if i == \"A\":\n a += 1\n elif i == \"D\":\n ans += a\n else:\n a = 0\nprint(ans)\n","change":"replace","i1":0,"i2":18,"j1":0,"j2":12,"error":"0","stderr":null,"stdout":3.0} {"problem_id":"p03018","language":"Python","original_status":"Time Limit Exceeded","pass":"def li():\n return list(map(int, input().split()))\n\n\nif __name__ == \"__main__\":\n s = input()\n ope_num = 0\n index = 0\n a_stock = 0\n b_stock = 0\n s = list(s)\n while index < len(s):\n # print(s)\n # print(index)\n # print(ope_num)\n # print()\n si = s[index]\n if si == \"A\":\n if b_stock > 0:\n a_stock = 1\n else:\n a_stock = a_stock + 1\n b_stock = 0\n elif a_stock > 0:\n if b_stock == 0:\n if si == \"B\":\n b_stock = 1\n else:\n a_stock = 0\n b_stock = 0\n elif si == \"C\":\n ope_num = ope_num + a_stock\n # s[index - 2 - a_stock + 1] = \"B\"\n # s[index - 1 - a_stock + 1] = \"C\"\n for i in range(a_stock - 1, -1, -1):\n s[index - i] = \"A\"\n index = index - a_stock\n a_stock = 0\n b_stock = 0\n else:\n a_stock = 0\n b_stock = 0\n else:\n a_stock = 0\n b_stock = 0\n index = index + 1\n print(ope_num)\n\n# ABC\u306e\u6570\n# ABC\u306e\u524d\u306b\u3042\u308bA\u306e\u5206\u3060\u3051\u8ffd\u52a0\u3067\u64cd\u4f5c\u3067\u304d\u308b\n# ABC\u306e\u5f8c\u306b\u3042\u308b(BC)\u306e\u5206\u3060\u3051\u8ffd\u52a0\u3067\u64cd\u4f5c\u3067\u304d\u308b\n\n# A\u304c\u3042\u308c\u3070\u899a\u3048\u3066\u304a\u304f\n# ABC\u3068\u6765\u305f\u3089\u3001\u305d\u308c\u3088\u308a\u524d\u5074\u306b\u96a3\u63a5\u3057\u3066\u3044\u308bA\u306e\u56de\u6570\u3060\u3051\u8ffd\u52a0\u3067\u64cd\u4f5c\u3067\u304d\u308b\n# \u898b\u3064\u304b\u3063\u305fABC\u3092BCA\u306b\u7f6e\u304d\u63db\u3048\u308b\n# BCA\u306eA\u304b\u3089\u8d70\u67fb\u3092\u7d99\u7d9a\u3059\u308b\n","fail":"def li():\n return list(map(int, input().split()))\n\n\nif __name__ == \"__main__\":\n s = input()\n ope_num = 0\n index = 0\n a_stock = 0\n b_stock = 0\n s = list(s)\n while index < len(s):\n # print(s)\n # print(index)\n # print(ope_num)\n # print()\n si = s[index]\n if si == \"A\":\n if b_stock > 0:\n a_stock = 1\n else:\n a_stock = a_stock + 1\n b_stock = 0\n elif a_stock > 0:\n if b_stock == 0:\n if si == \"B\":\n b_stock = 1\n else:\n a_stock = 0\n b_stock = 0\n elif si == \"C\":\n ope_num = ope_num + a_stock\n # s[index - 2 - a_stock + 1] = \"B\"\n # s[index - 1 - a_stock + 1] = \"C\"\n # s[index] = \"A\"\n # index = index - 1\n a_stock = a_stock\n b_stock = 0\n else:\n a_stock = 0\n b_stock = 0\n else:\n a_stock = 0\n b_stock = 0\n index = index + 1\n print(ope_num)\n\n# ABC\u306e\u6570\n# ABC\u306e\u524d\u306b\u3042\u308bA\u306e\u5206\u3060\u3051\u8ffd\u52a0\u3067\u64cd\u4f5c\u3067\u304d\u308b\n# ABC\u306e\u5f8c\u306b\u3042\u308b(BC)\u306e\u5206\u3060\u3051\u8ffd\u52a0\u3067\u64cd\u4f5c\u3067\u304d\u308b\n\n# A\u304c\u3042\u308c\u3070\u899a\u3048\u3066\u304a\u304f\n# ABC\u3068\u6765\u305f\u3089\u3001\u305d\u308c\u3088\u308a\u524d\u5074\u306b\u96a3\u63a5\u3057\u3066\u3044\u308bA\u306e\u56de\u6570\u3060\u3051\u8ffd\u52a0\u3067\u64cd\u4f5c\u3067\u304d\u308b\n# \u898b\u3064\u304b\u3063\u305fABC\u3092BCA\u306b\u7f6e\u304d\u63db\u3048\u308b\n# BCA\u306eA\u304b\u3089\u8d70\u67fb\u3092\u7d99\u7d9a\u3059\u308b\n","change":"replace","i1":34,"i2":38,"j1":34,"j2":37,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03018","language":"Python","original_status":"Time Limit Exceeded","pass":"s = input()\nans = 0\n\nwhile True:\n c = s.count(\"ABC\")\n ans += c\n if c == 0:\n print(ans)\n break\n s = s.replace(\"ABC\", \"BCA\")\n","fail":"s = input()\ns2 = s.replace(\"BC\", \"D\")\nans = 0\nna = 0\nfor c in s2:\n if na:\n if c == \"D\":\n ans += na\n elif c != \"A\":\n na = 0\n if c == \"A\":\n na += 1\nprint(ans)\n","change":"replace","i1":1,"i2":10,"j1":1,"j2":13,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03018","language":"Python","original_status":"Time Limit Exceeded","pass":"s = input()\n\nans = 0\n\ncheck = s.count(\"ABC\")\n\nwhile check > 0:\n ans += check\n s = s.replace(\"ABC\", \"BCA\")\n check = s.count(\"ABC\")\n\nprint(ans)\n","fail":"import sys\n\ninput = sys.stdin.readline\n\n\ndef main():\n s = input().strip()\n\n ans = 0\n count_a = 0\n if s[0] == \"A\":\n count_a += 1\n for i in range(len(s) - 1):\n tmp = s[i : i + 2]\n if tmp == \"AA\":\n count_a += 1\n elif tmp == \"AB\":\n pass\n elif tmp == \"BC\":\n ans += count_a\n elif tmp == \"CB\":\n pass\n elif tmp == \"CA\":\n count_a += 1\n elif tmp == \"BA\":\n count_a = 1\n else:\n count_a = 0\n # print(i, count_a)\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":0,"i2":12,"j1":0,"j2":34,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03021","language":"Python","original_status":"Runtime Error","pass":"import sys\n\nsys.setrecursionlimit(10000)\n\n\ndef first_dfs(v, p, stones, dists, costs):\n stone = s[v]\n dist = 0\n cost = 0\n children_dists = []\n for u in links[v]:\n if u == p:\n continue\n us, ud, uc = first_dfs(u, v, stones, dists, costs)\n stone += us\n dist += us + ud\n cost += uc\n children_dists.append((us + ud, uc))\n # print(v, p, stone, dist, cost, children_dists)\n if len(children_dists) > 1:\n md, mc = max(children_dists)\n if dist - md < md - mc * 2:\n cost = dist - md + mc\n else:\n cost = dist \/\/ 2\n # print(v, p, md, hd, dist, cost)\n stones[v] = stone\n dists[v] = dist\n costs[v] = cost\n return stone, dist, cost\n\n\ndef second_dfs(v, p, pd, pc):\n children_dists = []\n dist = 0\n\n for u in links[v]:\n if u == p:\n dist += pd\n children_dists.append((pd, pc))\n continue\n ud = stones[u] + dists[u]\n uc = costs[u]\n dist += ud\n children_dists.append((ud, uc))\n # print(v, p, pd, pc, dist, children_dists)\n\n if len(children_dists) == 1:\n u = next(iter(links[v]))\n second_dfs(u, v, s[v], 0)\n return\n\n children_dists.sort(reverse=True)\n md1, mc1 = children_dists[0]\n md2, mc2 = children_dists[1]\n\n hd, m = divmod(dist, 2)\n # print(' ', hd, m, md1, mc1)\n if m == 0 and dist - md1 >= md1 - mc1 * 2:\n print(hd)\n exit()\n\n for u in links[v]:\n if u == p:\n continue\n us = stones[u]\n ud = dists[u]\n uc = costs[u]\n usd = us + ud\n if usd > 0:\n if usd == md1 and uc == mc1:\n md, mc = md2, mc2\n else:\n md, mc = md1, mc1\n td = dist - usd\n if td - md < md - mc * 2:\n vc = td - md + mc\n else:\n vc = td \/\/ 2\n second_dfs(u, v, td + (all_stones - us), vc)\n\n\nn = int(input())\ns = list(map(int, input()))\nlinks = [set() for _ in [0] * n]\nfor line in sys.stdin:\n a, b = map(int, line.split())\n a -= 1\n b -= 1\n links[a].add(b)\n links[b].add(a)\nall_stones = sum(s)\nif all_stones == 1:\n print(0)\n exit()\n# print(links)\nstones = [0] * n # 1\u3092\u6839\u3068\u3057\u305f\u6728\u306e\u3001\u9802\u70b9v\u306e\u90e8\u5206\u6728\u4ee5\u4e0b\uff08\u81ea\u8eab\u542b\u3080\uff09\u306b\u3042\u308b\u77f3\u306e\u6570\ndists = [0] * n # \u9802\u70b9v\u306e\u90e8\u5206\u6728\u4ee5\u4e0b\u306b\u3042\u308b\u77f3 x \u305d\u308c\u305e\u308c\u306ev\u3068\u306e\u8ddd\u96e2 \u306e\u548c\ncosts = [0] * n # \u9802\u70b9v\u4ee5\u4e0b\u540c\u58eb\u306e\u77f3\u3067\u3001\u6700\u5927\u9650\u9802\u70b9v\u306b\u8fd1\u3065\u3051\u3066\u304a\u304f\u305f\u3081\u306b\u3067\u304d\u308b\u64cd\u4f5c\u306e\u6570\nfirst_dfs(0, -1, stones, dists, costs)\n# print(stones)\n# print(dists)\n# print(costs)\nsecond_dfs(0, -1, 0, 0)\nprint(-1)\n","fail":"import sys\nfrom heapq import nlargest\n\nsys.setrecursionlimit(10000)\n\n\ndef first_dfs(v, p, stones, dists, costs):\n stone = s[v]\n dist = 0\n cost = 0\n children_dists = []\n for u in links[v]:\n if u == p:\n continue\n us, ud, uc = first_dfs(u, v, stones, dists, costs)\n stone += us\n dist += us + ud\n cost += uc\n children_dists.append((us + ud, uc))\n # print(v, p, stone, dist, cost, children_dists)\n if len(children_dists) > 1:\n md, mc = max(children_dists)\n if dist - md < md - mc * 2:\n cost = dist - md + mc\n else:\n cost = dist \/\/ 2\n # print(v, p, md, hd, dist, cost)\n stones[v] = stone\n dists[v] = dist\n costs[v] = cost\n return stone, dist, cost\n\n\ndef second_dfs(v, p, pd, pc):\n children_dists = []\n dist = 0\n\n for u in links[v]:\n if u == p:\n dist += pd\n children_dists.append((pd, pc))\n continue\n ud = stones[u] + dists[u]\n uc = costs[u]\n dist += ud\n children_dists.append((ud, uc))\n # print(v, p, pd, pc, dist, children_dists)\n\n # only when source and leaf node\n if len(children_dists) == 1:\n u = next(iter(links[v]))\n return second_dfs(u, v, s[v], 0)\n\n (md1, mc1), (md2, mc2) = nlargest(2, children_dists)\n ret = INF\n\n hd, m = divmod(dist, 2)\n # print(' ', hd, m, md1, mc1, dist - md1, md1 - mc1 * 2)\n if m == 0 and dist - md1 >= md1 - mc1 * 2:\n ret = min(ret, hd)\n\n for u in links[v]:\n if u == p:\n continue\n us = stones[u]\n ud = dists[u]\n uc = costs[u]\n\n # dist=0 node cannot be a center\n if ud == 0:\n continue\n usd = us + ud\n if usd == md1 and uc == mc1:\n md, mc = md2, mc2\n else:\n md, mc = md1, mc1\n td = dist - usd\n if td - md < md - mc * 2:\n vc = td - md + mc\n else:\n vc = td \/\/ 2\n result = second_dfs(u, v, td + (all_stones - us), vc)\n ret = min(ret, result)\n\n return ret\n\n\nn = int(input())\ns = list(map(int, input()))\nlinks = [set() for _ in [0] * n]\nfor line in sys.stdin:\n a, b = map(int, line.split())\n a -= 1\n b -= 1\n links[a].add(b)\n links[b].add(a)\nall_stones = sum(s)\nif all_stones == 1:\n print(0)\n exit()\nstones = [0] * n # 1\u3092\u6839\u3068\u3057\u305f\u6728\u306e\u3001\u9802\u70b9v\u306e\u90e8\u5206\u6728\u4ee5\u4e0b\uff08\u81ea\u8eab\u542b\u3080\uff09\u306b\u3042\u308b\u77f3\u306e\u6570\ndists = [0] * n # \u9802\u70b9v\u306e\u90e8\u5206\u6728\u4ee5\u4e0b\u306b\u3042\u308b\u77f3 x \u305d\u308c\u305e\u308c\u306ev\u3068\u306e\u8ddd\u96e2 \u306e\u548c\ncosts = [0] * n # \u9802\u70b9v\u4ee5\u4e0b\u306e\u77f3\u540c\u58eb\u3067\u3001\u6700\u5927\u9650\u9802\u70b9v\u306b\u8fd1\u3065\u3051\u3066\u304a\u304f\u305f\u3081\u306b\u3067\u304d\u308b\u64cd\u4f5c\u306e\u6570\nfirst_dfs(0, -1, stones, dists, costs)\n# print(stones)\n# print(dists)\n# print(costs)\nINF = 10**10\nret = second_dfs(0, -1, 0, 0)\nprint(-1 if ret == INF else ret)\n","change":"replace","i1":1,"i2":105,"j1":1,"j2":110,"error":0,"stderr":null,"stdout":3} {"problem_id":"p03027","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\n\ng = 1000003\nfor x, d, n in (map(int, input().split()) for _ in range(N)):\n ans = 1\n\n for _ in range(n):\n ans = ans * x % g\n x += d\n\n print(ans)\n","fail":"import math\n\nN = int(input())\n\ng = 1000003\n\nfr = [1] * g\nfor x in range(2, g):\n fr[x] = x * fr[x - 1] % g\n\n\ndef div(a, b):\n return a * pow(b, g - 2, g) % g\n\n\nfor x, d, n in (map(int, input().split()) for _ in range(N)):\n ans = 1\n\n if d == 0:\n print(pow(x, n, g))\n\n else:\n s = div(x, d)\n x, y = s + n - 1, s - 1\n if s + n - 1 < g:\n print(div(fr[x], fr[y]) * pow(d, n, g) % g)\n else:\n print(0)\n","change":"replace","i1":0,"i2":11,"j1":0,"j2":28,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03029","language":"Python","original_status":"Runtime Error","pass":"a, p = map(int, input())\nprint((3 * a + p) \/\/ 2)\n","fail":"a, p = map(int, input().split())\nprint((3 * a + p) \/\/ 2)\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"ValueError: invalid literal for int() with base 10: ' '","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03029\/Python\/s938793340.py\", line 1, in \n a, p = map(int, input())\nValueError: invalid literal for int() with base 10: ' '\n","stdout":null} {"problem_id":"p03029","language":"Python","original_status":"Runtime Error","pass":"A, P = map(int, input.split(\" \"))\nprint((3 * A + P) \/\/ 2)\n","fail":"A, P = map(int, input().split(\" \"))\nprint((3 * A + P) \/\/ 2)\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"AttributeError: 'builtin_function_or_method' object has no attribute 'split'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03029\/Python\/s942506931.py\", line 1, in \n A, P = map(int, input.split(\" \"))\nAttributeError: 'builtin_function_or_method' object has no attribute 'split'\n","stdout":null} {"problem_id":"p03030","language":"Python","original_status":"Runtime Error","pass":"n = int(input())\na = []\nfor i in range(n):\n s, p = list(map(int, input().split()))\n a.append((s, -int(p), i))\na.sort()\n\nfor _, _, i in a:\n print(i + 1)\n","fail":"n = int(input())\na = []\nfor i in range(n):\n s, p = input().split()\n a.append((s, -int(p), i))\na.sort()\n\nfor _, _, i in a:\n print(i + 1)\n","change":"replace","i1":3,"i2":4,"j1":3,"j2":4,"error":"ValueError: invalid literal for int() with base 10: 'khabarovsk'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03030\/Python\/s542428073.py\", line 4, in \n s, p = list(map(int, input().split()))\nValueError: invalid literal for int() with base 10: 'khabarovsk'\n","stdout":null} {"problem_id":"p03030","language":"Python","original_status":"Runtime Error","pass":"n = int(input())\nres = list(enumerate(((s[0], int(s[1])) for s in input().split()), 1))\n\nres.sort(key=lambda r: r[1])\n\n[print(r[0]) for r in res]\n","fail":"n = int(input())\n\nres = []\nfor i in range(n):\n s, s_p = input().split()\n p = int(s_p)\n res.append(((s, -p), i + 1))\n\nres.sort(key=lambda r: r[0])\n\nfor r in res:\n print(r[1])\n","change":"replace","i1":1,"i2":6,"j1":1,"j2":12,"error":"ValueError: invalid literal for int() with base 10: 'h'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03030\/Python\/s639248400.py\", line 2, in \n res = list(enumerate(((s[0], int(s[1])) for s in input().split()), 1))\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03030\/Python\/s639248400.py\", line 2, in \n res = list(enumerate(((s[0], int(s[1])) for s in input().split()), 1))\nValueError: invalid literal for int() with base 10: 'h'\n","stdout":null} {"problem_id":"p03030","language":"Python","original_status":"Runtime Error","pass":"#!\/usr\/bin\/env python3\nn = int(input())\nres = [(i, *input().split()) for i in range(n)]\n\nres.sort(key=lambda x: (x[1], -int(x[2])))\n\nfor r in res:\n print(r[0] + 1)\n","fail":"#!\/usr\/bin\/env python3\nn = int(input())\nres = [[i] + input().split() for i in range(n)]\n\nres.sort(key=lambda x: (x[1], -int(x[2])))\n\nfor r in res:\n print(r[0] + 1)\n","change":"replace","i1":2,"i2":3,"j1":2,"j2":3,"error":"0","stderr":null,"stdout":"3\n4\n6\n1\n5\n2\n"} {"problem_id":"p03030","language":"Python","original_status":"Runtime Error","pass":"n = int(input())\nf = []\ns = []\np = []\nfor i in range(n):\n f += [list(map(str, input().split(\" \")))]\n s += [f[i][0]]\n p += [int(f[i][1])]\nprint(p)\ns.sort()\np.sort(reverse=True)\nprint(p)\nans = [0] * n\ncount = 0\nfor i in s:\n for j in p:\n if [i, str(j)] in f:\n ans[count] = f.index([i, str(j)]) + 1\n p[p.index(j)] = 0\n s[s.index(i)] = 0\n count += 1\n\nfor i in range(n):\n print(ans[i])\n","fail":"n = int(input())\nsr = []\nans = [0] * n\nfor _ in range(n):\n s, r = input().split()\n sr += [[str(s), int(r)]]\nse = sorted(sr, key=lambda x: (x[0], -x[1]))\nfor i in range(n):\n ans[i] = sr.index(se[i]) + 1\nfor i in range(n):\n print(ans[i])\n","change":"replace","i1":1,"i2":22,"j1":1,"j2":9,"error":"WA","stderr":null,"stdout":"[20, 10, 50, 35, 60, 40]\n[60, 50, 40, 35, 20, 10]\n3\n4\n6\n1\n5\n2\n"} {"problem_id":"p03030","language":"Python","original_status":"Runtime Error","pass":"N = int(input())\nSP = [(i + 1, input().split()) for i in range(N)]\nP = [[0, 0, 0] for _ in range(N)]\nfor i in range(N):\n P[i][0] = SP[i][0]\n P[i][1] = SP[i][1][0]\n P[i][2] = int(SP[i][1][1])\nP.sort(key=lambda x: x[1][1], reverse=True)\nP.sort(key=lambda x: x[1][0])\n\nfor p in P:\n print(p[0])\n","fail":"N = int(input())\nSP = [(i + 1, input().split()) for i in range(N)]\nP = [[0, 0, 0] for _ in range(N)]\nfor i in range(N):\n P[i][0] = SP[i][0]\n P[i][1] = SP[i][1][0]\n P[i][2] = int(SP[i][1][1])\nP.sort(key=lambda x: x[2], reverse=True)\nP.sort(key=lambda x: x[1])\n\nfor p in P:\n print(p[0])\n","change":"replace","i1":7,"i2":9,"j1":7,"j2":9,"error":"WA","stderr":null,"stdout":"1\n6\n3\n4\n2\n5\n"} {"problem_id":"p03031","language":"Python","original_status":"Runtime Error","pass":"swithCount, lightCount = map(int, input().split())\nswithList = [0] * lightCount\n\nfor i in range(swithCount):\n connectedLightList = list(map(int, input().split()))\n for lightIndex in connectedLightList[1:]:\n lightIndex -= 1\n swithList[i] = swithList[i] | 1 << lightIndex\n\nexpectedLightStatusList = list(map(int, input().split()))\nexpectedLightStatus = 0\n\nfor i, eachStatus in enumerate(expectedLightStatusList):\n expectedLightStatus = expectedLightStatus | eachStatus << i\n\nresultCount = 0\nfor eachSwitchSet in range(1 << swithCount):\n actuallyLightStatus = 0\n for switchIndex in range(swithCount):\n if eachSwitchSet >> switchIndex & 1:\n actuallyLightStatus = actuallyLightStatus ^ swithList[switchIndex]\n\n if expectedLightStatus == actuallyLightStatus:\n resultCount += 1\n\nprint(resultCount)\n","fail":"swithCount, lightCount = map(int, input().split())\nswithList = [0] * swithCount\n\nfor lightIndex in range(lightCount):\n connectedSwitchList = list(map(int, input().split()))\n for si in connectedSwitchList[1:]:\n switchIndex = si - 1\n swithList[switchIndex] = swithList[switchIndex] | 1 << lightIndex\n\nexpectedLightStatusList = list(map(int, input().split()))\nexpectedLightStatus = 0\n\nfor i, eachStatus in enumerate(expectedLightStatusList):\n expectedLightStatus = expectedLightStatus | eachStatus << i\n\nresultCount = 0\nfor eachSwitchSet in range(1 << swithCount):\n actuallyLightStatus = 0\n for switchIndex in range(swithCount):\n if eachSwitchSet >> switchIndex & 1:\n actuallyLightStatus = actuallyLightStatus ^ swithList[switchIndex]\n\n if expectedLightStatus == actuallyLightStatus:\n resultCount += 1\n\nprint(resultCount)\n","change":"replace","i1":1,"i2":8,"j1":1,"j2":8,"error":0,"stderr":null,"stdout":1} {"problem_id":"p03031","language":"Python","original_status":"Runtime Error","pass":"import itertools\n\n\nN, M = map(int, input().split())\nconnected_switches = [[int(x) - 1 for x in input().split()[1:]] for x in range(M)]\nconditions = list(map(int, input().split()))\n\nok = 0\nfor patterns in itertools.product((0, 1), repeat=M):\n patterns = list(patterns)\n is_lighting = True\n for i, lights in enumerate(connected_switches):\n turned_sw = sum([patterns[x] for x in lights])\n if turned_sw % 2 != conditions[i]:\n is_lighting = False\n break\n if is_lighting:\n ok += 1\n\nprint(ok)\n","fail":"import itertools\n\n\nN, M = map(int, input().split())\nconnected_switches = [[int(x) - 1 for x in input().split()[1:]] for x in range(M)]\nconditions = list(map(int, input().split()))\n\nok = 0\nfor patterns in itertools.product((0, 1), repeat=N):\n patterns = list(patterns)\n is_lighting = True\n for i, lights in enumerate(connected_switches):\n turned_sw = sum([patterns[x] for x in lights])\n if turned_sw % 2 != conditions[i]:\n is_lighting = False\n break\n if is_lighting:\n ok += 1\n\nprint(ok)\n","change":"replace","i1":8,"i2":9,"j1":8,"j2":9,"error":0,"stderr":null,"stdout":1} {"problem_id":"p03032","language":"Python","original_status":"Runtime Error","pass":"n, k = map(int, input().split())\nv = [int(i) for i in input().split()]\nans = 0\nfor a in range(k + 1):\n pa, va = v[:a], v[a:]\n for b in range(k - a + 1):\n pb = pa + va[-b:] if b > 0 else pa\n pb.sort()\n s = sum(pb)\n for c in range(min(k - a - b, a + b)):\n s -= pb[c]\n ans = max(ans, s)\nprint(ans)\n","fail":"n, k = map(int, input().split())\nv = [int(i) for i in input().split()]\nans = 0\nfor a in range(min(n, k) + 1):\n pa, va = v[:a], v[a:]\n for b in range(min(n, k) - a + 1):\n pb = pa + va[-b:] if b > 0 else pa\n pb.sort()\n s = sum(pb)\n ans = max(s, ans)\n for c in range(min(k - a - b, a + b)):\n s -= pb[c]\n ans = max(s, ans)\nprint(ans)\n","change":"replace","i1":3,"i2":12,"j1":3,"j2":13,"error":0,"stderr":null,"stdout":14} {"problem_id":"p03032","language":"Python","original_status":"Runtime Error","pass":"N, K = map(int, input().split())\nd = list(map(int, input().split()))\nleft = [0]\nleft_m = []\nright = [0]\nright_m = []\nfor i, l, r in zip(range(K), d, d[::-1]):\n left.append(left[i] + l)\n left_m.append(l if l < 0 else 0)\n right.append(right[i] + r)\n right_m.append(r if r < 0 else 0)\npoint = 0\nfor i in range(K):\n for j in range(K - i):\n p = K - i - j\n minus = list(sorted(left_m[:i] + right_m[:j]))\n point = max(point, left[i] + right[j] - sum(minus[:p]))\nprint(point)\n","fail":"N, K = map(int, input().split())\nd = list(map(int, input().split()))\nleft = [0]\nleft_m = []\nright = [0]\nright_m = []\nfor i, l, r in zip(range(K), d, d[::-1]):\n left.append(left[i] + l)\n left_m.append(l if l < 0 else 0)\n right.append(right[i] + r)\n right_m.append(r if r < 0 else 0)\npoint = 0\nm = min(N, K)\nfor i in range(m + 1):\n for j in range(m - i + 1):\n p = K - i - j\n minus = list(sorted(left_m[:i] + right_m[:j]))\n point = max(point, left[i] + right[j] - sum(minus[:p]))\nprint(point)\n","change":"replace","i1":12,"i2":14,"j1":12,"j2":15,"error":0,"stderr":null,"stdout":14} {"problem_id":"p03032","language":"Python","original_status":"Runtime Error","pass":"N, K = map(int, input().split())\nV = list(map(int, input().split()))\nque = []\nma = 0\nfor i in range(K):\n P = K - i\n for p in range(P + 1):\n q1 = []\n q2 = []\n s = 0\n for j in range(p):\n if V[j] >= 0:\n s += V[j]\n else:\n q1.append(V[j])\n if len(q1) == p:\n q1 = []\n for j in range(N - 1, N - (P - p) - 1, -1):\n if V[j] >= 0:\n s += V[j]\n else:\n q2.append(V[j])\n if len(q2) == P - p:\n q2 = []\n\n q = sorted(q1 + q2)\n if len(q) < i:\n t = 0\n else:\n t = sum(q[i:])\n ma = max(s + t, ma)\n\nprint(ma)\n","fail":"N, K = map(int, input().split())\nV = list(map(int, input().split()))\n\nma = 0\nfor i in range(K):\n P = K - i\n for p in range(P + 1):\n q1 = []\n q2 = []\n s = 0\n for j in range(min(N, p)):\n if V[j] >= 0:\n s += V[j]\n else:\n q1.append(V[j])\n if len(q1) == p:\n q1 = []\n for j in range(N - 1, max(p - 1, N - (P - p) - 1), -1):\n if V[j] >= 0:\n s += V[j]\n else:\n q2.append(V[j])\n if len(q2) == P - p:\n q2 = []\n\n q = sorted(q1 + q2)\n if len(q) < i:\n t = 0\n else:\n t = sum(q[i:])\n ma = max(s + t, ma)\n\nprint(ma)\n","change":"replace","i1":2,"i2":18,"j1":2,"j2":18,"error":0,"stderr":null,"stdout":14} {"problem_id":"p03033","language":"Python","original_status":"Time Limit Exceeded","pass":"from operator import itemgetter\nimport sys\n\ninput = sys.stdin.readline\n\nN, Q = map(int, input().split())\n\nevents = []\n\nfor _ in range(N):\n s, t, x = map(int, input().split())\n add_event = (s - x, 1, x)\n remove_event = (t - x, -1, x)\n events.append(add_event)\n events.append(remove_event)\n\nevents.sort(key=itemgetter(0)) # \u30a4\u30d9\u30f3\u30c8\u51e6\u7406\u6642\u523b\u6607\u9806\u30bd\u30fc\u30c8\n\nunder_construction = set()\n\ncur = 0\nfor _ in range(Q):\n d = int(input())\n # print('d', d)\n while cur < N * 2 and events[cur][0] <= d:\n exec_time, event_type, under_construction_x = events[cur]\n # print(cur, exec_time, event_type, under_construction_x)\n if event_type == 1:\n # add_event\n under_construction.add(under_construction_x)\n else:\n # remove_event\n under_construction.discard(under_construction_x)\n cur += 1\n # print('cur', cur, 'events', events)\n # print('uc', under_construction)\n print(min(under_construction) if under_construction else -1)\n\n # print()\n","fail":"from operator import itemgetter\nimport sys\n\ninput = sys.stdin.readline\n\ninf = float(\"inf\")\n\nN, Q = map(int, input().split())\n\nevents = []\n\nfor _ in range(N):\n s, t, x = map(int, input().split())\n add_event = (s - x, 1, x)\n remove_event = (t - x, -1, x)\n events.append(add_event)\n events.append(remove_event)\n\nevents.sort(key=itemgetter(0)) # \u30a4\u30d9\u30f3\u30c8\u51e6\u7406\u6642\u523b\u6607\u9806\u30bd\u30fc\u30c8\n\nunder_construction = set()\n\nmin_stop = inf\nchg_flg = False\n\ncur = 0\nfor _ in range(Q):\n d = int(input())\n while cur < N * 2 and events[cur][0] <= d:\n exec_time, event_type, under_construction_x = events[cur]\n if event_type == 1: # add_event\n under_construction.add(under_construction_x)\n if not chg_flg:\n min_stop = min(min_stop, under_construction_x)\n else: # remove_event\n under_construction.discard(under_construction_x)\n if not chg_flg and min_stop == under_construction_x:\n chg_flg = True\n cur += 1\n\n if chg_flg:\n min_stop = min(under_construction) if under_construction else inf\n chg_flg = False\n print(min_stop if min_stop != inf else -1)\n","change":"replace","i1":4,"i2":39,"j1":4,"j2":44,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03034","language":"Python","original_status":"Runtime Error","pass":"import numpy as np\n\n\ndef score(cache, sss, a, ab, d):\n mat = cache[ab]\n if mat is None:\n mat = cache[ab] = np.cumsum(np.resize(sss, ((n - 1) \/\/ ab + 1, ab)).T, axis=1)\n mat_a = mat[a % ab]\n return mat[0][d] + mat_a[-1] - mat_a[-d - 2]\n\n\nn = int(input())\nsss = list(map(int, input().split()))\nsss.extend([0] * n)\nsss = np.array(sss, dtype=np.int64)\n\nans = 0\ncache = [None] * n\nfor ab in range(1, int((n - 2) ** 0.5) + 1):\n for remain in range(ab, n - 3, ab):\n a = n - remain - 1\n d = remain \/\/ ab\n if remain < a:\n ans = max(ans, score(cache, sss, a, ab, d))\n if ab != d:\n ans = max(ans, score(cache, sss, a, d, ab))\n else:\n if a % ab > 0:\n ans = max(ans, score(cache, sss, a, ab, d))\n if a > d and ab != d and a % d > 0:\n ans = max(ans, score(cache, sss, a, d, ab))\nprint(ans)\n","fail":"n = int(input())\nsss = list(map(int, input().split()))\n\nans = 0\nfor c in range(1, n \/\/ 2):\n a = n - 1 - c\n k = c\n tmp = 0\n while a > c and a != k and a + c != k:\n tmp += sss[a] + sss[k]\n ans = max(ans, tmp)\n a -= c\n k += c\nprint(ans)\n","change":"replace","i1":0,"i2":31,"j1":0,"j2":13,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03035","language":"Python","original_status":"Runtime Error","pass":"A, B = map(int, input())\n\nif A >= 13:\n print(B)\nelif A >= 6:\n print(B \/\/ 2)\nelse:\n print(0)\n","fail":"A, B = map(int, input().split())\n\nif A >= 13:\n print(B)\nelif A >= 6:\n print(B \/\/ 2)\nelse:\n print(0)\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"ValueError: invalid literal for int() with base 10: ' '","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03035\/Python\/s602871516.py\", line 1, in \n A, B = map(int, input())\nValueError: invalid literal for int() with base 10: ' '\n","stdout":null} {"problem_id":"p03037","language":"Python","original_status":"Time Limit Exceeded","pass":"import itertools\nfrom collections import Counter\n\n\ndef main():\n N, M = map(int, input().split())\n LR = []\n for _ in range(M):\n L, R = map(int, input().split())\n LR.append(list(range(L, R + 1)))\n LR = list(itertools.chain.from_iterable(LR))\n C = Counter(LR)\n\n ans = 0\n for c in C.values():\n if c == M:\n ans += 1\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"def main():\n N, M = map(int, input().split())\n L = 0\n R = N\n for _ in range(M):\n l, r = map(int, input().split())\n if L < l:\n L = l\n if R > r:\n R = r\n ans = 0\n if L <= R:\n ans = R - L + 1\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":0,"i2":17,"j1":0,"j2":13,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03037","language":"Python","original_status":"Time Limit Exceeded","pass":"N, M = map(int, input().split())\nLR = [list(map(int, input().split())) for _ in range(M)]\n\nans = set(list(range(1, N + 1)))\nfor lr in LR:\n l, r = lr\n ans = ans & set(list(range(l, r + 1)))\nprint(len(list(ans)))\n","fail":"N, M = map(int, input().split())\nLR = [list(map(int, input().split())) for _ in range(M)]\n\nA, B = 1, N\nfor lr in LR:\n L, R = lr\n if R < A or B < L:\n print(0)\n exit()\n\n if A <= L <= R <= B:\n A, B = L, R\n elif L <= A <= R <= B:\n B = R\n elif A <= L <= B <= R:\n A = L\nprint(B - A + 1)\n","change":"replace","i1":3,"i2":8,"j1":3,"j2":17,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03037","language":"Python","original_status":"Time Limit Exceeded","pass":"# C - Prison\n\nN, M = map(int, input().split())\nls = [i for i in range(1, N + 1)]\nfor _ in range(M):\n l, r = map(int, input().split())\n ls = set(ls) & set([i for i in range(l, r + 1)])\n\nprint(len(ls))\n","fail":"# C - Prison\n\nN, M = map(int, input().split())\nleft = 0\nright = 10**5\nfor _ in range(M):\n l, r = map(int, input().split())\n left, right = max(left, l), min(right, r)\n\nprint(len([i for i in range(left, right + 1)]) if left <= right else 0)\n","change":"replace","i1":3,"i2":9,"j1":3,"j2":10,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03037","language":"Python","original_status":"Time Limit Exceeded","pass":"from sys import stdin, setrecursionlimit\n\n\ndef main():\n input = stdin.buffer.readline\n n, m = map(int, input().split())\n counts = [0] * n\n for _ in range(m):\n l, r = map(int, input().split())\n for i in range(l - 1, r):\n counts[i] += 1\n print(counts.count(m))\n\n\nif __name__ == \"__main__\":\n setrecursionlimit(10000)\n main()\n","fail":"from sys import stdin, setrecursionlimit\n\n\ndef main():\n input = stdin.buffer.readline\n n, m = map(int, input().split())\n l_max = 0\n r_min = float(\"inf\")\n for _ in range(m):\n l, r = map(int, input().split())\n l_max = max(l_max, l)\n r_min = min(r_min, r)\n print(max(r_min + 1 - l_max, 0))\n\n\nif __name__ == \"__main__\":\n setrecursionlimit(10000)\n main()\n","change":"replace","i1":6,"i2":12,"j1":6,"j2":13,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03037","language":"Python","original_status":"Time Limit Exceeded","pass":"N, M = list(map(int, input().split()))\n\nLs = [0] * M\nRs = [0] * M\n\nfor i in range(M):\n Ls[i], Rs[i] = list(map(int, input().split()))\n\ncount = 0\nfor i in range(N):\n judge = True\n for k in range(M):\n L = Ls[k]\n R = Rs[k]\n if not (L <= i + 1 <= R):\n judge = False\n if judge:\n count += 1\nprint(count)\n","fail":"N, M = list(map(int, input().split()))\n\nmaxvL = 0\nminvR = 1000000\nfor i in range(M):\n L, R = list(map(int, input().split()))\n if maxvL < L:\n maxvL = L\n if minvR > R:\n minvR = R\n\ncount = 0\nfor i in range(N):\n if maxvL <= i + 1 <= minvR:\n count += 1\nprint(count)\n","change":"replace","i1":2,"i2":17,"j1":2,"j2":14,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03037","language":"Python","original_status":"Time Limit Exceeded","pass":"n, m = map(int, input().split())\n\nli_w = list()\n\nfor _ in range(m):\n li_w.append(tuple(map(int, input().split())))\n\nanswer = set()\n\nfor idx, w in enumerate(li_w):\n if idx == 0:\n answer = set(range(w[0], w[1] + 1))\n else:\n answer = answer.intersection(range(w[0], w[1] + 1))\n\nprint(len(answer))\n","fail":"n, m = map(int, input().split())\n\nli_w = list()\n\nfor _ in range(m):\n li_w.append(tuple(map(int, input().split())))\n\nw_l = 0\nw_r = 999999\n\nfor w in li_w:\n w_l = max(w_l, w[0])\n w_r = min(w_r, w[1])\n\n\nif w_r >= w_l:\n print(w_r - w_l + 1)\nelse:\n print(0)\n","change":"replace","i1":7,"i2":16,"j1":7,"j2":19,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03037","language":"Python","original_status":"Time Limit Exceeded","pass":"def main():\n N, M = map(int, input().split())\n A = [0] * N\n for _ in range(M):\n L, R = map(int, input().split())\n for i in range(L - 1, R):\n A[i] += 1\n print(A.count(M))\n\n\nmain()\n","fail":"def main():\n N, M = map(int, input().split())\n A = [0] * (N + 1)\n for _ in range(M):\n L, R = map(int, input().split())\n A[L - 1] += 1\n A[R] -= 1\n c = 0\n ans = 0\n for i, a in enumerate(A):\n c += a\n if c == M:\n ans += 1\n print(ans)\n\n\nmain()\n","change":"replace","i1":2,"i2":8,"j1":2,"j2":14,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03037","language":"Python","original_status":"Time Limit Exceeded","pass":"n, m = map(int, input().split())\nAuthority = [list(map(int, input().split())) for _ in range(m)]\ncards = set(range(1, n + 1))\n\nfor i in range(m):\n gate = set(range(Authority[i][0], Authority[i][1] + 1))\n cards &= gate\nprint(len(cards))\n","fail":"n, m = map(int, input().split())\nAuthority = [list(map(int, input().split())) for _ in range(m)]\ncards = list(range(1, n + 2))\nl_list = []\nr_list = []\nfor i in range(m):\n l_list.append(Authority[i][0])\n r_list.append(Authority[i][1])\n\nprint(len(cards[max(l_list) : min(r_list) + 1]))\n","change":"replace","i1":2,"i2":8,"j1":2,"j2":10,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03037","language":"Python","original_status":"Runtime Error","pass":"from sys import exit\n\nN, M = map(int, input().split())\n\nans = []\n\nfor i in range(M):\n L, R = map(int, input().split())\n\n if i == 0:\n for card in range(L, R + 1):\n ans.append(card)\n continue\n\n if ans[0] < L:\n for card in range(ans[0], L):\n ans.remove(card)\n\n if R < ans[-1]:\n for card in range(R + 1, ans[-1] + 1):\n ans.remove(card)\n\n if not ans:\n print(0)\n exit()\n\nprint(len(ans))\n","fail":"from sys import exit\n\nN, M = map(int, input().split())\n\nL = []\nR = []\n\nfor i in range(M):\n l, r = map(int, input().split())\n L.append(l)\n R.append(r)\n\nl_max = max(L)\nr_min = min(R)\n\nif (r_min - l_max) < 0:\n print(0)\nelse:\n print(r_min - l_max + 1)\n","change":"replace","i1":4,"i2":27,"j1":4,"j2":19,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p03037","language":"Python","original_status":"Time Limit Exceeded","pass":"(n, m) = map(int, input().split())\ncounts = [0 for _ in range(n)]\nfor _ in range(m):\n gate_i = list(map(int, input().split()))\n for i in range(gate_i[0] - 1, gate_i[1]):\n counts[i] += 1\ncounts.sort()\nans = 0\nfor count in counts:\n ans += 1 if m == count else 0\nprint(ans)\n","fail":"(n, m) = map(int, input().split())\n\n\ndef intersect(lhs, rhs):\n if lhs[1] < rhs[0] or rhs[1] < lhs[0]:\n return [0, 0]\n min_value = lhs[0] if lhs[0] > rhs[0] else rhs[0]\n max_value = lhs[1] if lhs[1] < rhs[1] else rhs[1]\n return [min_value, max_value]\n\n\nans = [-1, 2 * 10**5]\nfor _ in range(m):\n ans = intersect(ans, list(map(int, input().split())))\n if 0 == ans[0] and 0 == ans[1]:\n print(0)\n exit(0)\nprint(ans[1] - ans[0] + 1)\n","change":"replace","i1":1,"i2":11,"j1":1,"j2":18,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03037","language":"Python","original_status":"Time Limit Exceeded","pass":"def main():\n n, m = map(int, input().split())\n lr_lst = [list(map(int, input().split())) for _ in range(m)]\n\n ans = 0\n\n for i in range(1, n + 1):\n is_able = True\n for j in range(m):\n if not lr_lst[j][0] <= i <= lr_lst[j][1]:\n is_able = False\n break\n if is_able:\n ans += 1\n\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"def main():\n n, m = map(int, input().split())\n lr_lst = [list(map(int, input().split())) for _ in range(m)]\n left = 0\n right = n + 1\n\n for i in range(m):\n if left < lr_lst[i][0]:\n left = lr_lst[i][0]\n if lr_lst[i][1] < right:\n right = lr_lst[i][1]\n\n if right - left < 0:\n print(0)\n else:\n print(right - left + 1)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":3,"i2":16,"j1":3,"j2":16,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03037","language":"Python","original_status":"Time Limit Exceeded","pass":"N, M = map(int, input().split())\nL = [0] * M\nR = [0] * M\ncount = 0\nfor i in range(M):\n L[i], R[i] = map(int, input().split())\nfor i in range(N):\n clear = 0\n for j in range(M):\n if L[j] <= i + 1 <= R[j]:\n clear += 1\n else:\n break\n if clear == M:\n count += 1\nprint(count)\n","fail":"N, M = map(int, input().split())\nL = [0] * M\nR = [0] * M\ncount = 0\nfor i in range(M):\n L[i], R[i] = map(int, input().split())\nLmax = max(L)\nRmin = min(R)\nif Lmax <= Rmin:\n print(Rmin - Lmax + 1)\nelse:\n print(0)\n","change":"replace","i1":6,"i2":16,"j1":6,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03037","language":"Python","original_status":"Time Limit Exceeded","pass":"import sys\n\ninput = sys.stdin.readline\n\nn, m = map(int, input().split())\n\nl_first, r_first = map(int, input().split())\n\nanswer_set = {value for value in range(l_first, r_first + 1)}\n\nfor _ in range(m - 1):\n l_current, r_current = map(int, input().split())\n current_set = {value for value in range(l_current, r_current + 1)}\n answer_set.intersection_update(current_set)\n\nprint(len(answer_set))\n","fail":"import sys\n\ninput = sys.stdin.readline\n\nn, m = map(int, input().split())\n\nl_list = []\nr_list = []\n\nfor _ in range(m):\n l, r = map(int, input().split())\n l_list.append(l)\n r_list.append(r)\n\nl_maybe_answer = max(l_list)\nr_maybe_answer = min(r_list)\n\nif l_maybe_answer <= r_maybe_answer:\n print(min(r_list) - max(l_list) + 1)\nelse:\n print(0)\n","change":"replace","i1":6,"i2":16,"j1":6,"j2":21,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03037","language":"Python","original_status":"Time Limit Exceeded","pass":"n, m = map(int, input().split())\nans = set(range(1, n + 1))\nfor _ in range(m):\n l, r = map(int, input().split())\n st = set(range(l, r + 1))\n ans &= st\nprint(len(ans))\n","fail":"def solve2():\n n, m = map(int, input().split())\n L = 1\n R = n\n for _ in range(m):\n l, r = map(int, input().split())\n L = max(L, l)\n R = min(R, r)\n if L <= R:\n print(R - L + 1)\n else:\n print(0)\n\n\nsolve2()\n","change":"replace","i1":0,"i2":7,"j1":0,"j2":15,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03037","language":"Python","original_status":"Time Limit Exceeded","pass":"n, m = map(int, input().split())\na = [list(map(int, input().split())) for i in range(m)]\n\nif len(a) == 1:\n print(a[0][1] - a[0][0] + 1)\nelse:\n ans = n\n for i in range(1, n + 1):\n for j in range(m):\n if a[j][0] <= i <= a[j][1]:\n continue\n else:\n ans -= 1\n break\n print(ans)\n","fail":"n, m = map(int, input().split())\n\nleft = []\nright = []\nfor i in range(m):\n a, b = map(int, input().split())\n left.append(a)\n right.append(b)\n\nif min(right) >= max(left):\n print(min(right) - max(left) + 1)\nelse:\n print(0)\n","change":"replace","i1":1,"i2":15,"j1":1,"j2":13,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03037","language":"Python","original_status":"Runtime Error","pass":"N, M = map(int, input().split())\ntable = [[int(i) for i in input().split()] for _ in range(M)]\n\nans = [table[0], table[1]]\n\nfor i in table:\n if ans[0] >= i[0] <= ans[1]:\n ans[0] = i[0]\n if ans[0] >= i[1] <= ans[1]:\n ans[1] = i[1]\n\nprint(ans[1] - ans[0] + 1)\n","fail":"N, M = map(int, input().split())\ntable = [[int(i) for i in input().split()] for _ in range(M)]\n\nans = [table[0][0], table[0][1]]\ncnt = 0\n\nfor i in table[1:]:\n if ans[0] <= i[0] <= ans[1]:\n ans[0] = i[0]\n if ans[0] <= i[1] <= ans[1]:\n ans[1] = i[1]\n if ans[1] < i[0] or i[1] < ans[0]:\n cnt += 1\n break\n\nif cnt != 0:\n print(0)\nelse:\n print(ans[1] - ans[0] + 1)\n","change":"replace","i1":3,"i2":12,"j1":3,"j2":19,"error":"TypeError: '>=' not supported between instances of 'list' and 'int'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03037\/Python\/s777390978.py\", line 7, in \n if ans[0] >= i[0] <= ans[1]:\nTypeError: '>=' not supported between instances of 'list' and 'int'\n","stdout":null} {"problem_id":"p03037","language":"Python","original_status":"Time Limit Exceeded","pass":"#!\/usr\/bin\/env python3\nimport sys\n\nN, M = map(int, input().rstrip().split())\n\nL = []\nR = []\nfor _ in range(M):\n l, r = map(int, input().rstrip().split())\n L.append(l)\n R.append(r)\n\nAns = set(range(L[0], R[0] + 1))\nfor i in range(1, len(L)):\n Ans = set(range(L[i], R[i] + 1)) & Ans\n if not Ans:\n print(0)\n sys.exit(0)\n\nprint(len(Ans))\n","fail":"#!\/usr\/bin\/env python3\nimport sys\n\nN, M = map(int, input().rstrip().split())\n\nL = []\nR = []\nfor _ in range(M):\n l, r = map(int, input().rstrip().split())\n L.append(l)\n R.append(r)\n\nAns = min(R) - max(L) + 1\nif Ans < 0:\n Ans = 0\nprint(Ans)\n","change":"replace","i1":12,"i2":20,"j1":12,"j2":16,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03037","language":"Python","original_status":"Time Limit Exceeded","pass":"N, M = map(int, input().split())\n\nid_list = [0] * N\n\nfor _ in range(M):\n L, R = map(int, input().split())\n for i in range(L, R + 1):\n id_list[i - 1] += 1\n\nprint(sorted(id_list, reverse=True).count(M))\n","fail":"N, M = map(int, input().split())\n\nL, R = 1, N\nfor _ in range(M):\n Li, Ri = map(int, input().split())\n if L <= Li:\n L = Li\n if Ri <= R:\n R = Ri\n\nprint(R - L + 1 if (R >= L) else 0)\n","change":"replace","i1":2,"i2":10,"j1":2,"j2":11,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03037","language":"Python","original_status":"Time Limit Exceeded","pass":"n, m = map(int, input().split())\nlr = [list(map(int, input().split())) for _ in range(m)]\nans = []\nfor i in range(m):\n res = []\n for j in range(lr[i][0], lr[i][1] + 1):\n res.append(j)\n if i == 0:\n ans = set(res)\n else:\n ans = set(ans) & set(res)\nprint(len(ans))\n","fail":"n, m = map(int, input().split())\nmi, ma = 1, n\nfor _ in range(m):\n l, r = map(int, input().split())\n mi = max(l, mi)\n ma = min(r, ma)\nprint(max(0, ma - mi + 1))\n","change":"replace","i1":1,"i2":12,"j1":1,"j2":7,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03037","language":"Python","original_status":"Time Limit Exceeded","pass":"N, M = map(int, input().split())\nLR = [list(map(int, input().split())) for _ in range(M)]\n\nc = [0 for _ in range(N)]\ncnt = 0\nfor i, (l, r) in enumerate(LR):\n for j in range(l - 1, r):\n c[j] += i + 1\n cnt += i + 1\n\ns = [1 if k == cnt else 0 for k in c]\n\nprint(sum(s))\n","fail":"N, M = map(int, input().split())\nLR = [list(map(int, input().split())) for _ in range(M)]\n\nleft = 1\nright = N\n\nfor l, r in LR:\n left = max(left, l)\n right = min(right, r)\n\nans = right - left\n\nprint(ans + 1 if ans >= 0 else 0)\n","change":"replace","i1":3,"i2":13,"j1":3,"j2":13,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03037","language":"Python","original_status":"Time Limit Exceeded","pass":"N, M = map(int, input().split())\nA = []\nfor i in range(M):\n L, R = map(int, input().split())\n if i == 0:\n S = set(list(range(L, R + 1)))\n else:\n S = S & set(list(range(L, R + 1)))\n if len(S) == 0:\n break\n\n# L = set(A[0])\n# for i in range(1, M):\n# L = L & set(A[i])\n\nprint(len(S))\n","fail":"N, M = map(int, input().split())\nA = []\nfor i in range(M):\n L, R = map(int, input().split())\n if i == 0:\n Lmax = L\n Rmin = R\n else:\n Lmax = max(L, Lmax)\n Rmin = min(R, Rmin)\n\n# L = set(A[0])\n# for i in range(1, M):\n# L = L & set(A[i])\n\nif Rmin - Lmax < 0:\n print(0)\nelse:\n print(Rmin - Lmax + 1)\n","change":"replace","i1":5,"i2":16,"j1":5,"j2":19,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03038","language":"Python","original_status":"Runtime Error","pass":"N, M = map(int, input().split())\nA = list(map(int, input().split()))\nBC = [list(map(int, input().split())) for i in range(M)]\nBC = sorted(BC, key=lambda x: x[1])\nA.sort()\ni = 0\nfor b, c in BC[::-1]:\n if i == N:\n break\n for _ in range(b):\n if c > A[i]:\n A[i] = c\n i += 1\n else:\n break\n\nprint(sum(A))\n","fail":"N, M = map(int, input().split())\nA = list(map(int, input().split()))\nBC = [list(map(int, input().split())) for i in range(M)]\nBC = sorted(BC, key=lambda x: x[1])\nA.sort()\ni = 0\nfor b, c in BC[::-1]:\n for _ in range(b):\n if i == N:\n break\n if c > A[i]:\n A[i] = c\n i += 1\n else:\n break\n\nprint(sum(A))\n","change":"replace","i1":7,"i2":10,"j1":7,"j2":10,"error":"0","stderr":null,"stdout":"14\n"} {"problem_id":"p03038","language":"Python","original_status":"Time Limit Exceeded","pass":"import heapq\n\nn, m = map(int, input().split())\na = list(map(int, input().split()))\nheapq.heapify(a)\nfor _ in range(m):\n b, c = map(int, input().split())\n for _ in range(b):\n tmp = heapq.heappop(a)\n if tmp >= c:\n heapq.heappush(a, tmp)\n break\n else:\n heapq.heappush(a, c)\nprint(sum(a))\n","fail":"n, m = map(int, input().split())\nA = list(map(int, input().split()))\nd = {}\nfor a in A:\n d[a] = 1 if a not in d else d[a] + 1\nfor _ in range(m):\n b, c = map(int, input().split())\n d[c] = b if c not in d else d[c] + b\nans = 0\ncnt = 0\nL = sorted(d, reverse=True)\nfor k in L:\n if d[k] + cnt < n:\n ans += k * d[k]\n cnt += d[k]\n else:\n ans += k * (n - cnt)\n break\nprint(ans)\n","change":"replace","i1":0,"i2":15,"j1":0,"j2":19,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03038","language":"Python","original_status":"Time Limit Exceeded","pass":"import sys\n\ninput = sys.stdin.readline\n\nN, M = map(int, input().split())\nA = list(map(int, input().split()))\nop = [list(map(int, input().split())) for _ in range(M)]\n\ncards = sorted(A)\nop.sort(key=lambda x: -x[1])\n\ni = 0\n\nfor m in range(M):\n b, c = op[m]\n for _ in range(b):\n if cards[i] < c:\n cards[i] = c\n i += 1\n if i >= N:\n break\n else:\n continue\n break\n\nprint(sum(cards))\n","fail":"import sys\n\ninput = sys.stdin.readline\n\nN, M = map(int, input().split())\nA = list(map(int, input().split()))\nop = [list(map(int, input().split())) for _ in range(M)]\n\ncards = sorted(A)\nop.sort(key=lambda x: -x[1])\n\ni = 0\n\nfor m in range(M):\n b, c = op[m]\n for _ in range(b):\n if cards[i] < c:\n cards[i] = c\n i += 1\n if i >= N:\n break\n else:\n break\n else:\n continue\n break\n\nprint(sum(cards))\n","change":"replace","i1":19,"i2":20,"j1":19,"j2":22,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03038","language":"Python","original_status":"Runtime Error","pass":"N, M = map(int, input().split())\nA = sorted(list(map(int, input().split())))\nBC = [list(map(int, input().split())) for _ in range(M)]\n\n# n\u756a\u76ee\u306e\u8981\u7d20\u3067\u30bd\u30fc\u30c8sort\nBC = sorted(BC, reverse=True, key=lambda x: x[1])\n\nm = A[0]\nD = []\np = 0\nfor b, c in BC:\n if c > m:\n _ = [D.append(c) for i in range(b)]\n p += 1\n if p > N:\n break\n else:\n continue\n\nD.append(0)\n\nfor i, d in enumerate(D):\n if i > N:\n break\n if A[i] < d:\n A[i] = d\n else:\n break\n\nprint(sum(A))\n","fail":"N, M = map(int, input().split())\nA = sorted(list(map(int, input().split())))\nBC = [list(map(int, input().split())) for _ in range(M)]\n\n# n\u756a\u76ee\u306e\u8981\u7d20\u3067\u30bd\u30fc\u30c8sort\nBC = sorted(BC, reverse=True, key=lambda x: x[1])\n\nm = A[0]\nD = []\nfor b, c in BC:\n if c > m:\n _ = [D.append(c) for i in range(b)]\n else:\n continue\n if len(D) > N:\n break\n\nD.append(0)\n\nfor i, d in enumerate(D):\n if i >= N:\n break\n if A[i] < d:\n A[i] = d\n else:\n break\n\nprint(sum(A))\n","change":"replace","i1":9,"i2":23,"j1":9,"j2":21,"error":"0","stderr":null,"stdout":"14\n"} {"problem_id":"p03038","language":"Python","original_status":"Runtime Error","pass":"#!\/usr\/bin\/env python3\nimport bisect\nimport numpy as np\n\nN, M = list(map(int, input().split()))\na_list = list(map(int, input().split()))\nbc_list = []\n\nfor _ in range(M):\n b, c = list(map(int, input().split()))\n bc_list.append((b, c))\n\nbc_list = sorted(bc_list, key=lambda x: x[1], reverse=True)\nnow_list = np.array(sorted(a_list))\nfix_list = np.array([])\nmin_a = min(a_list)\n\nfor bc in bc_list:\n b, c = bc\n if min_a >= c:\n # \u3082\u3046\u7f6e\u304d\u63db\u3048\u3066\u3082\u5408\u8a08\u5024\u306f\u5897\u3048\u306a\u3044\n break\n # c\u3088\u308a\u5c0f\u3055\u3044\u6570\u306f\u4f55\u500b\u3042\u308b\u304b\uff1f\n # \u7dda\u5f62\u63a2\u7d22\u3060\u3068TLE\u306b\u306a\u308b\u306e\u3067\u30012\u5206\u63a2\u7d22\u3067\u8003\u3048\u308b\n c_index = bisect.bisect_right(now_list, c)\n target_index = c_index if c_index < b else b\n\n # c_index\u307e\u3067\u3092c\u3067\u7f6e\u304d\u63db\u3048\u3066\u3082\u3001\u9806\u5e8f\u306e\u5165\u308c\u66ff\u3048\u306f\u306a\u3044\n now_list[:target_index] = c\n # c_index\u4ee5\u524d\u306e\u6574\u6570\u306f\u4f7f\u7528\u78ba\u5b9a\u306a\u306e\u3067\u6383\u304d\u51fa\u3059\n fix_list = np.hstack([fix_list, now_list[:target_index]])\n now_list = now_list[target_index:]\n min_a = now_list[0]\n\nfix_list = np.hstack([fix_list, now_list])\nans = fix_list.sum()\nans = int(ans)\nprint(ans)\n","fail":"#!\/usr\/bin\/env python3\nimport bisect\nimport numpy as np\n\nN, M = list(map(int, input().split()))\na_list = list(map(int, input().split()))\nbc_list = []\n\nfor i in range(M):\n try:\n b, c = list(map(int, input().split()))\n bc_list.append((b, c))\n except:\n M = i\n\nbc_list = sorted(bc_list, key=lambda x: x[1], reverse=True)\na_list = sorted(a_list)\n\nfix_list = []\ns = 0\nb, c = bc_list[0]\nbc_index = 0\nnow_b, now_c = 0, c\n\nfor i, a in enumerate(a_list):\n # a = a_list[i]\n if now_b >= b:\n bc_index += 1\n if bc_index >= len(bc_list):\n # TODO: \u6b8b\u308a\u3092\u8db3\u3059\n fix_list.append(a)\n s += a\n continue\n now_b = 0\n b, c = bc_list[bc_index]\n\n if a < c:\n fix_list.append(c)\n s += c\n else:\n fix_list.append(a)\n s += a\n now_b += 1\n\nans = s\nprint(ans)\n","change":"replace","i1":8,"i2":37,"j1":8,"j2":45,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03038","language":"Python","original_status":"Runtime Error","pass":"n, m = map(int, input().split())\na = list(map(int, input().split()))\nbc = [0] * m\nans = []\na.sort()\nfor i in range(m):\n bc[i] = list(map(int, input().split()))\nbc.sort(key=lambda x: x[1], reverse=True)\n\n\nj = 0\nfor i in range(n):\n if bc[j][0] == 0:\n j += 1\n if j >= m:\n ans.append(a[i])\n elif a[i] >= bc[j][1]:\n ans.append(a[i])\n else:\n ans.append(bc[j][1])\n bc[j][0] -= 1\n\nprint(sum(ans))\n","fail":"n, m = map(int, input().split())\na = list(map(int, input().split()))\nbc = [0] * m\nans = []\na.sort()\nfor i in range(m):\n bc[i] = list(map(int, input().split()))\nbc.sort(key=lambda x: x[1], reverse=True)\n\n\nj = 0\nfor i in range(n):\n if j < m:\n if bc[j][0] == 0:\n j += 1\n if j >= m:\n ans.append(a[i])\n elif a[i] >= bc[j][1]:\n ans.append(a[i])\n else:\n ans.append(bc[j][1])\n bc[j][0] -= 1\n\nprint(sum(ans))\n","change":"replace","i1":12,"i2":14,"j1":12,"j2":15,"error":"0","stderr":null,"stdout":"14\n"} {"problem_id":"p03038","language":"Python","original_status":"Time Limit Exceeded","pass":"N, M = map(int, input().split())\nA = list(map(int, input().split()))\noperation = []\nans = 0\n\nfor _ in range(M):\n t = tuple(map(int, input().split()))\n operation.append(t)\n\noperation.sort(key=lambda x: x[1], reverse=True)\nA.sort()\n\nwhile A and operation:\n if A[-1] >= operation[0][1]:\n ans += A[-1]\n A.pop(-1)\n else:\n cnt = 0\n for i in range(operation[0][0]):\n if len(A) == i or A[i] > operation[0][1]:\n cnt = i\n break\n else:\n cnt = operation[0][0]\n for _ in range(cnt):\n A.pop(0)\n ans += cnt * operation[0][1]\n operation.pop(0)\n\nans += sum(A)\n\nprint(ans)\n","fail":"from collections import deque\n\nN, M = map(int, input().split())\nA = list(map(int, input().split()))\noperation = []\nans = 0\n\nfor _ in range(M):\n t = tuple(map(int, input().split()))\n operation.append(t)\n\noperation.sort(key=lambda x: x[1], reverse=True)\nA.sort()\nA = deque(A)\noperation = deque(operation)\n\nwhile A and operation:\n if A[-1] >= operation[0][1]:\n ans += A[-1]\n A.pop()\n else:\n cnt = 0\n for i in range(operation[0][0]):\n if len(A) == i or A[i] > operation[0][1]:\n cnt = i\n break\n else:\n cnt = operation[0][0]\n for _ in range(cnt):\n A.popleft()\n ans += cnt * operation[0][1]\n operation.popleft()\n\nans += sum(A)\n\nprint(ans)\n","change":"replace","i1":0,"i2":28,"j1":0,"j2":32,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03038","language":"Python","original_status":"Runtime Error","pass":"#!\/usr\/bin\/env python3\nN, M = map(int, input().rstrip().split())\nA = list(map(int, input().rstrip().split()))\n\nB = []\nC = []\nfor _ in range(M):\n b, c = map(int, input().rstrip().split())\n B.append(b)\n C.append(c)\n\nIndex = sorted(range(M), key=lambda i: C[i], reverse=True)\n\nsum = 0\nA.sort()\nfor index in Index:\n if A[0] >= C[index]:\n break\n count = 0\n i = 0\n while True:\n if i >= len(A):\n break\n if A[i] < C[index] and count < B[index]:\n sum += C[index]\n A.pop(i)\n # print(A)\n count += 1\n continue\n if A[i] >= C[index] or count >= B[index]:\n break\n i += 1\n\nif A:\n for a in A:\n sum += a\n\nprint(sum)\n","fail":"#!\/usr\/bin\/env python3\nN, M = map(int, input().rstrip().split())\nA = list(map(int, input().rstrip().split()))\n\nB = []\nC = []\nfor _ in range(M):\n b, c = map(int, input().rstrip().split())\n B.append(b)\n C.append(c)\n\nIndex = sorted(range(M), key=lambda i: C[i], reverse=True)\n\nsum = 0\nA.sort()\nfor index in Index:\n if A and A[0] >= C[index]:\n break\n count = 0\n i = 0\n while True:\n if i >= len(A):\n break\n if A[i] < C[index] and count < B[index]:\n sum += C[index]\n A.pop(i)\n # print(A)\n count += 1\n continue\n if A[i] >= C[index] or count >= B[index]:\n break\n i += 1\n\nif A:\n for a in A:\n sum += a\n\nprint(sum)\n","change":"replace","i1":16,"i2":17,"j1":16,"j2":17,"error":"0","stderr":null,"stdout":"14\n"} {"problem_id":"p03038","language":"Python","original_status":"Time Limit Exceeded","pass":"N, M = map(int, input().split())\nA = list(map(int, input().split()))\nCB = []\nfor _ in range(M):\n b, c = map(int, input().split())\n CB.append((c, b))\n\n# ascend\nA.sort()\n\n# descend\nCB.sort(reverse=True)\n\n# fill convert ary\nconv = []\nfor cb in CB:\n c, b = cb\n conv.extend([c] * b)\n\ncl = len(conv)\n\nsum = 0\nfor i in range(N):\n if i >= cl:\n sum += A[i]\n else:\n sum += max(A[i], conv[i])\n\nprint(sum)\n","fail":"N, M = map(int, input().split())\nA = list(map(int, input().split()))\nCB = []\nfor _ in range(M):\n b, c = map(int, input().split())\n CB.append((c, b))\n\n# ascend\nA.sort()\n\n# descend\nCB.sort(reverse=True)\n\n# fill convert ary\nconv = []\nfor cb in CB:\n c, b = cb\n conv.extend([c] * b)\n if len(conv) >= N:\n break\n\ncl = len(conv)\n\nsum = 0\nfor i in range(N):\n if i >= cl:\n sum += A[i]\n else:\n sum += max(A[i], conv[i])\n\nprint(sum)\n","change":"insert","i1":18,"i2":18,"j1":18,"j2":20,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03038","language":"Python","original_status":"Time Limit Exceeded","pass":"import bisect\n\n\nn, m = map(int, input().split())\nA = list(map(int, input().split()))\nA.sort()\n\nfor _ in range(m):\n b, c = map(int, input().split())\n i = bisect.bisect_left(A, c)\n if i >= b:\n A[:b] = [c] * b\n else:\n A[:i] = [c] * i\n A.sort()\n\nanswer = sum(A)\nprint(answer)\n","fail":"from heapq import *\n\n\nn, m = map(int, input().split())\nPAIRS = [[-a, -1] for a in map(int, input().split())]\nheapify(PAIRS)\n\nfor _ in range(m):\n b, c = map(int, input().split())\n heappush(PAIRS, [-c, -b])\n\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)\n\nprint(answer)\n","change":"replace","i1":0,"i2":17,"j1":0,"j2":19,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03038","language":"Python","original_status":"Time Limit Exceeded","pass":"from bisect import bisect_right\n\nn, m = list(map(int, input().split()))\na = list(map(int, input().split()))\na.sort()\nbc = [list(map(int, input().split())) for _ in range(m)]\nbc.sort(key=lambda x: x[1], reverse=True)\n\nres = 0\nfor b, c in bc:\n count = bisect_right(a, c, hi=min(b, len(a)))\n res += count * c\n if count > 0:\n a = a[count:]\n\nprint(res + sum(a))\n","fail":"from bisect import bisect_right\n\nn, m = list(map(int, input().split()))\na = list(map(int, input().split()))\na.sort()\nbc = [list(map(int, input().split())) for _ in range(m)]\nbc.sort(key=lambda x: x[1], reverse=True)\n\nres = 0\nfin = 0\nfor b, c in bc:\n count = bisect_right(a, c, lo=fin, hi=min(fin + b, len(a))) - fin\n fin += count\n res += count * c\nfor i in range(fin, len(a)):\n res += a[i]\n\nprint(res)\n","change":"replace","i1":9,"i2":16,"j1":9,"j2":18,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03038","language":"Python","original_status":"Time Limit Exceeded","pass":"from heapq import heapify, heappush, heappop\n\n\nN, M = map(int, input().split())\nlst_A = list(map(int, input().split()))\n\n\nnumbers = []\nheapify(numbers)\nfor a in lst_A:\n heappush(numbers, -a)\nfor _ in range(M):\n b, c = map(int, input().split())\n for _ in range(b):\n heappush(numbers, -c)\n\n\nans = -sum(heappop(numbers) for _ in range(N))\nprint(ans)\n","fail":"from heapq import heapify, heappush, heappop\n\n\nN, M = map(int, input().split())\nlst_A = list(map(int, input().split()))\n\n\nhq = []\nheapify(hq)\nfor a in lst_A:\n heappush(hq, [-a, 1])\nfor _ in range(M):\n b, c = map(int, input().split())\n heappush(hq, [-c, b])\n\nans = 0\nwhile N > 0:\n c, b = heappop(hq)\n c *= -1\n if b < N:\n ans += c * b\n N -= b\n else:\n ans += c * N\n N = 0\n\n\nprint(ans)\n","change":"replace","i1":7,"i2":18,"j1":7,"j2":27,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03038","language":"Python","original_status":"Runtime Error","pass":"N, M = map(int, input().split())\nA = sorted(list(map(int, input().split())))\nBC = [None] * M\nfor i in range(M):\n BC[i] = tuple(map(int, input().split()))\nBC.sort(key=lambda tpl: tpl[1], reverse=True) # sort by C descendant\n\nD = [0] * N\ni = 0\nj = 0\nwhile i < N and j < M:\n b, c = BC[j]\n for k in range(i, i + b):\n D[k] = c\n i += b\n j += 1\n\nfor i in range(N):\n A[i] = max(A[i], D[i])\n\nprint(sum(A))\n","fail":"N, M = map(int, input().split())\nA = sorted(list(map(int, input().split())))\nBC = [None] * M\nfor i in range(M):\n BC[i] = tuple(map(int, input().split()))\nBC.sort(key=lambda tpl: tpl[1], reverse=True) # sort by C descendant\n\nD = [0] * N\ni = 0\nj = 0\nwhile i < N and j < M:\n b, c = BC[j]\n for k in range(i, min(i + b, N)):\n D[k] = c\n i += b\n j += 1\n\nfor i in range(N):\n A[i] = max(A[i], D[i])\n\nprint(sum(A))\n","change":"replace","i1":12,"i2":13,"j1":12,"j2":13,"error":"0","stderr":null,"stdout":"14\n"} {"problem_id":"p03038","language":"Python","original_status":"Time Limit Exceeded","pass":"N, M = map(int, input().split())\nA = list(map(int, input().split()))\nmin_a = min(A)\nfor i in range(M):\n B, C = map(int, input().split())\n if min_a < C:\n C = [C for i in range(B)]\n A.extend(C)\nA = sorted(A, reverse=True)\nprint(sum(A[:N]))\n","fail":"from collections import Counter\n\nN, M = map(int, input().split())\nA = list(map(int, input().split()))\ncount_a = Counter(A)\nA = [(v, k) for k, v in count_a.items()]\nfor i in range(M):\n B, C = map(int, input().split())\n A.append((B, C))\nA = sorted(A, reverse=True, key=lambda x: x[1])\nans = 0\nfor k, v in A:\n N = N - k\n if N <= 0:\n ans += k * v + N * v\n break\n ans += k * v\nprint(ans)\n","change":"replace","i1":0,"i2":10,"j1":0,"j2":18,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03038","language":"Python","original_status":"Time Limit Exceeded","pass":"import numpy as np\nfrom sys import stdin\n\nn, m = map(int, stdin.readline().split())\na = [int(num) for num in stdin.readline().split()]\n\ncnt_dict = {}\nmtr = [stdin.readline().rstrip().split() for _ in range(m)]\nfor row in mtr:\n cnt_dict.setdefault(int(row[1]), 0)\n cnt_dict[int(row[1])] += int(row[0])\nfor a_ in a:\n cnt_dict.setdefault(a_, 0)\n cnt_dict[a_] += 1\n\ncnt_dict = sorted(cnt_dict.items(), key=lambda x: -x[0])\n\ncnt = 0\nans = 0\n\nfor (k, v) in cnt_dict:\n v_ = np.min([v, n - cnt])\n ans += v_ * k\n cnt += v_\n if cnt == n:\n break\n\n\nprint(ans)\n","fail":"from sys import stdin\n\nn, m = map(int, stdin.readline().split())\na = [int(num) for num in stdin.readline().split()]\n\ncnt_list = [(a[i], 1) for i in range(n)]\nfor i in range(m):\n b, c = map(int, stdin.readline().split())\n cnt_list.append((c, b))\n\ncnt_list.sort()\ncnt_list.reverse()\n\ncnt = n\nans = 0\n\nfor (k, v) in cnt_list:\n acc_v = min(v, cnt)\n ans += k * acc_v\n cnt -= acc_v\n\n\nprint(ans)\n","change":"replace","i1":0,"i2":26,"j1":0,"j2":20,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03038","language":"Python","original_status":"Time Limit Exceeded","pass":"N, M = [int(i) for i in input().strip().split()]\nA = [int(i) for i in input().strip().split()]\nA.sort()\nfor i in range(M):\n B, C = [int(i) for i in input().strip().split()]\n is_changed = False\n for j in range(0, B):\n if A[j] < C:\n A[j] = C\n is_changed = True\n else:\n break\n if is_changed:\n A.sort()\nprint(sum(A))\n","fail":"N, M = [int(i) for i in input().strip().split()]\nA = [int(i) for i in input().strip().split()]\nA.sort()\n\nBC = [[0, 0] for _ in range(M)]\nfor j in range(M):\n BC[j][0], BC[j][1] = [int(i) for i in input().strip().split()]\nBC.sort(key=lambda x: x[1])\n\nres = 0\ncnt = 0\ni = N - 1\nj = M - 1\nwhile True:\n if cnt == N:\n break\n\n if j == -1:\n res += A[i]\n i -= 1\n elif A[i] > BC[j][1]:\n res += A[i]\n i -= 1\n elif A[i] <= BC[j][1]:\n res += BC[j][1]\n BC[j][0] -= 1\n if BC[j][0] == 0:\n j -= 1\n else:\n raise ValueError\n cnt += 1\nprint(res)\n","change":"replace","i1":3,"i2":15,"j1":3,"j2":32,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03038","language":"Python","original_status":"Time Limit Exceeded","pass":"N, M = map(int, input().split())\nA = list(map(int, input().split()))\nopes = [tuple(map(int, input().split())) for _ in range(M)]\n\nD = [C for B, C in opes for _ in range(B)]\nD = sorted(D, reverse=True)[:N]\n\nA.sort()\nfor i, d in enumerate(D):\n if A[i] >= d:\n break\n A[i] = d\n\nprint(sum(A))\n","fail":"N, M = map(int, input().split())\nA = list(map(int, input().split()))\nopes = [tuple(map(int, input().split())) for _ in range(M)]\nopes.sort(key=lambda x: -x[1])\n\nD = []\nlenD = 0\nfor B, C in opes:\n D += [C] * B\n lenD += B\n if lenD >= N:\n break\n\nA.sort()\nfor i, d in enumerate(D[:N]):\n if A[i] >= d:\n break\n A[i] = d\n\nprint(sum(A))\n","change":"replace","i1":3,"i2":9,"j1":3,"j2":15,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03038","language":"Python","original_status":"Runtime Error","pass":"n, m = map(int, input().split())\na = list(map(int, input().split()))\nbc = [tuple(map(int, input().split())) for _ in range(m)]\na.sort()\nbc.sort(reverse=True, key=lambda x: x[1])\nlast_idx = len(a) - 1\nidx = 0\nfor e in bc:\n b, c = e\n for i in range(b):\n if i + idx > last_idx:\n break\n if a[i + idx] < c:\n a[i + idx] = c\n else:\n break\n else:\n idx += b\n print(a)\n print(idx)\n continue\n break\n\nprint(sum(a))\n","fail":"n, m = map(int, input().split())\na = list(map(int, input().split()))\nbc = [tuple(map(int, input().split())) for _ in range(m)]\na.sort()\nbc.sort(reverse=True, key=lambda x: x[1])\nlast_idx = len(a) - 1\nidx = 0\nfor e in bc:\n b, c = e\n for i in range(b):\n if i + idx > last_idx:\n break\n if a[i + idx] < c:\n a[i + idx] = c\n idx += b\n\nprint(sum(a))\n","change":"replace","i1":14,"i2":22,"j1":14,"j2":15,"error":"WA","stderr":null,"stdout":"[5, 4, 5]\n1\n14\n"} {"problem_id":"p03038","language":"Python","original_status":"Time Limit Exceeded","pass":"import sys\n\n\nN, M = map(int, input().split())\nA = list(map(int, input().split()))\n\nope = [tuple(map(int, x.split())) for x in sys.stdin.readlines()]\n\nope.sort(key=lambda x: -x[1])\n\ncnt = 0\nfor b, c in ope:\n A = A + [c] * b\n cnt += b\n\n if cnt >= N:\n break\n\nA.sort(reverse=True)\n\nprint(sum(A[:N]))\n","fail":"import sys\n\n\nN, M = map(int, input().split())\nA = list(map(int, input().split()))\nA.sort(reverse=True)\n\nope = [list(map(int, x.split())) for x in sys.stdin.readlines()]\n\nope.sort(key=lambda x: -x[1])\n\nmp = 0\nap = 0\ncnt = 0\nans = 0\n\nwhile cnt < N:\n a = A[ap]\n m = ope[mp][1] if mp < M else 0\n\n if m >= a:\n mc = min(ope[mp][0], N - cnt)\n ans += m * mc\n cnt += mc\n mp += 1\n else:\n ans += a\n cnt += 1\n ap += 1\n\nprint(ans)\n","change":"replace","i1":5,"i2":21,"j1":5,"j2":31,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03038","language":"Python","original_status":"Time Limit Exceeded","pass":"import heapq\n\nN, M = map(int, input().split())\nA = list(map(int, input().split()))\norigin = sum(A)\nheapq.heapify(A)\n\nfor _ in range(M):\n b, c = map(int, input().split())\n for _ in range(b):\n smallest = heapq.heappop(A)\n tmp = c - smallest\n if tmp <= 0:\n heapq.heappush(A, smallest)\n break\n else:\n heapq.heappush(A, c)\n origin += tmp\n\nprint(origin)\n","fail":"import sys\nimport heapq\n\nN, M = map(int, input().split())\nA = list(map(int, input().split()))\norigin = sum(A)\nheapq.heapify(A)\n\nBC = [list(map(int, input().split())) for _ in range(M)]\nBC = sorted(BC, reverse=True, key=lambda x: x[1])\n\ncount = 0\n\nfor i in range(M):\n b = BC[i][0]\n c = BC[i][1]\n for _ in range(b):\n smallest = heapq.heappop(A)\n tmp = c - smallest\n if tmp <= 0:\n heapq.heappush(A, smallest)\n break\n else:\n heapq.heappush(A, c)\n origin += tmp\n count += 1\n if count >= N:\n print(origin)\n sys.exit()\n\nprint(origin)\n","change":"replace","i1":0,"i2":18,"j1":0,"j2":29,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03038","language":"Python","original_status":"Runtime Error","pass":"N, M = map(int, input().split())\nA = list(map(int, input().split()))\nA.sort()\nBC = [list(map(int, input().split())) for i in range(M)]\nBC = sorted(BC, key=lambda x: -x[1])\ni = 0\nfor B, C in BC:\n for _ in range(B):\n if A[i] < C:\n A[i] = C\n i += 1\n else:\n print(sum(A))\n exit()\nprint(sum(A))\n","fail":"N, M = map(int, input().split())\nA = list(map(int, input().split()))\nA.sort()\nBC = [list(map(int, input().split())) for i in range(M)]\nBC = sorted(BC, key=lambda x: -x[1])\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 print(sum(A))\n exit()\nprint(sum(A))\n","change":"replace","i1":8,"i2":9,"j1":8,"j2":9,"error":"0","stderr":null,"stdout":"14\n"} {"problem_id":"p03038","language":"Python","original_status":"Runtime Error","pass":"n, m = map(int, input().split())\na_list = list(map(int, input().split()))\nbc_list = [list(map(int, input().split())) for _ in range(m)]\na_list.sort()\nbc_list.sort(key=lambda i: -i[1])\n\na_idx = 0\nbc_idx = 0\nwhile bc_idx < len(bc_list):\n b, c = bc_list[bc_idx]\n finish = False\n for _ in range(b):\n if c > a_list[a_idx]:\n a_list[a_idx] = c\n a_idx += 1\n else:\n finish = True\n break\n if finish:\n break\n bc_idx += 1\n\nprint(sum(a_list))\n","fail":"n, m = map(int, input().split())\na_list = list(map(int, input().split()))\nbc_list = [list(map(int, input().split())) for _ in range(m)]\na_list.sort()\nbc_list.sort(key=lambda i: -i[1])\n\na_idx = 0\nbc_idx = 0\nwhile bc_idx < len(bc_list):\n b, c = bc_list[bc_idx]\n finish = False\n for _ in range(b):\n if a_idx >= len(a_list):\n finish = True\n break\n if c > a_list[a_idx]:\n a_list[a_idx] = c\n a_idx += 1\n else:\n finish = True\n break\n if finish:\n break\n bc_idx += 1\n\nprint(sum(a_list))\n","change":"insert","i1":12,"i2":12,"j1":12,"j2":15,"error":"0","stderr":null,"stdout":"14\n"} {"problem_id":"p03038","language":"Python","original_status":"Runtime Error","pass":"def main():\n N, M = map(int, input().split())\n A = sorted(list(map(int, input().split())))\n BC = []\n for _ in range(M):\n B, C = map(int, input().split())\n BC.append((B, C))\n BC = sorted(BC, key=lambda x: x[1], reverse=True)\n i = 0\n for b, c in BC:\n for _ in range(b):\n if A[i] >= c:\n break\n A[i] = c\n i += 1\n print(sum(A))\n\n\nmain()\n","fail":"def main():\n N, M = map(int, input().split())\n A = sorted(list(map(int, input().split())))\n BC = []\n for _ in range(M):\n B, C = map(int, input().split())\n BC.append((B, C))\n BC = sorted(BC, key=lambda x: x[1], reverse=True)\n i = 0\n for b, c in BC:\n for _ in range(b):\n if i >= len(A) or A[i] >= c:\n break\n A[i] = c\n i += 1\n print(sum(A))\n\n\nmain()\n","change":"replace","i1":11,"i2":12,"j1":11,"j2":12,"error":"0","stderr":null,"stdout":"14\n"} {"problem_id":"p03038","language":"Python","original_status":"Time Limit Exceeded","pass":"from sys import stdin, setrecursionlimit\nfrom heapq import heapify, heappop, heappush\n\n\ndef main():\n input = stdin.buffer.readline\n n, m = map(int, input().split())\n a = list(map(int, input().split()))\n heapify(a)\n\n for _ in range(m):\n b, c = map(int, input().split())\n for _ in range(b):\n ai = heappop(a)\n if ai < c:\n heappush(a, c)\n else:\n heappush(a, ai)\n break\n\n print(sum(a))\n\n\nif __name__ == \"__main__\":\n setrecursionlimit(10000)\n main()\n","fail":"from sys import stdin, setrecursionlimit\nfrom heapq import heapify, heappop, heappush\n\n\ndef main():\n input = stdin.buffer.readline\n n, m = map(int, input().split())\n a = list(map(int, input().split()))\n bc = [list(map(int, input().split())) for _ in range(m)]\n bc.sort(key=lambda x: -x[1])\n heapify(a)\n\n for i in range(m):\n b, c = bc[i]\n for _ in range(b):\n ai = heappop(a)\n if ai < c:\n heappush(a, c)\n else:\n heappush(a, ai)\n break\n\n print(sum(a))\n\n\nif __name__ == \"__main__\":\n setrecursionlimit(10000)\n main()\n","change":"replace","i1":8,"i2":12,"j1":8,"j2":14,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03038","language":"Python","original_status":"Time Limit Exceeded","pass":"import bisect\n\nn, m = map(int, input().split())\narr = list(sorted(list(map(int, input().split()))))\nbc = []\nfor _ in range(m):\n b, c = map(int, input().split())\n bc.append([b, c])\n\nbc = list(sorted(bc, key=lambda x: x[1], reverse=True))\nans = 0\n\nfor bci in bc:\n d = bisect.bisect_left(arr, bci[1])\n arr = arr[min(d, bci[0]) :]\n ans += min(d, bci[0]) * bci[1]\nprint(ans + sum(arr))\n","fail":"# \u66f8\u304d\u63db\u3048\u308b\u679a\u6570\u306f\u78ba\u5b9a\u3067\u304d\u308b\n# c\u306e\u5927\u304d\u3044\u9806\u306b\u3057\u305f\u3082\u306e\u3067a\u306e\u5c0f\u3055\u3044\u9806\u306b\u3057\u305f\u3082\u306e\u3092\u7f6e\u304d\u63db\u3048\u308b\u30a4\u30e1\u30fc\u30b8\n# \u306a\u3093\u304b\u5c3a\u53d6\u3063\u307d\u304f\u306a\u3063\u305f\n\nn, m = map(int, input().split())\narr = sorted(list(map(int, input().split())))\n\nbcs = []\nfor _ in range(m):\n bc = list(map(int, input().split()))\n bcs.append(bc)\n\nbcs = sorted(bcs, key=lambda x: x[1], reverse=True)\nans = 0\n\ni = 0\nfor b in bcs:\n while i < n and arr[i] < b[1] and b[0] > 0:\n ans += b[1]\n b[0] -= 1\n i += 1\nprint(ans + sum(arr[i:]))\n","change":"replace","i1":0,"i2":17,"j1":0,"j2":22,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03038","language":"Python","original_status":"Time Limit Exceeded","pass":"n, m = map(int, input().split())\nA = sorted(list(map(int, input().split())))\nC = []\nfor _ in range(m):\n b, c = map(int, input().split())\n C.extend([c] * b)\nC = sorted(C, reverse=True)\n\nans = 0\nfor i in range(n):\n try:\n ans += max(A[i], C[i])\n except IndexError:\n ans += A[i]\n\nprint(ans)\n","fail":"n, m = map(int, input().split())\nA = sorted(list(map(int, input().split())))\nBC = sorted(\n [list(map(int, input().split())) for _ in range(m)], key=lambda x: x[1], reverse=True\n)\n\nans = 0\nj = 0\nfor b, c in BC:\n for i in range(b):\n if j < n:\n ans += max(c, A[j])\n j += 1\n else:\n break\n\nif j < n:\n for i in range(n - j):\n ans += A[n - 1 - i]\n\nprint(ans)\n","change":"replace","i1":2,"i2":14,"j1":2,"j2":19,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03038","language":"Python","original_status":"Time Limit Exceeded","pass":"n, m = list(map(int, input().split()))\na = list(map(int, input().split()))\nbc = [[0] * 2] * m\n\nfor i in range(m):\n bc[i] = list(map(int, input().split()))\n\na.sort()\nbc = sorted(bc, key=lambda x: -x[1])\nnew = []\n\nfor e in bc:\n new.extend([e[1]] * e[0])\n\nfor i in range(min(n, len(new))):\n a[i] = max(a[i], new[i])\n\nprint(sum(a))\n","fail":"n, m = list(map(int, input().split()))\na = list(map(int, input().split()))\nbc = [[0] * 2] * m\n\nfor i in range(m):\n bc[i] = list(map(int, input().split()))\n\na.sort()\nbc = sorted(bc, key=lambda x: -x[1])\nnew = []\n\ncnt = 0\n\nfor e in bc:\n new += [e[1]] * e[0]\n cnt += e[0]\n\n if n <= cnt:\n break\n\nfor i in range(min(n, cnt)):\n a[i] = max(a[i], new[i])\n\nprint(sum(a))\n","change":"replace","i1":11,"i2":15,"j1":11,"j2":21,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03038","language":"Python","original_status":"Time Limit Exceeded","pass":"N, M = map(int, input().split())\nA_list = list(map(int, input().split()))\nA_list.sort()\n\nBC_list = [list(map(int, input().split())) for _ in range(M)]\nBC_list = [BC_list[i][1] for i in range(M) for _ in range(BC_list[i][0])]\nA_list.extend(BC_list)\nA_list.sort()\n\nprint(sum(A_list[-N:]))\n","fail":"N, M = map(int, input().split())\nA_list = list(map(int, input().split()))\nA_list.sort()\n\nBC_list = [list(map(int, input().split())) for _ in range(M)]\nBC_list = sorted(BC_list, key=lambda x: x[1])\n\nans = 0\ncount = 0\ni = N - 1\nm = M - 1\nwhile count < N:\n if A_list[i] < BC_list[m][1]:\n for _ in range(BC_list[m][0]):\n ans += BC_list[m][1]\n count += 1\n if count >= N:\n break\n m -= 1\n else:\n ans += A_list[i]\n count += 1\n i -= 1\n\n if m < 0:\n break\n\nfor _ in range(count, N):\n ans += A_list[i]\n i -= 1\n\nprint(ans)\n","change":"replace","i1":5,"i2":10,"j1":5,"j2":32,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03038","language":"Python","original_status":"Time Limit Exceeded","pass":"import sys\n\nn, m = list(map(int, input().split()))\naaa = list(map(int, input().split()))\nfor line in sys.stdin:\n b, c = list(map(int, line.split()))\n aaa = sorted(aaa + [c] * b, reverse=True)[:n]\nprint(sum(aaa))\n","fail":"import sys\n\nn, m = list(map(int, input().split()))\naaa = list(map(int, input().split()))\naaa.sort()\nbc = []\nfor line in sys.stdin:\n b, c = map(int, line.split())\n bc.append((c, b))\nbc.sort(reverse=True)\nans = 0\ncnt = 0\nfor c, b in bc:\n while aaa and aaa[-1] >= c and cnt < n:\n ans += aaa.pop()\n cnt += 1\n if cnt + b >= n:\n ans += c * (n - cnt)\n cnt = n\n break\n ans += c * b\n cnt += b\nif cnt < n:\n ans += sum(aaa[cnt - n :])\nprint(ans)\n","change":"replace","i1":4,"i2":8,"j1":4,"j2":25,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03038","language":"Python","original_status":"Time Limit Exceeded","pass":"N, M = map(int, input().split())\nAs = list(map(int, input().split()))\n\nfor _ in range(M):\n As.sort()\n b, c = map(int, input().split())\n for i in range(b):\n if As[i] < c:\n As[i] = c\n else:\n break\n\nprint(sum(As))\n","fail":"N, M = map(int, input().split())\nAs = list(map(int, input().split()))\nAs.sort(reverse=True)\n\nBCs = []\nfor _ in range(M):\n b, c = map(int, input().split())\n BCs.append({\"b\": b, \"c\": c})\n\nBCs = sorted(BCs, key=lambda bc: bc[\"c\"], reverse=True)\n# print(BCs)\n\nnew_cards = []\nfor i in range(M):\n new_cards += [BCs[i][\"c\"] for _ in range(BCs[i][\"b\"])]\n if len(new_cards) >= N:\n break\n\nif len(new_cards) < N:\n new_cards += [0 for _ in range(N - len(new_cards))]\n# print(new_cards)\n\nA_index = 0\nnew_index = 0\nnew_As = []\nfor i in range(N):\n if As[A_index] >= new_cards[new_index]:\n new_As.append(As[A_index])\n A_index += 1\n else:\n new_As.append(new_cards[new_index])\n new_index += 1\n\nprint(sum(new_As))\n","change":"replace","i1":2,"i2":13,"j1":2,"j2":34,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03038","language":"Python","original_status":"Time Limit Exceeded","pass":"[n, m] = [int(i) for i in input().split()]\na = [int(i) for i in input().split()]\n\nfor i in range(m):\n [b, c] = [int(i) for i in input().split()]\n a += [c for i in range(b)]\n\na.sort(reverse=True)\nprint(sum(a[:n]))\n","fail":"[n, m] = [int(i) for i in input().split()]\na = [int(i) for i in input().split()]\nl = [[int(j) for j in input().split()] for i in range(m)]\nl.sort(reverse=True, key=lambda x: x[1])\n\nk = []\nfor i in l:\n k += [i[1]] * i[0]\n if len(k) >= n:\n break\n\nk += a\nk.sort(reverse=True)\nprint(sum(k[:n]))\n","change":"replace","i1":2,"i2":9,"j1":2,"j2":14,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03038","language":"Python","original_status":"Time Limit Exceeded","pass":"n, m = map(int, input().split())\na = sorted(list(map(int, input().split())))\nmat = []\nfor _ in range(m):\n b, c = map(int, input().split())\n mat.extend([c] * b)\nmat = sorted(mat, reverse=True)[:n]\nfor i, t in enumerate(a):\n if i == len(mat):\n break\n if t < mat[i]:\n a[i] = mat[i]\n else:\n break\n\nprint(sum(a))\n","fail":"n, m = map(int, input().split())\na = sorted(list(map(int, input().split())))\nbc = [[0] * 2 for _ in range(m)]\nfor i in range(m):\n bc[i] = list(map(int, input().split()))\nbc = sorted(bc, key=lambda x: x[1], reverse=True)\nmat = []\nfor b, c in bc:\n if len(mat) + b > n:\n mat.extend([c] * (n - len(mat)))\n break\n else:\n mat.extend([c] * b)\n\nfor i, t in enumerate(a):\n if i == len(mat):\n break\n if t < mat[i]:\n a[i] = mat[i]\n else:\n break\n\nprint(sum(a))\n","change":"replace","i1":2,"i2":7,"j1":2,"j2":14,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03038","language":"Python","original_status":"Time Limit Exceeded","pass":"import sys\n\nN, M = map(int, input().split())\nA = list(map(int, sys.stdin.readline().rsplit()))\nA.sort()\nC = []\n\nfor _ in range(M):\n b, c = map(int, input().split())\n C.extend([c] * b)\n\nC.sort(reverse=True)\n\nres = 0\nfor i in range(N):\n if i < len(C):\n if A[i] < C[i]:\n res += C[i]\n else:\n res += A[i]\n else:\n res += A[i]\nprint(res)\n","fail":"import sys\n\nN, M = map(int, input().split())\nA = list(map(int, sys.stdin.readline().rsplit()))\nBC = [list(map(int, sys.stdin.readline().rsplit())) for _ in range(M)]\nA.sort()\nBC.sort(reverse=True, key=lambda x: x[1])\nC = []\n\nfor b, c in BC:\n if len(C) >= N:\n break\n for _ in range(b):\n C.append(c)\n\nC.sort(reverse=True)\n\nres = 0\nlenC = len(C)\nfor i in range(N):\n if i < lenC and A[i] < C[i]:\n res += C[i]\n else:\n res += A[i]\nprint(res)\n","change":"replace","i1":4,"i2":20,"j1":4,"j2":22,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03038","language":"Python","original_status":"Time Limit Exceeded","pass":"import bisect\n\nN, M = map(int, input().split())\nA = sorted(list(map(int, input().split())))\n\nBC = []\nfor _ in range(M):\n b, c = map(int, input().split())\n BC.append((b, c))\n\nBC.sort(reverse=True, key=lambda x: x[1])\n\nans, i = 0, 0\nfor bc in BC:\n ti = bisect.bisect(A[i:], bc[1]) + i\n if (ti > i) and (bc[0] >= (ti - i)):\n ans += bc[1] * (ti - i)\n i = ti\n elif (ti > i) and (bc[0] < (ti - i)):\n ans += bc[1] * bc[0]\n i = i + bc[0]\n\nprint(ans + sum(A[i:]))\n","fail":"import bisect\n\nN, M = map(int, input().split())\nA = sorted(list(map(int, input().split())))\n\nBC = []\nfor _ in range(M):\n b, c = map(int, input().split())\n BC.append((b, c))\n\nBC.sort(reverse=True, key=lambda x: x[1])\n\nans, i = 0, 0\nfor bc in BC:\n ti = bisect.bisect(A, bc[1])\n if (ti > i) and (bc[0] >= (ti - i)):\n ans += bc[1] * (ti - i)\n i = ti\n elif (ti > i) and (bc[0] < (ti - i)):\n ans += bc[1] * bc[0]\n i = i + bc[0]\n\nprint(ans + sum(A[i:]))\n","change":"replace","i1":14,"i2":15,"j1":14,"j2":15,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03038","language":"Python","original_status":"Time Limit Exceeded","pass":"import sys\n\nfin = sys.stdin.readline\n\nN, M = map(int, fin().split())\nAs = list(map(int, fin().split()))\nBC = [tuple(map(int, fin().split())) for _ in range(M)]\n\nAs = sorted(As)\n# BC = sorted(BC, key=lambda x: x[1], reverse=True)\n\nBC_ = {}\nfor num, val in BC:\n if val in BC_:\n BC_[val] += num\n else:\n BC_[val] = num\n\nBC_ = sorted(BC_.items(), reverse=True)\n\n#\n# def f(a, n, v):\n# if a[min(n-1, len(a)-1)] < v:\n# return v * min(n, len(a)), a[n:]\n# count = 0\n# for i in range(min(n, len(a))):\n# if a[i] < v:\n# count += 1\n# else:\n# break\n# return v * count, a[count:]\n\n\nsum__ = 0\nfor val, num in BC_:\n if len(As) == 0 or As[0] >= val:\n break\n\n if As[min(num - 1, len(As) - 1)] < val:\n sum_, As = val * min(num, len(As)), As[num:]\n else:\n count = 0\n for i in range(min(num, len(As))):\n if As[i] < val:\n count += 1\n else:\n break\n sum_, As = val * count, As[count:]\n sum__ += sum_\n\nprint(sum__ + sum(As))\n","fail":"import sys\n\nfin = sys.stdin.readline\n\nN, M = map(int, fin().split())\nAs = list(map(int, fin().split()))\nBC = [tuple(map(int, fin().split())) for _ in range(M)]\n\nAs = sorted(As)\n# BC = sorted(BC, key=lambda x: x[1], reverse=True)\n\nBC_ = {}\nfor num, val in BC:\n if val in BC_:\n BC_[val] += num\n else:\n BC_[val] = num\n\nBC_ = sorted(BC_.items(), reverse=True)\n\n#\n# def f(a, n, v):\n# if a[min(n-1, len(a)-1)] < v:\n# return v * min(n, len(a)), a[n:]\n# count = 0\n# for i in range(min(n, len(a))):\n# if a[i] < v:\n# count += 1\n# else:\n# break\n# return v * count, a[count:]\n\n\nsum__ = 0\nnow = 0\nfor val, num in BC_:\n if now >= len(As) or As[now] >= val:\n break\n\n if As[min(num - 1 + now, len(As) - 1)] < val:\n sum_ = val * min(num, len(As) - now)\n now += min(num, len(As) - now)\n else:\n count = 0\n for i in range(min(num, len(As) - now)):\n if As[i + now] < val:\n count += 1\n else:\n break\n sum_ = val * count\n now += count\n sum__ += sum_\n\nprint(sum__ + sum(As[now:]))\n","change":"replace","i1":34,"i2":51,"j1":34,"j2":54,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03038","language":"Python","original_status":"Time Limit Exceeded","pass":"import heapq\n\nn, m = map(int, input().split())\na = list(map(int, input().split()))\nheapq.heapify(a)\nbc = [list(map(int, input().split())) for _ in range(m)]\nfor b, c in bc:\n for _ in range(b):\n x = heapq.heappop(a)\n if c > x:\n heapq.heappush(a, c)\n else:\n heapq.heappush(a, x)\nprint(sum(a))\n","fail":"import heapq\n\nn, m = map(int, input().split())\na = list(map(int, input().split()))\nheapq.heapify(a)\nbc = [list(map(int, input().split())) for _ in range(m)]\nbc = sorted(bc, key=lambda x: -x[1])\nfor b, c in bc:\n for _ in range(b):\n x = heapq.heappop(a)\n if c > x:\n heapq.heappush(a, c)\n else:\n heapq.heappush(a, x)\n break\nprint(sum(a))\n","change":"replace","i1":6,"i2":13,"j1":6,"j2":15,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03038","language":"Python","original_status":"Time Limit Exceeded","pass":"def resolve():\n n, m = list(map(int, input().split()))\n a = list(map(int, input().split()))\n bc = list(list(map(int, input().split())) for _ in range(m))\n for b, c in bc:\n a += [c for _ in range(b)]\n print(sum(sorted(a, reverse=True)[:n]))\n\n\nif __name__ == \"__main__\":\n resolve()\n","fail":"def resolve():\n n, m = list(map(int, input().split()))\n a = list(map(int, input().split()))\n bc = list(list(map(int, input().split())) for _ in range(m))\n pairs = [(ai, 1) for ai in a]\n for b, c in bc:\n pairs.append((c, b))\n pairs.sort(key=lambda x: x[0], reverse=True)\n c = 0\n ans = 0\n for v, num in pairs:\n if c + num <= n:\n ans += v * num\n c += num\n else:\n ans += v * (n - c)\n break\n print(ans)\n\n\nif __name__ == \"__main__\":\n resolve()\n","change":"replace","i1":4,"i2":7,"j1":4,"j2":18,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03040","language":"Python","original_status":"Runtime Error","pass":"from heapq import heappush, heappushpop\n\nQ = int(input())\n\nb = 0\nla = []\nsl = 0\nra = []\nsr = 0\n\ncnt = 0\nfor _ in range(Q):\n q = map(int, input().split())\n # print(la, ra)\n if q[0] == 2:\n # \u6c42\u5024\n x = -la[0]\n cl = (cnt + 1) \/\/ 2\n cr = cnt - cl\n print(x, (cl * x - sl) + (sr - cr * x) + b)\n else:\n # \u66f4\u65b0\n b += q[2]\n cnt += 1\n if cnt % 2 == 1:\n sr += q[1]\n x = heappushpop(ra, q[1])\n sr -= x\n sl += x\n heappush(la, -x)\n else:\n sl += q[1]\n x = heappushpop(la, -q[1])\n x *= -1\n sl -= x\n sr += x\n heappush(ra, x)\n","fail":"from heapq import heappush, heappushpop\n\nQ = int(input())\n\nb = 0\nla = []\nsl = 0\nra = []\nsr = 0\n\ncnt = 0\nfor _ in range(Q):\n q = tuple(map(int, input().split()))\n # print(la, ra)\n if q[0] == 2:\n # \u6c42\u5024\n x = -la[0]\n cl = (cnt + 1) \/\/ 2\n cr = cnt - cl\n print(x, (cl * x - sl) + (sr - cr * x) + b)\n else:\n # \u66f4\u65b0\n b += q[2]\n cnt += 1\n if cnt % 2 == 1:\n sr += q[1]\n x = heappushpop(ra, q[1])\n sr -= x\n sl += x\n heappush(la, -x)\n else:\n sl += q[1]\n x = heappushpop(la, -q[1])\n x *= -1\n sl -= x\n sr += x\n heappush(ra, x)\n","change":"replace","i1":12,"i2":13,"j1":12,"j2":13,"error":"TypeError: 'map' object is not subscriptable","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03040\/Python\/s771493021.py\", line 15, in \n if q[0] == 2:\nTypeError: 'map' object is not subscriptable\n","stdout":null} {"problem_id":"p03040","language":"Python","original_status":"Runtime Error","pass":"# -*- coding: utf-8 -*-\nfrom heapq import heappush, heappop\n\nqn = int(input())\n\nlow = []\nhigh = []\nans = 0\nnum = 0\n\nfor i in range(qn):\n q = [int(i) for i in input().split()]\n if q[0] == 1:\n ans += q[2]\n a = q[1]\n if a < -low[0]:\n ans += -low[0] - a\n elif a > high[0]:\n ans += a - high[0]\n\n # low\u306f\u964d\u9806\u306b\u4e26\u3079\u305f\u3044\u306e\u3067-a\u3092\u5165\u308c\u308b\n heappush(low, -a)\n heappush(high, a)\n if -low[0] > high[0]:\n low0 = heappop(low)\n high0 = heappop(high)\n # low\u3068high\u3067\u6b63\u8ca0\u304c\u9006\u306a\u306e\u3067\u6ce8\u610f\u3059\u308b\n heappush(low, -high0)\n heappush(high, -low0)\n elif q[0] == 2:\n print(-low[0], ans)\n","fail":"# -*- coding: utf-8 -*-\nfrom heapq import heappush, heappop\n\nqn = int(input())\n\nlow = []\nhigh = []\nans = 0\n\nfor i in range(qn):\n q = [int(i) for i in input().split()]\n if q[0] == 1:\n ans += q[2]\n a = q[1]\n\n if len(low) >= 1:\n if a < -low[0]:\n ans += -low[0] - a\n elif a > high[0]:\n ans += a - high[0]\n\n # low\u306f\u964d\u9806\u306b\u4e26\u3079\u305f\u3044\u306e\u3067-a\u3092\u5165\u308c\u308b\n heappush(low, -a)\n heappush(high, a)\n if -low[0] > high[0]:\n low0 = heappop(low)\n high0 = heappop(high)\n # low\u3068high\u3067\u6b63\u8ca0\u304c\u9006\u306a\u306e\u3067\u6ce8\u610f\u3059\u308b\n heappush(low, -high0)\n heappush(high, -low0)\n\n elif q[0] == 2:\n print(-low[0], ans)\n","change":"replace","i1":8,"i2":29,"j1":8,"j2":31,"error":"IndexError: list index out of range","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03040\/Python\/s610424106.py\", line 16, in \n if a < -low[0]:\nIndexError: list index out of range\n","stdout":null} {"problem_id":"p03041","language":"Python","original_status":"Runtime Error","pass":"n, k = map(int, input().split())\ns = input()\n\nprint(s.replace(s[k], s[k].lower()))\n","fail":"n, k = map(int, input().split())\ns = input()\nprint(s[: k - 1] + s[k - 1].lower() + s[k:])\n","change":"replace","i1":2,"i2":4,"j1":2,"j2":3,"error":"WA","stderr":null,"stdout":"AbC\n"} {"problem_id":"p03041","language":"Python","original_status":"Runtime Error","pass":"n, k = map(int, input().split())\ns = list(input())\ns[k] = s[k].lower()\nprint(\"\".join(s))\n","fail":"n, k = map(int, input().split())\ns = list(input())\ns[k - 1] = s[k - 1].lower()\nprint(\"\".join(s))\n","change":"replace","i1":2,"i2":3,"j1":2,"j2":3,"error":"WA","stderr":null,"stdout":"AbC\n"} {"problem_id":"p03041","language":"Python","original_status":"Runtime Error","pass":"N, K = map(int, input().split())\nS = str(input())\nif S[K - 1] == \"A\":\n S[K - 1] = \"a\"\n print(\"\".join(S))\nelif S[K - 1] == \"B\":\n S[K - 1] = \"b\"\n print(\"\".join(S))\nelse:\n S[K - 1] = \"c\"\n print(\"\".join(S))\n","fail":"N, K = map(int, input().split())\nS = list(input())\nif S[K - 1] == \"A\":\n S[K - 1] = \"a\"\n print(\"\".join(S))\nelif S[K - 1] == \"B\":\n S[K - 1] = \"b\"\n print(\"\".join(S))\nelse:\n S[K - 1] = \"c\"\n print(\"\".join(S))\n","change":"replace","i1":1,"i2":2,"j1":1,"j2":2,"error":"TypeError: 'str' object does not support item assignment","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03041\/Python\/s243214892.py\", line 4, in \n S[K - 1] = \"a\"\nTypeError: 'str' object does not support item assignment\n","stdout":null} {"problem_id":"p03041","language":"Python","original_status":"Runtime Error","pass":"n, k = map(int, input().split())\ns = input()\ns[k - 1] = s[k - 1].lower()\nprint(s)\n","fail":"n, k = map(int, input().split())\ns = input()\nprint(s[: k - 1] + s[k - 1].lower() + s[k:])\n","change":"replace","i1":2,"i2":4,"j1":2,"j2":3,"error":"TypeError: 'str' object does not support item assignment","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03041\/Python\/s255611980.py\", line 3, in \n s[k - 1] = s[k - 1].lower()\nTypeError: 'str' object does not support item assignment\n","stdout":null} {"problem_id":"p03042","language":"Python","original_status":"Runtime Error","pass":"def ismonth(month):\n return 0 < month < 13\n\n\nS = input()\n\nformer = int(S[:2])\nlatter = int(S[2:])\n\nif former < 1 or latter < 1:\n ans = \"NA\"\n\nelif ismonth(former) and ismonth(latter):\n ans = \"AMBIGUOUS\"\n\nelif ismonth(former):\n ans = \"MMYY\"\n\nelif ismonth(latter):\n ans = \"YYMM\"\n\nprint(ans)\n","fail":"from datetime import datetime\n\nS = input()\nformer = int(S[:2])\nlatter = int(S[2:])\nYYMM = False\nMMYY = False\n\ntry:\n datetime(former + 2000, latter, 1)\n YYMM = True\nexcept:\n pass\n\ntry:\n datetime(latter + 2000, former, 1)\n MMYY = True\nexcept:\n pass\n\nif YYMM and MMYY:\n print(\"AMBIGUOUS\")\nelif YYMM:\n print(\"YYMM\")\nelif MMYY:\n print(\"MMYY\")\nelse:\n print(\"NA\")\n","change":"replace","i1":0,"i2":22,"j1":0,"j2":28,"error":0,"stderr":null,"stdout":"YYMM\n"} {"problem_id":"p03042","language":"Python","original_status":"Runtime Error","pass":"a = input()\nb = int(a[:2])\nc = int(a[2:])\nif 0 < b <= 12 and a < c <= 12:\n print(\"AMBIGUOUS\")\nelif 0 < b <= 12 and c > 12:\n print(\"MMYY\")\nelif b > 12 and 0 < c <= 12:\n print(\"YYMM\")\nelse:\n print(\"NA\")\n","fail":"a = input()\nb = int(a[:2])\nc = int(a[2:])\nif 0 < b <= 12 and 0 < c <= 12:\n print(\"AMBIGUOUS\")\nelif 0 < b <= 12:\n print(\"MMYY\")\nelif 0 < c <= 12:\n print(\"YYMM\")\nelse:\n print(\"NA\")\n","change":"replace","i1":3,"i2":8,"j1":3,"j2":8,"error":0,"stderr":null,"stdout":"YYMM\n"} {"problem_id":"p03042","language":"Python","original_status":"Runtime Error","pass":"#!\/usr\/bin\/env python3\nimport sys\n\n\ndef solve(S: int):\n\n S = str(S)\n\n if int(S[:2]) > 12 and 1 <= int(S[2:]) <= 12:\n print(\"YYMM\")\n elif 1 <= int(S[:2]) <= 12 and int(S[2:]) > 12:\n print(\"MMYY\")\n elif 1 <= int(S[:2]) <= 12 and 1 <= int(S[2:]) <= 12:\n print(\"AMBIGUOUS\")\n else:\n print(\"NA\")\n\n return\n\n\ndef main():\n def iterate_tokens():\n for line in sys.stdin:\n for word in line.split():\n yield word\n\n tokens = iterate_tokens()\n S = int(next(tokens)) # type: int\n solve(S)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"#!\/usr\/bin\/env python3\nimport sys\n\n\ndef solve(S: int):\n\n if 1 <= int(S[2:]) <= 12:\n if 1 <= int(S[:2]) <= 12:\n print(\"AMBIGUOUS\")\n else:\n print(\"YYMM\")\n else:\n if 1 <= int(S[:2]) <= 12:\n print(\"MMYY\")\n else:\n print(\"NA\")\n\n return\n\n\ndef main():\n def iterate_tokens():\n for line in sys.stdin:\n for word in line.split():\n yield word\n\n tokens = iterate_tokens()\n S = str(next(tokens)) # type: int\n solve(S)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":6,"i2":28,"j1":6,"j2":28,"error":0,"stderr":null,"stdout":"YYMM\n"} {"problem_id":"p03043","language":"Python","original_status":"Runtime Error","pass":"import math\n\nN, K = map(int, input().split())\np = 0\n\nfor i in range(1, min(K, N + 1)):\n print(math.ceil(math.log2(K \/ i)))\n p += 2 ** (-math.ceil(math.log2(K \/ i)))\n\np += max(0, N - K + 1)\nprint(p \/ N)\n","fail":"import math\n\nN, K = map(int, input().split())\np = 0\n\ncount = 1\nwhile True:\n p += (\n max(0, min(N + 1, math.ceil(K \/ 2 ** (count - 1))) - math.ceil(K \/ 2**count))\n * 0.5**count\n )\n count += 1\n if K \/ 2**count < 0.5:\n break\n\np += max(0, N - K + 1)\nprint(p \/ N)\n","change":"replace","i1":5,"i2":8,"j1":5,"j2":14,"error":"WA","stderr":null,"stdout":"4\n3\n2\n0.14583333333333334\n"} {"problem_id":"p03043","language":"Python","original_status":"Time Limit Exceeded","pass":"import decimal\n\n\ndef main():\n N, K = map(int, input().split())\n s = N\n c = 0\n while K > s:\n s *= 2\n c += 1\n cp = (1 \/ 2) ** c\n ans = decimal.Decimal((1 \/ N) * cp)\n cc = c\n for n in range(N - 1, 0, -1):\n s = n\n c = 0\n while K > s:\n s *= 2\n c += 1\n cp *= 1 \/ 2 ** (c - cc)\n ans += decimal.Decimal((1 \/ N) * cp)\n cc = c\n print(ans)\n\n\nmain()\n","fail":"import decimal\n\n\ndef main():\n N, K = map(int, input().split())\n ans = 0\n for n in range(1, N + 1):\n s = 0\n s += n\n c = 0\n while K > s:\n s *= 2\n c += 1\n ans += decimal.Decimal((1 \/ N) * (1 \/ 2) ** c)\n print(ans)\n\n\nmain()\n","change":"replace","i1":5,"i2":22,"j1":5,"j2":14,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03043","language":"Python","original_status":"Time Limit Exceeded","pass":"import decimal\n\n\ndef main():\n N, K = map(int, input().split())\n ans = 0\n for n in range(1, N + 1):\n s = n\n c = 1\n while K > s:\n s *= 2\n c \/= 2\n ans += decimal.Decimal((1 \/ N) * c)\n print(ans)\n\n\nmain()\n","fail":"def main():\n N, K = map(int, input().split())\n ans = 0\n for n in range(1, N + 1):\n s = n\n c = 1\n while K > s:\n s *= 2\n c \/= 2\n ans += (1 \/ N) * c\n print(ans)\n\n\nmain()\n","change":"replace","i1":0,"i2":13,"j1":0,"j2":10,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03043","language":"Python","original_status":"Time Limit Exceeded","pass":"from decimal import Decimal\n\nn, k = map(int, input().split())\nsum = Decimal(0.0)\nfor i in range(1, n + 1):\n p = Decimal(1.0 \/ n)\n score = i\n while score < k:\n score = score * 2\n p = p * Decimal(0.5)\n sum += p\nprint(str(sum)[:14])\n","fail":"n, k = map(int, input().split())\nsum = 0.0\nfor i in range(1, n + 1):\n p = 1.0 \/ n\n score = i\n while score < k:\n score = score * 2\n p = p * 0.5\n sum += p\nprint(sum)\n","change":"replace","i1":0,"i2":12,"j1":0,"j2":10,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03044","language":"Python","original_status":"Runtime Error","pass":"import sys\nfrom io import StringIO\nimport unittest\nimport os\n\nsys.setrecursionlimit(9999999999)\n\n\ndef dfs(now, edge, colors):\n # \u679d\u3092\u5168\u3066\u8abf\u67fb\n for i in edge[now]:\n # \u8272\u3092\u8a2d\u5b9a\u6e08\u307f\u306a\u3089\u4f55\u3082\u3057\u306a\u3044\n if not colors[i[0]] == -1:\n continue\n\n # \u8272\u306e\u8a2d\u5b9a\n # \u89aa\u5b50\u306e\u8ddd\u96e2%2(\u5076\u65700:\u5947\u6570:1) + \u89aa(\u5076\u65700:\u5947\u6570:1) \u306e\u4f59\u308a\u3092\u5b50\u306b\u8a2d\u5b9a(\u5076\u6570\u306a\u30890 \u5947\u6570\u306a\u30891\u3092\u8a2d\u5b9a\u3067\u304d\u308b\u30ed\u30b8\u30c3\u30af)\n colors[i[0]] = (i[1] % 2 + colors[now]) % 2\n\n # \u518d\u5e30\u51e6\u7406\n dfs(i[0], edge, colors)\n\n\n# \u5b9f\u88c5\u3092\u884c\u3046\u95a2\u6570\ndef resolve():\n n = int(input())\n uvw = [list(map(int, input().split())) for i in range(n - 1)]\n\n edge = [[] for i in range(n + 1)]\n\n # \u4f8b\uff1aedge[0] = [[1, 100][2, 300]]\n # \u70b90\u306f\u70b91\u3068\u8ddd\u96e2100\u3001\u70b92\u3068\u8ddd\u96e2300\u3067\u3064\u306a\u304c\u3063\u3066\u3044\u308b\u3002\n for i in uvw:\n edge[i[0]].append([i[1], i[2]])\n edge[i[1]].append([i[0], i[2]])\n\n # -1\u306f\u300c\u672a\u8a2d\u5b9a\u300d\u306e\u610f\u5473\n colors = [-1 for i in range(n + 1)]\n\n # \u521d\u671f(\u9069\u5f53\u306a\u70b9\u3092\u9ed2\u306b\u5857\u308b)\n colors[1] = 1\n\n dfs(1, edge, colors)\n\n for i in range(1, len(colors)):\n print(colors[i])\n\n\n# \u30c6\u30b9\u30c8\u30af\u30e9\u30b9\nclass TestClass(unittest.TestCase):\n def assertIO(self, assert_input, output):\n stdout, sat_in = sys.stdout, sys.stdin\n sys.stdout, sys.stdin = StringIO(), StringIO(assert_input)\n resolve()\n sys.stdout.seek(0)\n out = sys.stdout.read()[:-1]\n sys.stdout, sys.stdin = stdout, sat_in\n self.assertEqual(out, output)\n\n def test_input_1(self):\n test_input = \"\"\"3\n1 2 2\n2 3 1\"\"\"\n output = \"\"\"0\n0\n1\"\"\"\n self.assertIO(test_input, output)\n\n def test_input_2(self):\n test_input = \"\"\"5\n2 5 2\n2 3 10\n1 3 8\n3 4 2\"\"\"\n output = \"\"\"1\n0\n1\n0\n1\"\"\"\n self.assertIO(test_input, output)\n\n # \u81ea\u4f5c\u30c6\u30b9\u30c8\u30d1\u30bf\u30fc\u30f3\u306e\u3072\u306a\u5f62(\u5229\u7528\u6642\u306f\u300ctes_t\u300d\u306e\u30a2\u30f3\u30c0\u30fc\u30d0\u30fc\u3092\u524a\u9664\u3059\u308b\u3053\u3068\n def tes_t_1original_1(self):\n test_input = \"\"\"\u30c7\u30fc\u30bf\"\"\"\n output = \"\"\"\u30c7\u30fc\u30bf\"\"\"\n self.assertIO(test_input, output)\n\n\n# \u5b9f\u88c5or\u30c6\u30b9\u30c8\u306e\u547c\u3073\u51fa\u3057\nif __name__ == \"__main__\":\n if os.environ.get(\"USERNAME\") is None:\n # AtCoder\u63d0\u51fa\u6642\u306e\u5834\u5408\n resolve()\n\n else:\n # \u81eaPC\u306e\u5834\u5408\n unittest.main()\n","fail":"import sys\nfrom io import StringIO\nimport unittest\nimport os\n\nsys.setrecursionlimit(999999999)\n\n\ndef dfs(now, edge, colors):\n # \u679d\u3092\u5168\u3066\u8abf\u67fb\n for i in edge[now]:\n # \u8272\u3092\u8a2d\u5b9a\u6e08\u307f\u306a\u3089\u4f55\u3082\u3057\u306a\u3044\n if not colors[i[0]] == -1:\n continue\n\n # \u8272\u306e\u8a2d\u5b9a\n # \u89aa\u5b50\u306e\u8ddd\u96e2%2(\u5076\u65700:\u5947\u6570:1) + \u89aa(\u5076\u65700:\u5947\u6570:1) \u306e\u4f59\u308a\u3092\u5b50\u306b\u8a2d\u5b9a(\u5076\u6570\u306a\u30890 \u5947\u6570\u306a\u30891\u3092\u8a2d\u5b9a\u3067\u304d\u308b\u30ed\u30b8\u30c3\u30af)\n colors[i[0]] = (i[1] % 2 + colors[now]) % 2\n\n # \u518d\u5e30\u51e6\u7406\n dfs(i[0], edge, colors)\n\n\n# \u5b9f\u88c5\u3092\u884c\u3046\u95a2\u6570\ndef resolve():\n n = int(input())\n uvw = [list(map(int, input().split())) for i in range(n - 1)]\n\n edge = [[] for i in range(n + 1)]\n\n # \u4f8b\uff1aedge[0] = [[1, 100][2, 300]]\n # \u70b90\u306f\u70b91\u3068\u8ddd\u96e2100\u3001\u70b92\u3068\u8ddd\u96e2300\u3067\u3064\u306a\u304c\u3063\u3066\u3044\u308b\u3002\n for i in uvw:\n edge[i[0]].append([i[1], i[2]])\n edge[i[1]].append([i[0], i[2]])\n\n # -1\u306f\u300c\u672a\u8a2d\u5b9a\u300d\u306e\u610f\u5473\n colors = [-1 for i in range(n + 1)]\n\n # \u521d\u671f(\u9069\u5f53\u306a\u70b9\u3092\u9ed2\u306b\u5857\u308b)\n colors[1] = 1\n\n dfs(1, edge, colors)\n\n for i in range(1, len(colors)):\n print(colors[i])\n\n\n# \u30c6\u30b9\u30c8\u30af\u30e9\u30b9\nclass TestClass(unittest.TestCase):\n def assertIO(self, assert_input, output):\n stdout, sat_in = sys.stdout, sys.stdin\n sys.stdout, sys.stdin = StringIO(), StringIO(assert_input)\n resolve()\n sys.stdout.seek(0)\n out = sys.stdout.read()[:-1]\n sys.stdout, sys.stdin = stdout, sat_in\n self.assertEqual(out, output)\n\n def test_input_1(self):\n test_input = \"\"\"3\n1 2 2\n2 3 1\"\"\"\n output = \"\"\"0\n0\n1\"\"\"\n self.assertIO(test_input, output)\n\n def test_input_2(self):\n test_input = \"\"\"5\n2 5 2\n2 3 10\n1 3 8\n3 4 2\"\"\"\n output = \"\"\"1\n0\n1\n0\n1\"\"\"\n self.assertIO(test_input, output)\n\n # \u81ea\u4f5c\u30c6\u30b9\u30c8\u30d1\u30bf\u30fc\u30f3\u306e\u3072\u306a\u5f62(\u5229\u7528\u6642\u306f\u300ctes_t\u300d\u306e\u30a2\u30f3\u30c0\u30fc\u30d0\u30fc\u3092\u524a\u9664\u3059\u308b\u3053\u3068\n def tes_t_1original_1(self):\n test_input = \"\"\"\u30c7\u30fc\u30bf\"\"\"\n output = \"\"\"\u30c7\u30fc\u30bf\"\"\"\n self.assertIO(test_input, output)\n\n\n# \u5b9f\u88c5or\u30c6\u30b9\u30c8\u306e\u547c\u3073\u51fa\u3057\nif __name__ == \"__main__\":\n if os.environ.get(\"USERNAME\") is None:\n # AtCoder\u63d0\u51fa\u6642\u306e\u5834\u5408\n resolve()\n\n else:\n # \u81eaPC\u306e\u5834\u5408\n unittest.main()\n","change":"replace","i1":5,"i2":6,"j1":5,"j2":6,"error":"OverflowError: Python int too large to convert to C int","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03044\/Python\/s708960220.py\", line 6, in \n sys.setrecursionlimit(9999999999)\nOverflowError: Python int too large to convert to C int\n","stdout":null} {"problem_id":"p03044","language":"Python","original_status":"Runtime Error","pass":"class Tree:\n WHITE = 0\n GRAY = 1\n BLACK = 2\n\n def __init__(self, adj):\n n = len(adj)\n self.adj = adj\n self.colors = [self.WHITE] * n\n self.depths = [-1] * n\n self.depth = 0\n\n def dfs(self, u):\n if self.colors[u] == self.BLACK:\n return\n\n self.colors[u] = self.GRAY\n self.depths[u] = self.depth\n\n for v, w in self.adj[u]:\n if self.colors[v] == self.WHITE:\n self.depth += w\n self.dfs(v)\n self.depth -= w\n\n self.colors[u] = self.BLACK\n\n\nif __name__ == \"__main__\":\n n = int(input())\n uvw = [list(map(int, input().split())) for _ in range(n - 1)]\n\n g = [[] for _ in range(n)]\n\n for u, v, w in uvw:\n u -= 1\n v -= 1\n g[u].append((v, w))\n g[v].append((u, w))\n\n tree = Tree(g)\n tree.dfs(0)\n ans = [x % 2 for x in tree.depths]\n print(*ans, sep=\"\\\\n\")\n","fail":"import sys\n\nsys.setrecursionlimit(10**6)\n\n\nclass Tree:\n WHITE = 0\n GRAY = 1\n BLACK = 2\n\n def __init__(self, adj):\n n = len(adj)\n self.adj = adj\n self.colors = [self.WHITE] * n\n self.depths = [-1] * n\n self.depth = 0\n\n def dfs(self, u):\n if self.colors[u] == self.BLACK:\n return\n\n self.colors[u] = self.GRAY\n self.depths[u] = self.depth\n\n for v, w in self.adj[u]:\n if self.colors[v] == self.WHITE:\n self.depth += w\n self.dfs(v)\n self.depth -= w\n\n self.colors[u] = self.BLACK\n\n\nif __name__ == \"__main__\":\n n = int(input())\n uvw = [list(map(int, input().split())) for _ in range(n - 1)]\n\n g = [[] for _ in range(n)]\n\n for u, v, w in uvw:\n u -= 1\n v -= 1\n g[u].append((v, w))\n g[v].append((u, w))\n\n tree = Tree(g)\n tree.dfs(0)\n ans = [x % 2 for x in tree.depths]\n print(*ans, sep=\"\\\\n\")\n","change":"insert","i1":0,"i2":0,"j1":0,"j2":5,"error":"0","stderr":null,"stdout":"0\n0\n1\n"} {"problem_id":"p03044","language":"Python","original_status":"Runtime Error","pass":"N = int(input())\nG = [[] for _ in range(N)]\nfor _ in range(N - 1):\n u, v, w = map(int, input().split())\n u -= 1\n v -= 1\n G[u].append((v, w))\n G[v].append((u, w))\n\nC = [-1 for _ in range(N)]\n\n\ndef dfs(pos, color):\n for e in G[pos]:\n if C[e[0]] != -1:\n continue\n # odd\n if e[1] & 1:\n c = 1 - color\n C[e[0]] = c\n dfs(e[0], c)\n # even\n else:\n c = color\n C[e[0]] = c\n dfs(e[0], c)\n\n\nC[0] = 0\ndfs(0, 0)\nfor i in range(N):\n print(C[i])\n","fail":"import sys\n\nsys.setrecursionlimit(100000)\n\nN = int(input())\nG = [[] for _ in range(N)]\nfor _ in range(N - 1):\n u, v, w = map(int, input().split())\n u -= 1\n v -= 1\n G[u].append((v, w))\n G[v].append((u, w))\n\nC = [-1 for _ in range(N)]\n\n\ndef dfs(pos, color):\n C[pos] = color\n for e in G[pos]:\n if C[e[0]] != -1:\n continue\n # odd\n if e[1] & 1:\n c = 1 - color\n dfs(e[0], c)\n # even\n else:\n c = color\n dfs(e[0], c)\n\n\ndfs(0, 0)\nfor i in range(N):\n print(C[i])\n","change":"replace","i1":0,"i2":29,"j1":0,"j2":31,"error":"0","stderr":null,"stdout":"0\n0\n1\n"} {"problem_id":"p03044","language":"Python","original_status":"Runtime Error","pass":"import sys\nfrom io import StringIO\nimport unittest\nimport os\n\n\ndef dfs(now, edge, colors):\n # \u679d\u3092\u5168\u3066\u8abf\u67fb\n for i in edge[now]:\n # \u8272\u3092\u8a2d\u5b9a\u6e08\u307f\u306a\u3089\u4f55\u3082\u3057\u306a\u3044\n if not colors[i[0]] == -1:\n continue\n\n # \u8272\u306e\u8a2d\u5b9a\n # \u89aa\u5b50\u306e\u8ddd\u96e2%2(\u5076\u65700:\u5947\u6570:1) + \u89aa(\u5076\u65700:\u5947\u6570:1) \u306e\u4f59\u308a\u3092\u5b50\u306b\u8a2d\u5b9a(\u5076\u6570\u306a\u30890 \u5947\u6570\u306a\u30891\u3092\u8a2d\u5b9a\u3067\u304d\u308b\u30ed\u30b8\u30c3\u30af)\n colors[i[0]] = (i[1] % 2 + colors[now]) % 2\n\n # \u518d\u5e30\u51e6\u7406\n dfs(i[0], edge, colors)\n\n\n# \u5b9f\u88c5\u3092\u884c\u3046\u95a2\u6570\ndef resolve():\n n = int(input())\n uvw = [list(map(int, input().split())) for i in range(n - 1)]\n\n edge = [[] for i in range(n + 1)]\n\n # \u4f8b\uff1aedge[0] = [[1, 100][2, 300]]\n # \u70b90\u306f\u70b91\u3068\u8ddd\u96e2100\u3001\u70b92\u3068\u8ddd\u96e2300\u3067\u3064\u306a\u304c\u3063\u3066\u3044\u308b\u3002\n for i in uvw:\n edge[i[0]].append([i[1], i[2]])\n edge[i[1]].append([i[0], i[2]])\n\n # -1\u306f\u300c\u672a\u8a2d\u5b9a\u300d\u306e\u610f\u5473\n colors = [-1 for i in range(n + 1)]\n\n # \u521d\u671f(\u9069\u5f53\u306a\u70b9\u3092\u9ed2\u306b\u5857\u308b)\n colors[1] = 1\n\n dfs(1, edge, colors)\n\n for i in range(1, len(colors)):\n print(colors[i])\n\n\n# \u30c6\u30b9\u30c8\u30af\u30e9\u30b9\nclass TestClass(unittest.TestCase):\n def assertIO(self, assert_input, output):\n stdout, sat_in = sys.stdout, sys.stdin\n sys.stdout, sys.stdin = StringIO(), StringIO(assert_input)\n resolve()\n sys.stdout.seek(0)\n out = sys.stdout.read()[:-1]\n sys.stdout, sys.stdin = stdout, sat_in\n self.assertEqual(out, output)\n\n def test_input_1(self):\n test_input = \"\"\"3\n1 2 2\n2 3 1\"\"\"\n output = \"\"\"0\n0\n1\"\"\"\n self.assertIO(test_input, output)\n\n def test_input_2(self):\n test_input = \"\"\"5\n2 5 2\n2 3 11\n1 3 8\n3 4 2\"\"\"\n output = \"\"\"1\n0\n1\n0\n1\"\"\"\n self.assertIO(test_input, output)\n\n # \u81ea\u4f5c\u30c6\u30b9\u30c8\u30d1\u30bf\u30fc\u30f3\u306e\u3072\u306a\u5f62(\u5229\u7528\u6642\u306f\u300ctes_t\u300d\u306e\u30a2\u30f3\u30c0\u30fc\u30d0\u30fc\u3092\u524a\u9664\u3059\u308b\u3053\u3068\n def tes_t_1original_1(self):\n test_input = \"\"\"\u30c7\u30fc\u30bf\"\"\"\n output = \"\"\"\u30c7\u30fc\u30bf\"\"\"\n self.assertIO(test_input, output)\n\n\n# \u5b9f\u88c5or\u30c6\u30b9\u30c8\u306e\u547c\u3073\u51fa\u3057\nif __name__ == \"__main__\":\n if os.environ.get(\"USERNAME\") is None:\n # AtCoder\u63d0\u51fa\u6642\u306e\u5834\u5408\n resolve()\n\n else:\n # \u81eaPC\u306e\u5834\u5408\n unittest.main()\n","fail":"import sys\nfrom io import StringIO\nimport unittest\nimport os\n\nsys.setrecursionlimit(1000000)\n\n\ndef dfs(now, edge, colors):\n # \u679d\u3092\u5168\u3066\u8abf\u67fb\n for i in edge[now]:\n # \u8272\u3092\u8a2d\u5b9a\u6e08\u307f\u306a\u3089\u4f55\u3082\u3057\u306a\u3044\n if not colors[i[0]] == -1:\n continue\n\n # \u8272\u306e\u8a2d\u5b9a\n # \u89aa\u5b50\u306e\u8ddd\u96e2%2(\u5076\u65700:\u5947\u6570:1) + \u89aa(\u5076\u65700:\u5947\u6570:1) \u306e\u4f59\u308a\u3092\u5b50\u306b\u8a2d\u5b9a(\u5076\u6570\u306a\u30890 \u5947\u6570\u306a\u30891\u3092\u8a2d\u5b9a\u3067\u304d\u308b\u30ed\u30b8\u30c3\u30af)\n colors[i[0]] = (i[1] % 2 + colors[now]) % 2\n\n # \u518d\u5e30\u51e6\u7406\n dfs(i[0], edge, colors)\n\n\n# \u5b9f\u88c5\u3092\u884c\u3046\u95a2\u6570\ndef resolve():\n n = int(input())\n uvw = [list(map(int, input().split())) for i in range(n - 1)]\n\n edge = [[] for i in range(n + 1)]\n\n # \u4f8b\uff1aedge[0] = [[1, 100][2, 300]]\n # \u70b90\u306f\u70b91\u3068\u8ddd\u96e2100\u3001\u70b92\u3068\u8ddd\u96e2300\u3067\u3064\u306a\u304c\u3063\u3066\u3044\u308b\u3002\n for i in uvw:\n edge[i[0]].append([i[1], i[2]])\n edge[i[1]].append([i[0], i[2]])\n\n # -1\u306f\u300c\u672a\u8a2d\u5b9a\u300d\u306e\u610f\u5473\n colors = [-1 for i in range(n + 1)]\n\n # \u521d\u671f(\u9069\u5f53\u306a\u70b9\u3092\u9ed2\u306b\u5857\u308b)\n colors[1] = 1\n\n dfs(1, edge, colors)\n\n for i in range(1, len(colors)):\n print(colors[i])\n\n\n# \u30c6\u30b9\u30c8\u30af\u30e9\u30b9\nclass TestClass(unittest.TestCase):\n def assertIO(self, assert_input, output):\n stdout, sat_in = sys.stdout, sys.stdin\n sys.stdout, sys.stdin = StringIO(), StringIO(assert_input)\n resolve()\n sys.stdout.seek(0)\n out = sys.stdout.read()[:-1]\n sys.stdout, sys.stdin = stdout, sat_in\n self.assertEqual(out, output)\n\n def test_input_1(self):\n test_input = \"\"\"3\n1 2 2\n2 3 1\"\"\"\n output = \"\"\"0\n0\n1\"\"\"\n self.assertIO(test_input, output)\n\n def test_input_2(self):\n test_input = \"\"\"5\n2 5 2\n2 3 10\n1 3 8\n3 4 2\"\"\"\n output = \"\"\"1\n0\n1\n0\n1\"\"\"\n self.assertIO(test_input, output)\n\n # \u81ea\u4f5c\u30c6\u30b9\u30c8\u30d1\u30bf\u30fc\u30f3\u306e\u3072\u306a\u5f62(\u5229\u7528\u6642\u306f\u300ctes_t\u300d\u306e\u30a2\u30f3\u30c0\u30fc\u30d0\u30fc\u3092\u524a\u9664\u3059\u308b\u3053\u3068\n def tes_t_1original_1(self):\n test_input = \"\"\"\u30c7\u30fc\u30bf\"\"\"\n output = \"\"\"\u30c7\u30fc\u30bf\"\"\"\n self.assertIO(test_input, output)\n\n\n# \u5b9f\u88c5or\u30c6\u30b9\u30c8\u306e\u547c\u3073\u51fa\u3057\nif __name__ == \"__main__\":\n if os.environ.get(\"USERNAME\") is None:\n # AtCoder\u63d0\u51fa\u6642\u306e\u5834\u5408\n resolve()\n\n else:\n # \u81eaPC\u306e\u5834\u5408\n unittest.main()\n","change":"replace","i1":4,"i2":70,"j1":4,"j2":72,"error":"WA","stderr":null,"stdout":"1\n1\n0\n"} {"problem_id":"p03044","language":"Python","original_status":"Runtime Error","pass":"def dfs(v, p, c):\n for u, w in tree[v]:\n res[v] = c\n if u == p:\n continue\n else:\n if w % 2 == 0:\n dfs(u, v, c)\n else:\n dfs(u, v, c + 1)\n\n\nn = int(input())\ntree = [[] for _ in range(n)]\nfor _ in range(n - 1):\n u, v, w = map(int, input().split())\n tree[u - 1].append([v - 1, w])\n tree[v - 1].append([u - 1, w])\n\nres = [0 for _ in range(n)]\ndfs(0, -1, 0)\n\nfor i in res:\n print(i)\n","fail":"import sys\n\nsys.setrecursionlimit(10**9)\n\n\ndef dfs(v, p, dist):\n for u, w in tree[v]:\n if u == p:\n continue\n else:\n dist[u] = dist[v] + w\n dfs(u, v, dist)\n\n\nn = int(input())\ntree = [[] for _ in range(n)]\nfor _ in range(n - 1):\n u, v, w = map(int, input().split())\n tree[u - 1].append((v - 1, w))\n tree[v - 1].append((u - 1, w))\n\ndist = [0 for _ in range(n)]\ndfs(0, -1, dist)\n\nfor i in dist:\n if i % 2 == 0:\n print(0)\n else:\n print(1)\n","change":"replace","i1":0,"i2":24,"j1":0,"j2":29,"error":"0","stderr":null,"stdout":"0\n0\n1\n"} {"problem_id":"p03044","language":"Python","original_status":"Runtime Error","pass":"import sys\nfrom collections import defaultdict\n\ninput = sys.stdin.readline\n\nN = int(input())\nG = defaultdict(list)\nfor _ in range(N - 1):\n u, v, w = map(int, input().split())\n G[u - 1].append((v - 1, w))\n G[v - 1].append((u - 1, w))\nres = [None] * N\n\n\ndef dfs(v, c):\n res[v] = c\n for u, w in G[v]:\n if res[u] is not None:\n continue\n if w % 2 == 0:\n dfs(u, c)\n else:\n dfs(u, 1 - c)\n\n\ndfs(0, 0)\nfor x in res:\n print(x)\n","fail":"import sys\nfrom collections import defaultdict\n\nsys.setrecursionlimit(100000)\ninput = sys.stdin.readline\n\nN = int(input())\nG = defaultdict(list)\nfor _ in range(N - 1):\n u, v, w = map(int, input().split())\n G[u - 1].append((v - 1, w))\n G[v - 1].append((u - 1, w))\nres = [None] * N\n\n\ndef dfs(v, c):\n res[v] = c\n for u, w in G[v]:\n if res[u] is not None:\n continue\n if w % 2 == 0:\n dfs(u, c)\n else:\n dfs(u, 1 - c)\n\n\ndfs(0, 0)\nfor x in res:\n print(x)\n","change":"insert","i1":3,"i2":3,"j1":3,"j2":4,"error":"0","stderr":null,"stdout":"0\n0\n1\n"} {"problem_id":"p03044","language":"Python","original_status":"Runtime Error","pass":"N = int(input())\n\nneighbors = [[] for _ in range(N + 1)]\nfor _ in range(N - 1):\n u, v, w = map(int, input().split())\n neighbors[u].append((v, w))\n neighbors[v].append((u, w))\n\nans = [None for _ in range(N)]\n\n\ndef dfs(v, p, c):\n ans[v - 1] = c\n for next_v, distance in neighbors[v]:\n if next_v == p:\n continue\n next_c = c if distance % 2 == 0 else 1 - c\n dfs(next_v, v, next_c)\n\n\ndfs(1, -1, 0)\nfor e in ans:\n print(e)\n","fail":"import sys\n\nsys.setrecursionlimit(200000)\n\nN = int(input())\n\nneighbors = [[] for _ in range(N + 1)]\nfor _ in range(N - 1):\n u, v, w = map(int, input().split())\n neighbors[u].append((v, w))\n neighbors[v].append((u, w))\n\nans = [None for _ in range(N)]\n\n\ndef dfs(v, p, c):\n ans[v - 1] = c\n for next_v, distance in neighbors[v]:\n if next_v == p:\n continue\n next_c = c if distance % 2 == 0 else 1 - c\n dfs(next_v, v, next_c)\n\n\ndfs(1, -1, 0)\nfor e in ans:\n print(e)\n","change":"insert","i1":0,"i2":0,"j1":0,"j2":4,"error":"0","stderr":null,"stdout":"0\n0\n1\n"} {"problem_id":"p03044","language":"Python","original_status":"Time Limit Exceeded","pass":"import networkx as nx\n\nN = int(input())\n\nUVW = [list(map(int, input().split())) for _ in range(N - 1)]\n\nG = nx.Graph()\n\ncolor = [0 for _ in range(N)] # 0: tbd\uff0c1: white, 2: black\n\nfor u, v, w in UVW:\n G.add_edge(u - 1, v - 1, weight=w)\n\ncolor[0] = -1\n\nfor i in range(N - 1):\n if color[i] == 0 or i == 0:\n for j in range(i + 1, N):\n if color[j] == 0:\n d = nx.shortest_path_length(G, source=i, target=j, weight=\"weight\")\n if int(d + 0.5) % 2 == 0:\n color[j] = color[i]\n else:\n color[j] = color[i] * -1\n\nans = [1 if i == -1 else 0 for i in color]\nprint(*ans)\n","fail":"import networkx as nx\n\nN = int(input())\nUVW = [list(map(int, input().split())) for _ in range(N - 1)]\n\nG = nx.Graph()\n\ncolor = [0 for _ in range(N)]\n\nfor u, v, w in UVW:\n G.add_edge(u - 1, v - 1, weight=w)\n\ncolor[0] = -1\n\npred, dist = nx.dijkstra_predecessor_and_distance(G, 0)\n\nc = [dist[i] for i in range(N)]\nans = [1 if i % 2 == 0 else 0 for i in c]\nprint(*ans)\n","change":"replace","i1":3,"i2":26,"j1":3,"j2":18,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03044","language":"Python","original_status":"Runtime Error","pass":"def dfs(i, d):\n # print(i, d)\n for j, w in node_array[i]:\n if color_array[j] == -1:\n color_array[j] = (d + w) % 2\n dfs(j, d + w)\n\n\nN = int(input())\nnode_array = [[] for i in range(N)]\ncolor_array = [-1] * N\n\nfor _ in range(N - 1):\n i, j, w = map(int, input().split())\n node_array[i - 1].append((j - 1, w))\n node_array[j - 1].append((i - 1, w))\n\ncolor_array[0] = 0\ndfs(0, 0)\n\nfor i in range(N):\n print(color_array[i])\n","fail":"from sys import setrecursionlimit\n\nsetrecursionlimit(10**8)\n\n\ndef dfs(i, d):\n # print(i, d)\n for j, w in node_array[i]:\n if color_array[j] == -1:\n color_array[j] = (d + w) % 2\n dfs(j, d + w)\n\n\nN = int(input())\nnode_array = [[] for i in range(N)]\ncolor_array = [-1] * N\n\nfor _ in range(N - 1):\n i, j, w = map(int, input().split())\n node_array[i - 1].append((j - 1, w))\n node_array[j - 1].append((i - 1, w))\n\ncolor_array[0] = 0\ndfs(0, 0)\n\nfor i in range(N):\n print(color_array[i])\n","change":"insert","i1":0,"i2":0,"j1":0,"j2":5,"error":"0","stderr":null,"stdout":"0\n0\n1\n"} {"problem_id":"p03044","language":"Python","original_status":"Runtime Error","pass":"from collections import deque\n\nN = int(input())\ngraph = [[] for _ in range(N)]\nfor _ in range(N - 1):\n u, v, w = map(int, input().split())\n u, v, w = u - 1, v - 1, w % 2\n graph[u].append([v, w])\n graph[v].append([u, w])\n\ncolors = [-1 for _ in range(N)]\nstack = deque()\nstack.append(0)\ncolors[0] = 0\n\nwhile stack:\n n = stack.pop()\n for _next, w in graph[n]:\n if colors[_next] != -1:\n continue\n colors[_next] = (colors[n] + w) % 2\n stack.append([_next])\n\nfor c in colors:\n print(c)\n","fail":"from collections import deque\n\nN = int(input())\ngraph = [[] for _ in range(N)]\nfor _ in range(N - 1):\n u, v, w = map(int, input().split())\n u, v = u - 1, v - 1\n graph[u].append([v, w])\n graph[v].append([u, w])\n\ncolors = [-1 for _ in range(N)]\nstack = deque()\nstack.append(0)\ncolors[0] = 0\n\nwhile stack:\n n = stack.popleft()\n for _next, w in graph[n]:\n if colors[_next] != -1:\n continue\n colors[_next] = (colors[n] + w) % 2\n stack.append(_next)\n\nfor c in colors:\n print(c)\n","change":"replace","i1":6,"i2":22,"j1":6,"j2":22,"error":"TypeError: list indices must be integers or slices, not list","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03044\/Python\/s113709906.py\", line 18, in \n for _next, w in graph[n]:\nTypeError: list indices must be integers or slices, not list\n","stdout":null} {"problem_id":"p03045","language":"Python","original_status":"Time Limit Exceeded","pass":"from scipy.sparse import lil_matrix\nfrom scipy.sparse.csgraph import connected_components\n\nN, M = map(int, input().split())\nmatr = lil_matrix((N, N))\n\nfor _ in range(M):\n x, y, z = map(int, input().split())\n matr[x - 1, y - 1] = matr[y - 1, x - 1] = 1\n\nmatr = matr.tocsr()\nprint(connected_components(matr, return_labels=False))\n","fail":"import numpy as np\nfrom scipy.sparse import csr_matrix\nfrom scipy.sparse.csgraph import connected_components\n\nN, M = map(int, input().split())\nedge = np.array([input().split() for _ in range(M)], dtype=np.int64).T\n\nmatr = csr_matrix(([1 for _ in range(M)], (edge[:2] - 1)), (N, N))\nprint(connected_components(matr, return_labels=False))\n","change":"replace","i1":0,"i2":11,"j1":0,"j2":8,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03045","language":"Python","original_status":"Time Limit Exceeded","pass":"n, m = map(int, input().split())\n\nxy = [0 for _ in range(n + 1)]\n\n\ndef root(x):\n i = x\n while xy[i] != 0:\n i = xy[i]\n return i\n\n\nfor _ in range(m):\n x, y, z = map(int, input().split())\n rx = root(x)\n ry = root(y)\n if rx != ry:\n xy[ry] = rx\n\nans = 0\nfor i in xy[1:]:\n if i == 0:\n ans += 1\n\nprint(ans)\n","fail":"n, m = map(int, input().split())\n\nxy = [i for i in range(n + 1)]\n\n\ndef root(x):\n i = x\n while i != xy[i]:\n i = xy[i]\n xy[x] = i\n return i\n\n\nfor _ in range(m):\n x, y, z = map(int, input().split())\n rx = root(x)\n ry = root(y)\n if rx != ry:\n xy[ry] = rx\n\nans = -1\nfor i, v in enumerate(xy):\n if i == v:\n ans += 1\n\nprint(ans)\n","change":"replace","i1":2,"i2":22,"j1":2,"j2":23,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03045","language":"Python","original_status":"Runtime Error","pass":"n, m = map(int, input().split())\n\np = list(range(n))\n\n\ndef find(x):\n if p[x] != x:\n p[x] = find(p[x])\n return p[x]\n\n\ndef union(x, y):\n x, y = find(x), find(y)\n p[y] = x\n\n\nfor _ in range(m):\n x, y, z = [int(i) - 1 for i in input().split()]\n if find(x) != find(y):\n union(x, y)\n\nans = set()\nfor i in range(n):\n find(i)\nprint(len(set(p)))\n","fail":"n, m = map(int, input().split())\n\np = list(range(n))\n\n\ndef find(x):\n if p[x] != x:\n p[x] = find(p[x])\n return p[x]\n\n\ndef union(x, y):\n x, y = find(x), find(y)\n p[x] = p[y] = min(x, y)\n\n\nfor _ in range(m):\n x, y, z = [int(i) - 1 for i in input().split()]\n if find(x) != find(y):\n union(x, y)\n\nans = set()\nfor i in range(n):\n find(i)\nprint(len(set(p)))\n","change":"replace","i1":13,"i2":14,"j1":13,"j2":14,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p03047","language":"Python","original_status":"Runtime Error","pass":"N, K = map(int, input())\n\nprint(N - K + 1)\n","fail":"N, K = map(int, input().split())\n\nprint(N - K + 1)\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"ValueError: invalid literal for int() with base 10: ' '","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03047\/Python\/s597421224.py\", line 1, in \n N, K = map(int, input())\nValueError: invalid literal for int() with base 10: ' '\n","stdout":null} {"problem_id":"p03047","language":"Python","original_status":"Runtime Error","pass":"N, K = map(int, input())\nprint(N - (K - 1))\n","fail":"N, K = map(int, input().split())\nprint(N - (K - 1))\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"ValueError: invalid literal for int() with base 10: ' '","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03047\/Python\/s207697669.py\", line 1, in \n N, K = map(int, input())\nValueError: invalid literal for int() with base 10: ' '\n","stdout":null} {"problem_id":"p03047","language":"Python","original_status":"Runtime Error","pass":"n, k = list(map(int, input()))\n\nprint(n - k + 1)\n","fail":"nk = list(map(int, input().split()))\n\nprint(nk[0] - nk[1] + 1)\n","change":"replace","i1":0,"i2":3,"j1":0,"j2":3,"error":"ValueError: invalid literal for int() with base 10: ' '","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03047\/Python\/s255071503.py\", line 1, in \n n, k = list(map(int, input()))\nValueError: invalid literal for int() with base 10: ' '\n","stdout":null} {"problem_id":"p03048","language":"Python","original_status":"Time Limit Exceeded","pass":"#!\/usr\/bin\/env python3\nimport sys\n\nread = sys.stdin.buffer.read\n# input = sys.stdin.buffer.readline\nreadlines = sys.stdin.buffer.readlines\na, b, c, n = map(int, input().split())\nans = 0\nfor i in range(3001):\n for j in range(3001):\n if n <= i * a + j * b and (n - i * a - j * b) % c == 0:\n ans += 1\nprint(ans)\n","fail":"#!\/usr\/bin\/env python3\nimport sys\n\nread = sys.stdin.buffer.read\n# input = sys.stdin.buffer.readline\nreadlines = sys.stdin.buffer.readlines\na, b, c, n = map(int, input().split())\nans = 0\nfor i in range(3001):\n for j in range(3001):\n if n >= i * a + j * b and (n - i * a - j * b) % c == 0:\n ans += 1\nprint(ans)\n","change":"replace","i1":10,"i2":11,"j1":10,"j2":11,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03048","language":"Python","original_status":"Time Limit Exceeded","pass":"r, g, b, n = map(int, input().split())\n\ncnt = 0\nfor i in range(3001):\n for j in range(3001):\n x = n - (r * i + g * j)\n if x < 0:\n continue\n if x % b == 0:\n cnt += 1\n\nprint(cnt)\n","fail":"r, g, b, n = map(int, input().split())\n\ncnt = 0\nfor i in range(int(n \/\/ r) + 1):\n r_num = r * i\n for j in range(int((n - r_num) \/\/ g) + 1):\n g_num = g * j\n b_num = n - r_num - g_num\n if b_num >= 0 and b_num % b == 0:\n cnt += 1\n\nprint(cnt)\n","change":"replace","i1":3,"i2":9,"j1":3,"j2":9,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03048","language":"Python","original_status":"Time Limit Exceeded","pass":"r, g, b, n = map(int, input().split())\narr = [r, g, b]\narr.sort()\nans = 0\nfor i in range(n \/\/ arr[2] + 1):\n if arr[2] * i > n:\n break\n for j in range(n \/\/ arr[1] + 1):\n tmp = arr[2] * i + arr[1] * j\n if tmp > n:\n break\n else:\n if tmp == n:\n ans += 1\n break\n elif n - tmp > 0 and (n - tmp) % arr[0] == 0:\n ans += 1\n\nprint(ans)\n","fail":"R, G, B, n = map(int, input().split())\nans = 0\nfor r in range(n \/\/ R + 1):\n Rr = R * r\n for g in range((n - Rr) \/\/ G + 1):\n tmp = Rr + G * g\n if (n - tmp) % B == 0:\n ans += 1\nprint(ans)\n","change":"replace","i1":0,"i2":18,"j1":0,"j2":8,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03048","language":"Python","original_status":"Time Limit Exceeded","pass":"r, g, b, n = map(int, input().split())\nc = sorted([r, g, b])[::-1]\nans = 0\nfor i in range(n \/\/ c[0] + 1):\n for j in range((n - i * r) \/\/ c[1] + 1):\n x = n - i * c[0] - j * c[1]\n if x >= 0 and x % c[2] == 0:\n ans += 1\nprint(ans)\n","fail":"r, g, b, n = map(int, input().split())\nc = sorted([r, g, b])[::-1]\nans = 0\nfor i in range(n \/\/ c[0] + 1):\n x = n - i * c[0]\n for j in range(x \/\/ c[1] + 1):\n y = x - j * c[1]\n if y < 0:\n break\n elif y % c[2] == 0:\n ans += 1\nprint(ans)\n","change":"replace","i1":4,"i2":7,"j1":4,"j2":10,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03048","language":"Python","original_status":"Time Limit Exceeded","pass":"r, g, b, n = map(int, input().split())\n\nif r >= g and g >= b:\n pass\nelif r >= b and b >= g:\n temp = g\n g = b\n b = temp\nelse:\n temp = r\n r = g\n g = temp\n\nrg = {}\nri = 0\nwhile ri <= n:\n gi = 0\n while gi <= n - ri:\n if (n - ri - gi) % b == 0:\n total = rg.get(ri + gi, 0)\n rg[ri + gi] = total + 1\n else:\n pass\n gi += g\n ri += r\n\nbi = 0\nresult = 0\n\nwhile bi <= n:\n total = rg.get(n - bi, 0)\n result += total\n bi += b\n\nprint(result)\n","fail":"r, g, b, n = map(int, input().split())\n\nif r >= g and g >= b:\n pass\nelif r >= b and b >= g:\n temp = g\n g = b\n b = temp\nelse:\n temp = r\n r = g\n g = temp\n\nif (r == 1 and g == 1) or (r == 1 and b == 1) or (g == 1 and b == 1):\n rg = [i + 1 for i in range(n + 1)]\nelif (\n (r == 1 and g == 2)\n or (r == 1 and b == 2)\n or (g == 1 and b == 2)\n or (r == 2 and g == 1)\n or (r == 2 and b == 1)\n or (g == 2 and b == 1)\n):\n rg = [1 + i \/\/ 2 for i in range(n + 1)]\nelse:\n rg = [0 for _ in range(n + 1)]\n ri = 0\n while ri <= n:\n gi = 0\n while gi <= n - ri:\n rg[ri + gi] += 1\n gi += g\n ri += r\n\nbi = 0\nresult = 0\n\nwhile bi <= n:\n total = rg[n - bi]\n result += total\n bi += b\n\nprint(result)\n","change":"replace","i1":13,"i2":31,"j1":13,"j2":39,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03048","language":"Python","original_status":"Time Limit Exceeded","pass":"R, G, B, N = map(int, input().split())\nans = 0\nfor r in range(N + 1):\n for g in range(N + 1):\n b = (N - R * r - G * g) \/ B\n if b >= 0 and int(b) == b:\n ans += 1\nprint(ans)\n","fail":"R, G, B, N = map(int, input().split())\nans = 0\nfor r in range(N \/\/ R + 1):\n for g in range(N \/\/ G + 1):\n b = (N - R * r - G * g) \/ B\n if b == int(b) and b >= 0:\n ans += 1\nprint(ans)\n","change":"replace","i1":2,"i2":6,"j1":2,"j2":6,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03048","language":"Python","original_status":"Time Limit Exceeded","pass":"R, G, B, N = map(int, input().split())\n\nres = 0\n\nfor i in range(N \/\/ R + 1):\n for j in range(N \/\/ G + 1):\n b = N - R * i - G * j\n if b >= 0 and b % B == 0:\n res += 1\n\nprint(res)\n","fail":"R, G, B, N = map(int, input().split())\n\nres = 0\n\nfor i in range(N \/\/ R + 1):\n for j in range((N - R * i) \/\/ G + 1):\n b = N - R * i - G * j\n if b >= 0 and b % B == 0:\n res += 1\n\nprint(res)\n","change":"replace","i1":5,"i2":6,"j1":5,"j2":6,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03048","language":"Python","original_status":"Time Limit Exceeded","pass":"R, G, B, N = map(int, input().split())\n\nans = 0\nfor r in range(N \/\/ R + 1):\n if N - r * R < 0:\n break\n for g in range((N - R * r) \/\/ G + 1):\n tmp = N - r * R - g * G\n if tmp < 0:\n break\n if tmp % B == 0 and tmp \/\/ B >= 0:\n ans += 1\n\nprint(ans)\n","fail":"R, G, B, N = map(int, input().split())\n\nans = 0\nfor r in range(N \/\/ R + 1):\n for g in range((N - R * r) \/\/ G + 1):\n tmp = N - r * R - g * G\n if tmp % B == 0:\n ans += 1\n\nprint(ans)\n","change":"replace","i1":4,"i2":11,"j1":4,"j2":7,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03048","language":"Python","original_status":"Time Limit Exceeded","pass":"r, g, b, n = map(int, input().split())\nans = 0\nnr = n \/\/ r\nng = n \/\/ g\nfor i in range(nr + 1):\n for j in range(ng + 1):\n tmp = n - i * r - j * g\n if tmp % b == 0 and tmp >= 0:\n ans += 1\nprint(ans)\n","fail":"r, g, b, n = map(int, input().split())\nans = 0\nnr = n \/\/ r\nng = n \/\/ g\nfor i in range(nr + 1):\n for j in range(ng + 1):\n tmp = n - i * r - j * g\n if tmp >= 0 and tmp % b == 0:\n ans += 1\nprint(ans)\n","change":"replace","i1":7,"i2":8,"j1":7,"j2":8,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03048","language":"Python","original_status":"Time Limit Exceeded","pass":"R, G, B, N = map(int, input().split())\nLIM = 3003\nans = 0\nfor r in range(LIM):\n for g in range(LIM):\n if R * r + G * g > N:\n break\n Bb = N - R * r - G * g\n if Bb % B == 0:\n ans += 1\nprint(ans)\n","fail":"def solve():\n R, G, B, N = map(int, input().split())\n LIM = 3001\n ans = 0\n for r in range(LIM):\n for g in range(LIM):\n if R * r + G * g > N:\n break\n Bb = N - R * r - G * g\n if Bb % B == 0:\n ans += 1\n return ans\n\n\nprint(solve())\n","change":"replace","i1":0,"i2":11,"j1":0,"j2":15,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03048","language":"Python","original_status":"Time Limit Exceeded","pass":"# import time\nR, G, B, N = map(int, input().split())\n# print(R, G, B)\ni = 0\n# r, g = 0, 0\n# s = time.time()\nfor r in range(N \/\/ R + 1):\n for g in range(N \/\/ G + 1):\n if (N - r * R - g * G) >= 0:\n b = int((N - r * R - g * G) \/ B)\n if N - (r * R + g * G + b * B) == 0:\n # print(r, g, b)\n i += 1\nprint(i)\n# print(time.time()-s)\n","fail":"R, G, B, N = map(int, input().split())\ni = 0\nfor r in range(N \/\/ R + 1):\n Rr = r * R\n for g in range(N \/\/ G + 1):\n Gg = g * G\n Bb = N - Rr - Gg\n if Bb < 0:\n break\n if Bb % B == 0:\n i += 1\nprint(i)\n","change":"replace","i1":0,"i2":15,"j1":0,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03048","language":"Python","original_status":"Time Limit Exceeded","pass":"r, g, b, n = map(int, input().split())\n\ncount = 0\nr, g, b = sorted([r, g, b])\n\n\nfor i in range(n \/\/ r + 1):\n total = r * i\n if total > n:\n continue\n for j in range((n - total) \/\/ g + 1):\n total = r * i + g * j\n if total > n:\n continue\n for k in range((n - total) \/\/ b + 1):\n total = r * i + g * j + b * k\n if total == n:\n count += 1\n\nprint(count)\n","fail":"r, g, b, n = map(int, input().split())\n\ncount = 0\nr, g, b = sorted([r, g, b], reverse=True)\n\n\nfor i in range(n \/\/ r + 1):\n rc = r * i\n for j in range((n - rc) \/\/ g + 1):\n gc = g * j\n if (n - rc - gc) % b == 0:\n count += 1\nprint(count)\n","change":"replace","i1":3,"i2":19,"j1":3,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03048","language":"Python","original_status":"Time Limit Exceeded","pass":"R, G, B, N = map(int, input().split())\n\nans = 0\nfor i in range(N \/\/ R + 1):\n N_R = N - i * R\n for j in range(N_R \/\/ G + 1):\n N_RG = N_R - j * G\n for k in range(N_RG \/\/ B + 1):\n N_RGB = N_RG - k * B\n if N_RGB == 0:\n ans += 1\nprint(ans)\n","fail":"R, G, B, N = map(int, input().split())\n\nans = 0\nfor i in range(N \/\/ R + 1):\n for j in range((N - i * R) \/\/ G + 1):\n if (N - i * R - j * G) % B == 0:\n ans += 1\nprint(ans)\n","change":"replace","i1":4,"i2":11,"j1":4,"j2":7,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03048","language":"Python","original_status":"Time Limit Exceeded","pass":"R, G, B, N = map(int, input().split())\n\nres = 0\nfor i in range(N \/\/ R + 1):\n for j in range(N \/\/ G + 1):\n b = N - (i * R + j * G)\n if b >= 0 and b % B == 0:\n res += 1\nprint(res)\n","fail":"R, G, B, N = map(int, input().split())\n\nres = 0\nfor i in range(N \/\/ R + 1):\n for j in range((N - i * R) \/\/ G + 1):\n if (N - (i * R + j * G)) % B == 0:\n res += 1\n\nprint(res)\n","change":"replace","i1":4,"i2":8,"j1":4,"j2":8,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03048","language":"Python","original_status":"Time Limit Exceeded","pass":"R, G, B, N = map(int, input().split())\nans = 0\n\nfor r in range(min(3000, 3000 \/\/ R) + 1):\n for g in range(min(3000, 3000 \/\/ G) + 1):\n v = R * r + G * g\n if N >= v and (N - v) % B == 0:\n ans += 1\n\nprint(ans)\n","fail":"R, G, B, N = map(int, input().split())\nans = 0\n\nfor r in range(min(3000, 3000 \/\/ R) + 1):\n if R * r <= N:\n for g in range(min(3000, 3000 \/\/ G) + 1):\n v = R * r + G * g\n if N >= v and (N - v) % B == 0:\n ans += 1\n\nprint(ans)\n","change":"replace","i1":4,"i2":8,"j1":4,"j2":9,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03048","language":"Python","original_status":"Time Limit Exceeded","pass":"R, G, B, N = map(int, input().split())\nans = 0\nfor r in range(3001):\n if R * r > N:\n break\n for g in range(3001):\n if R * r + G * g > N:\n break\n elif (N - (R * r + G * g)) % B == 0:\n ans += 1\nprint(ans)\n","fail":"R, G, B, N = map(int, input().split())\nans = 0\nfor r in range(N \/\/ R + 1):\n for g in range((N - R * r) \/\/ G + 1):\n if (N - (R * r + G * g)) % B == 0:\n ans += 1\nprint(ans)\n","change":"replace","i1":2,"i2":9,"j1":2,"j2":5,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03048","language":"Python","original_status":"Time Limit Exceeded","pass":"r, g, b, n = map(int, input().split())\ns_rgb = sorted([r, g, b], reverse=True)\nresult = 0\nfor i in range(int(n \/ s_rgb[0]) + 1)[::-1]:\n for j in range(int((n - s_rgb[0] * i) \/ s_rgb[1]) + 1)[::-1]:\n if s_rgb[0] * i + s_rgb[1] * j > n:\n break\n for k in range(int((n - s_rgb[0] * i - s_rgb[1] * j) \/ s_rgb[2]) + 1)[::-1]:\n if s_rgb[0] * i + s_rgb[1] * j + s_rgb[2] * k > n:\n break\n if s_rgb[0] * i + s_rgb[1] * j + s_rgb[2] * k == n:\n result += 1\n break\nprint(result)\n","fail":"r, g, b, n = map(int, input().split())\ns_rgb = sorted([r, g, b], reverse=True)\ncount = 0\nfor i in range(int(n \/ s_rgb[0]) + 1)[::-1]:\n for j in range(int((n - s_rgb[0] * i) \/ s_rgb[1]) + 1)[::-1]:\n tmp = n - s_rgb[0] * i - s_rgb[1] * j\n if tmp >= 0 and tmp % s_rgb[2] == 0:\n count += 1\nprint(count)\n","change":"replace","i1":2,"i2":14,"j1":2,"j2":9,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03048","language":"Python","original_status":"Time Limit Exceeded","pass":"R, G, B, N = map(int, input().split())\n\ncounter = 0\nfor r in range((N \/\/ R) + 1):\n for g in range(((N - (r * R)) \/\/ G) + 1):\n w_b_sum = N - ((R * r) + (G * g))\n\n if w_b_sum % B == 0 and w_b_sum >= 0 and w_b_sum == N - ((R * r) + (G * g)):\n # print(r, g, (w_b_sum \/\/ B))\n counter += 1\nprint(counter)\n","fail":"R, G, B, N = map(int, input().split())\n\ncounter = 0\nfor r in range((N \/\/ R) + 1):\n for g in range(((N - (r * R)) \/\/ G) + 1):\n w_b_sum = N - ((R * r) + (G * g))\n\n if w_b_sum % B == 0 and w_b_sum >= 0:\n # print(r, g, (w_b_sum \/\/ B))\n counter += 1\nprint(counter)\n","change":"replace","i1":7,"i2":8,"j1":7,"j2":8,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03048","language":"Python","original_status":"Runtime Error","pass":"def inpl():\n return list(map(int, input().split()))\n\n\ndef gcd(a, b):\n # greatest common divisor\n la = max(a, b)\n sm = min(a, b)\n if la % sm == 0:\n return sm\n else:\n return gcd(sm, la - sm)\n\n\ndef lcm(a, b):\n # least common multiple\n return a * b \/\/ gcd(a, b)\n\n\nR, G, B, N = inpl()\nans = 0\nfor r in range(N \/\/ R + 1):\n rest = N - r * R\n for i in range(B):\n if (G * i) % B == rest % B:\n x = i\n break\n else:\n # print(r)\n continue\n if rest - G * x < 0:\n continue\n ans += (rest - G * x) \/\/ lcm(B, G) + 1\n # print(r, rest, x, ans)\n\nprint(ans)\n","fail":"def inpl():\n return list(map(int, input().split()))\n\n\ndef gcd(a, b):\n # greatest common divisor\n la = max(a, b)\n sm = min(a, b)\n if la % sm == 0:\n return sm\n else:\n return gcd(sm, la - sm)\n\n\ndef lcm(a, b):\n # least common multiple\n return a * b \/\/ gcd(a, b)\n\n\nimport sys\n\nsys.setrecursionlimit(5000)\n\n\nR, G, B, N = inpl()\nans = 0\nfor r in range(N \/\/ R + 1):\n rest = N - r * R\n for i in range(B):\n if (G * i) % B == rest % B:\n x = i\n break\n else:\n # print(r)\n continue\n if rest - G * x < 0:\n continue\n ans += (rest - G * x) \/\/ lcm(B, G) + 1\n # print(r, rest, x, ans)\n\nprint(ans)\n","change":"insert","i1":19,"i2":19,"j1":19,"j2":24,"error":"0","stderr":null,"stdout":4.0} {"problem_id":"p03048","language":"Python","original_status":"Time Limit Exceeded","pass":"R, G, B, N = map(int, input().split())\n\nans = 0\nfor i in range(int(N \/ R) + 1):\n for j in range(int((N - i * R) \/ G) + 1):\n if (N - (i * R + j * G)) % B == 0 and (N - (i * R + j * G)) >= 0:\n ans += 1\nprint(ans)\n","fail":"R, G, B, N = map(int, input().split())\n\nans = 0\nfor i in range(int(N \/ R) + 1):\n for j in range(int((N - i * R) \/ G) + 1):\n if (N - (i * R + j * G)) % B == 0:\n ans += 1\nprint(ans)\n","change":"replace","i1":5,"i2":6,"j1":5,"j2":6,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03048","language":"Python","original_status":"Time Limit Exceeded","pass":"r, g, b, n = map(int, input().split())\n\nans = 0\nfor i in range(n \/\/ r + 1):\n for j in range(n \/\/ g + 1):\n m = r * i + g * j\n if m <= n and (n - m) % b == 0:\n ans += 1\n\nprint(ans)\n","fail":"r, g, b, n = map(int, input().split())\n\nans = 0\nfor i in range(n \/\/ r + 1):\n for j in range(n \/\/ g + 1):\n m = r * i + g * j\n if m <= n and (n - m) % b == 0:\n ans += 1\n elif m > n:\n break\n\nprint(ans)\n","change":"insert","i1":8,"i2":8,"j1":8,"j2":10,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03050","language":"Python","original_status":"Runtime Error","pass":"import math\n\n\ndef main():\n n = int(input())\n a = []\n for i in range(1, (int)(math.sqrt(n)) + 1):\n if n % i == 0:\n if i != 1:\n a.append(i - 1)\n a.append((n \/\/ i) - 1)\n a.sort()\n ans = 0\n if len(a) == 0:\n ans = 0\n else:\n for i in a:\n if i != 1 and (n \/\/ i == n % i):\n ans += i\n print(ans)\n\n\nmain()\n","fail":"import math\n\n\ndef main():\n n = int(input())\n a = []\n for i in range(1, (int)(math.sqrt(n)) + 1):\n if n % i == 0:\n if i != 1:\n a.append(i - 1)\n if n \/\/ i - 1 != 0:\n a.append((n \/\/ i) - 1)\n ans = 0\n for i in range(len(a)):\n if a[i] != 1 and (n \/\/ a[i] == n % a[i]):\n ans += a[i]\n print(ans)\n\n\nmain()\n","change":"replace","i1":10,"i2":19,"j1":10,"j2":16,"error":"0","stderr":null,"stdout":10.0} {"problem_id":"p03050","language":"Python","original_status":"Runtime Error","pass":"import math\n\nN = int(input())\nans = 0\nfor i in range(1, int(math.sqrt(N)) + 2):\n if N % i:\n continue\n m = N \/\/ i - 1\n if N \/\/ m == N % m:\n ans += m\nprint(ans)\n","fail":"import math\n\nN = int(input())\nans = 0\nfor i in range(1, int(math.sqrt(N)) + 2):\n if N % i:\n continue\n m = N \/\/ i - 1\n if m <= 0:\n continue\n if N \/\/ m == N % m:\n ans += m\nprint(ans)\n","change":"insert","i1":8,"i2":8,"j1":8,"j2":10,"error":"0","stderr":null,"stdout":10.0} {"problem_id":"p03050","language":"Python","original_status":"Runtime Error","pass":"n = int(input())\n\nans = 0\nfor i in range(1, int(n**0.5) + 1):\n if n % i == 0:\n m = n \/\/ i - 1\n if n \/\/ m == n % m:\n ans += m\n\nprint(ans)\n","fail":"n = int(input())\n\nans = 0\nfor i in range(1, int(n**0.5) + 1):\n if n % i == 0:\n m = n \/\/ i - 1\n if m != 0 and n \/\/ m == n % m:\n ans += m\n\nprint(ans)\n","change":"replace","i1":6,"i2":7,"j1":6,"j2":7,"error":"0","stderr":null,"stdout":10.0} {"problem_id":"p03050","language":"Python","original_status":"Runtime Error","pass":"import math\n\nN = int(input())\nans = 0\nfor i in range(1, math.ceil(math.sqrt(N)) + 1):\n if N % i:\n continue\n n = N \/\/ i - 1\n if N % n == N \/\/ n:\n ans += n\nprint(ans)\n","fail":"import math\n\nN = int(input())\nans = 0\nfor i in range(1, math.ceil(math.sqrt(N)) + 1):\n if N % i:\n continue\n n = N \/\/ i - 1\n if n and N % n == N \/\/ n:\n ans += n\nprint(ans)\n","change":"replace","i1":8,"i2":9,"j1":8,"j2":9,"error":"0","stderr":null,"stdout":10.0} {"problem_id":"p03050","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\ni = 1\nans = 0\nwhile True:\n d, m = divmod(n, i)\n if m != 0:\n i += 1\n continue\n d -= 1\n if i >= d:\n break\n ans += d\n i += 1\nprint(ans)\n","fail":"n = int(input())\ni = 1\nans = 0\nwhile True:\n d, m = divmod(n, i)\n d -= 1\n if i >= d:\n break\n if m != 0:\n i += 1\n continue\n ans += d\n i += 1\nprint(ans)\n","change":"replace","i1":5,"i2":11,"j1":5,"j2":11,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03053","language":"Python","original_status":"Runtime Error","pass":"H, W = map(int, input().split())\nitems = []\nblack = []\nfor i in range(H):\n tmp = input()\n for j in range(W):\n if tmp[j] == \"#\":\n black.append((i, j))\n items.append(list(tmp))\n\nque = []\n\nfor b in black:\n que.append(b)\n\nans = 0\nd4 = [(1, 0), (0, -1), (-1, 0), (0, 1)]\nnext_que = que.copy()\nwhile len(que) != H * W:\n tmp = next_que.copy()\n next_que = []\n for b in list(tmp):\n x, y = b[0], b[1]\n for d in d4:\n dx = d[0]\n dy = d[1]\n if 0 <= x + dx <= H - 1 and 0 <= y + dy <= W - 1:\n tar = items[x + dx][y + dy]\n if tar == \".\":\n next_que.append((x + dx, y + dy))\n que.append((x + dx, y + dy))\n items[x + dx][y + dy] = \"#\"\n ans += 1\nprint(ans)\n","fail":"H, W = map(int, input().split())\nitems = []\nblack = []\nfor i in range(H):\n tmp = list(input())\n for j in range(W):\n if tmp[j] == \"#\":\n black.append((i, j))\n items.append(tmp)\n\nque = []\nfor b in black:\n que.append(b)\n\nans = 0\nd4 = [(1, 0), (0, -1), (-1, 0), (0, 1)]\nnext_que = que\nwhile len(que) != H * W:\n tmp = next_que\n next_que = []\n for b in list(tmp):\n x, y = b[0], b[1]\n for d in d4:\n dx = d[0]\n dy = d[1]\n if 0 <= x + dx <= H - 1 and 0 <= y + dy <= W - 1:\n tar = items[x + dx][y + dy]\n if tar == \".\":\n next_que.append((x + dx, y + dy))\n que.append((x + dx, y + dy))\n items[x + dx][y + dy] = \"#\"\n ans += 1\nprint(ans)\n","change":"replace","i1":4,"i2":20,"j1":4,"j2":19,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p03053","language":"Python","original_status":"Time Limit Exceeded","pass":"H, W = map(int, input(\"\").split(\" \"))\n\ngrid = []\nblacks = set()\nfor i in range(H):\n row = list(input(\"\"))\n grid.append(row)\n\n for idx, r in enumerate(row):\n if r == \"#\":\n blacks.add((i, idx))\n\nc = 0\nwhile len(blacks) > 0:\n c += 1\n\n new_blacks = set()\n for b in blacks:\n top = b[0] - 1\n bottom = b[0] + 1\n left = b[1] - 1\n right = b[1] + 1\n\n if top >= 0:\n if grid[top][b[1]] == \".\":\n grid[top][b[1]] = \"#\"\n new_blacks.add((top, b[1]))\n if bottom < H:\n if grid[bottom][b[1]] == \".\":\n grid[bottom][b[1]] = \"#\"\n new_blacks.add((bottom, b[1]))\n if left >= 0:\n if grid[b[0]][left] == \".\":\n grid[b[0]][left] = \"#\"\n new_blacks.add((b[0], left))\n if right < W:\n if grid[b[0]][right] == \".\":\n grid[b[0]][right] = \"#\"\n new_blacks.add((b[0], right))\n\n blacks = new_blacks\n\nprint(c - 1)\n","fail":"H, W = map(int, input(\"\").split(\" \"))\n\ngrid = []\nblacks = []\nfor i in range(H):\n row = list(input(\"\"))\n grid.append(row)\n\n for idx, r in enumerate(row):\n if r == \"#\":\n blacks.append((i, idx))\n\nc = 0\nwhile len(blacks) > 0:\n c += 1\n\n new_blacks = []\n for b in blacks:\n top = b[0] - 1\n bottom = b[0] + 1\n left = b[1] - 1\n right = b[1] + 1\n\n if top >= 0:\n if grid[top][b[1]] == \".\":\n grid[top][b[1]] = \"#\"\n new_blacks.append((top, b[1]))\n if bottom < H:\n if grid[bottom][b[1]] == \".\":\n grid[bottom][b[1]] = \"#\"\n new_blacks.append((bottom, b[1]))\n if left >= 0:\n if grid[b[0]][left] == \".\":\n grid[b[0]][left] = \"#\"\n new_blacks.append((b[0], left))\n if right < W:\n if grid[b[0]][right] == \".\":\n grid[b[0]][right] = \"#\"\n new_blacks.append((b[0], right))\n\n blacks = new_blacks\n\nprint(c - 1)\n","change":"replace","i1":3,"i2":39,"j1":3,"j2":39,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03053","language":"Python","original_status":"Time Limit Exceeded","pass":"from collections import deque\nimport sys\n\n\ndef input():\n return sys.stdin.readline()[:-1]\n\n\nh, w = map(int, input().split())\ngrid = [input() for _ in range(h)]\ncost = [[float(\"inf\")] * w for _ in range(h)]\nnb = [(-1, 0), (0, -1), (1, 0), (0, 1)]\n\nq = deque()\nfor i in range(h):\n for j in range(w):\n if grid[i][j] == \"#\":\n q.append((i, j))\n cost[i][j] = 0\n\nwhile q:\n x, y = q.popleft()\n for dx, dy in nb:\n nx = x + dx\n ny = y + dy\n if 0 <= nx and nx < h and 0 <= ny and ny < w and cost[nx][ny] == float(\"inf\"):\n cost[nx][ny] = cost[x][y] + 1\n q.append((nx, ny))\n\n\nprint(max([max(c) for c in cost]))\n","fail":"from collections import deque\n\nH, W = map(int, input().split())\nA = [input() for i in range(H)]\nq = deque()\nc = [[-1] * W for i in range(H)]\nfor i in range(H):\n for j in range(W):\n if A[i][j] == \"#\":\n q.append((i, j))\n c[i][j] = 0\nD = [[0, 1], [1, 0], [0, -1], [-1, 0]]\nwhile q:\n y, x = q.popleft()\n for dy, dx in D:\n ny, nx = y + dy, x + dx\n if 0 <= ny < H and 0 <= nx < W and c[ny][nx] == -1:\n q.append((ny, nx))\n c[ny][nx] = c[y][x] + 1\nprint(max([max(l) for l in c]))\n","change":"replace","i1":1,"i2":31,"j1":1,"j2":20,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03053","language":"Python","original_status":"Time Limit Exceeded","pass":"import sys\nfrom collections import deque\n\nimport numpy as np\n\ninput = sys.stdin.readline\n\n\ndef bfs(H, W, A, dist):\n queue = deque([])\n for h, w in zip(*np.where(A == \"#\")):\n dist[h, w] = 0\n queue.append((h, w))\n while queue:\n h, w = queue.popleft()\n for y, x in [(0, 1), (0, -1), (1, 0), (-1, 0)]:\n next_h, next_w = h + y, w + x\n if not (0 <= next_h < H and 0 <= next_w < W):\n continue\n if dist[next_h][next_w] == -1:\n dist[next_h][next_w] = dist[h][w] + 1\n queue.append((next_h, next_w))\n\n return dist.max()\n\n\ndef main():\n H, W = map(int, input().split())\n A = np.zeros(shape=(H, W), dtype=str)\n for i in range(H):\n A[i] = list(input().rstrip())\n\n dist = np.full(shape=(H, W), fill_value=-1, dtype=np.int32)\n ans = bfs(H, W, A, dist)\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"import sys\nfrom collections import deque\n\ninput = sys.stdin.readline\n\n\ndef bfs(H, W, A, dist):\n queue = deque([])\n for h in range(H):\n for w in range(W):\n if A[h][w] == \"#\":\n dist[h][w] = 0\n queue.append((h, w))\n while queue:\n h, w = queue.popleft()\n for y, x in [(0, 1), (0, -1), (1, 0), (-1, 0)]:\n next_h, next_w = h + y, w + x\n if dist[next_h][next_w] == -1:\n dist[next_h][next_w] = dist[h][w] + 1\n queue.append((next_h, next_w))\n\n\ndef main():\n H, W = map(int, input().split())\n A = [None] * (H + 2)\n A[0] = A[-1] = \".\" * (W + 2)\n for i in range(1, H + 1):\n A[i] = \"\".join([\".\", input().rstrip(), \".\"])\n\n dist = [[0] + [-1] * W + [0] for _ in range(H + 2)]\n dist[0] = dist[-1] = [0] * (W + 2)\n bfs(H + 2, W + 2, A, dist)\n\n ans = max(map(max, dist))\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":2,"i2":34,"j1":2,"j2":34,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03053","language":"Python","original_status":"Time Limit Exceeded","pass":"from collections import deque\n\nh, w = map(int, input().split())\na = [input() for _ in range(h)]\n\nq = deque()\ndone = set()\nfor i in range(h):\n for j in range(w):\n if a[i][j] == \"#\":\n q.append((i, j, 0))\n done.add((i, j))\n\nwhile q:\n # print(q)\n i, j, k = q.popleft()\n if i > 0 and (i - 1, j) not in done:\n q.append((i - 1, j, k + 1))\n done.add((i - 1, j))\n if i < h - 1 and (i + 1, j) not in done:\n q.append((i + 1, j, k + 1))\n done.add((i + 1, j))\n if j > 0 and (i, j - 1) not in done:\n q.append((i, j - 1, k + 1))\n done.add((i, j - 1))\n if j < w - 1 and (i, j + 1) not in done:\n q.append((i, j + 1, k + 1))\n done.add((i, j + 1))\n\nprint(k)\n","fail":"import numpy as np\nfrom scipy.ndimage.morphology import distance_transform_cdt\n\nh, w = map(int, input().split())\na = [input() for _ in range(h)]\n\na = np.array([[(ai[j] != \"#\") for j in range(w)] for ai in a])\nd = distance_transform_cdt(a, metric=\"taxicab\").max()\nprint(d)\n","change":"replace","i1":0,"i2":30,"j1":0,"j2":9,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03053","language":"Python","original_status":"Runtime Error","pass":"H, W, N = map(int, input().split())\nsr, sc = map(int, input().split())\nS = input()\nT = input()\n\nleft = 1\nright = W\nup = 1\ndown = H\n\nfor i in reversed(range(N)):\n if i != N - 1:\n if T[i] == \"U\":\n if down != H:\n down -= 1\n elif T[i] == \"D\":\n if up != 1:\n up += 1\n elif T[i] == \"L\":\n if right != W:\n right += 1\n else:\n if left != 1:\n left -= 1\n if S[i] == \"U\":\n up -= 1\n elif S[i] == \"D\":\n down += 1\n elif S[i] == \"L\":\n left += 1\n else:\n right -= 1\n if left == right or up == down:\n print(\"NO\")\n exit()\nif left <= sr <= right and up <= sc <= down:\n print(\"YES\")\nelse:\n print(\"NO\")\n","fail":"from collections import deque\n\nH, W = map(int, input().split())\ngrid = (\n [[\"#\"] * (W + 2)] + [list(\"#\" + input() + \"#\") for i in range(H)] + [[\"#\"] * (W + 2)]\n)\n# print(grid)\nstack = deque()\nfor h in range(1, H + 1):\n for w in range(1, W + 1):\n # \u9ed2\u306a\u3089\u30b9\u30bf\u30c3\u30af\u306bpush\n if grid[h][w] == \"#\":\n stack.append([h, w])\n\nfor i in range(h + w + 3):\n tmp = deque()\n while stack:\n h, w = stack.pop()\n for dh, dw in ([0, 1], [0, -1], [1, 0], [-1, 0]):\n if grid[h + dh][w + dw] == \".\":\n grid[h + dh][w + dw] = \"#\"\n tmp.append([h + dh, w + dw])\n stack = tmp\n if not stack:\n print(i)\n break\n","change":"replace","i1":0,"i2":39,"j1":0,"j2":26,"error":"ValueError: not enough values to unpack (expected 3, got 2)","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03053\/Python\/s005797508.py\", line 1, in \n H, W, N = map(int, input().split())\nValueError: not enough values to unpack (expected 3, got 2)\n","stdout":null} {"problem_id":"p03059","language":"Python","original_status":"Runtime Error","pass":"a, b, t = (int(i) for i in input())\n\ntimes = int(t \/ a)\n\nnum = times * b\n\nprint(num)\n","fail":"a, b, t = (int(i) for i in input().split())\n\ntimes = int(t \/ a)\n\nnum = times * b\n\nprint(num)\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"ValueError: invalid literal for int() with base 10: ' '","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03059\/Python\/s003873800.py\", line 1, in \n a, b, t = (int(i) for i in input())\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03059\/Python\/s003873800.py\", line 1, in \n a, b, t = (int(i) for i in input())\nValueError: invalid literal for int() with base 10: ' '\n","stdout":null} {"problem_id":"p03059","language":"Python","original_status":"Runtime Error","pass":"N = int(input())\nV = list(map(int, input().split()))\nC = list(map(int, input().split()))\n\nans = 0\n\n# \u4fa1\u5024 - \u30b3\u30b9\u30c8 > 0 \u306e\u30d5\u30a3\u30eb\u30bf\nfor i in range(N):\n s = V[i] - C[i]\n if s > 0:\n ans += s\n\nprint(ans)\n","fail":"nums = [int(e) for e in input().split()]\n\na = nums[0]\nb = nums[1]\nt = nums[2]\n\nans = 0\n\nans = ((t + 0.5) \/\/ a) * b\nprint(int(ans))\n","change":"replace","i1":0,"i2":13,"j1":0,"j2":10,"error":"ValueError: invalid literal for int() with base 10: '3 5 7'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03059\/Python\/s782812756.py\", line 1, in \n N = int(input())\nValueError: invalid literal for int() with base 10: '3 5 7'\n","stdout":null} {"problem_id":"p03060","language":"Python","original_status":"Time Limit Exceeded","pass":"def resolve():\n N = int(input())\n V = [int(i) for i in input().split()]\n C = [int(i) for i in input().split()]\n maxA = 0\n for i in range(2**N):\n X = 0\n Y = 0\n for j in range(N):\n if (i >> j) & 1:\n X += V[j]\n Y += C[j]\n maxA = max(maxA, X - Y)\n print(maxA)\n\n\nresolve()\n","fail":"def resolve():\n N = int(input())\n V = [int(i) for i in input().split()]\n C = [int(i) for i in input().split()]\n ans = 0\n for i in range(N):\n if V[i] > C[i]:\n ans += V[i] - C[i]\n print(ans)\n\n\nresolve()\n","change":"replace","i1":4,"i2":14,"j1":4,"j2":9,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03060","language":"Python","original_status":"Runtime Error","pass":"def sub():\n N, Vs, Cs = [e for e in input().split(\" \")]\n N = int(N)\n Vs = [int(e) for e in Vs.split(\" \")]\n Cs = [int(e) for e in Cs.split(\" \")]\n ds = [v - c for v, c in zip(Vs, Cs)]\n ds = [d for d in ds if d > 0]\n print(sum(ds))\n\n\nsub()\n","fail":"def sub():\n N, Vs, Cs = [input() for _ in range(3)]\n N = int(N)\n Vs = [int(e) for e in Vs.split(\" \")]\n Cs = [int(e) for e in Cs.split(\" \")]\n ds = [v - c for v, c in zip(Vs, Cs)]\n ds = [d for d in ds if d > 0]\n print(sum(ds))\n\n\nsub()\n","change":"replace","i1":1,"i2":2,"j1":1,"j2":2,"error":"ValueError: not enough values to unpack (expected 3, got 1)","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03060\/Python\/s308117687.py\", line 11, in \n sub()\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03060\/Python\/s308117687.py\", line 2, in sub\n N, Vs, Cs = [e for e in input().split(\" \")]\nValueError: not enough values to unpack (expected 3, got 1)\n","stdout":null} {"problem_id":"p03060","language":"Python","original_status":"Runtime Error","pass":"n = int(input())\nv = [int(item) for item in input().split()]\nc = [int(item) for item in input().split()]\n\nd = [[v[i], c[i]] for i in range(n)]\nd.sort(key=lambda x: x[0] - x[1], reverse=True)\n\nans = 0\ni = 0\nwhile d[i][0] - d[i][1] > 0:\n ans += d[i][0] - d[i][1]\n i += 1\n\nprint(ans)\n","fail":"n = int(input())\nv = [int(item) for item in input().split()]\nc = [int(item) for item in input().split()]\n\nd = [[v[i], c[i]] for i in range(n)]\nd.sort(key=lambda x: x[0] - x[1], reverse=True)\n\nans = 0\ni = 0\nwhile i < n and d[i][0] - d[i][1] > 0:\n ans += d[i][0] - d[i][1]\n i += 1\n\nprint(ans)\n","change":"replace","i1":9,"i2":10,"j1":9,"j2":10,"error":"0","stderr":null,"stdout":5.0} {"problem_id":"p03060","language":"Python","original_status":"Time Limit Exceeded","pass":"import itertools as it\n\nN = int(input())\nV = [int(i) for i in input().split()]\nC = [int(i) for i in input().split()]\n\nans = 0\nfor ith_conf in it.product(range(2), repeat=N):\n dif = 0\n for j_jewel in range(N):\n if ith_conf[j_jewel] == 1:\n dif += V[j_jewel] - C[j_jewel]\n ans = max(ans, dif)\nprint(ans)\n","fail":"N = int(input())\nV = [int(i) for i in input().split()]\nC = [int(i) for i in input().split()]\nans = 0\nfor i in range(N):\n if V[i] > C[i]:\n ans += V[i] - C[i]\nprint(ans)\n","change":"replace","i1":0,"i2":13,"j1":0,"j2":7,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03061","language":"Python","original_status":"Runtime Error","pass":"import math as mt\n\nN = int(input())\nA = list(map(int, input().split()))\n\n\ndef solve(n: int, a: list):\n lgcd = [0] * (n - 1)\n lgcd[0] = a[0]\n for i in range(1, n - 1):\n lgcd[i] = mt.gcd(a[i], lgcd[i - 1])\n a.reverse()\n\n rgcd = [0] * (n - 1)\n rgcd[0] = a[0]\n for i in range(1, n - 1):\n rgcd[i] = mt.gcd(a[i], rgcd[i - 1])\n a.reverse()\n\n ans = [0] * n\n ans[0] = rgcd[n - 2]\n ans[n - 1] = lgcd[n - 2]\n for i in range(1, n):\n ans[i] = mt.gcd(lgcd[i - 1], rgcd[n - 2 - i])\n\n return max(ans)\n\n\nprint(solve(N, A))\n","fail":"from fractions import *\n\nn, *a = map(int, open(0).read().split())\nb = [0]\nfor i in a:\n b += (gcd(b[-1], i),)\nw = m = 0\nfor i in range(n):\n m = max(m, gcd(w, b[-i - 2]))\n w = gcd(w, a[~i])\nprint(m)\n","change":"replace","i1":0,"i2":29,"j1":0,"j2":11,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p03061","language":"Python","original_status":"Runtime Error","pass":"from math import gcd\n\nn = int(input())\na = list(map(int, input().split()))\np = list(a)\ns = list(a)\nfor i in range(1, n):\n p[i] = gcd(p[i - 1], p[i])\nfor i in range(n - 2, -1, -1):\n s[i] = gcd(s[i], s[i + 1])\n\nans = max(p[-2], s[1])\nif n > 2:\n ans = max(ans, max(gcd(p[i - 1], s[i + 1]) for i in range(1, n - 1)))\n\nprint(ans)\n","fail":"from fractions import gcd\n\nn = int(raw_input())\na = list(map(int, raw_input().split()))\np = list(a)\ns = list(a)\nfor i in range(1, n):\n p[i] = gcd(p[i - 1], p[i])\nfor i in range(n - 2, -1, -1):\n s[i] = gcd(s[i], s[i + 1])\n\nans = max(p[-2], s[1])\nif n > 2:\n ans = max(ans, max(gcd(p[i - 1], s[i + 1]) for i in range(1, n - 1)))\n\nprint(ans)\n","change":"replace","i1":0,"i2":4,"j1":0,"j2":4,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p03061","language":"Python","original_status":"Time Limit Exceeded","pass":"from functools import lru_cache, reduce\nfrom sys import stdin\n\n\n@lru_cache(maxsize=None)\ndef gcd(a, b):\n if b == 0:\n return a\n return gcd(b, a % b)\n\n\ndef mygcd(lst):\n result = lst[0]\n for x in lst[1:]:\n result = gcd(result, x)\n return result\n\n\ndef main():\n _ = int(stdin.readline().rstrip())\n As = [int(x) for x in stdin.readline().rstrip().split()]\n max_ = 0\n for a in As:\n tmp = As[:]\n tmp.remove(a)\n max_ = max(max_, reduce(gcd, tmp))\n print(max_)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"from functools import lru_cache\nfrom sys import stdin\n\n\n@lru_cache(maxsize=None)\ndef gcd(a, b):\n if b == 0:\n return a\n return gcd(b, a % b)\n\n\ndef make_acc_gdbs(As):\n result = []\n tmp = 0\n for x in As:\n tmp = gcd(tmp, x)\n result.append(tmp)\n return result\n\n\ndef main():\n N = int(stdin.readline().rstrip())\n As = [int(x) for x in stdin.readline().rstrip().split()]\n lAs = make_acc_gdbs(As)\n rAs = make_acc_gdbs(As[::-1])[::-1]\n max_ = 0\n for i in range(N):\n left = 0 if i == 0 else lAs[i - 1]\n right = 0 if i == (N - 1) else rAs[i + 1]\n max_ = max(max_, gcd(left, right))\n print(max_)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":0,"i2":26,"j1":0,"j2":30,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03061","language":"Python","original_status":"Time Limit Exceeded","pass":"import fractions\nfrom functools import reduce\n\nn = int(input())\nas_ = list(map(int, input().split()))\n\ngcds = []\n\nfor i in range(n):\n as2 = as_[:]\n del as2[i]\n gcds.append(reduce(fractions.gcd, as2))\n\nprint(max(gcds))\n","fail":"from fractions import gcd\n\nn = int(input())\nas_ = list(map(int, input().split()))\n\ngcd_all = as_.pop()\nset_ = {as_[0]}\nfor a in as_:\n set_ = set(gcd(s, a) for s in set_)\n set_.add(gcd_all)\n gcd_all = gcd(gcd_all, a)\n\nprint(max(set_))\n","change":"replace","i1":0,"i2":14,"j1":0,"j2":13,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03061","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = [int(i) for i in input().split()]\n\nif len(A) > 1:\n result = sorted(A)[1]\nelse:\n result = min(A)\n\nwhile True:\n counter = 0\n should_continue = False\n for e in A:\n if e % result != 0:\n counter += 1\n if counter > 1:\n should_continue = True\n break\n if should_continue:\n continue\n if counter <= 1: # 1\u3064\u306f\u66f8\u304d\u63db\u3048\u3089\u308c\u308b\n break\n else:\n result -= 1\n\nprint(result)\n","fail":"N = int(input())\nA = [int(i) for i in input().split()]\n\nif len(A) > 1:\n result = sorted(A)[1]\nelse:\n result = min(A)\n\nwhile True:\n counter = 0\n should_continue = False\n for e in A:\n if e % result != 0:\n counter += 1\n if counter > 1:\n should_continue = True\n break\n if should_continue:\n result -= 1\n continue\n if counter <= 1: # 1\u3064\u306f\u66f8\u304d\u63db\u3048\u3089\u308c\u308b\n break\n else:\n result -= 1\n\nprint(result)\n","change":"insert","i1":18,"i2":18,"j1":18,"j2":19,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03061","language":"Python","original_status":"Runtime Error","pass":"from math import gcd\nfrom itertools import accumulate\n\ninput()\na = list(map(int, input().split()))\nb = list(accumulate(a, gcd))\nc = list(accumulate(reversed(a), gcd))\nb = [c[-2]] + b\nc = [b[-2]] + c\nprint(max(map(gcd, b, c[-2::-1])))\n","fail":"from fractions import gcd\nfrom itertools import accumulate\n\ninput()\na = list(map(int, input().split()))\nb = list(accumulate(a, gcd))\nc = list(accumulate(reversed(a), gcd))\nprint(max(b[-2], c[-2], *map(gcd, b[:-2], c[-3::-1])))\n","change":"replace","i1":0,"i2":10,"j1":0,"j2":8,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p03061","language":"Python","original_status":"Runtime Error","pass":"n = int(input())\nv = [int(i) for i in input().split()]\nc = [int(i) for i in input().split()]\n\nv.sort()\nc.sort()\n\nmaximum = 0\nprofit = []\nfor i in range(len(v)):\n tmp = v[i] - c[i]\n if tmp > 0:\n maximum += tmp\n tmp = 0\n\nprint(maximum)\n","fail":"from fractions import gcd\n\nN = int(input())\nA = list(map(int, input().split()))\ntA = list(reversed(A))\nl = [0]\nr = [0]\nm = []\nfor i in range(N):\n tmpl = l[i]\n tmpa = A[i]\n tmpta = tA[i]\n l.append(gcd(l[i], A[i]))\n r.append(gcd(r[i], tA[i]))\nr = list(reversed(r))\nfor i in range(N):\n m.append(gcd(l[i], r[i + 1]))\nprint(max(m))\n","change":"replace","i1":0,"i2":16,"j1":0,"j2":18,"error":"EOFError: EOF when reading a line","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03061\/Python\/s384324982.py\", line 3, in \n c = [int(i) for i in input().split()]\nEOFError: EOF when reading a line\n","stdout":null} {"problem_id":"p03061","language":"Python","original_status":"Runtime Error","pass":"from math import gcd\n\nN = int(input())\nA = list(map(int, input().split()))\n\ncum_left = [A[0]]\ncum_right = [A[N - 1]]\nfor i in range(1, N - 1):\n cum_left.append(gcd(cum_left[-1], A[i]))\n cum_right.append(gcd(cum_right[-1], A[N - 1 - i]))\n\nans = max(cum_left[N - 2], cum_right[N - 2])\nfor i in range(1, N - 1):\n ans = max(ans, gcd(cum_left[i - 1], cum_right[N - 2 - i]))\nprint(ans)\n","fail":"from fractions import gcd\n\nN = int(input())\nA = list(map(int, input().split()))\n\ncum_left = [A[0]]\ncum_right = [A[N - 1]]\nfor i in range(1, N - 1):\n cum_left.append(gcd(cum_left[-1], A[i]))\n cum_right.append(gcd(cum_right[-1], A[N - 1 - i]))\n\nans = max(cum_left[N - 2], cum_right[N - 2])\nfor i in range(1, N - 1):\n ans = max(ans, gcd(cum_left[i - 1], cum_right[N - 2 - i]))\nprint(ans)\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p03061","language":"Python","original_status":"Runtime Error","pass":"def gcd(a, b):\n if b == 0:\n return a\n return gcd(b, a % b)\n\n\ndef sub():\n N, As = [input() for _ in range(2)]\n N = int(N)\n As = [int(e) for e in As.split(\" \")]\n # As = sorted(As, reverse=True)\n\n memG = 0\n for i in range(N):\n tmp = As[:i] + As[i + 1 :]\n gI = gcd(tmp[0], tmp[1])\n tmp = tmp[2:]\n for t in tmp:\n gI = gcd(t, gI)\n if gI < memG:\n break\n if gI > memG:\n memG = gI\n print(\"{}\".format(memG))\n\n\nsub()\n","fail":"from functools import lru_cache, reduce\n\n\n@lru_cache(maxsize=None)\ndef gcd(a, b):\n if b == 0:\n return a\n return gcd(b, a % b)\n\n\ndef sub():\n N, As = [input() for _ in range(2)]\n N = int(N)\n As = [int(e) for e in As.split(\" \")]\n # As = sorted(As, reverse=True)\n\n memG = 0\n # if N == 2:\n # memG = gcd(As[0], As[1])\n if N < 10:\n for i in range(N):\n tmp = As[:i] + As[i + 1 :]\n g = reduce(gcd, tmp)\n if g > memG:\n memG = g\n else:\n gLeft = {0: As[0], 1: gcd(As[0], As[1])}\n for i in range(2, N):\n gI = gcd(gLeft[i - 1], As[i])\n gLeft[i] = gI\n gRight = {N - 1: As[N - 1], N - 2: gcd(As[N - 1], As[N - 2])}\n for i in range(2, N):\n gI = gcd(gRight[N - i], As[N - 1 - i])\n gRight[N - 1 - i] = gI\n\n buf = []\n for i in range(N):\n leftG = None\n if (i - 1) in gLeft:\n leftG = gLeft[i - 1]\n rightG = None\n if (i + 1) in gRight:\n rightG = gRight[i + 1]\n # tmpG = None\n if leftG is None:\n leftG = rightG\n elif rightG is None:\n rightG = leftG\n buf.append(gcd(leftG, rightG))\n # tmpG = gcd(leftG, rightG)\n # if tmpG > memG:\n # memG = tmpG\n memG = max(buf)\n\n print(\"{}\".format(memG))\n\n\nsub()\n","change":"replace","i1":0,"i2":23,"j1":0,"j2":54,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p03061","language":"Python","original_status":"Time Limit Exceeded","pass":"from functools import reduce\nfrom fractions import gcd\n\nn = int(input())\na = list(map(int, input().split()))\nA = list(set(a))\nans = [reduce(gcd, A)]\n\nif len(A) == 1:\n print(A[0])\n exit()\nfor i in a:\n b = sorted(A)\n b.remove(i)\n if a.count(i) == 1:\n ans.append(reduce(gcd, b))\n\nprint(max(ans))\n","fail":"from functools import reduce\nfrom fractions import gcd\n\nn = int(input())\na = list(map(int, input().split()))\nA = list(set(a))\nans = [reduce(gcd, A)]\n\nif len(A) == 1:\n print(A[0])\n exit()\nfor i in A:\n b = sorted(A)\n b.remove(i)\n if a.count(i) == 1:\n ans.append(reduce(gcd, b))\n\nprint(max(ans))\n","change":"replace","i1":11,"i2":12,"j1":11,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03061","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = list(map(int, input().split()))\n\n\ndef gcd(a, b):\n while b > 0:\n a, b = b, a % b\n return a\n\n\ngcds = []\nfor i in range(N):\n m = A[0] if i != 0 else A[1]\n for j in range(N):\n if i == j:\n continue\n m = gcd(m, A[j])\n gcds.append(m)\n\nmax_gcd = 1\nfor i in range(N):\n max_gcd = max(max_gcd, max(gcd(A[i], gcds[i]), gcds[i]))\n\nprint(max_gcd)\n","fail":"from itertools import *\nimport fractions\n\nN = int(input())\nA = list(map(int, input().split()))\n\nL = list(accumulate([0] + A, fractions.gcd))\nR = list(accumulate([0] + A[::-1], fractions.gcd))\n\nprint(max(fractions.gcd(s, t) for s, t in zip(L, R[::-1][1:])))\n","change":"replace","i1":0,"i2":24,"j1":0,"j2":10,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03061","language":"Python","original_status":"Time Limit Exceeded","pass":"def gcd(a, b):\n r = a % b\n return b if 0 == r else gcd(b, r)\n\n\ndef gcd_list(lst):\n a = lst[0]\n for i in lst[1:]:\n a = gcd(a, i)\n return a\n\n\nn = int(input())\na = list(map(int, input().split()))\nmax_value = max(a)\nans = 0\nfor i in range(n):\n target = [a[j] for j in range(n)]\n target.pop(i)\n ans = max(ans, gcd_list(target))\nprint(ans)\n","fail":"def gcd(a, b):\n if 0 == b:\n return a\n r = a % b\n return b if 0 == r else gcd(b, r)\n\n\ndef gcd_list(lst):\n a = lst[0]\n for i in lst[1:]:\n a = gcd(a, i)\n return a\n\n\nn = int(input())\na = list(map(int, input().split()))\nl = [0 for _ in range(n)]\nr = [0 for _ in range(n)]\nfor i in range(n - 1):\n l_i = 0 if 0 == i else l[i]\n l[i + 1] = gcd(l_i, a[i])\nfor i in range(n)[::-1]:\n r_i1 = 0 if i == n - 1 else r[i + 1]\n r[i] = gcd(r_i1, a[i])\nm = []\nfor i in range(n):\n r_i1 = 0 if i == n - 1 else r[i + 1]\n m.append(gcd(l[i], r_i1))\nprint(max(m))\n","change":"replace","i1":1,"i2":21,"j1":1,"j2":29,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03061","language":"Python","original_status":"Runtime Error","pass":"import math\n\nN = int(input())\nA = list(map(int, input().strip().split()))\n\ngcd_l = [0] * N\n\ngcd_l[0] = A[0]\nfor i in range(1, N):\n gcd_l[i] = math.gcd(gcd_l[i - 1], A[i])\n\ngcd_r = [0] * N\n\ngcd_r[N - 1] = A[N - 1]\nfor i in reversed(range(0, N - 1)):\n gcd_l[i] = math.gcd(gcd_r[i + 1], A[i])\n\ngcd_lr = [0] * N\n\nfor i in range(N):\n if i == 0:\n gcd_lr[i] = gcd_r[i + 1]\n elif 1 <= i <= N - 2:\n gcd_lr[i] = math.gcd(gcd_l[i - 1], gcd_r[i + 1])\n elif i == N - 1:\n gcd_lr[i] = gcd_l[i - 1]\n\nprint(max(gcd_lr))\n","fail":"def gcd(x, y):\n if y == 0:\n return x\n else:\n return gcd(y, x % y)\n\n\nN = int(input())\nA = list(map(int, input().strip().split()))\n\ngcd_l = [0] * N\n\ngcd_l[0] = A[0]\nfor i in range(1, N):\n gcd_l[i] = gcd(gcd_l[i - 1], A[i])\n\ngcd_r = [0] * N\n\ngcd_r[N - 1] = A[N - 1]\nfor i in reversed(range(0, N - 1)):\n gcd_r[i] = gcd(gcd_r[i + 1], A[i])\n\ngcd_lr = [0] * N\n\nfor i in range(N):\n if i == 0:\n gcd_lr[i] = gcd_r[i + 1]\n elif 1 <= i <= N - 2:\n gcd_lr[i] = gcd(gcd_l[i - 1], gcd_r[i + 1])\n elif i == N - 1:\n gcd_lr[i] = gcd_l[i - 1]\n\nprint(max(gcd_lr))\n","change":"replace","i1":0,"i2":24,"j1":0,"j2":29,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p03061","language":"Python","original_status":"Time Limit Exceeded","pass":"from fractions import gcd\n\nN = int(input())\nA = list(map(int, input().split()))\nans = 1\nfor i in range(0, N):\n if i == 0:\n tmp = A[1]\n else:\n tmp = A[0]\n for j in range(0, N):\n if i != j:\n tmp = gcd(A[j], tmp)\n if tmp < ans:\n break\n ans = max(ans, tmp)\nprint(ans)\n","fail":"from fractions import gcd\n\nN = int(input())\nA = list(map(int, input().split()))\nL = [0]\nfor i in range(1, N):\n L.append(gcd(A[i - 1], L[i - 1]))\nR = [0]\nfor i in range(1, N):\n R.append(gcd(R[i - 1], A[N - i]))\nR.reverse()\nans = []\nfor i in range(0, N):\n ans.append(gcd(L[i], R[i]))\nprint(max(ans))\n","change":"replace","i1":4,"i2":17,"j1":4,"j2":15,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03061","language":"Python","original_status":"Runtime Error","pass":"from math import gcd\n\n# input\nN = int(input())\nA = list(map(int, input().split()))\n\n# check\nA.sort(reverse=True)\nmax_gcd = A[0]\nchange = False\nfor a in A:\n ans = gcd(max_gcd, a)\n if ans < max_gcd and change is False:\n change = True\n continue\n max_gcd = ans\n\nprint(max_gcd)\n","fail":"from fractions import gcd\n\n\nn = int(input())\na = list(map(int, input().split()))\n\n# \u7d2f\u7a4dGCD\nleft = [0] * (n + 1)\nright = [0] * (n + 1)\nfor i in range(n):\n left[i + 1] = gcd(left[i], a[i])\n right[n - i - 1] = gcd(right[n - i], a[n - 1 - i])\n\nans = 0\nfor i in range(n):\n ans = max(ans, gcd(left[i], right[i + 1]))\nprint(ans)\n","change":"replace","i1":0,"i2":18,"j1":0,"j2":17,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p03061","language":"Python","original_status":"Runtime Error","pass":"from math import gcd\n\nn = int(input())\na = list(map(int, input().split()))\n\nforward = []\nbackward = [0 for x in range(n)]\n\nif n == 2:\n print(max(a[0], a[1]))\n exit(0)\n\nfor i in range(n):\n if i == 0:\n forward.append(a[i])\n else:\n forward.append(gcd(forward[i - 1], a[i]))\n\n\nfor i in range(n - 1, -1, -1):\n if i == n - 1:\n backward[i] = a[i]\n else:\n backward[i] = gcd(backward[i + 1], a[i])\n\n\nans = 1\n\nfor i in range(n):\n if i == 0:\n ans = max(ans, backward[1])\n elif i == n - 1:\n ans = max(ans, forward[n - 2])\n else:\n ans = max(ans, gcd(forward[i - 1], backward[i + 1]))\n\nprint(ans)\n","fail":"from fractions import gcd\n\nn = int(input())\na = list(map(int, input().split()))\n\nforward = []\nbackward = [0 for x in range(n)]\n\nif n == 2:\n print(max(a[0], a[1]))\n exit(0)\n\nfor i in range(n):\n if i == 0:\n forward.append(a[i])\n else:\n forward.append(gcd(forward[i - 1], a[i]))\n\n\nfor i in range(n - 1, -1, -1):\n if i == n - 1:\n backward[i] = a[i]\n else:\n backward[i] = gcd(backward[i + 1], a[i])\n\n\nans = 1\n\nfor i in range(n):\n if i == 0:\n ans = max(ans, backward[1])\n elif i == n - 1:\n ans = max(ans, forward[n - 2])\n else:\n ans = max(ans, gcd(forward[i - 1], backward[i + 1]))\n\nprint(ans)\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p03061","language":"Python","original_status":"Time Limit Exceeded","pass":"def make_divisors(n):\n divisors = []\n\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\n divisors.sort(reverse=True)\n return divisors\n\n\nN = int(input())\nA = sorted([int(x) for x in input().split()])\nans = 1\n\nfor i in range(2):\n divisors = make_divisors(A[i])\n\n for divisor in divisors:\n indivisible_count = 0\n for j in range(N):\n if A[j] % divisor != 0:\n indivisible_count += 1\n\n if indivisible_count <= 1 and divisor > ans:\n ans = divisor\n\nprint(ans)\n","fail":"def make_divisors(n):\n divisors = []\n\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\n return divisors\n\n\nN = int(input())\nA = sorted([int(x) for x in input().split()])\n\nans = 1\ndivisors = make_divisors(A[0]) + make_divisors(A[1])\ndivisors = sorted(set(divisors), reverse=True)\n\nfor divisor in divisors:\n indivisible_count = 0\n for i in range(N):\n if A[i] % divisor != 0:\n indivisible_count += 1\n\n if indivisible_count <= 1:\n ans = divisor\n break\n\nprint(ans)\n","change":"replace","i1":9,"i2":28,"j1":9,"j2":28,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03061","language":"Python","original_status":"Runtime Error","pass":"from math import gcd\n\nn = int(input())\na = list(map(int, input().split()))\nfromLeft = [0] * n\nfromLeft[0] = a[0]\nfromRight = [0] * n\nfromRight[0] = a[n - 1]\nfor i in range(1, n):\n fromLeft[i] = gcd(fromLeft[i - 1], a[i])\n fromRight[i] = gcd(fromRight[i - 1], a[n - i - 1])\nret = fromLeft[n - 1]\nfor i in range(n):\n if i == 0:\n curGcd = fromRight[n - 2]\n elif i == n - 1:\n curGcd = fromLeft[n - 2]\n else:\n curGcd = gcd(fromLeft[i - 1], fromRight[n - i - 2])\n ret = max(ret, curGcd)\nprint(ret)\n","fail":"def gcd(x, y):\n while y:\n x, y = y, x % y\n return x\n\n\nn = int(input())\na = list(map(int, input().split()))\nfromLeft = [0] * n\nfromLeft[0] = a[0]\nfromRight = [0] * n\nfromRight[0] = a[n - 1]\nfor i in range(1, n):\n fromLeft[i] = gcd(fromLeft[i - 1], a[i])\n fromRight[i] = gcd(fromRight[i - 1], a[n - i - 1])\nret = fromLeft[n - 1]\nfor i in range(n):\n if i == 0:\n curGcd = fromRight[n - 2]\n elif i == n - 1:\n curGcd = fromLeft[n - 2]\n else:\n curGcd = gcd(fromLeft[i - 1], fromRight[n - i - 2])\n ret = max(ret, curGcd)\nprint(ret)\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":5,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p03061","language":"Python","original_status":"Time Limit Exceeded","pass":"import fractions\nfrom functools import reduce\nimport copy\n\n\ndef gcd_list(numbers):\n return reduce(fractions.gcd, numbers)\n\n\nN = int(input())\nA = [int(i) for i in input().split()]\n\nans = 1\nfor i in range(N):\n a = copy.copy(A)\n a.pop(i)\n g = gcd_list(a)\n if g > ans:\n ans = g\nprint(ans)\n","fail":"def 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\n divisors.sort(reverse=True)\n return divisors\n\n\nN = int(input())\nA = sorted([int(x) for x in input().split()])\n\nans = 1\nfor i in range(2):\n div_list = make_divisors(A[i])\n\n for div_i in div_list:\n wrong_count = 0\n\n for A_i in A:\n if A_i % div_i != 0:\n wrong_count += 1\n\n if wrong_count <= 1 and div_i > ans:\n ans = div_i\n\nprint(ans)\n","change":"replace","i1":0,"i2":19,"j1":0,"j2":29,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03062","language":"Python","original_status":"Runtime Error","pass":"n = int(input())\na = [int(i) for i in input().split()]\nm = len(list(filter(lambda x: x < 0, a)))\ns = sum(map(abs, a))\nif m % 2 == 0 or a in 0:\n print(s)\nelse:\n print(s - 2 * min(a))\n","fail":"n = int(input())\na = [int(i) for i in input().split()]\nm = len(list(filter(lambda x: x < 0, a)))\ns = [abs(i) for i in a]\nif m % 2 == 0 or 0 in a:\n print(sum(s))\nelse:\n print(sum(s) - 2 * min(s))\n","change":"replace","i1":3,"i2":8,"j1":3,"j2":8,"error":"0","stderr":null,"stdout":19.0} {"problem_id":"p03062","language":"Python","original_status":"Runtime Error","pass":"from sys import stdin, setrecursionlimit\nfrom bisect import bisect_right\n\n\ndef main():\n input = stdin.buffer.readline\n n = int(input())\n a = list(map(int, input().split()))\n a.sort()\n\n if n == 1:\n print(abs(sum(a)))\n exit()\n\n idx = bisect_right(a, 0)\n\n if idx % 2 == 0:\n print(sum(a[idx:]) - sum(a[:idx]))\n else:\n print(sum(a[idx:]) - sum(a[:idx]) - 2 * min(-a[idx - 1], a[idx]))\n\n\nif __name__ == \"__main__\":\n setrecursionlimit(10000)\n main()\n","fail":"from sys import stdin, setrecursionlimit\nfrom bisect import bisect_right\n\n\ndef main():\n input = stdin.buffer.readline\n n = int(input())\n a = list(map(int, input().split()))\n a.sort()\n\n idx = bisect_right(a, 0)\n\n if idx % 2 == 0:\n print(sum(a[idx:]) - sum(a[:idx]))\n elif idx == n:\n print(a[idx - 1] - sum(a[: idx - 1]))\n else:\n print(sum(a[idx:]) - sum(a[:idx]) - 2 * min(-a[idx - 1], a[idx]))\n\n\nif __name__ == \"__main__\":\n setrecursionlimit(10000)\n main()\n","change":"replace","i1":10,"i2":18,"j1":10,"j2":16,"error":"0","stderr":null,"stdout":19.0} {"problem_id":"p03062","language":"Python","original_status":"Runtime Error","pass":"import numpy as np\nfrom math import inf\n\nN = int(input())\na = map(int, input().split())\n\ndp = np.zeros((N + 1, 2))\ndp[0][1] = -inf\n# dp[i][0]:=1-indexed\u3067\u3001a_i\u3068a_i+1\u3092\u53cd\u8ee2\u3055\u305b\u306a\u3044\u5834\u5408\u306e\u6700\u5927\u5024\n# dp[i][1]:=1-indexed\u3067\u3001a_i\u3068a_i+1\u3092\u53cd\u8ee2\u3055\u305b\u308b\u5834\u5408\u306e\u6700\u5927\u5024\n\nfor i, aa in enumerate(a, 0):\n dp[i + 1][0] = max(dp[i][0] + aa, dp[i][1] - aa)\n dp[i + 1][1] = max(dp[i][0] - aa, dp[i][1] + aa)\nprint(dp[N][0])\n","fail":"import numpy as np\n\ninf = float(\"inf\")\n\nN = int(input())\na = map(int, input().split())\n\ndp = np.zeros((N + 1, 2))\ndp[0][1] = -inf\n# dp[i][0]:=1-indexed\u3067\u3001a_i\u3068a_i+1\u3092\u53cd\u8ee2\u3055\u305b\u306a\u3044\u5834\u5408\u306e\u6700\u5927\u5024\n# dp[i][1]:=1-indexed\u3067\u3001a_i\u3068a_i+1\u3092\u53cd\u8ee2\u3055\u305b\u308b\u5834\u5408\u306e\u6700\u5927\u5024\n\nfor i, aa in enumerate(a, 0):\n dp[i + 1][0] = max(dp[i][0] + aa, dp[i][1] - aa)\n dp[i + 1][1] = max(dp[i][0] - aa, dp[i][1] + aa)\nprint(int(dp[N][0]))\n","change":"replace","i1":1,"i2":15,"j1":1,"j2":16,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03062","language":"Python","original_status":"Runtime Error","pass":"from bisect import bisect_left\n\nn = int(input())\na = tuple(sorted(map(int, input().split())))\nj = bisect_left(a, 0)\n\np = a[j:]\nm = a[:j]\n\nif len(m) % 2 == 0:\n print(sum(p) - sum(m))\nelse:\n print(sum(p[1:]) - sum(m[:-1]) + abs(p[0] + m[-1]))\n","fail":"from bisect import bisect_left\n\nn = int(input())\na = tuple(sorted(map(int, input().split())))\nb = tuple(sorted(map(abs, a)))\n\nj = bisect_left(a, 0)\nm = a[:j]\n\nif len(m) % 2 == 0:\n print(sum(b))\nelse:\n print(sum(b) - min(b) * 2)\n","change":"replace","i1":4,"i2":13,"j1":4,"j2":13,"error":"0","stderr":null,"stdout":19.0} {"problem_id":"p03062","language":"Python","original_status":"Runtime Error","pass":"N = int(input())\nA = [int(i) for i in input().split()]\n\nB = map(abs, A)\nif len([a for a in A if a < 0]) % 2 == 1:\n print(sum(B) - min(B))\nelse:\n print(sum(B))\n","fail":"N = int(input())\nA = [int(i) for i in input().split()]\n\nB = [abs(a) for a in A]\nif len([a for a in A if a < 0]) % 2 == 1:\n print(sum(B) - 2 * min(B))\nelse:\n print(sum(B))\n","change":"replace","i1":3,"i2":6,"j1":3,"j2":6,"error":"0","stderr":null,"stdout":19.0} {"problem_id":"p03062","language":"Python","original_status":"Time Limit Exceeded","pass":"from functools import lru_cache\nimport sys\n\nsys.setrecursionlimit(10000000)\n\nN = int(input())\nA = list(map(int, input().split()))\n\n\n@lru_cache(maxsize=None)\ndef rec(i, reverse):\n if i == N - 1:\n return A[i] * reverse\n\n num_normal = rec(i + 1, 1) + (A[i] * reverse)\n num_reverse = rec(i + 1, -1) + (-1 * A[i] * reverse)\n\n return max(num_normal, num_reverse)\n\n\nprint(rec(0, 1))\n","fail":"N = int(input())\nA = list(map(int, input().split()))\n\nminus_count = 0\n\nfor a in A:\n if a < 0:\n minus_count += 1\n\ntotal = 0\nmin_num = 10**9\n\nfor a in A:\n total += abs(a)\n min_num = min(min_num, abs(a))\n\nif minus_count % 2 == 1:\n total -= 2 * min_num\n\nprint(total)\n","change":"replace","i1":0,"i2":21,"j1":0,"j2":20,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03062","language":"Python","original_status":"Runtime Error","pass":"import math\n\n\ndef sub():\n N, As = [input() for _ in range(2)]\n N = int(N)\n As = [int(e) for e in As.split(\" \")]\n\n dp = {(-1, 0): 0, (-1, 1): -math.inf}\n for i in range(0, N):\n dp[(i, 0)] = max(dp[(i - 1, 0)] + As[i], dp[(i - 1, 1)] - As[i])\n dp[(i, 1)] = max(dp[(i - 1, 0)] - As[i], dp[(i - 1, 1)] + As[i])\n print(\"{}\".format(dp[(N - 1, 0)]))\n\n\nsub()\n","fail":"def sub():\n N, As = [input() for _ in range(2)]\n N = int(N)\n As = [int(e) for e in As.split(\" \")]\n\n dp = {(-1, 0): 0, (-1, 1): -1e10}\n for i in range(0, N):\n dp[(i, 0)] = max(dp[(i - 1, 0)] + As[i], dp[(i - 1, 1)] - As[i])\n dp[(i, 1)] = max(dp[(i - 1, 0)] - As[i], dp[(i - 1, 1)] + As[i])\n print(\"{}\".format(dp[(N - 1, 0)]))\n\n\nsub()\n","change":"replace","i1":0,"i2":9,"j1":0,"j2":6,"error":"0","stderr":null,"stdout":19.0} {"problem_id":"p03064","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = [int(input()) for _ in range(N)]\n\nsum_A = sum(A)\nMOD = 998244353\n\ndp1 = [0] * (sum_A + 1)\ndp2 = [0] * (sum_A + 1)\ndp1[0] = dp2[0] = 1\n\nfor a in A:\n dp1_ = [0] * (sum_A + 1)\n dp2_ = [0] * (sum_A + 1)\n for i in range(sum_A + 1):\n # R \u306b\u5857\u3063\u305f\u5834\u5408\n if i + a <= sum_A:\n dp1_[i + a] += dp1[i]\n dp2_[i + a] += dp2[i]\n # G, B \u306b\u5857\u3063\u305f\u5834\u5408\n dp1_[i] += dp1[i] * 2\n dp2_[i] += dp2[i]\n dp1 = dp1_\n dp2 = dp2_\n\nans = pow(3, N)\nfor i in range(sum_A + 1):\n if i * 2 >= sum_A:\n ans -= dp1[i] * 3\n if i * 2 == sum_A:\n ans += dp2[i] * 3\nprint(ans % MOD)\n","fail":"N = int(input())\nA = [int(input()) for _ in range(N)]\n\nsum_A = sum(A)\nMOD = 998244353\n\ndp1 = [0] * (sum_A + 1)\ndp2 = [0] * (sum_A + 1)\ndp1[0] = dp2[0] = 1\n\n\nfor a in A:\n dp1_ = [0] * (sum_A + 1)\n dp2_ = [0] * (sum_A + 1)\n for i in range(sum_A + 1):\n if i - a >= 0:\n # R \u306b\u5857\u308c\u308b\u5834\u5408\n dp1_[i] = (dp1[i - a] + dp1[i] * 2) % MOD\n dp2_[i] = (dp2[i - a] + dp2[i]) % MOD\n else:\n dp1_[i] = (dp1[i] * 2) % MOD\n dp2_[i] = dp2[i]\n dp1, dp2 = dp1_, dp2_\n\n\nans = pow(3, N, MOD)\nfor i in range(sum_A + 1):\n if i * 2 >= sum_A:\n ans = (ans - dp1[i] * 3 + MOD * 3) % MOD\n if i * 2 == sum_A:\n ans = (ans + dp2[i] * 3) % MOD\nprint(ans)\n","change":"replace","i1":10,"i2":31,"j1":10,"j2":32,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03068","language":"Python","original_status":"Runtime Error","pass":"# -*- coding: utf-8 -*-\nN = int(input())\nS = list(str(input()))\nK = int(input())\n\nfor i in range(N):\n if S[i] != S[K]:\n S[i] = \"*\"\n\"\".join(S)\nprint(S)\n","fail":"# -*- coding: utf-8 -*-\nN = int(input())\nS = list(str(input()))\nK = int(input())\n\nfor i in range(N):\n if S[i] != S[K - 1]:\n S[i] = \"*\"\n\nZ = \"\".join(S)\nprint(Z)\n","change":"replace","i1":6,"i2":10,"j1":6,"j2":11,"error":"WA","stderr":null,"stdout":"['*', 'r', 'r', '*', 'r']\n"} {"problem_id":"p03068","language":"Python","original_status":"Runtime Error","pass":"input()\nS = input()\nK = int(input())\n\nc = S[K]\n\nprint(\"\".join([v if v == c else \"*\" for v in S]))\n","fail":"input()\nS = input()\nK = int(input())\n\nc = S[K - 1]\n\nprint(\"\".join([v if v == c else \"*\" for v in S]))\n","change":"replace","i1":4,"i2":5,"j1":4,"j2":5,"error":"0","stderr":null,"stdout":"*rr*r\n"} {"problem_id":"p03068","language":"Python","original_status":"Runtime Error","pass":"n = int(input())\ns = input()\nk = int(input())\nresult = []\n\nfor x in s:\n if x != s[k]:\n result.append(\"*\")\n else:\n result.append(x)\n\nprint(\"\".join(result))\n","fail":"n = int(input())\ns = input()\nk = int(input())\nresult = []\n\nfor x in s:\n if x != s[k - 1]:\n result.append(\"*\")\n else:\n result.append(x)\n\nprint(\"\".join(result))\n","change":"replace","i1":6,"i2":7,"j1":6,"j2":7,"error":"0","stderr":null,"stdout":"*rr*r\n"} {"problem_id":"p03068","language":"Python","original_status":"Runtime Error","pass":"N = int(input())\nS = list(input())\nK = int(input())\n\ntarget = S[K]\nans = \"\"\nfor s in S:\n ans += s if s == target else \"*\"\nprint(ans)\n","fail":"N = int(input())\nS = list(input())\nK = int(input())\n\ntarget = S[K - 1]\nans = \"\"\nfor s in S:\n ans += s if s == target else \"*\"\nprint(ans)\n","change":"replace","i1":4,"i2":5,"j1":4,"j2":5,"error":"0","stderr":null,"stdout":"*rr*r\n"} {"problem_id":"p03068","language":"Python","original_status":"Runtime Error","pass":"n = int(input())\ns = str(input())\nk = int(input())\n\nchar = s[k]\nresult = \"\"\nfor x in s:\n if x == char:\n result += char\n else:\n result += \"*\"\nprint(result)\n","fail":"n = int(input())\ns = str(input())\nk = int(input())\n\nchar = s[k - 1]\nresult = \"\"\nfor x in s:\n if x == char:\n result += char\n else:\n result += \"*\"\nprint(result)\n","change":"replace","i1":4,"i2":5,"j1":4,"j2":5,"error":"0","stderr":null,"stdout":"*rr*r\n"} {"problem_id":"p03069","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nS = input()\n\nres = float(\"inf\")\n\nif \".\" not in S or \"#\" not in S:\n res = 0\n\nfor i in range(N):\n res = min(res, S[:i].count(\"#\") + S[i:].count(\".\"))\n\nprint(res)\n","fail":"N = int(input())\nS = input()\n\nres = float(\"inf\")\n\n# if \"#\" not in S or \".\" not in S:\n# res = 0\n\ncounts = []\ncounts.append((0, 0))\na, b = 0, 0\nfor s in S:\n if s == \"#\":\n a += 1\n elif s == \".\":\n b += 1\n counts.append((a, b))\n\nfor i in range(N + 1):\n res = min(res, counts[i][0] + counts[-1][1] - counts[i][1])\n\nprint(res)\n","change":"replace","i1":5,"i2":10,"j1":5,"j2":20,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03069","language":"Python","original_status":"Runtime Error","pass":"N = int(input())\nS = input()\n\nW = [0] * N\nW[-1] += S[-1] == \".\"\nfor i in range(N - 2, -1, -1):\n W[i] = W[i + 1] + (S[i] == \".\")\n\nB = [0] * N\nB[0] += S[0] == \"#\"\nfor i in range(1, N):\n B[i] = B[i - 1] + (S[i] == \"#\")\n\nT = [w + b for w, b in zip(W, B)]\nprint(min(*T, W[0], B[-1]))\n","fail":"N = int(input())\nS = input()\n\nW = [0] * N\nW[-1] += S[-1] == \".\"\nfor i in range(N - 2, -1, -1):\n W[i] = W[i + 1] + (S[i] == \".\")\n\nB = [0] * N\nB[0] += S[0] == \"#\"\nfor i in range(1, N):\n B[i] = B[i - 1] + (S[i] == \"#\")\n\nT = [w + b - 1 for w, b in zip(W, B)]\nT = min(T)\nprint(min(T, W[0], B[-1]))\n","change":"replace","i1":13,"i2":15,"j1":13,"j2":16,"error":"0","stderr":null,"stdout":1.0} {"problem_id":"p03069","language":"Python","original_status":"Runtime Error","pass":"N = int(input())\nS = input()\n\nfor i in range(N - 1, -1, -1):\n if S[i] == \".\":\n right_white = i\n break\n\nprint(min(S.count(\".\"), S[:right_white].count(\"#\")))\n","fail":"N = int(input())\nS = input()\n\nwhite = [0] * (N + 1)\nfor i in range(N):\n if S[i] == \".\":\n white[i + 1] = white[i] + 1\n else:\n white[i + 1] = white[i]\n\nans = N\nfor i in range(N + 1):\n tmp = (i - white[i]) + (white[-1] - white[i])\n if tmp < ans:\n ans = tmp\n\nprint(ans)\n","change":"replace","i1":3,"i2":9,"j1":3,"j2":17,"error":"0","stderr":null,"stdout":1.0} {"problem_id":"p03071","language":"Python","original_status":"Runtime Error","pass":"a, b, t = map(int, input().split())\n\nprint((t \/\/ a) * b)\n","fail":"a, b = map(int, input().split())\n\ntotal = 0\n\nif a > b:\n total = 2 * a - 1\nelif b > a:\n total = 2 * b - 1\nelse:\n total = 2 * a\n\nprint(total)\n","change":"replace","i1":0,"i2":3,"j1":0,"j2":12,"error":"ValueError: not enough values to unpack (expected 3, got 2)","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03071\/Python\/s212213791.py\", line 1, in \n a, b, t = map(int, input().split())\nValueError: not enough values to unpack (expected 3, got 2)\n","stdout":null} {"problem_id":"p03071","language":"Python","original_status":"Runtime Error","pass":"a, b = map(int, input().split())\n\nif a >= b:\n tmp1 = a\n a -= 1\nelse:\n tmp2 = b\n b -= 1\n\nif a >= b:\n tmp2 = a\nelse:\n tmp2 = b\n\nprint(tmp1 + tmp2)\n","fail":"a, b = map(int, input().split())\n\nif a >= b:\n tmp1 = a\n a -= 1\nelse:\n tmp1 = b\n b -= 1\n\nif a >= b:\n tmp2 = a\nelse:\n tmp2 = b\n\nprint(tmp1 + tmp2)\n","change":"replace","i1":6,"i2":7,"j1":6,"j2":7,"error":"0","stderr":null,"stdout":9.0} {"problem_id":"p03072","language":"Python","original_status":"Runtime Error","pass":"n = int(input())\nh = map(int, input().split())\ntotal = 1\nmax_value = h[0]\nfor i in range(1, n):\n if max_value <= h[i]:\n total += 1\n max_value = max(max_value, h[i])\nprint(total)\n","fail":"n = int(input())\nh = list(map(int, input().split()))\ntotal = 1\nmax_value = h[0]\nfor i in range(1, n):\n if max_value <= h[i]:\n total += 1\n max_value = max(max_value, h[i])\nprint(total)\n","change":"replace","i1":1,"i2":2,"j1":1,"j2":2,"error":"TypeError: 'map' object is not subscriptable","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03072\/Python\/s924267077.py\", line 4, in \n max_value = h[0]\nTypeError: 'map' object is not subscriptable\n","stdout":null} {"problem_id":"p03072","language":"Python","original_status":"Runtime Error","pass":"n = int(input())\nh = [int(x) for x in input().split()]\nc = 0\nfor i in range(n):\n if h[i] >= max(h[:i]):\n c += 1\nprint(c)\n","fail":"n = int(input())\nh = [int(x) for x in input().split()]\nc = 1\n\nfor i in range(1, n):\n if h[i] >= max(h[:i]):\n c += 1\nprint(c)\n","change":"replace","i1":2,"i2":4,"j1":2,"j2":5,"error":"ValueError: max() arg is an empty sequence","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03072\/Python\/s836485359.py\", line 5, in \n if h[i] >= max(h[:i]):\nValueError: max() arg is an empty sequence\n","stdout":null} {"problem_id":"p03072","language":"Python","original_status":"Runtime Error","pass":"n = int(input().split())\nh = list(map(int, input().split()))\nheight = h[0]\ncounter = 0\nfor i in h:\n if h[i] >= height:\n counter += 1\n height = h[i]\n\nprint(counter)\n","fail":"n = int(input())\nh = list(map(int, input().split()))\nheight = h[0]\ncounter = 0\nfor i in range(n):\n if h[i] >= height:\n counter += 1\n height = h[i]\n\nprint(counter)\n","change":"replace","i1":0,"i2":5,"j1":0,"j2":5,"error":"TypeError: int() argument must be a string, a bytes-like object or a real number, not 'list'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03072\/Python\/s611455430.py\", line 1, in \n n = int(input().split())\nTypeError: int() argument must be a string, a bytes-like object or a real number, not 'list'\n","stdout":null} {"problem_id":"p03072","language":"Python","original_status":"Runtime Error","pass":"n = int(input())\nh_list = map(int, input().split())\nhighest = max(h_list)\ncount = 1\n\nfor i in range(1, n):\n if highest <= h_list[i]:\n count += 1\n\nprint(count)\n","fail":"n = int(input())\nh_list = list(map(int, input().split()))\nhighest = 0\ncount = 0\n\nfor i in range(n):\n if highest <= h_list[i]:\n count += 1\n highest = h_list[i]\n\nprint(count)\n","change":"replace","i1":1,"i2":8,"j1":1,"j2":9,"error":"TypeError: 'map' object is not subscriptable","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03072\/Python\/s767322373.py\", line 7, in \n if highest <= h_list[i]:\nTypeError: 'map' object is not subscriptable\n","stdout":null} {"problem_id":"p03074","language":"Python","original_status":"Time Limit Exceeded","pass":"def main():\n N, K = map(int, input().split())\n S = input()\n nums = []\n now = 1\n cnt = 0\n for s in S:\n if int(s) == now:\n cnt += 1\n else:\n nums.append(cnt)\n now ^= 1\n cnt = 1\n if cnt > 0:\n nums.append(cnt)\n if len(nums) % 2 == 0:\n nums.append(0)\n add = 2 * K + 1\n ans = 0\n for cnt in range(0, len(nums), 2):\n tmp = 0\n left = cnt\n right = min(cnt + add, len(nums))\n for j in range(left, right):\n tmp += nums[j]\n ans = max(tmp, ans)\n print(ans)\n\n\nmain()\n","fail":"def main():\n N, K = map(int, input().split())\n S = input()\n nums = []\n now = 1\n cnt = 0\n for s in S:\n if int(s) == now:\n cnt += 1\n else:\n nums.append(cnt)\n now ^= 1\n cnt = 1\n if cnt > 0:\n nums.append(cnt)\n if len(nums) % 2 == 0:\n nums.append(0)\n add = 2 * K + 1\n ans = 0\n left = 0\n right = 0\n tmp = 0\n for cnt in range(0, len(nums), 2):\n nleft = cnt\n nright = min(cnt + add, len(nums))\n while nleft > left:\n tmp -= nums[left]\n left += 1\n while nright > right:\n tmp += nums[right]\n right += 1\n ans = max(tmp, ans)\n print(ans)\n\n\nmain()\n","change":"replace","i1":19,"i2":25,"j1":19,"j2":31,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03074","language":"Python","original_status":"Runtime Error","pass":"N, K = map(int, input().split())\nS = input()\nL = [0]\nprev = S[0]\nnum = 1\nfor s in S[1:]:\n if s == prev:\n num += 1\n else:\n L.append(num)\n num = 1\n prev = s\nL.append(num)\n# print(L)\nfor i in range(1, len(L)):\n L[i] += L[i - 1]\n# print(L)\nleft = 0\nif S[0] == \"1\":\n right = min(2 * K + 1, len(L) - 1)\nelse:\n right = min(2 * K, len(L) - 1)\nnum = 0\nwhile right < len(L):\n # print(\"L[\" + str(right) + \"] - L[\" + str(left) + \"] = \" + str(L[right] - L[left]))\n num = max(num, L[right] - L[left])\n if left == 0 and S[0] == \"0\":\n left += 1\n else:\n left += 2\n right += 2\nif S[-1] == \"0\" and len(S) > 1:\n right -= 1\n # print(\"L[\" + str(right) + \"] - L[\" + str(left) + \"] = \" + str(L[right] - L[left]))\n num = max(num, L[right] - L[left])\nprint(num)\n","fail":"N, K = map(int, input().split())\nS = input()\nif S == \"0\":\n print(1)\n exit()\nif S.count(\"0\") == N:\n print(N)\n exit()\nL = [0]\nprev = S[0]\nnum = 1\nfor s in S[1:]:\n if s == prev:\n num += 1\n else:\n L.append(num)\n num = 1\n prev = s\nL.append(num)\n# print(L)\nfor i in range(1, len(L)):\n L[i] += L[i - 1]\n# print(L)\nleft = 0\nif S[0] == \"1\":\n right = min(2 * K + 1, len(L) - 1)\nelse:\n right = min(2 * K, len(L) - 1)\nnum = 0\nwhile right < len(L):\n # print(\"L[\" + str(right) + \"] - L[\" + str(left) + \"] = \" + str(L[right] - L[left]))\n num = max(num, L[right] - L[left])\n if left == 0 and S[0] == \"0\":\n left += 1\n else:\n left += 2\n right += 2\nif S[-1] == \"0\":\n right -= 1\n # print(\"L[\" + str(right) + \"] - L[\" + str(left) + \"] = \" + str(L[right] - L[left]))\n num = max(num, L[right] - L[left])\nprint(num)\n","change":"replace","i1":2,"i2":32,"j1":2,"j2":38,"error":"0","stderr":null,"stdout":4.0} {"problem_id":"p03075","language":"Python","original_status":"Runtime Error","pass":"from itertools import product\n\nx, y, z, k = list(map(int, input().split()))\na = list(map(int, input().split()))\nb = list(map(int, input().split()))\nc = list(map(int, input().split()))\n\nab = [ai + bi for (ai, bi) in product(a, b)]\nab.sort(reverse=True)\nabc = [abi + ci for (abi, ci) in product(ab[: min(k, x * y * z)], c)]\nabc.sort(reverse=True)\n\nfor abci in abc[: min(k, x * y * z)]:\n print(abci)\n","fail":"#!\/usr\/bin\/env python3\nimport sys\n\n\ndef solve(a: int, b: int, c: int, d: int, e: int, k: int):\n print(\"Yay!\" if e - a <= k else \":(\")\n\n\n# Generated by 1.1.7.1 https:\/\/github.com\/kyuridenamida\/atcoder-tools (tips: You use the default template now. You can remove this line by using your custom template)\ndef main():\n def iterate_tokens():\n for line in sys.stdin:\n for word in line.split():\n yield word\n\n tokens = iterate_tokens()\n a = int(next(tokens)) # type: int\n b = int(next(tokens)) # type: int\n c = int(next(tokens)) # type: int\n d = int(next(tokens)) # type: int\n e = int(next(tokens)) # type: int\n k = int(next(tokens)) # type: int\n solve(a, b, c, d, e, k)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":0,"i2":14,"j1":0,"j2":27,"error":"ValueError: not enough values to unpack (expected 4, got 1)","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03075\/Python\/s634556284.py\", line 3, in \n x, y, z, k = list(map(int, input().split()))\nValueError: not enough values to unpack (expected 4, got 1)\n","stdout":null} {"problem_id":"p03076","language":"Python","original_status":"Runtime Error","pass":"times = [int(input()) for i in range(5)]\ncost = 0\np_times = [time % 10 for time in times]\nif sum(p_times) == 0 and min(p_times) > 0:\n last_order = False\nelse:\n last_order = min([i for i in p_times if i > 0])\n last_order_idx = p_times.index(last_order)\n\nif last_order:\n cost = times.pop(last_order_idx)\n\nfor time in times:\n if time % 10 == 0:\n cost += time\n else:\n cost += time + (10 - time % 10)\n\nprint(cost)\n","fail":"times = [int(input()) for i in range(5)]\ncost = 0\np_times = [time % 10 for time in times]\n\nif (sum([i % 10 for i in p_times]) == 0) & (min(times) > 0):\n last_order = False\nelse:\n last_order = min([i for i in p_times if i > 0])\n last_order_idx = p_times.index(last_order)\n\nif last_order:\n cost = times.pop(last_order_idx)\n\nfor time in times:\n if time % 10 == 0:\n cost += time\n else:\n cost += time + (10 - time % 10)\n\nprint(cost)\n","change":"replace","i1":3,"i2":4,"j1":3,"j2":5,"error":"0","stderr":null,"stdout":215.0} {"problem_id":"p03076","language":"Python","original_status":"Runtime Error","pass":"dishes = [int(input()) for _ in range(5)]\n\ndishes = sorted(dishes, key=lambda x: 10 - int(str(x)[-1]))\na = list()\nb = list()\nfor d in dishes:\n if d % 10 == 0:\n a.append(d)\n else:\n b.append(d)\nb = [d + 10 - d % 10 for d in b[:-1]] + [b[-1]]\ndishes = a + b\n# print(sum(dishes))\n#\nprint(1)\n","fail":"dishes = [int(input()) for _ in range(5)]\n\ndishes = sorted(dishes, key=lambda x: 10 - int(str(x)[-1]))\na = list()\nb = list()\nfor d in dishes:\n if d % 10 == 0:\n a.append(d)\n else:\n b.append(d)\nif len(b) > 0:\n b = [d + 10 - d % 10 for d in b[:-1]] + [b[-1]]\ndishes = a + b\nprint(sum(dishes))\n","change":"replace","i1":10,"i2":15,"j1":10,"j2":14,"error":"WA","stderr":null,"stdout":1.0} {"problem_id":"p03076","language":"Python","original_status":"Runtime Error","pass":"menu = [int(input()) for _ in range(5)]\nans = 0\nmod = []\nfor time in menu:\n if time % 10 == 0:\n ans += time\n else:\n ans += time\n mod.append(10 - time % 10)\nmod.remove(max(mod))\nans += sum(mod)\nprint(ans)\n","fail":"menu = [int(input()) for _ in range(5)]\nans = 0\nmod = []\nfor time in menu:\n if time % 10 == 0:\n ans += time\n else:\n ans += time\n mod.append(10 - time % 10)\ntry:\n mod.remove(max(mod))\n ans += sum(mod)\nexcept:\n pass\nprint(ans)\n","change":"replace","i1":9,"i2":11,"j1":9,"j2":14,"error":"0","stderr":null,"stdout":215.0} {"problem_id":"p03076","language":"Python","original_status":"Runtime Error","pass":"n = [int(input()) for _ in range(5)]\nfirst_digit = []\nfor num in n:\n z = int(str(num)[-1])\n if z > 0:\n first_digit.append(z)\n\n# print(first_digit)\nt = 0\nfor i in range(len(n)):\n t += -(-n[i] \/\/ 10) * 10\nprint(t - (10 - min(first_digit)))\n","fail":"n = [int(input()) for _ in range(5)]\nfirst_digit = []\nfor num in n:\n z = int(str(num)[-1])\n if z > 0:\n first_digit.append(z)\n\n\n# print(first_digit)\nt = 0\nfor i in range(len(n)):\n t += -(-n[i] \/\/ 10) * 10\nif len(first_digit) == 0:\n print(t)\nelse:\n print(t - (10 - min(first_digit)))\n","change":"replace","i1":7,"i2":12,"j1":7,"j2":16,"error":"0","stderr":null,"stdout":215.0} {"problem_id":"p03076","language":"Python","original_status":"Runtime Error","pass":"# A = int(input())\n# B = int(input())\n# C = int(input())\n# D = int(input())\n# E = int(input())\nM = [int(input()) for _ in range(5)]\nm = []\nT = 0\nfor i in range(5):\n if M[i] % 10 == 0:\n T += M[i]\n else:\n T += M[i]\n T += 10 - M[i] % 10\n m.append(M[i] % 10)\nprint(T - (10 - min(m)))\n","fail":"M = [int(input()) for _ in range(5)]\nm = []\nT = 0\nfor i in range(5):\n if M[i] % 10 == 0:\n T += M[i]\n else:\n T += M[i]\n T += 10 - M[i] % 10\n m.append(M[i] % 10)\nprint(T - (10 - (10 if not m else min(m))))\n","change":"replace","i1":0,"i2":16,"j1":0,"j2":11,"error":"0","stderr":null,"stdout":215.0} {"problem_id":"p03076","language":"Python","original_status":"Runtime Error","pass":"def main():\n K = [int(input()) for _ in range(5)]\n ans = []\n A = []\n for k in K:\n a = k % 10\n if a == 0:\n ans.append(k)\n else:\n ans.append(k + (10 - a))\n A.append(a)\n print(sum(ans) - (10 - min(A)))\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"def main():\n K = [int(input()) for _ in range(5)]\n ans = []\n A = [0]\n for k in K:\n a = k % 10\n if a == 0:\n ans.append(k)\n else:\n ans.append(k + (10 - a))\n A.append(10 - a)\n print(sum(ans) - max(A))\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":3,"i2":12,"j1":3,"j2":12,"error":"0","stderr":null,"stdout":215.0} {"problem_id":"p03076","language":"Python","original_status":"Runtime Error","pass":"L = [input() for i in range(1, 6)]\n\nli = list(filter(lambda x: x[-1] != \"0\", L))\nlast = int(sorted(li, key=lambda x: x[-1])[0])\n\nt = sum(map(int, L)) - last\nprint(t + (10 - (t % 10)) + last)\n","fail":"import math\n\nL = [int(input()) for i in range(5)]\n\ntotal = 0\nsub = 0\nfor i in L:\n if i % 10 == 0:\n total += i\n else:\n rest = 10 - (i % 10)\n if rest > sub:\n sub = rest\n total += math.ceil(i \/ 10) * 10\n\nprint(total - sub)\n","change":"replace","i1":0,"i2":7,"j1":0,"j2":16,"error":"0","stderr":null,"stdout":215.0} {"problem_id":"p03076","language":"Python","original_status":"Runtime Error","pass":"one = []\nten = []\n\nmenu = [int(input()) for i in range(5)]\n\nfor i in range(5):\n one.append(menu[i] % 10)\n ten.append(menu[i] \/\/ 10)\n\nfor i in range(5):\n if one[i] == 0:\n one[i] = 10\n\none_min = min(one)\n\nfor i in range(5):\n if one[i] == 10:\n one[i] = 0\n\nfor i in range(5):\n if one_min == one[i]:\n one_min_idx = i\n\ntotal = 0\n\nfor i in range(5):\n if one_min_idx != i:\n if one[i] == 0:\n total += ten[i] * 10\n else:\n total += ten[i] * 10 + 10\n\ntotal += menu[one_min_idx]\n\nprint(total)\n","fail":"one = []\n\nmenu = [int(input()) for i in range(5)]\n\nfor i in range(5):\n one.append(10 - menu[i] % 10)\n\nfor i in range(5):\n if one[i] == 10:\n one[i] = 0\n\ntotal = 0\ncnt = 0\nfor i in range(5):\n if cnt == 0 and one[i] == max(one):\n total += menu[i]\n cnt = 1\n else:\n total += menu[i]\n total += one[i]\n\nprint(total)\n","change":"replace","i1":1,"i2":33,"j1":1,"j2":20,"error":"0","stderr":null,"stdout":215.0} {"problem_id":"p03076","language":"Python","original_status":"Runtime Error","pass":"dish = [int(input()) for x in range(5)]\nhitoketa = list(map(int, [str(x)[-1] for x in dish]))\n\nlast = 999\nfor i in hitoketa:\n if not i % 10 == 0:\n last = min(last, i)\n\nlast = dish[hitoketa.index(last)]\nans = last\nskip = False\nfor i in dish:\n if i == last and not skip:\n skip = True\n elif i % 10 == 0:\n ans += i\n else:\n ans += (i \/\/ 10 + 1) * 10\n\nprint(ans)\n","fail":"dish = [int(input()) for x in range(5)]\nhitoketa = list(map(int, [str(x)[-1] for x in dish]))\n\nlast = 999\nfor i in hitoketa:\n if not i % 10 == 0:\n last = min(last, i)\n\nif last != 999:\n last = dish[hitoketa.index(last)]\nelse:\n last = dish[0]\n\nans = last\nskip = False\n\nfor i in dish:\n if i == last and not skip:\n skip = True\n elif i % 10 == 0:\n ans += i\n else:\n ans += (i \/\/ 10 + 1) * 10\n\nprint(ans)\n","change":"replace","i1":8,"i2":11,"j1":8,"j2":16,"error":"0","stderr":null,"stdout":215.0} {"problem_id":"p03076","language":"Python","original_status":"Runtime Error","pass":"orders = [int(input()) for _ in range(5)]\n\nrest = []\ntime = 0\nfor order in orders:\n if order % 10 == 0:\n time += order\n else:\n rest.append(order)\n\nrest_mods = list(map(lambda x: x % 10, rest))\nmin_mods_index = rest_mods.index(min(rest_mods))\nfor i in range(len(rest)):\n time += rest[i]\n if i != min_mods_index:\n time += 10 - rest[i] % 10\nprint(time)\n","fail":"orders = [int(input()) for _ in range(5)]\n\nrest = []\ntime = 0\nfor order in orders:\n if order % 10 == 0:\n time += order\n else:\n rest.append(order)\n\nrest_mods = list(map(lambda x: x % 10, rest))\n\nif len(rest_mods) > 0:\n min_mods_index = rest_mods.index(min(rest_mods))\n for i in range(len(rest)):\n time += rest[i]\n if i != min_mods_index:\n time += 10 - rest[i] % 10\nelse:\n time += sum(rest)\nprint(time)\n","change":"replace","i1":11,"i2":16,"j1":11,"j2":20,"error":"0","stderr":null,"stdout":215.0} {"problem_id":"p03076","language":"Python","original_status":"Runtime Error","pass":"A = int(input())\nB = int(input())\nC = int(input())\nD = int(input())\nE = int(input())\n\norders = [A, B, C, D, E]\nmax_fp = 10\nans = 0\n\nfor i, order in enumerate(orders):\n if order % 10 < max_fp and order % 10 != 0:\n max_fp = order % 10\n last_order = i\n\nfor i, order in enumerate(orders):\n if i == last_order or order % 10 == 0:\n ans += order\n else:\n ans += (order \/\/ 10 + 1) * 10\n\nprint(ans)\n","fail":"A = int(input())\nB = int(input())\nC = int(input())\nD = int(input())\nE = int(input())\n\norders = [A, B, C, D, E]\nmax_fp = 10\nans = 0\nlast_order = 0\n\nfor i, order in enumerate(orders):\n if order % 10 < max_fp and order % 10 != 0:\n max_fp = order % 10\n last_order = i\n\nfor i, order in enumerate(orders):\n if i == last_order or order % 10 == 0:\n ans += order\n else:\n ans += (order \/\/ 10 + 1) * 10\n\nprint(ans)\n","change":"insert","i1":9,"i2":9,"j1":9,"j2":10,"error":"0","stderr":null,"stdout":215.0} {"problem_id":"p03076","language":"Python","original_status":"Runtime Error","pass":"order_time = [0, 0, 0, 0, 0]\norder = len(order_time)\ntime = 0\nlast_order = 9\ncount_change = 0\n\nfor i in range(0, order):\n order_time[i] = int(input())\n if (order_time[i] % 10 != 0) and (order_time[i] % 10 <= last_order % 10):\n last_order = order_time[i]\n count_change += 1\n\nif count_change == 0:\n last_order = order_time[i]\n\nfor i in range(0, order):\n if order_time[i] % 10 != 0:\n time += order_time[i] \/\/ 10 * 10 + 10\n else:\n time += order_time[i]\n\ntime -= last_order \/\/ 10 * 10 + 10\ntime += last_order\n\nprint(time)\norder_time = [0, 0, 0, 0, 0]\norder = len(order_time)\ntime = 0\nlast_order = 9\ncount_change = 0\n\nfor i in range(0, order):\n order_time[i] = int(input())\n if (order_time[i] % 10 != 0) and (order_time[i] % 10 <= last_order % 10):\n last_order = order_time[i]\n count_change += 1\n\nfor i in range(0, order):\n if order_time[i] % 10 != 0:\n time += order_time[i] \/\/ 10 * 10 + 10\n else:\n time += order_time[i]\n\nif count_change == 0:\n last_order = order_time[i]\nelse:\n time -= last_order \/\/ 10 * 10 + 10\n time += last_order\n\nprint(time)\n","fail":"order_time = [0, 0, 0, 0, 0]\norder = len(order_time)\ntime = 0\nlast_order = 9\ncount_change = 0\n\nfor i in range(0, order):\n order_time[i] = int(input())\n if (order_time[i] % 10 != 0) and (order_time[i] % 10 <= last_order % 10):\n last_order = order_time[i]\n count_change += 1\n\nfor i in range(0, order):\n if order_time[i] % 10 != 0:\n time += order_time[i] \/\/ 10 * 10 + 10\n else:\n time += order_time[i]\n\nif count_change == 0:\n last_order = 0\nelse:\n time -= last_order \/\/ 10 * 10 + 10\n time += last_order\n\nprint(time)\n","change":"replace","i1":0,"i2":45,"j1":0,"j2":20,"error":"EOFError: EOF when reading a line","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03076\/Python\/s884853631.py\", line 33, in \n order_time[i] = int(input())\nEOFError: EOF when reading a line\n","stdout":215.0} {"problem_id":"p03076","language":"Python","original_status":"Runtime Error","pass":"five_dish = [int(input()) for _ in range(5)]\nidx = None\nmaxdiff = 0\nresult = 0\nfor i in range(len(five_dish)):\n tmp = five_dish[i] % 10\n if tmp == 0:\n pass\n else:\n if 10 - tmp > maxdiff:\n maxdiff = 10 - tmp\n idx = i\n else:\n pass\nfor j in range(len(five_dish)):\n if j == idx:\n pass\n else:\n if five_dish[j] % 10 == 0:\n result += five_dish[j]\n else:\n result += five_dish[j] + (10 - (five_dish[j] % 10))\nresult += five_dish[idx]\nprint(result)\n","fail":"five_dish = [int(input()) for _ in range(5)]\nidx = 0\nmaxdiff = 0\nresult = 0\nfor i in range(len(five_dish)):\n tmp = five_dish[i] % 10\n if tmp != 0:\n if 10 - tmp > maxdiff:\n maxdiff = 10 - tmp\n idx = i\nfor j in range(len(five_dish)):\n if j == idx:\n continue\n else:\n if five_dish[j] % 10 == 0:\n result += five_dish[j]\n else:\n result += five_dish[j] + (10 - (five_dish[j] % 10))\nresult += five_dish[idx]\nprint(result)\n","change":"replace","i1":1,"i2":17,"j1":1,"j2":13,"error":"0","stderr":null,"stdout":215.0} {"problem_id":"p03076","language":"Python","original_status":"Runtime Error","pass":"import math\n\ntime_list = list()\n\nfor _ in range(5):\n time_list.append(int(input()))\n\n\ndef key_func(x):\n if x < 100: # 2\u6841 or 1\u6841\u306e\u5834\u5408\n if x % 10 == 0:\n return 10\n return x % 10 # ex: 19\u306e\u5834\u5408\u306f9\u3092\u8fd4\u3059\n else:\n if x % 100 == 0:\n return 10\n return x % 100 # ex: 123\u306e\u5834\u5408\u306f3\u3092\u8fd4\u3059\n\n\ntime_list.sort(key=key_func, reverse=True)\n\n# print(time_list)\n\nans = sum\nfor i, time in enumerate(time_list):\n if i < len(time_list) - 1:\n ans += math.ceil(time \/ 10) * 10\n else:\n ans += time\n\nprint(ans)\n","fail":"import math\n\ntime_list = list()\n\nfor _ in range(5):\n time_list.append(int(input()))\n\n# \u5168\u63a2\u7d22\nans = 1e6\nfor i in range(len(time_list)):\n tmp = 0\n for j in range(len(time_list)):\n if i == j:\n tmp += time_list[i]\n continue\n tmp += math.ceil(time_list[j] \/ 10) * 10\n ans = min(tmp, ans)\n\nprint(ans)\n","change":"replace","i1":7,"i2":29,"j1":7,"j2":17,"error":"TypeError: unsupported operand type(s) for +=: 'builtin_function_or_method' and 'int'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03076\/Python\/s039938039.py\", line 27, in \n ans += math.ceil(time \/ 10) * 10\nTypeError: unsupported operand type(s) for +=: 'builtin_function_or_method' and 'int'\n","stdout":null} {"problem_id":"p03077","language":"Python","original_status":"Runtime Error","pass":"import math\n\nn = int(input())\na = int(input())\nb = int(input())\nc = int(input())\nd = int(input())\ne = int(input())\n\ncities = [a, b, c, d, e]\nmin_val = 10\nfor i, x in enumerate(cities):\n if x < min_val:\n min_val = x\n idx = i\n\nans = 0 if idx == 0 else idx\n\nans += math.ceil(n \/ min_val)\nans = ans + 4 - idx\nprint(ans)\n","fail":"import math\n\nn = int(input())\na = int(input())\nb = int(input())\nc = int(input())\nd = int(input())\ne = int(input())\n\ncities = [a, b, c, d, e]\nmin_val = 1e18\nfor i, x in enumerate(cities):\n if x < min_val:\n min_val = x\n idx = i\n\nans = 0 if idx == 0 else idx\n\nans += math.ceil(n \/ min_val)\nans = ans + 4 - idx\nprint(ans)\n","change":"replace","i1":10,"i2":11,"j1":10,"j2":11,"error":"0","stderr":null,"stdout":7.0} {"problem_id":"p03077","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = int(input())\nB = int(input())\nC = int(input())\nD = int(input())\nE = int(input())\n\nd = {\n 1: N,\n 2: 0,\n 3: 0,\n 4: 0,\n 5: 0,\n 6: 0,\n}\n\nans = 0\nwhile d[6] != N:\n m = min(d[5], E)\n d[5] -= m\n d[6] += m\n\n m = min(d[4], D)\n d[4] -= m\n d[5] += m\n\n m = min(d[3], C)\n d[3] -= m\n d[4] += m\n\n m = min(d[2], B)\n d[2] -= m\n d[3] += m\n\n m = min(d[1], A)\n d[1] -= m\n d[2] += m\n\n ans += 1\n\nprint(ans)\n","fail":"from math import ceil\n\nN = int(input())\nA = int(input())\nB = int(input())\nC = int(input())\nD = int(input())\nE = int(input())\n\nmin_move = min(A, B, C, D, E)\n\nans = ceil(N \/ min_move) + 4\n\nprint(ans)\n","change":"replace","i1":0,"i2":39,"j1":0,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03077","language":"Python","original_status":"Runtime Error","pass":"N = int(input())\na = [int(input) for _ in range(5)]\n\nprint(N \/\/ min(a) + 5)\n","fail":"from math import ceil\n\nN = int(input())\na = [int(input()) for _ in range(5)]\n\nprint(ceil(N \/ min(a)) + (5 - 1))\n","change":"replace","i1":0,"i2":4,"j1":0,"j2":6,"error":"TypeError: int() argument must be a string, a bytes-like object or a real number, not 'builtin_function_or_method'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03077\/Python\/s850924049.py\", line 2, in \n a = [int(input) for _ in range(5)]\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03077\/Python\/s850924049.py\", line 2, in \n a = [int(input) for _ in range(5)]\nTypeError: int() argument must be a string, a bytes-like object or a real number, not 'builtin_function_or_method'\n","stdout":null} {"problem_id":"p03077","language":"Python","original_status":"Runtime Error","pass":"N = int(input())\nn = [int(input()) for _ in range(N)]\nmin_n = min(n)\nprint(N \/\/ min_n + (1 if (0 != N % min_n) else 0) + N - 1)\n","fail":"N = int(input())\nn = [int(input()) for _ in range(5)]\nmin_n = min(n)\nans = N \/\/ min_n + 4 + (1 if (0 != N % min_n) else 0)\nprint(ans)\n","change":"replace","i1":1,"i2":4,"j1":1,"j2":5,"error":"0","stderr":null,"stdout":7.0} {"problem_id":"p03077","language":"Python","original_status":"Runtime Error","pass":"import math\n\nn = int(input())\na = int(input())\nb = int(input())\nc = int(input())\nd = int(input())\ne = int(input())\n\ncities = [a, b, c, d, e]\nmin_val = 1e6\nfor i, x in enumerate(cities):\n if x < min_val:\n min_val = x\n idx = i\n\nans = 0 if idx == 0 else idx\n\nans += math.ceil(n \/ min_val)\nans = ans + 4 - idx\nprint(ans)\n","fail":"import math\n\nn = int(input())\na = int(input())\nb = int(input())\nc = int(input())\nd = int(input())\ne = int(input())\n\ncities = [a, b, c, d, e]\nmin_val = 1e18\nidx = 0\nfor i, x in enumerate(cities):\n if x < min_val:\n min_val = x\n idx = i\n\nans = 0 if idx == 0 else idx\n\nans += math.ceil(n \/ min_val)\nans = ans + 4 - idx\nprint(ans)\n","change":"replace","i1":10,"i2":11,"j1":10,"j2":12,"error":"0","stderr":null,"stdout":7.0} {"problem_id":"p03077","language":"Python","original_status":"Runtime Error","pass":"from math import ceil\n\n\ndef main(N, A, B, C, D, E):\n loads = [A, B, C, D, E]\n min_val = min(loads)\n min_index = loads.index(min_val)\n\n res = min_index + ceil(N \/ min_val) + (5 - (min_index + 1))\n\n return res\n\n\nif __name__ == \"__main__\":\n N = input()\n A = input()\n B = input()\n C = input()\n D = input()\n E = input()\n print(main(N, A, B, C, D, E))\n","fail":"from math import ceil\n\n\ndef main(N, A, B, C, D, E):\n loads = [A, B, C, D, E]\n min_val = min(loads)\n min_index = loads.index(min_val)\n\n res = min_index + ceil(N \/ min_val) + (5 - (min_index + 1))\n\n return res\n\n\nif __name__ == \"__main__\":\n N = int(input())\n A = int(input())\n B = int(input())\n C = int(input())\n D = int(input())\n E = int(input())\n print(main(N, A, B, C, D, E))\n","change":"replace","i1":14,"i2":20,"j1":14,"j2":20,"error":"TypeError: unsupported operand type(s) for \/: 'str' and 'str'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03077\/Python\/s219806680.py\", line 21, in \n print(main(N, A, B, C, D, E))\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03077\/Python\/s219806680.py\", line 9, in main\n res = min_index + ceil(N \/ min_val) + (5 - (min_index + 1))\nTypeError: unsupported operand type(s) for \/: 'str' and 'str'\n","stdout":null} {"problem_id":"p03077","language":"Python","original_status":"Runtime Error","pass":"print(-(-(int(input())) \/\/ min([int(input() for i in range(5))])) + 4)\n","fail":"print(-(-int(input()) \/\/ min([int(input()) for i in range(5)])) + 4)\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"TypeError: int() argument must be a string, a bytes-like object or a real number, not 'generator'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03077\/Python\/s377505366.py\", line 1, in \n print(-(-(int(input())) \/\/ min([int(input() for i in range(5))])) + 4)\nTypeError: int() argument must be a string, a bytes-like object or a real number, not 'generator'\n","stdout":null} {"problem_id":"p03077","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = int(input())\nb = int(input())\nc = int(input())\nd = int(input())\ne = int(input())\n\nitems = [a, b, c, d, e]\npps = [0] * 5\npps[0] = n\ntime = 0\nflg = True\nwhile flg:\n carry = 0\n for i, (item, pp) in enumerate(zip(items, pps)):\n pp_bef = pp\n num = pp - item\n if num < 0:\n num = 0\n pps[i] = num + carry\n pp_aft = num\n carry = pp_bef - pp_aft\n time += 1\n if pps == [0] * 5:\n flg = False\nprint(time)\n","fail":"n = int(input())\na = int(input())\nb = int(input())\nc = int(input())\nd = int(input())\ne = int(input())\n\nimport math\n\nitems = [a, b, c, d, e]\nmin_item = min(items)\nmin_idx = items.index(min_item)\nn_times = math.ceil(n \/ min_item)\nprint(len(items) + n_times - 1)\n","change":"replace","i1":7,"i2":26,"j1":7,"j2":14,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03078","language":"Python","original_status":"Time Limit Exceeded","pass":"X, Y, Z, K = [int(_) for _ in input().split()]\nAs = [int(_) for _ in input().split()]\nBs = [int(_) for _ in input().split()]\nCs = [int(_) for _ in input().split()]\n\nAs.sort()\nBs.sort()\nCs.sort()\n\nchoice_stack = [(len(As) - 1, len(Bs) - 1, len(Cs) - 1)]\nchoice_stack_next = []\nchoice_log = set()\nsums = []\n\nj = 0\nwhile True:\n for Ai, Bi, Ci in choice_stack:\n sums.append(As[Ai] + Bs[Bi] + Cs[Ci])\n cA = (max(0, Ai - 1), Bi, Ci)\n cB = (Ai, max(0, Bi - 1), Ci)\n cC = (Ai, Bi, max(0, Ci - 1))\n if not (cA in choice_log):\n choice_stack_next.append(cA)\n choice_log.add(cA)\n if not (cB in choice_log):\n choice_stack_next.append(cB)\n choice_log.add(cB)\n if not (cC in choice_log):\n choice_stack_next.append(cC)\n choice_log.add(cC)\n\n sums.sort()\n print(sums.pop())\n choice_stack = [_ for _ in choice_stack_next]\n choice_stack_next.clear()\n j += 1\n if j >= K:\n break\n","fail":"X, Y, Z, K = [int(_) for _ in input().split()]\nAs = [int(_) for _ in input().split()]\nBs = [int(_) for _ in input().split()]\nCs = [int(_) for _ in input().split()]\n\nAs.sort()\nBs.sort()\nCs.sort()\n\nchoice_stack = [(As[-1] + Bs[-1] + Cs[-1], len(As) - 1, len(Bs) - 1, len(Cs) - 1)]\nchoice_log = set()\n\nj = 0\nwhile True:\n choice_stack.sort()\n chosen_sum, Ai, Bi, Ci = choice_stack.pop()\n\n print(chosen_sum)\n\n step_A = (As[max(0, Ai - 1)] + Bs[Bi] + Cs[Ci], max(0, Ai - 1), Bi, Ci)\n step_B = (As[Ai] + Bs[max(0, Bi - 1)] + Cs[Ci], Ai, max(0, Bi - 1), Ci)\n step_C = (As[Ai] + Bs[Bi] + Cs[max(0, Ci - 1)], Ai, Bi, max(0, Ci - 1))\n\n if not (step_A in choice_log):\n choice_stack.append(step_A)\n choice_log.add(step_A)\n if not (step_B in choice_log):\n choice_stack.append(step_B)\n choice_log.add(step_B)\n if not (step_C in choice_log):\n choice_stack.append(step_C)\n choice_log.add(step_C)\n\n j += 1\n if j >= K:\n break\n","change":"replace","i1":9,"i2":35,"j1":9,"j2":33,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03078","language":"Python","original_status":"Runtime Error","pass":"x, y, z, k = map(int, input().split())\na = list(map(int, input().split()))\nb = list(map(int, input().split()))\nc = list(map(int, input().split()))\n\nd = []\nfor i in range(x):\n for j in range(y):\n d.append(a[i] + b[j])\nd.sort(reverse=True)\n\ne = []\nfor i in range(k):\n for j in range(z):\n e.append(d[i] + c[j])\ne.sort(reverse=True)\n\nfor i in range(k):\n print(e[i])\n","fail":"x, y, z, k = map(int, input().split())\na = list(map(int, input().split()))\nb = list(map(int, input().split()))\nc = list(map(int, input().split()))\n\nd = []\nfor i in range(x):\n for j in range(y):\n d.append(a[i] + b[j])\nd.sort(reverse=True)\n\ne = []\nfor i in range(min(len(d), k)):\n for j in range(z):\n e.append(d[i] + c[j])\ne.sort(reverse=True)\n\nfor i in range(k):\n print(e[i])\n","change":"replace","i1":12,"i2":13,"j1":12,"j2":13,"error":"IndexError: list index out of range","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03078\/Python\/s896173078.py\", line 15, in \n e.append(d[i] + c[j])\nIndexError: list index out of range\n","stdout":null} {"problem_id":"p03078","language":"Python","original_status":"Time Limit Exceeded","pass":"x, y, z, k = map(int, input().split())\na = map(int, input().split())\nb = list(map(int, input().split()))\nc = map(int, input().split())\nd = sorted((ai + bi for ai in a for bi in b), reverse=True)[:k]\ne = sorted((ci + di for ci in c for di in d), reverse=True)\ni = 0\nwhile i != k:\n print(e[i])\n i += 1\n","fail":"x, y, z, k = map(int, input().split())\na = map(int, input().split())\nb = list(map(int, input().split()))\nc = map(int, input().split())\nd = sorted((ai + bi for ai in a for bi in b), reverse=True)[:k]\ne = sorted((ci + di for ci in c for di in d), reverse=True)[:k]\nprint(*e)\n","change":"replace","i1":5,"i2":10,"j1":5,"j2":7,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03078","language":"Python","original_status":"Time Limit Exceeded","pass":"x, y, z, k = map(int, input().split())\na = tuple(map(int, input().split()))\nb = tuple(map(int, input().split()))\nc = tuple(map(int, input().split()))\n\nab = [i + j for i in a for j in b]\nab.sort(reverse=True)\nabc = [i + j for i in ab[:k] for j in c]\n\nabc.sort(reverse=True)\nprint(\"\\\\n\".join(map(str, abc[:k])))\n","fail":"x, y, z, k = map(int, input().split())\na = list(map(int, input().split()))\nb = list(map(int, input().split()))\nc = list(map(int, input().split()))\n\na.sort(reverse=True)\nb.sort(reverse=True)\nc.sort(reverse=True)\nans = []\nfor i in range(x):\n for j in range(y):\n for m in range(z):\n if (i + 1) * (j + 1) * (m + 1) > k:\n break\n ans.append(a[i] + b[j] + c[m])\n\nans.sort(reverse=True)\nfor i in ans[:k]:\n print(i)\n","change":"replace","i1":1,"i2":11,"j1":1,"j2":19,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03078","language":"Python","original_status":"Time Limit Exceeded","pass":"X, Y, Z, K = map(int, input().split())\nA = sorted(list(map(int, input().split())), reverse=True)\nB = sorted(list(map(int, input().split())), reverse=True)\nC = sorted(list(map(int, input().split())), reverse=True)\n\nAB = []\nfor a in A[:K]:\n for b in B[:K]:\n AB.append(a + b)\nAB.sort(reverse=True)\n\nABC = []\nfor ab in AB[:K]:\n for c in C[:K]:\n ABC.append(ab + c)\nABC.sort(reverse=True)\n\nfor abc in ABC[:K]:\n print(abc)\n","fail":"X, Y, Z, K = map(int, input().split())\nA = sorted(list(map(int, input().split())), reverse=True)\nB = sorted(list(map(int, input().split())), reverse=True)\nC = sorted(list(map(int, input().split())), reverse=True)\n\nAB = [a + b for a in A for b in B]\nAB.sort(reverse=True)\nABC = [ab + c for ab in AB[:K] for c in C[:K]]\nABC.sort(reverse=True)\n[print(abc) for abc in ABC[:K]]\n","change":"replace","i1":5,"i2":19,"j1":5,"j2":10,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03078","language":"Python","original_status":"Time Limit Exceeded","pass":"X, Y, Z, K = map(int, input().split())\nA = sorted(map(int, input().split()), reverse=True)[:K]\nB = sorted(map(int, input().split()), reverse=True)[:K]\nC = sorted(map(int, input().split()), reverse=True)[:K]\n\nAB = sorted([a + b for a in A for b in B], reverse=True)[:K]\nABC = sorted([ab + c for ab in AB for c in C], reverse=True)[:K]\nfor v in ABC:\n print(v)\n","fail":"from heapq import heappush, heappop\n\nX, Y, Z, K = map(int, input().split())\nA = sorted(list(map(int, input().split())), reverse=True)\nB = sorted(list(map(int, input().split())), reverse=True)\nC = sorted(list(map(int, input().split())), reverse=True)\n\ncake_heap = []\nfor i in range(len(A)):\n if i + 1 > K:\n break\n for j in range(len(B)):\n if (i + 1) * (j + 1) > K:\n break\n for k in range(len(C)):\n if (i + 1) * (j + 1) * (k + 1) > K:\n break\n heappush(cake_heap, -(A[i] + B[j] + C[k]))\nfor i in range(K):\n print(-heappop(cake_heap))\n","change":"replace","i1":0,"i2":9,"j1":0,"j2":20,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03078","language":"Python","original_status":"Time Limit Exceeded","pass":"from itertools import product\n\nx, y, z, k = list(map(int, input().split()))\na = list(map(int, input().split()))\nb = list(map(int, input().split()))\nc = list(map(int, input().split()))\n\nab = [ai + bi for (ai, bi) in product(a, b)]\nab.sort(reverse=True)\nabc = [abi + ci for (abi, ci) in product(ab[: min(k, x * y * z)], c)]\nabc.sort(reverse=True)\n\nfor abci in abc[: min(k, x * y * z)]:\n print(abci)\n","fail":"from itertools import product\n\nx, y, z, k = list(map(int, input().split()))\na = sorted(list(map(int, input().split())), reverse=True)\nb = sorted(list(map(int, input().split())), reverse=True)\nc = sorted(list(map(int, input().split())), reverse=True)\n\nab = [ai + bi for (ai, bi) in product(a[:k], b[:k])]\nab.sort(reverse=True)\nabc = [abi + ci for (abi, ci) in product(ab[: min(k, x * y * z)], c[:k])]\nabc.sort(reverse=True)\n\nfor abci in abc[: min(k, x * y * z)]:\n print(abci)\n","change":"replace","i1":3,"i2":10,"j1":3,"j2":10,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03078","language":"Python","original_status":"Time Limit Exceeded","pass":"# -*- coding: utf-8 -*-\n\nX, Y, Z, K = map(int, input().split())\n# A = sorted(map(int, input().split()), reverse=True)\n# B = sorted(map(int, input().split()), reverse=True)\n# C = sorted(map(int, input().split()), reverse=True)\nA = list(map(int, input().split()))\nB = list(map(int, input().split()))\nC = list(map(int, input().split()))\n\nAB = []\n\nfor a in A:\n for b in B:\n AB.append(a + b)\n\nAB = sorted(AB, reverse=True)\n\nif K < len(AB):\n AB = AB[:K]\n\nABC = []\nfor ab in AB:\n for c in C:\n ABC.append(ab + c)\n\nABC = sorted(ABC, reverse=True)\n\nABC = ABC[:K]\nABC = [str(abc) for abc in ABC]\n\nprint(\"\\\\n\".join(ABC))\n","fail":"# -*- coding: utf-8 -*-\n\nX, Y, Z, K = map(int, input().split())\nA = sorted(map(int, input().split()), reverse=True)\nB = sorted(map(int, input().split()), reverse=True)\nC = sorted(map(int, input().split()), reverse=True)\n\nABC = []\n\nfor x in range(X):\n for y in range(Y):\n if (x + 1) * (y + 1) > K:\n break\n for z in range(Z):\n if (x + 1) * (y + 1) * (z + 1) > K:\n break\n ABC.append(A[x] + B[y] + C[z])\n\nABC = sorted(ABC, reverse=True)\nABC = ABC[:K]\n\nprint(\"\\\\n\".join(map(str, ABC)))\n","change":"replace","i1":3,"i2":32,"j1":3,"j2":22,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03078","language":"Python","original_status":"Time Limit Exceeded","pass":"from heapq import heappop, heappush\n\nX, Y, Z, K = [int(s) for s in input().split()]\nA = [int(s) for s in input().split()]\nB = [int(s) for s in input().split()]\nC = [int(s) for s in input().split()]\nh = []\nfor i in range(X):\n for j in range(Y):\n for k in range(Z):\n heappush(h, -(A[i] + B[j] + C[k]))\nfor _ in range(K):\n print(-heappop(h))\n","fail":"from heapq import heappop, heappush\n\nX, Y, Z, K = [int(s) for s in input().split()]\nA = [int(s) for s in input().split()]\nB = [int(s) for s in input().split()]\nC = [int(s) for s in input().split()]\nA.sort(reverse=True)\nB.sort(reverse=True)\nC.sort(reverse=True)\ncounted = set()\nh = [(-(A[0] + B[0] + C[0]), 0, 0, 0)]\nfor _ in range(K):\n s, i, j, k = heappop(h)\n print(-s)\n if X > i + 1 and (i + 1, j, k) not in counted:\n heappush(h, (-(A[i + 1] + B[j] + C[k]), i + 1, j, k))\n counted.add((i + 1, j, k))\n if Y > j + 1 and (i, j + 1, k) not in counted:\n heappush(h, (-(A[i] + B[j + 1] + C[k]), i, j + 1, k))\n counted.add((i, j + 1, k))\n if Z > k + 1 and (i, j, k + 1) not in counted:\n heappush(h, (-(A[i] + B[j] + C[k + 1]), i, j, k + 1))\n counted.add((i, j, k + 1))\n","change":"replace","i1":6,"i2":13,"j1":6,"j2":23,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03078","language":"Python","original_status":"Time Limit Exceeded","pass":"x, y, z, k = map(int, input().split())\na = list(map(int, input().split()))\nb = list(map(int, input().split()))\nc = list(map(int, input().split()))\nc.sort(reverse=True)\n\np = [0 for _ in range(x * y)]\nt = 0\nfor ai in a:\n for bi in b:\n p[t] = ai + bi\n t += 1\np.sort(reverse=True)\nq = [0 for _ in range(k * z)]\nt = 0\nfor pi in p[:k]:\n for ci in c[:k]:\n q[t] = pi + ci\n t += 1\nq.sort(reverse=True)\nfor qi in q[:k]:\n print(qi)\n","fail":"x, y, z, kk = map(int, input().split())\na = list(map(int, input().split()))\nb = list(map(int, input().split()))\nc = list(map(int, input().split()))\na.sort(reverse=True)\nb.sort(reverse=True)\nc.sort(reverse=True)\n\np = []\nfor i in range(x):\n for j in range(y):\n for k in range(z):\n if (i + 1) * (j + 1) * (k + 1) <= kk:\n p.append(a[i] + b[j] + c[k])\n else:\n break\np.sort(reverse=True)\nfor i in range(kk):\n print(p[i])\n","change":"replace","i1":0,"i2":22,"j1":0,"j2":19,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03078","language":"Python","original_status":"Time Limit Exceeded","pass":"from itertools import product, chain\n\nx, y, z, k = list(map(int, input().split(\" \")))\na = sorted(list(map(int, input().split(\" \"))))\nb = sorted(list(map(int, input().split(\" \"))))\nc = sorted(list(map(int, input().split(\" \"))))\n\napb_sorted = sorted([a + b for a, b in product(a, b)])\nans_list = sorted(\n list(chain.from_iterable([[_c + ab for ab in apb_sorted] for _c in c[:k]]))\n)\nit = reversed(ans_list)\nfor _ in range(k):\n print(next(it))\n","fail":"from itertools import product, chain\n\nx, y, z, k = list(map(int, input().split(\" \")))\na = sorted(list(map(int, input().split(\" \"))))\nb = sorted(list(map(int, input().split(\" \"))))\nc = sorted(list(map(int, input().split(\" \"))))\n\napb_sorted = sorted([a + b for a, b in product(a, b)])[-k:]\nans_list = sorted(\n list(chain.from_iterable([[_c + ab for ab in apb_sorted] for _c in c[:k]]))\n)\nit = reversed(ans_list)\nfor _ in range(k):\n print(next(it))\n","change":"replace","i1":7,"i2":8,"j1":7,"j2":8,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03078","language":"Python","original_status":"Time Limit Exceeded","pass":"# -*- coding: utf-8 -*-\n\nX, Y, Z, K = map(int, input().split())\nA = list(map(int, input().split()))\nB = list(map(int, input().split()))\nC = list(map(int, input().split()))\n\nE = []\nfor i in range(X):\n for j in range(Y):\n E.append(A[i] + B[j])\nE.sort(reverse=True)\n\nF = []\nfor i in range(min(X * Y, K)):\n for j in range(Z):\n F.append(E[i] + C[j])\nF.sort(reverse=True)\n\nfor i in range(K):\n print(F[i])\n","fail":"# -*- coding: utf-8 -*-\n\nX, Y, Z, K = map(int, input().split())\nA = sorted(list(map(int, input().split())), reverse=True)\nB = sorted(list(map(int, input().split())), reverse=True)\nC = sorted(list(map(int, input().split())), reverse=True)\n\nComb = []\nfor i in range(X):\n for j in range(Y):\n if (i + 1) * (j + 1) > K:\n break\n for k in range(Z):\n if (i + 1) * (j + 1) * (k + 1) > K:\n break\n Comb.append(A[i] + B[j] + C[k])\n\nComb.sort(reverse=True)\nfor i in range(K):\n print(Comb[i])\n","change":"replace","i1":3,"i2":21,"j1":3,"j2":20,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03078","language":"Python","original_status":"Time Limit Exceeded","pass":"from itertools import product, chain\nfrom collections import deque\n\n\ndef solver1(a, b, c, k):\n apb_sorted = sorted([a + b for a, b in product(a, b)])[-k:]\n ans_list = sorted(\n list(chain.from_iterable([[_c + ab for ab in apb_sorted] for _c in c[:k]]))\n )\n it = reversed(ans_list)\n for _ in range(k):\n print(next(it))\n\n\ndef solver2(a, b, c, k):\n d = deque()\n n = len(a)\n m = min(k, n)\n for p in range(m):\n for q in range(m):\n for r in range(m):\n if (p + 1) * (q + 1) * (r + 1) > k:\n continue\n d.append(a[-p - 1] + b[-q - 1] + c[-r - 1])\n it = reversed(sorted(d))\n for _ in range(k):\n print(next(it))\n\n\nif __name__ == \"__main__\":\n x, y, z, k = list(map(int, input().split(\" \")))\n a = sorted(list(map(int, input().split(\" \"))))\n b = sorted(list(map(int, input().split(\" \"))))\n c = sorted(list(map(int, input().split(\" \"))))\n solver2(a, b, c, k)\n","fail":"from itertools import product, chain\nfrom collections import deque\n\n\ndef solver1(a, b, c, k):\n apb_sorted = sorted([a + b for a, b in product(a, b)])[-k:]\n ans_list = sorted(\n list(chain.from_iterable([[_c + ab for ab in apb_sorted] for _c in c[:k]]))\n )\n it = reversed(ans_list)\n for _ in range(k):\n print(next(it))\n\n\ndef solver2(a, b, c, k):\n n = len(a)\n m = min(k, n)\n pqr = deque()\n for p in range(m):\n for q in range(m):\n for r in range(m):\n if (p + 1) * (q + 1) * (r + 1) > k:\n break\n else:\n pqr.append(a[-p - 1] + b[-q - 1] + c[-r - 1])\n it = reversed(sorted(pqr))\n for _ in range(k):\n print(next(it))\n\n\nif __name__ == \"__main__\":\n x, y, z, k = list(map(int, input().split(\" \")))\n a = sorted(list(map(int, input().split(\" \"))))\n b = sorted(list(map(int, input().split(\" \"))))\n c = sorted(list(map(int, input().split(\" \"))))\n solver2(a, b, c, k)\n","change":"replace","i1":15,"i2":25,"j1":15,"j2":26,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03078","language":"Python","original_status":"Runtime Error","pass":"X, Y, Z, K = map(int, input().split())\nA = list(map(int, input().split()))\nB = list(map(int, input().split()))\nC = list(map(int, input().split()))\n\nA.sort(reverse=True)\nB.sort(reverse=True)\nC.sort(reverse=True)\n\nABC = []\nfor i in range(X):\n for j in range(Y):\n if i + 1 + j + 1 > K:\n break\n for k in range(Z):\n if i + 1 + j + 1 + k + 1 > K:\n break\n ABC.append(A[i] + B[j] + C[k])\n\nABC.sort(reverse=True)\nfor i in range(K):\n print(ABC[i])\n","fail":"X, Y, Z, K = map(int, input().split())\nA = list(map(int, input().split()))\nB = list(map(int, input().split()))\nC = list(map(int, input().split()))\n\nA.sort(reverse=True)\nB.sort(reverse=True)\nC.sort(reverse=True)\n\nABC = []\nfor i in range(X):\n for j in range(Y):\n if (i + 1) * (j + 1) > K:\n break\n for k in range(Z):\n if (i + 1) * (j + 1) * (k + 1) > K:\n break\n ABC.append(A[i] + B[j] + C[k])\n\nABC.sort(reverse=True)\nfor i in range(K):\n print(ABC[i])\n","change":"replace","i1":12,"i2":16,"j1":12,"j2":16,"error":"0","stderr":null,"stdout":"19\n17\n15\n14\n13\n12\n10\n8\n"} {"problem_id":"p03078","language":"Python","original_status":"Time Limit Exceeded","pass":"import itertools\n\n\nX, Y, Z, K = list(map(int, input().split()))\nA = list(map(int, input().split()))\nB = list(map(int, input().split()))\nC = list(map(int, input().split()))\n\nAB = [a + b for (a, b) in list(itertools.product(A, B))]\nAB = sorted(AB)[::-1]\nans = [ab + c for (ab, c) in list(itertools.product(AB[:3000], C))]\nans = sorted(ans)[::-1]\nfor i in range(K):\n print(ans[i])\n","fail":"import itertools\n\n\nX, Y, Z, K = list(map(int, input().split()))\nA = list(map(int, input().split()))\nB = list(map(int, input().split()))\nC = list(map(int, input().split()))\n\nAB = [a + b for (a, b) in list(itertools.product(A, B))]\nAB.sort(reverse=True)\nans = [ab + c for (ab, c) in list(itertools.product(AB[: min(3000, X * Y * Z)], C))]\nans.sort(reverse=True)\nfor i in range(K):\n print(ans[i])\n","change":"replace","i1":9,"i2":12,"j1":9,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03078","language":"Python","original_status":"Time Limit Exceeded","pass":"from heapq import heappush, heappop\n\nX, Y, Z, K = map(int, input().split())\nA = [int(s) for s in input().split()]\nB = [int(s) for s in input().split()]\nC = [int(s) for s in input().split()]\nA.sort(reverse=True)\nB.sort(reverse=True)\nC.sort(reverse=True)\nh = []\n\nmaxv = A[0] + B[0] + C[0]\n\n\ndef inv(v):\n return maxv - v\n\n\npushed = []\nheappush(h, (0, 0, 0, 0))\nfor _ in range(K):\n invv, i, j, k = heappop(h)\n print(inv(invv))\n if i + 1 < X and (i + 1, j, k) not in pushed:\n heappush(h, (inv(A[i + 1] + B[j] + C[k]), i + 1, j, k))\n pushed.append((i + 1, j, k))\n if j + 1 < Y and (i, j + 1, k) not in pushed:\n heappush(h, (inv(A[i] + B[j + 1] + C[k]), i, j + 1, k))\n pushed.append((i, j + 1, k))\n if k + 1 < Z and (i, j, k + 1) not in pushed:\n heappush(h, (inv(A[i] + B[j] + C[k + 1]), i, j, k + 1))\n pushed.append((i, j, k + 1))\n","fail":"from heapq import heappush, heappop\n\nX, Y, Z, K = map(int, input().split())\nA = [int(s) for s in input().split()]\nB = [int(s) for s in input().split()]\nC = [int(s) for s in input().split()]\nA.sort(reverse=True)\nB.sort(reverse=True)\nC.sort(reverse=True)\nh = []\n\nmaxv = A[0] + B[0] + C[0]\n\n\ndef inv(v):\n return maxv - v\n\n\npushed = [[[] for _ in range(Y)] for _ in range(X)]\nheappush(h, (0, 0, 0, 0))\nfor _ in range(K):\n invv, i, j, k = heappop(h)\n print(inv(invv))\n if i + 1 < X and k not in pushed[i + 1][j]:\n heappush(h, (inv(A[i + 1] + B[j] + C[k]), i + 1, j, k))\n pushed[i + 1][j].append(k)\n if j + 1 < Y and k not in pushed[i][j + 1]:\n heappush(h, (inv(A[i] + B[j + 1] + C[k]), i, j + 1, k))\n pushed[i][j + 1].append(k)\n if k + 1 < Z and k + 1 not in pushed[i][j]:\n heappush(h, (inv(A[i] + B[j] + C[k + 1]), i, j, k + 1))\n pushed[i][j].append(k + 1)\n","change":"replace","i1":18,"i2":32,"j1":18,"j2":32,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03078","language":"Python","original_status":"Time Limit Exceeded","pass":"X, Y, Z, K = map(int, input().split())\nA = list(map(int, input().split()))\nB = list(map(int, input().split()))\nC = list(map(int, input().split()))\ntmp = []\nfor a in A:\n for b in B:\n tmp.append(a + b)\nans = []\nfor ab in tmp:\n for c in C:\n ans.append(ab + c)\nans.sort(reverse=True)\nfor i in range(K):\n print(ans[i])\n","fail":"X, Y, Z, K = map(int, input().split())\nA = list(map(int, input().split()))\nB = list(map(int, input().split()))\nC = list(map(int, input().split()))\n\n# A+B\u306e\u4e0a\u4f4dK\u500b\ntmp = []\nfor a in A:\n for b in B:\n tmp.append(a + b)\ntmp.sort(reverse=True)\ntmp = tmp[:K]\n\nans = []\nfor ab in tmp:\n for c in C:\n ans.append(ab + c)\nans.sort(reverse=True)\n\nfor i in range(K):\n print(ans[i])\n","change":"replace","i1":4,"i2":13,"j1":4,"j2":19,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03078","language":"Python","original_status":"Time Limit Exceeded","pass":"X, Y, Z, K = map(int, input().split())\nA = sorted(list(map(int, input().split())), reverse=True)\nK1 = min(K, len(A))\n\nB = sorted(list(map(int, input().split())), reverse=True)\nK2 = min(K, len(B))\n\nC = sorted(list(map(int, input().split())), reverse=True)\nK3 = min(K, len(C))\n\nK12 = min(K1 * K2, K)\n\nM1 = [0] * (K1 * K2)\nk = 0\nfor i in range(0, K1):\n for j in range(0, K2):\n M1[k] = A[i] + B[j]\n k += 1\n\nM1.sort(reverse=True)\n\nM = [0] * (K12 * K3)\nk = 0\nfor i in range(0, K12):\n for j in range(0, K3):\n M[k] = M1[i] + C[j]\n k += 1\n\nM.sort(reverse=True)\nfor i in range(0, K):\n print(M[i])\n","fail":"X, Y, Z, K = map(int, input().split())\nA = sorted(list(map(int, input().split())), reverse=True)\nB = sorted(list(map(int, input().split())), reverse=True)\nC = sorted(list(map(int, input().split())), reverse=True)\n\nM = []\nfor i in range(0, X):\n for j in range(0, Y):\n for k in range(0, Z):\n if (i + 1) * (j + 1) * (k + 1) <= K:\n M.append(A[i] + B[j] + C[k])\n else:\n break\n\nM.sort(reverse=True)\nfor i in range(0, K):\n print(M[i])\n","change":"replace","i1":2,"i2":27,"j1":2,"j2":13,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03078","language":"Python","original_status":"Time Limit Exceeded","pass":"# pypy\u3067\u30ae\u30ea\u3002\nimport sys\n\nread = sys.stdin.buffer.read\nreadline = sys.stdin.buffer.readline\nreadlines = sys.stdin.buffer.readlines\n\nx, y, z, k = map(int, readline().split())\nA = list(map(int, readline().split()))\nB = list(map(int, readline().split()))\nC = list(map(int, readline().split()))\ngoukei = []\nfor a in A:\n for b in B:\n goukei.append(a + b)\ngoukei.sort()\ngoukei2 = goukei[-k:]\ngoukei3 = []\nfor c in C:\n for ab in goukei2:\n goukei3.append(ab + c)\ngoukei3.sort(reverse=True)\nprint(*goukei3[:k], sep=\"\\\\n\")\n","fail":"from heapq import heappush, heappop\n\nx, y, z, k = map(int, input().split())\nA = list(map(int, input().split()))\nB = list(map(int, input().split()))\nC = list(map(int, input().split()))\n# used = [[[False] * (z + 1) for _ in range(y + 1)] for _ in range(x + 1)]\nused = set()\nA.sort(reverse=True)\nB.sort(reverse=True)\nC.sort(reverse=True)\nkouho = [(-(A[0] + B[0] + C[0]), 0, 0, 0)]\n\n\ndef calc(a, b, c):\n if not (a, b, c) in used:\n used.add((a, b, c))\n heappush(kouho, ((-A[a] - B[b] - C[c]), a, b, c))\n\n\nused.add((0, 0, 0))\nfor i in range(k):\n temp, p, q, r = heappop(kouho)\n print(-temp)\n if p + 1 < x:\n calc(p + 1, q, r)\n if q + 1 < y:\n calc(p, q + 1, r)\n if r + 1 < z:\n calc(p, q, r + 1)\n","change":"replace","i1":0,"i2":23,"j1":0,"j2":30,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03078","language":"Python","original_status":"Time Limit Exceeded","pass":"def main():\n X, Y, Z, K = map(int, input().split())\n A = sorted(list(map(int, input().split())), reverse=True)\n B = sorted(list(map(int, input().split())), reverse=True)\n C = sorted(list(map(int, input().split())), reverse=True)\n L = []\n for a in A:\n for b in B:\n L.append(a + b)\n LL = []\n for ab in L:\n for c in C:\n LL.append(ab + c)\n for x in sorted(LL, reverse=True)[:K]:\n print(x)\n\n\nmain()\n","fail":"def main():\n X, Y, Z, K = map(int, input().split())\n A = sorted(list(map(int, input().split())), reverse=True)\n B = sorted(list(map(int, input().split())), reverse=True)\n C = sorted(list(map(int, input().split())), reverse=True)\n AB = []\n for a in A:\n for b in B:\n AB.append(a + b)\n AB.sort(reverse=True)\n ABC = []\n for i in range(min(K, len(AB))):\n for c in C:\n ABC.append(AB[i] + c)\n ABC.sort(reverse=True)\n for x in ABC[:K]:\n print(x)\n\n\nmain()\n","change":"replace","i1":5,"i2":14,"j1":5,"j2":16,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03078","language":"Python","original_status":"Time Limit Exceeded","pass":"x, y, z, k = map(int, input().split())\na = list(map(int, input().split()))\nb = list(map(int, input().split()))\nc = list(map(int, input().split()))\n\nab = []\nfor i in range(x):\n for j in range(y):\n ab.append(a[i] + b[j])\n\n\nab.sort(reverse=True)\nc.sort(reverse=True)\n\nabc = []\nfor i in range(min(k, x * y)):\n for j in range(z):\n abc.append(ab[i] + c[j])\n\n\nabc.sort(reverse=True)\nfor i in range(k):\n print(abc[i])\n","fail":"import heapq\n\nx, y, z, k = map(int, input().split())\na = list(map(int, input().split()))\nb = list(map(int, input().split()))\nc = list(map(int, input().split()))\na.sort(reverse=True)\nb.sort(reverse=True)\nc.sort(reverse=True)\n\ncnt = 0\nq = []\narg = (0, 0, 0)\nvisited = {}\nvisited[arg] = True\nheapq.heappush(q, (-(a[arg[0]] + b[arg[1]] + c[arg[2]]),) + arg)\n\nwhile cnt < k:\n score, ia, ib, ic = heapq.heappop(q)\n print(-score)\n cnt += 1\n arg_a = (ia + 1, ib, ic)\n arg_b = (ia, ib + 1, ic)\n arg_c = (ia, ib, ic + 1)\n if arg_a[0] <= x - 1 and arg_a not in visited:\n heapq.heappush(q, (-(a[arg_a[0]] + b[arg_a[1]] + c[arg_a[2]]),) + arg_a)\n visited[arg_a] = True\n if arg_b[1] <= y - 1 and arg_b not in visited:\n heapq.heappush(q, (-(a[arg_b[0]] + b[arg_b[1]] + c[arg_b[2]]),) + arg_b)\n visited[arg_b] = True\n if arg_c[2] <= z - 1 and arg_c not in visited:\n heapq.heappush(q, (-(a[arg_c[0]] + b[arg_c[1]] + c[arg_c[2]]),) + arg_c)\n visited[arg_c] = True\n","change":"replace","i1":0,"i2":23,"j1":0,"j2":33,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03078","language":"Python","original_status":"Time Limit Exceeded","pass":"x, y, z, k = map(int, input().split())\na_array = sorted([int(x) for x in input().split()], reverse=True)\nb_array = sorted([int(x) for x in input().split()], reverse=True)\nc_array = sorted([int(x) for x in input().split()], reverse=True)\n\n\ndef solver1():\n ab_array = [x + y for x in a_array for y in b_array]\n abc_array = sorted([ab + c for ab in ab_array for c in c_array], reverse=True)\n for abc in abc_array[:k]:\n print(abc)\n\n\nsolver1()\n","fail":"x, y, z, k = map(int, input().split())\na_array = sorted([int(x) for x in input().split()], reverse=True)\nb_array = sorted([int(x) for x in input().split()], reverse=True)\nc_array = sorted([int(x) for x in input().split()], reverse=True)\n\n\ndef solver1():\n ab_array = sorted([x + y for x in a_array for y in b_array], reverse=True)[:3000]\n abc_array = sorted([ab + c for ab in ab_array for c in c_array], reverse=True)\n for abc in abc_array[:k]:\n print(abc)\n\n\nsolver1()\n","change":"replace","i1":7,"i2":8,"j1":7,"j2":8,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03078","language":"Python","original_status":"Time Limit Exceeded","pass":"from heapq import heappush, heappushpop\n\n\ndef main():\n x, y, z, k = map(int, input().split())\n aa = sorted(map(int, input().split()), reverse=True)\n bb = sorted(map(int, input().split()), reverse=True)\n cc = sorted(map(int, input().split()), reverse=True)\n\n heap = []\n for a in aa:\n if len(heap) == k and a + bb[0] + cc[0] < heap[0]:\n break\n for b in bb:\n if len(heap) == k and a + b + cc[0] < heap[0]:\n break\n for c in cc:\n v = a + b + c\n if len(heap) < k:\n heappush(heap, v)\n continue\n if v < heap[0]:\n break\n heappushpop(heap, v)\n\n for v in sorted(heap, reverse=True):\n print(v)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"from heapq import heappop, heappush\n\n\ndef main():\n x, y, z, k = map(int, input().split())\n aa = sorted(map(int, input().split()))\n bb = sorted(map(int, input().split()))\n cc = sorted(map(int, input().split()))\n v = aa[-1] + bb[-1] + cc[-1]\n t = (len(aa) - 1, len(bb) - 1, len(cc) - 1)\n q = [(-v, t)]\n vs = []\n ts = set()\n while len(vs) < k:\n nv, t = heappop(q)\n if t in ts:\n continue\n vs.append(-nv)\n ts.add(t)\n if t[0] > 0:\n heappush(q, (-(aa[t[0] - 1] + bb[t[1]] + cc[t[2]]), (t[0] - 1, t[1], t[2])))\n if t[1] > 0:\n heappush(q, (-(aa[t[0]] + bb[t[1] - 1] + cc[t[2]]), (t[0], t[1] - 1, t[2])))\n if t[2] > 0:\n heappush(q, (-(aa[t[0]] + bb[t[1]] + cc[t[2] - 1]), (t[0], t[1], t[2] - 1)))\n for v in vs:\n print(v)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":0,"i2":26,"j1":0,"j2":26,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03078","language":"Python","original_status":"Runtime Error","pass":"x, y, z, k = map(int, input().split())\nA = sorted(list(map(int, input().split())), reverse=True)\nB = sorted(list(map(int, input().split())), reverse=True)\nC = sorted(list(map(int, input().split())), reverse=True)\n\nAB = []\nfor a in A:\n for b in B:\n AB.append(a + b)\n\nAB.sort(reverse=True)\n\nABC = []\nfor i in range(min(a * b, k)):\n for c in C:\n ABC.append(AB[i] + c)\n\nABC.sort(reverse=True)\n\nfor i in range(k):\n print(ABC[i])\n","fail":"x, y, z, k = map(int, input().split())\nA = sorted(list(map(int, input().split())), reverse=True)\nB = sorted(list(map(int, input().split())), reverse=True)\nC = sorted(list(map(int, input().split())), reverse=True)\n\nAB = []\nfor a in A:\n for b in B:\n AB.append(a + b)\n\nAB.sort(reverse=True)\n\nABC = []\nfor i in range(min(x * y, k)):\n for c in C:\n ABC.append(AB[i] + c)\n\nABC.sort(reverse=True)\n\nfor i in range(k):\n print(ABC[i])\n","change":"replace","i1":13,"i2":14,"j1":13,"j2":14,"error":"0","stderr":null,"stdout":"19\n17\n15\n14\n13\n12\n10\n8\n"} {"problem_id":"p03078","language":"Python","original_status":"Time Limit Exceeded","pass":"X, Y, Z, K = [int(i) for i in input().split()]\nABCList = [sorted([int(i) for i in input().split()], reverse=True) for _ in range(3)]\n\nABSum = sorted([i + j for i in ABCList[0] for j in ABCList[1]], reverse=True)[:K]\nfor ans in sorted([i + j for i in ABSum for j in ABCList[2]], reverse=True)[:K]:\n print(ans)\n","fail":"X, Y, Z, K = [int(i) for i in input().split()]\nABCList = [sorted([int(i) for i in input().split()], reverse=True) for _ in range(3)]\n\nansList = []\nfor i, A in enumerate(ABCList[0]):\n for j, B in enumerate(ABCList[1]):\n for k, C in enumerate(ABCList[2]):\n if (i + 1) * (j + 1) * (k + 1) <= K:\n ansList.append(A + B + C)\n else:\n break\n\nfor ans in sorted(ansList, reverse=True)[:K]:\n print(ans)\n","change":"replace","i1":3,"i2":5,"j1":3,"j2":13,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03078","language":"Python","original_status":"Runtime Error","pass":"X, Y, Z, K = map(int, input().split())\n\nA = sorted(map(int, input().split()), reverse=True)\nB = sorted(map(int, input().split()), reverse=True)\nC = sorted(map(int, input().split()), reverse=True)\n\nABC = []\nfor a in range(X):\n for b in range(Y):\n if (a + 1) + (b + 1) > K:\n break\n for c in range(Z):\n if (a + 1) + (b + 1) * (c + 1) > K:\n break\n ABC.append(A[a] + B[b] + C[c])\n\nABC.sort(reverse=True)\nfor i in range(K):\n print(ABC[i])\n","fail":"X, Y, Z, K = map(int, input().split())\n\nA = sorted(map(int, input().split()), reverse=True)\nB = sorted(map(int, input().split()), reverse=True)\nC = sorted(map(int, input().split()), reverse=True)\n\nABC = []\nfor a in range(X):\n for b in range(Y):\n if (a + 1) * (b + 1) > K:\n break\n for c in range(Z):\n if (a + 1) * (b + 1) * (c + 1) > K:\n break\n ABC.append(A[a] + B[b] + C[c])\n\nABC.sort(reverse=True)\nfor i in range(K):\n print(ABC[i])\n","change":"replace","i1":9,"i2":13,"j1":9,"j2":13,"error":"0","stderr":null,"stdout":"19\n17\n15\n14\n13\n12\n10\n8\n"} {"problem_id":"p03078","language":"Python","original_status":"Time Limit Exceeded","pass":"x, y, z, k = map(int, input().split())\nA = list(map(int, input().split()))\nB = list(map(int, input().split()))\nC = list(map(int, input().split()))\ngoukei = []\nfor i in range(x):\n for j in range(y):\n goukei.append(A[i] + B[j])\ngoukei.sort()\ngoukei2 = goukei[-k:]\ngoukei3 = []\nfor c in C:\n for ab in goukei2:\n goukei3.append(ab + c)\ngoukei3.sort(reverse=True)\nprint(*goukei3[:k], sep=\"\\\\n\")\n","fail":"x, y, z, k = map(int, input().split())\nA = list(map(int, input().split()))\nB = list(map(int, input().split()))\nC = list(map(int, input().split()))\ngoukei = []\nfor a in A:\n for b in B:\n goukei.append(a + b)\ngoukei.sort()\ngoukei2 = goukei[-k:]\ngoukei3 = []\nfor c in C:\n for ab in goukei2:\n goukei3.append(ab + c)\ngoukei3.sort(reverse=True)\nprint(*goukei3[:k], sep=\"\\\\n\")\n","change":"replace","i1":5,"i2":8,"j1":5,"j2":8,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03078","language":"Python","original_status":"Time Limit Exceeded","pass":"import sys\nimport heapq\n\ninput = sys.stdin.readline\n\n\ndef main():\n X, Y, Z, K = map(int, input().split())\n A = list(map(lambda x: -int(x), input().split()))\n B = list(map(lambda x: -int(x), input().split()))\n C = list(map(lambda x: -int(x), input().split()))\n\n A.sort()\n B.sort()\n C.sort()\n\n p_queue = [(A[0] + B[0] + C[0], 0, 0, 0)]\n appear = [[[False for _ in range(Z)] for _ in range(Y)] for _ in range(X)]\n appear[0][0][0] = True\n ans = []\n while len(ans) < K:\n s, i_A, i_B, i_C = heapq.heappop(p_queue)\n ans.append(-s)\n if i_A < X - 1 and not appear[i_A + 1][i_B][i_C]:\n appear[i_A + 1][i_B][i_C] = True\n t = s - A[i_A] + A[i_A + 1]\n heapq.heappush(p_queue, (t, i_A + 1, i_B, i_C))\n if i_B < Y - 1 and not appear[i_A][i_B + 1][i_C]:\n appear[i_A][i_B + 1][i_C] = True\n t = s - B[i_B] + B[i_B + 1]\n heapq.heappush(p_queue, (t, i_A, i_B + 1, i_C))\n if i_C < Z - 1 and not appear[i_A][i_B][i_C + 1]:\n appear[i_A][i_B][i_C + 1] = True\n t = s - C[i_C] + C[i_C + 1]\n heapq.heappush(p_queue, (t, i_A, i_B, i_C + 1))\n\n print(\"\\\\n\".join(map(str, ans)))\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"import sys\nimport heapq\n\ninput = sys.stdin.readline\n\n\ndef main():\n X, Y, Z, K = map(int, input().split())\n A = list(map(lambda x: -int(x), input().split()))\n B = list(map(lambda x: -int(x), input().split()))\n C = list(map(lambda x: -int(x), input().split()))\n\n A.sort()\n B.sort()\n C.sort()\n\n p_queue = [(A[0] + B[0] + C[0], 0, 0, 0)]\n visited = set()\n visited.add((0, 0, 0))\n ans = []\n while len(ans) < K:\n s, i_A, i_B, i_C = heapq.heappop(p_queue)\n ans.append(-s)\n if i_A < X - 1 and (i_A + 1, i_B, i_C) not in visited:\n visited.add((i_A + 1, i_B, i_C))\n t = s - A[i_A] + A[i_A + 1]\n heapq.heappush(p_queue, (t, i_A + 1, i_B, i_C))\n if i_B < Y - 1 and (i_A, i_B + 1, i_C) not in visited:\n visited.add((i_A, i_B + 1, i_C))\n t = s - B[i_B] + B[i_B + 1]\n heapq.heappush(p_queue, (t, i_A, i_B + 1, i_C))\n if i_C < Z - 1 and (i_A, i_B, i_C + 1) not in visited:\n visited.add((i_A, i_B, i_C + 1))\n t = s - C[i_C] + C[i_C + 1]\n heapq.heappush(p_queue, (t, i_A, i_B, i_C + 1))\n\n print(\"\\\\n\".join(map(str, ans)))\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":17,"i2":33,"j1":17,"j2":33,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03079","language":"Python","original_status":"Runtime Error","pass":"a, b, c = input()\nif a == b == c:\n print(\"Yes\")\nelse:\n print(\"No\")\n","fail":"a, b, c = input().split()\nif a == b == c:\n print(\"Yes\")\nelse:\n print(\"No\")\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"ValueError: too many values to unpack (expected 3)","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03079\/Python\/s108336051.py\", line 1, in \n a, b, c = input()\nValueError: too many values to unpack (expected 3)\n","stdout":null} {"problem_id":"p03081","language":"Python","original_status":"Runtime Error","pass":"N, Q = map(int, input().split())\ns = input()\n\nQuery = [input().split() for i in range(Q)]\n\nleft, right = 0, N - 1\n\nfor t, d in reversed(Query):\n if d == \"L\":\n if t == s[left]:\n left += 1\n if right < N - 1 and t == s[right + 1]:\n right = min(right + 1, N - 1)\n else:\n if left > 0 and t == s[left - 1]:\n left = max(left - 1, 0)\n if t == s[right]:\n right -= 1\nprint(max(right - left + 1, 0))\n","fail":"# N, Q = map(int, input().split())\nimport sys\n\ninput = sys.stdin.readline\n\nN, Q = tuple(map(int, input().split()))\ns = input()\n\nQuery = [input().split() for i in range(Q)]\n\nleft, right = 0, N - 1\n\nfor t, d in reversed(Query):\n if d == \"L\":\n if t == s[left]:\n left += 1\n if right < N - 1 and t == s[right + 1]:\n right = min(right + 1, N - 1)\n else:\n if left > 0 and t == s[left - 1]:\n left = max(left - 1, 0)\n if t == s[right]:\n right -= 1\nprint(max(right - left + 1, 0))\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":6,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p03081","language":"Python","original_status":"Time Limit Exceeded","pass":"import logging\nimport sys\n\nlogger = logging.getLogger(__name__)\nlogger.setLevel(logging.INFO)\nh = logging.FileHandler(\"logtest.log\")\nlogger.addHandler(h)\n\ninput = sys.stdin.readline\n\nN, Q = map(int, input().split())\nlogger.info(\"N: {}, Q: {}\".format(N, Q))\n\ns = input()\nlogger.info(\"s: {}\".format(s))\n\nQuery = [input().split() for i in range(Q)]\n\nleft, right = 0, N - 1\n\n# \u4e8c\u5206\u63a2\u7d22: boundary\u3092\u6c42\u3081\u308b\nfor t, d in reversed(Query):\n logger.info(\"t: {}, d: {}\".format(t, d))\n logger.info(\"[before] left: {}, right: {}\".format(left, right))\n if d == \"L\":\n if t == s[left]:\n left += 1\n if right < N - 1 and t == s[right + 1]:\n right = min(right + 1, N - 1)\n else:\n if left > 0 and t == s[left - 1]:\n left = max(left - 1, 0)\n if t == s[right]:\n right -= 1\n logger.info(\"[after] left: {}, right: {}\\\\n\".format(left, right))\nprint(max(right - left + 1, 0))\n","fail":"import sys\n\ninput = sys.stdin.readline\n\nN, Q = map(int, input().split())\ns = input()\n\nQuery = [input().split() for i in range(Q)]\n\nleft, right = 0, N - 1\n\nfor t, d in reversed(Query):\n if d == \"L\":\n if t == s[left]:\n left += 1\n if right < N - 1 and t == s[right + 1]:\n right = min(right + 1, N - 1)\n else:\n if left > 0 and t == s[left - 1]:\n left = max(left - 1, 0)\n if t == s[right]:\n right -= 1\nprint(max(right - left + 1, 0))\n","change":"replace","i1":0,"i2":35,"j1":0,"j2":22,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03081","language":"Python","original_status":"Runtime Error","pass":"import sys\n\nN, Q = map(int, sys.stdin.readline().split())\ns = input()\n\nQuery = [input().split() for i in range(Q)]\n\nleft, right = 0, N - 1\n\nfor t, d in reversed(Query):\n if d == \"L\":\n if t == s[left]:\n left += 1\n if right < N - 1 and t == s[right + 1]:\n right = min(right + 1, N - 1)\n else:\n if left > 0 and t == s[left - 1]:\n left = max(left - 1, 0)\n if t == s[right]:\n right -= 1\nprint(max(right - left + 1, 0))\n","fail":"import sys\n\ninput = sys.stdin.readline\nN, Q = map(int, input().split())\n\ns = input()\n\ninput = sys.stdin.readline\nQuery = [input().split() for i in range(Q)]\n\nleft, right = 0, N - 1\n\nfor t, d in reversed(Query):\n if d == \"L\":\n if t == s[left]:\n left += 1\n if right < N - 1 and t == s[right + 1]:\n right = min(right + 1, N - 1)\n else:\n if left > 0 and t == s[left - 1]:\n left = max(left - 1, 0)\n if t == s[right]:\n right -= 1\nprint(max(right - left + 1, 0))\n","change":"replace","i1":2,"i2":5,"j1":2,"j2":8,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p03085","language":"Python","original_status":"Runtime Error","pass":"input(\"ATCG\"[\"TAGC\".find(input())])\n","fail":"print(\"ATCG\"[\"TAGC\".find(input())])\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"EOFError: EOF when reading a line","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03085\/Python\/s332767566.py\", line 1, in \n input(\"ATCG\"[\"TAGC\".find(input())])\nEOFError: EOF when reading a line\n","stdout":"T"} {"problem_id":"p03085","language":"Python","original_status":"Runtime Error","pass":"b = int(input())\nif b == \"A\":\n print(\"T\")\nelif b == \"C\":\n print(\"G\")\nelif b == \"T\":\n print(\"A\")\nelse:\n print(\"C\")\n","fail":"b = input()\nif b == \"A\":\n print(\"T\")\nelif b == \"C\":\n print(\"G\")\nelif b == \"T\":\n print(\"A\")\nelse:\n print(\"C\")\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"ValueError: invalid literal for int() with base 10: 'A'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03085\/Python\/s167969735.py\", line 1, in \n b = int(input())\nValueError: invalid literal for int() with base 10: 'A'\n","stdout":null} {"problem_id":"p03086","language":"Python","original_status":"Runtime Error","pass":"s = input()\nans = 0\nli = [\"A\", \"C\", \"G\", \"T\"]\ncount = 0\nfor i in s:\n if i in li:\n count += 1\n else:\n if count > ans:\n ans = count\n count = 0\nif count == len(ans):\n print(count)\nelse:\n print(ans)\n","fail":"s = input()\nans = 0\nli = [\"A\", \"C\", \"G\", \"T\"]\ncount = 0\nfor i in s:\n if i in li:\n count += 1\n else:\n if count > ans:\n ans = count\n count = 0\n\nif count > ans:\n ans = count\nprint(ans)\n","change":"replace","i1":11,"i2":15,"j1":11,"j2":15,"error":"TypeError: object of type 'int' has no len()","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03086\/Python\/s143153057.py\", line 12, in \n if count == len(ans):\nTypeError: object of type 'int' has no len()\n","stdout":null} {"problem_id":"p03086","language":"Python","original_status":"Runtime Error","pass":"S = input()\nL = [\"A\", \"C\", \"G\", \"T\"]\n\narr = []\nst = \"\"\n\nfor s in S:\n if st and s not in L:\n arr.append(st)\n st = \"\"\n if s in L:\n st += s\n\nprint(max(map(len, arr)))\n","fail":"S = input()\nL = [\"A\", \"C\", \"G\", \"T\"]\n\narr = []\nst = \"\"\n\nfor s in S:\n if st and s not in L:\n st = \"\"\n if s in L:\n st += s\n arr.append(st)\n\nprint(max(map(len, arr)) if arr else 0)\n","change":"replace","i1":8,"i2":14,"j1":8,"j2":14,"error":"0","stderr":null,"stdout":3.0} {"problem_id":"p03086","language":"Python","original_status":"Runtime Error","pass":"import re\n\ns = input()\npat = r\"[ACGT]+\"\natgc = re.findall(pat, s)\nress = []\nfor i in atgc:\n ress.append(len(i))\n\nprint(max(ress))\n","fail":"import re\n\ns = input()\npat = r\"[ACGT]+\"\natgc = re.findall(pat, s)\nress = []\nfor i in atgc:\n ress.append(len(i))\nif ress == [\"\"] or ress == []:\n print(0)\nelse:\n print(max(ress))\n","change":"replace","i1":8,"i2":10,"j1":8,"j2":12,"error":"0","stderr":null,"stdout":3.0} {"problem_id":"p03086","language":"Python","original_status":"Runtime Error","pass":"S = input()\nAA = [\"A\", \"C\", \"G\", \"T\"]\n\nans = []\nll = 0\nfor i in range(len(S)):\n if S[i] in AA:\n ll += 1\n else:\n ans.append(ll)\n ll = 0\n\nprint(max(ans))\n","fail":"S = input()\nAA = [\"A\", \"C\", \"G\", \"T\"]\n\nans = []\nll = 0\nfor i in range(len(S)):\n if S[i] in AA:\n ll += 1\n else:\n ans.append(ll)\n ll = 0\nans.append(ll)\n\nprint(max(ans))\n","change":"insert","i1":11,"i2":11,"j1":11,"j2":12,"error":"0","stderr":null,"stdout":3.0} {"problem_id":"p03086","language":"Python","original_status":"Runtime Error","pass":"b = input()\nans = 0\nls = []\nfor i in range(len(b)):\n if b[i] == \"A\" or b[i] == \"T\" or b[i] == \"C\" or b[i] == \"G\":\n ans += 1\n else:\n ls.append(ans)\n ans = 0\nprint(max(ls))\n","fail":"b = input()\nans = \"\"\n\nfor i in range(len(b)):\n if b[i] == \"A\" or b[i] == \"T\" or b[i] == \"C\" or b[i] == \"G\":\n ans += \"1\"\n else:\n ans += \"0\"\n# print(ans)\n\nls = ans.split(\"0\")\n# print(ls)\nprint(len(max(ls)))\n","change":"replace","i1":1,"i2":10,"j1":1,"j2":13,"error":"0","stderr":null,"stdout":3.0} {"problem_id":"p03086","language":"Python","original_status":"Runtime Error","pass":"string = input()\n\nchar = [\"A\", \"C\", \"G\", \"T\"]\n\ncount = 0\nlengths = []\nfor s in string:\n if s in char:\n count += 1\n else:\n lengths.append(count)\n count = 0\nelse:\n print(max(lengths))\n","fail":"s = input()\nn = len(s)\n\nans = 0\nfor i in range(n):\n for j in range(i, n):\n if all(\"ACGT\".count(l) for l in s[i : j + 1]):\n ans = max(ans, j - i + 1)\n\nprint(ans)\n","change":"replace","i1":0,"i2":14,"j1":0,"j2":10,"error":"0","stderr":null,"stdout":3.0} {"problem_id":"p03086","language":"Python","original_status":"Runtime Error","pass":"s = input()\nans = []\nacgt = [\"A\", \"C\", \"G\", \"T\"]\n\ncnt = 0\nfor i in range(len(s)):\n if s[i] in acgt:\n cnt += 1\n else:\n ans.append(cnt)\n cnt = 0\nprint(max(ans))\n","fail":"s = input()\nans = []\nacgt = [\"A\", \"C\", \"G\", \"T\"]\n\ncnt = 0\nfor i in range(len(s)):\n if s[i] in acgt:\n cnt += 1\n else:\n ans.append(cnt)\n cnt = 0\nans.append(cnt)\nprint(max(ans))\n","change":"insert","i1":11,"i2":11,"j1":11,"j2":12,"error":"0","stderr":null,"stdout":3.0} {"problem_id":"p03086","language":"Python","original_status":"Runtime Error","pass":"s = input()\n\ns.append(\"X\")\npat = [\"A\", \"C\", \"G\", \"T\"]\nmx = 0\ncount = 0\n\nfor i in range(len(s)):\n if s[i] in pat:\n count += 1\n else:\n if count > mx:\n mx = count\n count = 0\n\nprint(mx)\n","fail":"s = input()\n\ns += \"X\"\npat = [\"A\", \"C\", \"G\", \"T\"]\nmx = 0\ncount = 0\n\nfor i in range(len(s)):\n if s[i] in pat:\n count += 1\n else:\n if count > mx:\n mx = count\n count = 0\n\nprint(mx)\n","change":"replace","i1":2,"i2":3,"j1":2,"j2":3,"error":"AttributeError: 'str' object has no attribute 'append'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03086\/Python\/s975280686.py\", line 3, in \n s.append(\"X\")\nAttributeError: 'str' object has no attribute 'append'\n","stdout":null} {"problem_id":"p03086","language":"Python","original_status":"Runtime Error","pass":"s = input()\nans = 0\nans_l = []\n\nif len(s) == 1:\n print(1)\n quit()\nfor i in range(len(s)):\n if s[i] == \"A\" or s[i] == \"C\" or s[i] == \"G\" or s[i] == \"T\":\n ans += 1\n else:\n ans_l.append(ans)\n ans = 0\nprint(max(ans_l))\n","fail":"s = input()\nans = 0\nans_l = [0] * len(s)\n\n\nfor i in range(len(s)):\n if s[i] == \"A\" or s[i] == \"C\" or s[i] == \"G\" or s[i] == \"T\":\n ans_l[ans] += 1\n else:\n ans += 1\nprint(max(ans_l))\n","change":"replace","i1":2,"i2":13,"j1":2,"j2":10,"error":"0","stderr":null,"stdout":3.0} {"problem_id":"p03086","language":"Python","original_status":"Runtime Error","pass":"N = input()\nanswer_list = []\nanswer = 0\n\nfor i in range(len(N)):\n if N[i] == \"A\" or N[i] == \"T\" or N[i] == \"C\" or N[i] == \"G\":\n answer += 1\n else:\n answer_list.append(answer)\n answer = 0\nprint(max(answer_list))\n","fail":"N = input()\nanswer_list = []\nanswer = 0\n\nfor i in range(len(N)):\n if N[i] == \"A\" or N[i] == \"T\" or N[i] == \"C\" or N[i] == \"G\":\n answer += 1\n else:\n answer_list.append(answer)\n answer = 0\n if i + 1 == len(N):\n answer_list.append(answer)\nprint(max(answer_list))\n","change":"insert","i1":10,"i2":10,"j1":10,"j2":12,"error":"0","stderr":null,"stdout":3.0} {"problem_id":"p03086","language":"Python","original_status":"Runtime Error","pass":"pat = [\"A\", \"C\", \"G\", \"T\"]\n\ns = input()\n\nleft = right = 0\nans = 0\n\nwhile left < len(s):\n right = left\n while s[right] in pat:\n right += 1\n\n ans = max(ans, right - left)\n\n left = right + 1\n\nprint(ans)\n","fail":"pat = [\"A\", \"C\", \"G\", \"T\"]\n\ns = input()\n\nleft = right = 0\nans = 0\n\nwhile left < len(s):\n right = left\n while right < len(s) and s[right] in pat:\n right += 1\n\n ans = max(ans, right - left)\n\n left = right + 1\n\nprint(ans)\n","change":"replace","i1":9,"i2":10,"j1":9,"j2":10,"error":"0","stderr":null,"stdout":3.0} {"problem_id":"p03087","language":"Python","original_status":"Time Limit Exceeded","pass":"import numpy as np\n\nn, q = map(int, input().split())\ns = input()\nl_ = np.zeros(q)\nr_ = np.zeros(q)\n\nfor i in range(q):\n l_tmp, r_tmp = map(int, input().split())\n l_[i] = l_tmp\n r_[i] = r_tmp\nl_ = l_ - 1\nr_ = r_ - 1\nfor i in range(q):\n cnt = 0\n t = s[int(l_[i]) : int(r_[i]) + 1]\n for j in range(len(t) - 1):\n if t[j : j + 2] == \"AC\":\n cnt += 1\n print(cnt)\n","fail":"n, q = map(int, input().split())\ns = input()\nt = [0] * (n + 1)\nfor i in range(n):\n if s[i : i + 2] == \"AC\":\n t[i + 1] = t[i] + 1\n else:\n t[i + 1] = t[i]\n\nfor i in range(q):\n l, r = map(int, input().split())\n print(t[r - 1] - t[l - 1])\n","change":"replace","i1":0,"i2":20,"j1":0,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03087","language":"Python","original_status":"Time Limit Exceeded","pass":"N, Q = map(int, input().split())\nS = input()\nlr = [None] * Q\nfor _ in range(Q):\n lr[_] = list(map(int, input().split()))\nfor _ in range(Q):\n ans = S.count(\"AC\", lr[_][0] - 1, lr[_][1])\n print(ans)\n","fail":"N, Q = map(int, input().split())\nS = input()\nL = len(S)\nACnum = [0] * L\nfor i in range(1, L):\n ACnum[i] += ACnum[i - 1]\n if S[i - 1] == \"A\" and S[i] == \"C\":\n ACnum[i] += 1\n\nlr = [None] * Q\nfor _ in range(Q):\n lr[_] = list(map(int, input().split()))\n\nfor i in range(Q):\n ans = ACnum[lr[i][1] - 1] - ACnum[lr[i][0] - 1]\n print(ans)\n","change":"replace","i1":2,"i2":7,"j1":2,"j2":15,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03087","language":"Python","original_status":"Time Limit Exceeded","pass":"import re\n\nN, Q = [int(i) for i in input().split()]\nS = input()\nans = []\nfor i in range(Q):\n l, r = [int(i) for i in input().split()]\n l -= 1\n s = S[l:r]\n ret = re.findall(r\"AC\", s)\n ans.append(ret)\nfor a in ans:\n print(len(a))\n","fail":"N, Q = [int(i) for i in input().split()]\nS = input()\nt = [0] * (N + 1)\nfor i in range(N):\n end = i + 2\n t[i + 1] = t[i] + (1 if S[i:end] == \"AC\" else 0)\nfor i in range(Q):\n l, r = [int(i) for i in input().split()]\n print(t[r - 1] - t[l - 1])\n","change":"replace","i1":0,"i2":13,"j1":0,"j2":9,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03087","language":"Python","original_status":"Time Limit Exceeded","pass":"import re\n\nn, q = map(int, input().split())\ns = input()\n\nans = [0] * q\n\nfor i in range(q):\n l, r = map(int, input().split())\n sl = s[l - 1 : r]\n # sl = sl.replace(\"AC\", \"-\")\n # ans = sl.count(\"-\")\n # print(ans)\n\n result = re.findall(r\"AC\", sl)\n # print(len(result))\n ans[i] = len(result)\nprint(*ans, sep=\"\\\\n\")\n","fail":"n, q = map(int, input().split())\ns = input()\n\nt = [0] * (n + 1)\nfor i in range(n):\n t[i + 1] = t[i] + (1 if s[i : i + 2] == \"AC\" else 0)\n# print(t)\nfor j in range(q):\n l, r = map(int, input().split())\n print(t[r - 1] - t[l - 1])\n","change":"replace","i1":0,"i2":18,"j1":0,"j2":10,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03087","language":"Python","original_status":"Runtime Error","pass":"# \u7d2f\u7a4d\u548c\nn, q = map(int, input().split())\ns = input()\narr = [0] * (2 * 10**5 + 10)\nidx = 1\nwhile idx <= len(s):\n if s[idx - 1] == \"A\" and s[idx] == \"C\":\n arr[idx] += 1\n idx += 1\nfor i in range(1, len(arr)):\n arr[i] += arr[i - 1]\nfor _ in range(q):\n l, r = map(int, input().split())\n print(arr[r - 1] - arr[l - 1])\n","fail":"# \u7d2f\u7a4d\u548c\nn, q = map(int, input().split())\ns = input()\narr = [0] * (2 * 10**5 + 10)\nidx = 1\nwhile idx < len(s):\n if s[idx - 1] == \"A\" and s[idx] == \"C\":\n arr[idx] += 1\n idx += 1\nfor i in range(1, len(arr)):\n arr[i] += arr[i - 1]\nfor _ in range(q):\n l, r = map(int, input().split())\n print(arr[r - 1] - arr[l - 1])\n","change":"replace","i1":5,"i2":6,"j1":5,"j2":6,"error":"0","stderr":null,"stdout":"2\n0\n3\n"} {"problem_id":"p03089","language":"Python","original_status":"Time Limit Exceeded","pass":"import copy\n\n\ndef insertion(n, x):\n if not x:\n return True\n for i in range(n - 1, -1, -1):\n y = copy.copy(x)\n if y[i] == i + 1:\n y.pop(i)\n ope.insert(0, i + 1)\n if insertion(n - 1, y):\n return True\n else:\n ope.pop(0)\n return False\n\n\nn = int(input())\nb = list(map(int, input().split()))\nope = []\nif insertion(n, b):\n for i in ope:\n print(i)\nelse:\n print(-1)\n","fail":"import sys\n\n\nn = int(input())\nb = list(map(int, input().split()))\nope = []\ni = n\nwhile i > 0:\n flag = 0\n j = i\n while j > 0:\n if b[j - 1] == j:\n b.pop(j - 1)\n i -= 1\n ope.insert(0, j)\n flag = 1\n break\n j -= 1\n if flag == 0:\n print(-1)\n sys.exit()\nfor i in ope:\n print(i)\n","change":"replace","i1":0,"i2":26,"j1":0,"j2":23,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03091","language":"Python","original_status":"Runtime Error","pass":"N, M = map(int, input().split())\nc = 0\nd = 0\nfor _ in range(100):\n a, b = map(int, input().split())\nprint(\"No\")\n","fail":"N, M = map(int, input().split())\nc = 0\nd = 0\nfor _ in range(min(M, 1000)):\n a, b = map(int, input().split())\n d += a * 5 + b * 7\n c += a * 2 + b * 3\n d %= 100\n c %= 100\nif c * 100 + d in [\n 15,\n 238,\n 639,\n 1008,\n 1870,\n 2773,\n 3072,\n 3622,\n 4911,\n 4939,\n 5062,\n 5915,\n 6158,\n 6669,\n 7997,\n 8237,\n 8289,\n 9023,\n 9120,\n 9182,\n 9863,\n 9992,\n]:\n print(\"No\")\nelse:\n print(\"Yes\")\n","change":"replace","i1":3,"i2":6,"j1":3,"j2":36,"error":"EOFError: EOF when reading a line","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03091\/Python\/s054793607.py\", line 5, in \n a, b = map(int, input().split())\nEOFError: EOF when reading a line\n","stdout":null} {"problem_id":"p03092","language":"Python","original_status":"Time Limit Exceeded","pass":"from bisect import bisect\n\nn, a, b = map(int, input().split())\nppp = map(int, input().split())\nqqq = [0] * n\nfor i, p in enumerate(ppp, start=1):\n qqq[p - 1] = i\n\ndp = [(0, 0)]\nfor i in qqq:\n s = bisect(dp, (i,))\n ndp = [(j, cost + b) for j, cost in dp[:s]]\n stay_cost = dp[s - 1][1]\n ndp.append((i, stay_cost))\n ndp.extend((j, cost + a) for j, cost in dp[s:] if stay_cost > cost + a)\n dp = ndp\nprint(dp[-1][1])\n","fail":"from bisect import bisect\n\nn, a, b = map(int, input().split())\nppp = map(int, input().split())\nqqq = [0] * n\nfor i, p in enumerate(ppp, start=1):\n qqq[p - 1] = i\n\ndp = [(0, 0)]\nfor i in qqq:\n s = bisect(dp, (i,))\n ndp = [(j, cost + b) for j, cost in dp[:s]]\n stay_cost = dp[s - 1][1]\n ndp.append((i, stay_cost))\n remain = iter(dp[s:])\n for j, cost in remain:\n if stay_cost > cost + a:\n ndp.append((j, cost + a))\n break\n ndp.extend((j, cost + a) for j, cost in remain)\n dp = ndp\nprint(dp[-1][1])\n","change":"replace","i1":14,"i2":15,"j1":14,"j2":20,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03095","language":"Python","original_status":"Time Limit Exceeded","pass":"from itertools import combinations\n\n\nMOD = 1000000007\n\nN = int(input())\nS = input()\n\nchars = set()\ncnt = {}\nfor s in S:\n if s not in chars:\n chars.add(s)\n cnt[s] = 1\n else:\n cnt[s] += 1\n\nans = N % MOD\nr = 2\nchars = list(chars)\nwhile r <= len(chars):\n combs = combinations(chars, r)\n for comb in combs:\n res = 1\n for c in comb:\n res *= cnt[c]\n res %= MOD\n ans += res\n ans %= MOD\n r += 1\n\nprint(ans)\n","fail":"MOD = 1000000007\n\nN = int(input())\nS = input()\n\ncnt = {}\nfor s in S:\n if s not in cnt:\n cnt[s] = 1\n else:\n cnt[s] += 1\n\nans = 1\nfor v in cnt.values():\n ans *= v + 1\n ans %= MOD\n\nprint(ans - 1)\n","change":"replace","i1":0,"i2":32,"j1":0,"j2":18,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03095","language":"Python","original_status":"Runtime Error","pass":"# 2019\/03\/16\n# AtCoder Grand Contest 031 - A\n\n# Input\nn = int(input())\ns = input()\n\naprcnt = [1] * 26\n\n# Count up Alphabets\nfor idx in range(n):\n w_idx = ord(s[idx]) - 97\n aprcnt[w_idx] += 1\n\n# Calc Combination count\nans = 1\nfor idx in range(n):\n ans = ans * aprcnt[idx]\n\n# Reduces 1 in choose nothing case\nans -= 1\n\n# Output\nprint(ans)\n","fail":"# 2019\/03\/17\n# AtCoder Grand Contest 031 - A\n\n# Input\nn = int(input())\ns = input()\n\naprcnt = [1] * 26\n\n# Count up Alphabets\nfor idx in range(n):\n w_idx = ord(s[idx]) - 97\n aprcnt[w_idx] += 1\n\n# Calc Combination count\nans = 1\nfor idx in range(26):\n ans = ans * aprcnt[idx]\n\n# Reduces 1 in choose nothing case\nans -= 1\nans = ans % (10**9 + 7)\n\n# Output\nprint(ans)\n","change":"replace","i1":0,"i2":21,"j1":0,"j2":22,"error":"0","stderr":null,"stdout":15.0} {"problem_id":"p03096","language":"Python","original_status":"Time Limit Exceeded","pass":"# input\nn = int(input())\n\nc = []\ndp = [0] * (n + 1)\nfor i in range(n):\n stone = int(input())\n if len(c) == 0:\n dp[i + 1] = 1\n else:\n if stone in c and c[-1] is not stone:\n plc = len(c) - 1 - c[::-1].index(stone)\n dp[i + 1] = dp[i] + dp[plc + 1]\n else:\n dp[i + 1] = dp[i]\n c.append(stone)\n\nprint(dp[-1])\n","fail":"# input\nn = int(input())\n\nmod = pow(10, 9) + 7\nc = []\ndp = [0] * (n + 1)\nstone_history = dict()\nfor i in range(n):\n stone = int(input())\n if len(c) == 0:\n dp[i + 1] = 1\n else:\n if stone in stone_history and c[-1] != stone:\n dp[i + 1] = dp[i] + stone_history[stone]\n else:\n dp[i + 1] = dp[i]\n\n stone_history[stone] = dp[i + 1]\n c.append(stone)\n\nprint(dp[-1] % mod)\n","change":"replace","i1":3,"i2":18,"j1":3,"j2":21,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03101","language":"Python","original_status":"Runtime Error","pass":"H, W = int(input().split())\nh, w = int(input().split())\n\nprint((H - h) * (W - w))\nH, W = map(int, input().split())\nh, w = map(int, input().split())\n\nprint((H - h) * (W - w))\n","fail":"H, W = map(int, input().split())\nh, w = map(int, input().split())\n\nprint((H - h) * (W - w))\n","change":"delete","i1":0,"i2":4,"j1":0,"j2":0,"error":"TypeError: int() argument must be a string, a bytes-like object or a real number, not 'list'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03101\/Python\/s085592284.py\", line 1, in \n H, W = int(input().split())\nTypeError: int() argument must be a string, a bytes-like object or a real number, not 'list'\n","stdout":null} {"problem_id":"p03101","language":"Python","original_status":"Runtime Error","pass":"in1 = input().split()\nin2 = input().split()\n\nH = in1[0]\nW = in1[1]\n\nh = in2[0]\nw = in2[1]\n\nprint((H - h) * (W - w))\n","fail":"in1 = input().split()\nin2 = input().split()\n\nH = int(in1[0])\nW = int(in1[1])\n\nh = int(in2[0])\nw = int(in2[1])\n\nprint((H - h) * (W - w))\n","change":"replace","i1":3,"i2":8,"j1":3,"j2":8,"error":"TypeError: unsupported operand type(s) for -: 'str' and 'str'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03101\/Python\/s646870351.py\", line 10, in \n print((H - h) * (W - w))\nTypeError: unsupported operand type(s) for -: 'str' and 'str'\n","stdout":null} {"problem_id":"p03101","language":"Python","original_status":"Runtime Error","pass":"H, W, h, w = map(int, input().split())\nprint((H - h) * (W - w))\n","fail":"H, W = map(int, input().split())\nh, w = map(int, input().split())\nprint((H - h) * (W - w))\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":2,"error":"ValueError: not enough values to unpack (expected 4, got 2)","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03101\/Python\/s695121527.py\", line 1, in \n H, W, h, w = map(int, input().split())\nValueError: not enough values to unpack (expected 4, got 2)\n","stdout":null} {"problem_id":"p03101","language":"Python","original_status":"Runtime Error","pass":"lh, lw = input().split()\nh, w = input().split()\n\nprint(lh * lw - lh * w - lw * h + h + w)\n","fail":"lh, lw = map(int, input().split())\nh, w = map(int, input().split())\n\nprint(lh * lw - lh * w - lw * h + h * w)\n","change":"replace","i1":0,"i2":4,"j1":0,"j2":4,"error":"TypeError: can't multiply sequence by non-int of type 'str'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03101\/Python\/s628387371.py\", line 4, in \n print(lh * lw - lh * w - lw * h + h + w)\nTypeError: can't multiply sequence by non-int of type 'str'\n","stdout":null} {"problem_id":"p03102","language":"Python","original_status":"Runtime Error","pass":"from sys import stdin\n\n\ndef na():\n return map(int, stdin().split())\n\n\nn, _, c = na()\nbs = na()\n\ncnt = 0\nfor _ in range(n):\n if sum(x * y for x, y in zip(na(), bs)) > -c:\n cnt += 1\n\nprint(cnt)\n","fail":"from sys import stdin\n\n\ndef na():\n return map(int, stdin.readline().split())\n\n\nn, _, c = na()\nbs = tuple(na())\n\ncnt = 0\nfor _ in range(n):\n if sum(x * y for x, y in zip(na(), bs)) > -c:\n cnt += 1\n\nprint(cnt)\n","change":"replace","i1":4,"i2":9,"j1":4,"j2":9,"error":"TypeError: '_io.TextIOWrapper' object is not callable","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03102\/Python\/s048620808.py\", line 8, in \n n, _, c = na()\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03102\/Python\/s048620808.py\", line 5, in na\n return map(int, stdin().split())\nTypeError: '_io.TextIOWrapper' object is not callable\n","stdout":null} {"problem_id":"p03102","language":"Python","original_status":"Runtime Error","pass":"n, m, c = map(int, input().split())\nb = [int(i) for i in input().split()]\na = [[int(input()) for _ in range(m)] for _ in range(n)]\nans = 0\nctn = 0\nfor j in range(n):\n for k in range(m):\n ctn += b[k] * a[j][k]\n if ctn + c > 0:\n ans += 1\n ctn = 0\nprint(ans)\n","fail":"n, m, c = map(int, input().split())\nb = [int(i) for i in input().split()]\na = [[int(j) for j in input().split()] for _ in range(n)]\nans = 0\nfor k in range(n):\n ct = c\n for l in range(m):\n ct += a[k][l] * b[l]\n if ct > 0:\n ans += 1\n ct = 0\nprint(ans)\n","change":"replace","i1":2,"i2":11,"j1":2,"j2":11,"error":"ValueError: invalid literal for int() with base 10: '3 2 1'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03102\/Python\/s069245551.py\", line 3, in \n a = [[int(input()) for _ in range(m)] for _ in range(n)]\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03102\/Python\/s069245551.py\", line 3, in \n a = [[int(input()) for _ in range(m)] for _ in range(n)]\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03102\/Python\/s069245551.py\", line 3, in \n a = [[int(input()) for _ in range(m)] for _ in range(n)]\nValueError: invalid literal for int() with base 10: '3 2 1'\n","stdout":null} {"problem_id":"p03102","language":"Python","original_status":"Runtime Error","pass":"# -*- coding: utf-8 -*-\n\nimport numpy as np\n\nN, M, C = map(int, input().split())\nB = np.ndarray([M, 1])\nB = list(map(int, input().split()))\nA = np.ndarray([N, M])\nfor i in range(N):\n A[i, :] = list(map(int, input().split()))\n\nans = sum((A @ B + C) > 0)\n\nprint(ans)\n","fail":"# -*- coding: utf-8 -*-\n\nimport numpy as np\n\nN, M, C = map(int, input().split())\nB = np.ndarray([M, 1])\nB = list(map(int, input().split()))\nA = np.ndarray([N, M])\nfor i in range(N):\n A[i, :] = list(map(int, input().split()))\n\nans = sum((np.dot(A, B) + C) > 0)\n\nprint(ans)\n","change":"replace","i1":11,"i2":12,"j1":11,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03102","language":"Python","original_status":"Runtime Error","pass":"n, m, c = map(int, input().split())\nb = list(map(int, input().split()))\nans = 0\nfor _ in range(n):\n a = list(map(int, input().split()))\n if a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + c > 0:\n ans += 1\nprint(ans)\n","fail":"n, m, c = map(int, input().split())\nb = list(map(int, input().split()))\na = [list(map(int, input().split())) for _ in range(n)]\nans = 0\nfor ai in a:\n absum = 0\n for i in range(m):\n absum += ai[i] * b[i]\n if absum + c > 0:\n ans += 1\nprint(ans)\n","change":"replace","i1":2,"i2":6,"j1":2,"j2":9,"error":"0","stderr":null,"stdout":1.0} {"problem_id":"p03102","language":"Python","original_status":"Runtime Error","pass":"N, M, C = map(int, input().split())\nB = [int(input()) for i in range(M)]\nA = [[int(input()) for i in range(M)] for j in range(N)]\ncnt = 0\nfor i in range(N):\n ans = 0\n for j in range(M):\n ans += A[j][i] * B[j]\n if ans + C > 0:\n cnt += 1\nprint(cnt)\n","fail":"N, M, C = map(int, input().split())\nB = list(map(int, input().split()))\nans = 0\n\nfor i in range(N):\n A = list(map(int, input().split()))\n tmp = C\n for i, j in zip(A, B):\n tmp += i * j\n if tmp > 0:\n ans += 1\nprint(ans)\n","change":"replace","i1":1,"i2":11,"j1":1,"j2":12,"error":"ValueError: invalid literal for int() with base 10: '1 2 3'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03102\/Python\/s538264445.py\", line 2, in \n B = [int(input()) for i in range(M)]\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03102\/Python\/s538264445.py\", line 2, in \n B = [int(input()) for i in range(M)]\nValueError: invalid literal for int() with base 10: '1 2 3'\n","stdout":null} {"problem_id":"p03103","language":"Python","original_status":"Runtime Error","pass":"N, M = map(int, input().split())\nab = [list(map(int, input().split())) for i in range(N)]\n\nab_hash = {}\ncount = 0\nprice_sum = 0\nfor x in ab:\n ab_hash[x[0]] = x[1]\nab_key_sorted = sorted(ab_hash.items(), key=lambda x: x[0])\nwhile M > 0:\n if M > ab_key_sorted[count][1]:\n price_sum += ab_key_sorted[count][0] * ab_key_sorted[count][1]\n else:\n price_sum += ab_key_sorted[count][0] * M\n M = M - ab_key_sorted[count][1]\n count += 1\n\nprint(price_sum)\n","fail":"N, M = map(int, input().split())\nab = [list(map(int, input().split())) for i in range(N)]\n\nab_hash = {}\ncount = 0\nprice_sum = 0\nfor x in range(len(ab)):\n ab_hash[x] = [ab[x][0], ab[x][1]]\nab_key_sorted = sorted(ab_hash.items(), key=lambda x: x[1][0])\n\nfor y in ab_key_sorted:\n if M > y[1][1]:\n price_sum += y[1][0] * y[1][1]\n else:\n price_sum += y[1][0] * M\n M -= y[1][1]\n if M <= 0:\n break\n\nprint(price_sum)\n","change":"replace","i1":6,"i2":16,"j1":6,"j2":18,"error":"0","stderr":null,"stdout":"12\n"} {"problem_id":"p03103","language":"Python","original_status":"Runtime Error","pass":"n, m = map(int, input().split())\na = [list(map(int, input().split())) for _ in range(n)].sort()\npm = s = 0\nm_minus_1 = m - 1\nfor item in a:\n pm += item[1]\n if pm > m_minus_1:\n print(s + item[0] * (m - pm + item[1]))\n break\n else:\n s += item[0] * item[1]\n","fail":"n, m = map(int, input().split())\na = [list(map(int, input().split())) for _ in range(n)]\na.sort()\npm = s = 0\nm_minus_1 = m - 1\nfor item in a:\n pm += item[1]\n if pm > m_minus_1:\n print(s + item[0] * (m - pm + item[1]))\n break\n else:\n s += item[0] * item[1]\n","change":"replace","i1":1,"i2":2,"j1":1,"j2":3,"error":"TypeError: 'NoneType' object is not iterable","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03103\/Python\/s281800849.py\", line 5, in \n for item in a:\nTypeError: 'NoneType' object is not iterable\n","stdout":null} {"problem_id":"p03103","language":"Python","original_status":"Runtime Error","pass":"n, m = map(int, input().split())\nstores = [tuple(map(int, input().split())) for _ in range(n)]\ndict_stores = dict(stores)\nlower_cost = sorted(dict_stores.keys())\ntotal = 0\nans = 0\nfor i in range(n):\n total += dict_stores[lower_cost[i]]\n if total >= m:\n diff = m - (total - dict_stores[lower_cost[i]])\n ans += lower_cost[i] * diff\n break\n else:\n ans += lower_cost[i] * dict_stores[lower_cost[i]]\nprint(ans)\n","fail":"n, m = map(int, input().split())\nstores = [list(map(int, input().split())) for _ in range(n)]\nsorted_sotres = sorted(stores, key=lambda x: x[0])\ntotal = 0\nans = 0\nfor cost, number in sorted_sotres:\n if number > m:\n ans += cost * m\n break\n elif number == m:\n ans += cost * number\n break\n else:\n ans += cost * number\n m -= number\nprint(ans)\n","change":"replace","i1":1,"i2":14,"j1":1,"j2":15,"error":"0","stderr":null,"stdout":"12\n"} {"problem_id":"p03103","language":"Python","original_status":"Runtime Error","pass":"N, M = map(int, input().split())\nd = dict([list(map(int, input().split()))[::-1] for i in range(N)])\nd = sorted(d.items(), key=lambda x: x[1])\nc = p = i = 0\n\nwhile c < M:\n if c + d[i][0] <= M:\n c += d[i][0]\n p += d[i][1] * d[i][0]\n i += 1\n else:\n p += d[i][1] * (M - c)\n print(c)\n break\n\nprint(p)\n","fail":"N, M = map(int, input().split())\nd = [list(map(int, input().split())) for i in range(N)]\nd.sort(key=lambda x: (x[0], x[1]))\n\nc = p = i = 0\n\nwhile c < M:\n if c + d[i][1] <= M:\n c += d[i][1]\n p += d[i][0] * d[i][1]\n i += 1\n else:\n p += d[i][0] * (M - c)\n break\n\nprint(p)\n","change":"replace","i1":1,"i2":13,"j1":1,"j2":13,"error":"WA","stderr":null,"stdout":"4\n12\n"} {"problem_id":"p03103","language":"Python","original_status":"Time Limit Exceeded","pass":"def main():\n N, M = map(int, input().split())\n D = [tuple(map(int, input().split())) for _ in range(N)]\n D.sort()\n ans = 0\n while M > 0:\n a, b = D.pop(0)\n ans += a * min(M, b)\n M -= min(M, b)\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"def main():\n N, M = map(int, input().split())\n D = [tuple(map(int, input().split())) for _ in range(N)]\n D.sort()\n ans = 0\n i = 0\n while M > 0:\n a, b = D[i]\n ans += a * min(M, b)\n M -= min(M, b)\n i += 1\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":5,"i2":9,"j1":5,"j2":11,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03106","language":"Python","original_status":"Runtime Error","pass":"a, b, k = map(int, input().split())\nm = 0\nans = []\n\nif a < b:\n m = b\n n = a\nelse:\n m = a\n n = b\n\nfor i in range(1, m):\n if n % i == 0 and m % i == 0:\n ans.append(i)\n\nif ans:\n print(ans[-k])\nelse:\n print(\"1\")\n","fail":"a, b, k = map(int, input().split())\nm = 0\nans = []\n\nif a < b:\n m = b\n n = a\nelse:\n m = a\n n = b\n\nfor i in range(1, n + 1):\n if m % i == 0 and n % i == 0:\n ans.append(i)\n\nif ans:\n print(ans[-k])\nelse:\n print(\"1\")\n","change":"replace","i1":11,"i2":13,"j1":11,"j2":13,"error":"0","stderr":null,"stdout":"2\n"} {"problem_id":"p03106","language":"Python","original_status":"Runtime Error","pass":"A, B, K = map(int, input().split())\n\n\ndef gcd(a, b):\n x = max(a, b)\n y = min(a, b)\n mod = x % y\n if mod == 0:\n return y\n\n return gcd(y, mod)\n\n\nmx = gcd(A, B)\ncount = 0\nfor a in range(mx, 1, -1):\n print(a)\n if A % a == 0 and B % a == 0:\n count += 1\n if count == K:\n ans = a\n break\nprint(ans)\n","fail":"A, B, K = map(int, input().split())\n\n\ndef gcd(a, b):\n x = max(a, b)\n y = min(a, b)\n mod = x % y\n if mod == 0:\n return y\n\n return gcd(y, mod)\n\n\nmx = gcd(A, B)\ncount = 0\n\nfor a in range(mx, 0, -1):\n if A % a == 0 and B % a == 0:\n count += 1\n if count == K:\n ans = a\n break\n\nprint(ans)\n","change":"replace","i1":15,"i2":22,"j1":15,"j2":23,"error":"WA","stderr":null,"stdout":"4\n3\n2\n2\n"} {"problem_id":"p03106","language":"Python","original_status":"Runtime Error","pass":"A, B, K = map(int, input().split())\nn = max(A, B)\nk = 0\nif n == 1:\n print(\"1\")\nelse:\n while k < K:\n n = n - 1\n if A % n == 0 and B % n == 0:\n k = k + 1\n print(n)\n","fail":"A, B, K = map(int, input().split())\nn = max(A, B)\nk = 0\nwhile True:\n if A % n == 0 and B % n == 0:\n k = k + 1\n if k >= K:\n break\n n = n - 1\nprint(n)\n","change":"replace","i1":3,"i2":11,"j1":3,"j2":10,"error":"0","stderr":null,"stdout":"2\n"} {"problem_id":"p03106","language":"Python","original_status":"Runtime Error","pass":"# coding:utf-8\n\n\ndef main():\n A, B, K = map(int, input().split())\n ans = []\n ans.append(1)\n for i in range(2, max(A, B)):\n if A % i == 0 and B % i == 0:\n ans.append(i)\n # if len(ans) >= K:\n # break\n # print(ans)\n print(ans[-K])\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"# coding:utf-8\n\n\ndef main():\n A, B, K = map(int, input().split())\n ans = []\n ans.append(1)\n for i in range(2, max(A, B) + 1):\n if A % i == 0 and B % i == 0:\n ans.append(i)\n # if len(ans) >= K:\n # break\n # print(ans)\n print(ans[-K])\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":7,"i2":8,"j1":7,"j2":8,"error":"0","stderr":null,"stdout":"2\n"} {"problem_id":"p03106","language":"Python","original_status":"Runtime Error","pass":"a, b, k = map(int, input().split())\ndiv = []\nfor i in range(1, max(a, b)):\n if (a % i == 0) and (b % i == 0):\n div.append(i)\nif len(div) == 0:\n print(1)\nelse:\n div.sort()\n print(div[-k])\n","fail":"a, b, k = map(int, input().split())\ndiv = []\nfor i in range(1, 105):\n if (a % i == 0) and (b % i == 0):\n div.append(i)\n\nif len(div) < k:\n print(max(div))\nelse:\n div.sort()\n print(div[-k])\n","change":"replace","i1":2,"i2":7,"j1":2,"j2":8,"error":"0","stderr":null,"stdout":"2\n"} {"problem_id":"p03106","language":"Python","original_status":"Runtime Error","pass":"import math\n\nA, B, K = map(int, input().split())\n\ngcd = math.gcd(A, B)\norder = 0\nfor i in range(gcd, 0, -1):\n if gcd % i == 0:\n order += 1\n if order == K:\n print(i)\n break\n","fail":"import fractions\n\nA, B, K = map(int, input().split())\n\ngcd = fractions.gcd(A, B)\norder = 0\nfor i in range(gcd, 0, -1):\n if gcd % i == 0:\n order += 1\n if order == K:\n print(i)\n break\n","change":"replace","i1":0,"i2":5,"j1":0,"j2":5,"error":"0","stderr":null,"stdout":"2\n"} {"problem_id":"p03106","language":"Python","original_status":"Runtime Error","pass":"a, b, k = map(int, input().split())\ndivisers = []\n\nfor i in range(1, max(a, b)):\n if a % i == 0 and b % i == 0:\n divisers.append(i)\n\nprint(divisers[-k])\n","fail":"a, b, k = map(int, input().split())\ndivisers = []\n\nfor i in range(1, min(a, b) + 1):\n if a % i == 0 and b % i == 0:\n divisers.append(i)\n\nprint(divisers[-k])\n","change":"replace","i1":3,"i2":4,"j1":3,"j2":4,"error":"0","stderr":null,"stdout":"2\n"} {"problem_id":"p03106","language":"Python","original_status":"Runtime Error","pass":"a, b, k = map(int, input().split())\n\ncommon_factors = []\nfor i in range(1, a):\n if a % i == 0 and b % i == 0:\n common_factors.append(i)\nprint(common_factors[-k])\n","fail":"a, b, k = map(int, input().split())\n\ncommon_factors = []\nfor i in range(1, a + 1):\n if a % i == 0 and b % i == 0:\n common_factors.append(i)\nprint(common_factors[-k])\n","change":"replace","i1":3,"i2":4,"j1":3,"j2":4,"error":"0","stderr":null,"stdout":"2\n"} {"problem_id":"p03106","language":"Python","original_status":"Runtime Error","pass":"A, B, K = [int(i) for i in input().split()]\nth = []\ni = 1\nwhile True:\n i += 1\n if (A % i, B % i) == (0, 0):\n th.append(i)\n if i > A or i > B:\n break\nprint(th[len(th) - K])\n","fail":"A, B, K = [int(i) for i in input().split()]\nth = []\ni = 0\nwhile True:\n i += 1\n if (A % i, B % i) == (0, 0):\n th.append(i)\n if i > A or i > B:\n break\nprint(th[len(th) - K])\n","change":"replace","i1":2,"i2":3,"j1":2,"j2":3,"error":"0","stderr":null,"stdout":"2\n"} {"problem_id":"p03107","language":"Python","original_status":"Time Limit Exceeded","pass":"def recursin_operation(S, len_init_s):\n S = list(S)\n N = len(S)\n lst = [i for i in range(N - 1) if S[i] != S[i + 1]]\n nums_of_deleted = []\n if len(lst) != 0:\n for i in lst:\n S_next = [S[j] for j in range(len(S)) if j < i or j > i + 1]\n nums_of_deleted.append(recursin_operation(S_next, len_init_s))\n else:\n nums_of_deleted.append(len_init_s - len(S))\n\n return max(nums_of_deleted)\n\n\ndef main():\n S = input()\n len_init_s = len(S)\n ans = recursin_operation(S, len_init_s)\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"S = input()\nlen_S = len(S)\nzero_lst = [S[i] for i in range(len_S) if S[i] == \"0\"]\none_lst = [S[i] for i in range(len_S) if S[i] == \"1\"]\nans = min(len(zero_lst), len(one_lst)) * 2\nprint(ans)\n","change":"replace","i1":0,"i2":24,"j1":0,"j2":6,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03107","language":"Python","original_status":"Time Limit Exceeded","pass":"# -*- coding: utf-8 -*-\n\nimport re\n\nS = input()\n\ns = S\nans = 0\nwhile 1:\n s, t = re.subn(\"01|10\", \"\", s)\n ans += t * 2\n if t == 0:\n break\n\nprint(ans)\n","fail":"# -*- coding: utf-8 -*-\n\nS = input()\n\nans = min(S.count(\"0\"), S.count(\"1\"))\nprint(ans * 2)\n","change":"replace","i1":1,"i2":15,"j1":1,"j2":6,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03107","language":"Python","original_status":"Runtime Error","pass":"s = input()\nprint(2 * min(s.count(0), s.count(1)))\n","fail":"s = input()\nprint(2 * min(s.count(\"0\"), s.count(\"1\")))\n","change":"replace","i1":1,"i2":2,"j1":1,"j2":2,"error":"TypeError: must be str, not int","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03107\/Python\/s119508612.py\", line 2, in \n print(2 * min(s.count(0), s.count(1)))\nTypeError: must be str, not int\n","stdout":null} {"problem_id":"p03107","language":"Python","original_status":"Runtime Error","pass":"# -*- coding: utf-8 -*-\ns = input()\ns = list(s)\nx = 0\nmaxIndex = len(s) - 1\ncount = 0\nwhile True:\n if len(s) == x + 1:\n break\n if s[x] != s[x + 1]:\n s.pop(x)\n s.pop(x)\n count += 1\n x -= 1\n else:\n x += 1\nprint(\"{}\".format(count * 2))\n","fail":"s = input()\nx = 0\nfor c in s:\n if c == \"1\":\n x = x + 1\nprint(min(x, len(s) - x) * 2)\n","change":"replace","i1":0,"i2":17,"j1":0,"j2":6,"error":"0","stderr":null,"stdout":4.0} {"problem_id":"p03107","language":"Python","original_status":"Time Limit Exceeded","pass":"import re\n\ns = input()\npattern = \"(01)|(10)\"\ncount = 0\ndiff = 1\n\nwhile diff:\n ssub = re.sub(pattern, \"\", s)\n diff = len(s) - len(ssub)\n count += diff\n s = ssub\n\n\nprint(count)\n","fail":"import re\n\ns = input()\nzero = re.findall(\"0\", s)\none = re.findall(\"1\", s)\nprint(2 * min(len(zero), len(one)))\n","change":"replace","i1":3,"i2":15,"j1":3,"j2":6,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03107","language":"Python","original_status":"Time Limit Exceeded","pass":"S = input()\nsubS = S\ncnt = 0\nwhile True:\n flg = True\n if \"01\" in subS:\n flg = False\n subS = subS.replace(\"01\", \"\", 1)\n cnt += 2\n if \"10\" in subS:\n flg = False\n subS = subS.replace(\"10\", \"\", 1)\n cnt += 2\n if flg:\n break\nprint(cnt)\n","fail":"S = input()\n\nzeroSum = 0\noneSum = 0\nfor _ in S:\n if _ == \"0\":\n zeroSum += 1\n if _ == \"1\":\n oneSum += 1\n\nt = max(zeroSum, oneSum) - min(zeroSum, oneSum)\nprint(len(S) - t)\n","change":"replace","i1":1,"i2":16,"j1":1,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03107","language":"Python","original_status":"Time Limit Exceeded","pass":"#!\/usr\/bin\/env python3\ns = input()\nn = len(s)\nwhile True:\n ns = s.replace(\"01\", \"\").replace(\"10\", \"\")\n if ns == s:\n break\n s = ns\nprint(n - len(s))\n","fail":"#!\/usr\/bin\/env python3\ns = input()\nn = len(s)\nc = 0\np = \"\"\ncount = 0\nfor i in s:\n if i == p:\n count += 1\n else:\n c = count - c\n count = 1\n p = i\nc = count - c\nprint(n - abs(c))\n","change":"replace","i1":3,"i2":9,"j1":3,"j2":15,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03107","language":"Python","original_status":"Runtime Error","pass":"S = input()\nS = [Si for Si in S]\n\ni = len(S) - 2\nnumber_of_deleted_qube = 0\nwhile i >= 0 and len(S) >= 2:\n current = S[i]\n right = S[i + 1]\n\n if current != right:\n del S[i + 1]\n del S[i]\n number_of_deleted_qube += 2\n\n i -= 1\n\nprint(number_of_deleted_qube)\n","fail":"S = input()\nS = [Si for Si in S]\n\ni = len(S) - 2\nnumber_of_deleted_qube = 0\nwhile i >= 0 and len(S) >= 2:\n if i >= len(S) - 1:\n i -= 1\n continue\n\n current = S[i]\n right = S[i + 1]\n\n if current != right:\n del S[i + 1]\n del S[i]\n number_of_deleted_qube += 2\n\n i -= 1\n\nprint(number_of_deleted_qube)\n","change":"insert","i1":6,"i2":6,"j1":6,"j2":10,"error":"0","stderr":null,"stdout":4.0} {"problem_id":"p03107","language":"Python","original_status":"Time Limit Exceeded","pass":"S = input()\ninit_len = len(S)\n\nwhile True:\n cur_len = len(S)\n S = S.replace(\"01\", \"\")\n S = S.replace(\"10\", \"\")\n if len(S) == cur_len:\n print(init_len - cur_len)\n exit()\n","fail":"S = list(input())\n\nzero_S = S.count(\"0\")\none_S = S.count(\"1\")\n\nprint(min(zero_S, one_S) * 2)\n","change":"replace","i1":0,"i2":10,"j1":0,"j2":6,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03107","language":"Python","original_status":"Time Limit Exceeded","pass":"# s1 = input()\n# len_s = len(s1)\n# s2 = s1\n# while True:\n# len_1 = len(s2)\n# s2 = s2.replace(\"01\", \"\").replace(\"10\", \"\")\n# len_2 = len(s2)\n# if len_1 == len_2:\n# break\n#\n# print(len_s - len(s2))\n\ns = input()\ns2 = s\n# for i in range(len(s) \/\/ 2, 0, -1):\n# # print(\"i\", i)\n# # print(\"s2\", s2)\n# m1 = \"1\" * i + \"0\" * i\n# m2 = \"0\" * i + \"1\" * i\n# s2 = s2.replace(m1, \"\").replace(m2, \"\")\n\nwhile True:\n len_1 = len(s2)\n\n a1 = \"000111\"\n a2 = \"111000\"\n if a1 in s2:\n s2 = s2.replace(a1, \"\")\n if a2 in s2:\n s2 = s2.replace(a2, \"\")\n\n a3 = \"0011\"\n a4 = \"1100\"\n if a3 in s2:\n s2 = s2.replace(a3, \"\")\n if a4 in s2:\n s2 = s2.replace(a4, \"\")\n\n a5 = \"01\"\n a6 = \"10\"\n if a5 in s2:\n s2 = s2.replace(a5, \"\")\n if a6 in s2:\n s2 = s2.replace(a6, \"\")\n\n len_2 = len(s2)\n if len_1 == len_2:\n break\n\nprint(len(s) - len_2)\n","fail":"s = input()\nans = min(s.count(\"0\"), s.count(\"1\"))\nprint(ans * 2)\n","change":"replace","i1":0,"i2":50,"j1":0,"j2":3,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03107","language":"Python","original_status":"Time Limit Exceeded","pass":"s = list(input())\nn = len(s)\npos = 0\ncnt = 0\n\nwhile pos != n - 1 and n != 0:\n if s[pos] != s[pos + 1]:\n del s[pos]\n del s[pos]\n pos = 0\n n -= 2\n cnt += 2\n else:\n pos += 1\n\nprint(cnt)\n","fail":"s = input()\na = s.count(\"0\")\nb = s.count(\"1\")\nprint(min(a, b) * 2)\n","change":"replace","i1":0,"i2":16,"j1":0,"j2":4,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03107","language":"Python","original_status":"Time Limit Exceeded","pass":"import re\n\nS = input()\n\ntrimmed = 0\n\nwhile True:\n tmp = re.split(\"01|10\", S)\n if len(tmp) == 1:\n break\n else:\n trimmed = trimmed + len(tmp) - 1\n S = \"\".join(tmp)\n\nprint(trimmed * 2)\n","fail":"S = input()\n\nzero = 0\none = 0\n\nfor ch in S:\n if ch == \"0\":\n zero = zero + 1\n else:\n one = one + 1\n\nprint(min(zero, one) * 2)\n","change":"replace","i1":0,"i2":15,"j1":0,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03107","language":"Python","original_status":"Runtime Error","pass":"S = list(int(input()))\na = S.count(0)\nb = S.count(1)\nans = 2 * min(a, b)\nprint(ans)\n","fail":"S = list(input())\na = S.count(\"0\")\nb = S.count(\"1\")\nans = 2 * min(a, b)\nprint(ans)\n","change":"replace","i1":0,"i2":3,"j1":0,"j2":3,"error":"TypeError: 'int' object is not iterable","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03107\/Python\/s301284896.py\", line 1, in \n S = list(int(input()))\nTypeError: 'int' object is not iterable\n","stdout":null} {"problem_id":"p03107","language":"Python","original_status":"Time Limit Exceeded","pass":"s = input()\ncount = 0\ns = s + \"a\"\nwhile True:\n if \"01\" in s:\n s = s.replace(\"01\", \"\", 1)\n count += 2\n elif \"10\" in s:\n s = s.replace(\"10\", \"\", 1)\n count += 2\n else:\n break\nprint(count)\n","fail":"s = input()\ncube_list = [s[0]]\ns = s[1:]\ncount = 0\nfor c in s:\n if cube_list:\n if cube_list[-1] == c:\n cube_list.append(c)\n else:\n count += 2\n cube_list.pop(-1)\n else:\n cube_list.append(c)\nprint(count)\n","change":"replace","i1":1,"i2":12,"j1":1,"j2":13,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03107","language":"Python","original_status":"Time Limit Exceeded","pass":"s = input()\ncount = 0\n\nwhile s.find(\"01\") != -1 or s.find(\"10\") != -1:\n count += 2 * s.count(\"01\")\n s = s.replace(\"01\", \"\")\n count += 2 * s.count(\"10\")\n s = s.replace(\"10\", \"\")\nprint(count)\n","fail":"s = input()\nprint(2 * min(s.count(\"0\"), s.count(\"1\")))\n","change":"replace","i1":1,"i2":9,"j1":1,"j2":2,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03107","language":"Python","original_status":"Time Limit Exceeded","pass":"S = input()\ncnt1 = 0\ncnt2 = 0\nwhile True:\n before = S\n S = before.replace(\"01\", \"\", 1)\n if before != S:\n cnt1 += 1\n else:\n break\n\nwhile True:\n before = S\n S = before.replace(\"10\", \"\", 1)\n if before != S:\n cnt2 += 1\n else:\n break\n\nprint(2 * (cnt1 + cnt2))\n","fail":"S = input()\nprint(2 * min(S.count(\"1\"), S.count(\"0\")))\n","change":"replace","i1":1,"i2":20,"j1":1,"j2":2,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03107","language":"Python","original_status":"Time Limit Exceeded","pass":"b = list(map(int, input()))\ncnt = 0\nwhile len(b) > 1:\n\n if len(list(set(b))) == 1:\n break\n if b[0] != b[1]:\n b = b[2:]\n cnt += 1\n continue\n temp = b[:1]\n b = b[1:]\n b.append(*temp)\nprint(cnt * 2)\n","fail":"s = input()\nzom = min(s.count(\"1\"), s.count(\"0\"))\nif len(set(list(s))) == 1:\n zom = 0\nprint(zom * 2)\n","change":"replace","i1":0,"i2":14,"j1":0,"j2":5,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03107","language":"Python","original_status":"Time Limit Exceeded","pass":"s = input()\nn = len(s)\n\n\ndef divide(x):\n a = \"\".join(x.split(\"01\"))\n b = \"\".join(a.split(\"10\"))\n return b\n\n\ndef judge(x):\n return len(x.split(\"01\")) == 1 and len(x.split(\"10\")) == 1\n\n\nwhile not judge(s):\n s = divide(s)\n\nprint(n - len(s))\n","fail":"s = input()\nn = len(s)\nnum_0 = s.count(\"0\")\nnum_1 = n - num_0\n\nprint(n - abs(num_0 - num_1))\n","change":"replace","i1":2,"i2":18,"j1":2,"j2":6,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03107","language":"Python","original_status":"Runtime Error","pass":"s = list(input())\n\ncnt = 0\ni = 0\n\nwhile i < len(s):\n while len(s) != 0 and s[i] != s[i + 1]:\n s.pop(i)\n s.pop(i)\n cnt += 2\n i -= 1\n i += 1\n\nprint(cnt)\n","fail":"s = list(input())\n\n# Note: init\n# cnt = 0\n# i = 1\n#\n# while i < len(s):\n# while len(s) != 0 and s[i - 1] != s[i]:\n# s.pop(i)\n# s.pop(i - 1)\n# i -= 1\n# cnt += 2\n# i += 1\n#\n# print(cnt)\n\n\ncnt = min(s.count(\"0\"), s.count(\"1\"))\nprint(cnt * 2)\n","change":"replace","i1":2,"i2":14,"j1":2,"j2":19,"error":"0","stderr":null,"stdout":4.0} {"problem_id":"p03108","language":"Python","original_status":"Time Limit Exceeded","pass":"class UnionFind(object):\n def __init__(self, n=1):\n self.par = [i for i in range(n)] # \u30b0\u30eb\u30fc\u30d7\u756a\u53f7\n self.rank = [0 for _ in range(n)]\n self.num = [1 for _ in range(n)]\n\n def find(self, x):\n \"\"\"\n x \u304c\u5c5e\u3059\u308b\u30b0\u30eb\u30fc\u30d7\u3092\u63a2\u7d22\n \"\"\"\n if self.par[x] == x:\n return x\n else:\n self.par[x] = self.find(self.par[x])\n return self.par[x]\n\n def union(self, x, y):\n \"\"\"\n x \u3068 y \u306e\u30b0\u30eb\u30fc\u30d7\u3092\u7d50\u5408\n \"\"\"\n x = self.find(x)\n y = self.find(y)\n if x != y:\n if self.rank[x] < self.rank[y]:\n x, y = y, x\n if self.rank[x] == self.rank[y]:\n self.rank[x] += 1\n self.par[y] = x\n self.num[x] += self.num[y]\n self.num[y] = 0\n\n def is_same(self, x, y):\n \"\"\"\n x \u3068 y \u304c\u540c\u3058\u30b0\u30eb\u30fc\u30d7\u304b\u5426\u304b\n \"\"\"\n return self.find(x) == self.find(y)\n\n\nN, M = map(int, input().split())\nL = [list(map(int, input().split())) for i in range(M)]\nA = [0] * M\nD = N * (N - 1) \/\/ 2\nu = UnionFind(N)\nfor i in reversed(range(M)):\n # u.union(L[i][0]-1, L[i][1]-1)\n a = 0\n for j in range(N):\n # print(i, j, u.num[j])\n if u.num[j] >= 2:\n a += u.num[j] * (u.num[j] - 1) \/\/ 2\n A[i] = a\n # print(A[i])\n u.union(L[i][0] - 1, L[i][1] - 1)\nfor i in range(M):\n print(D - A[i])\n","fail":"class UnionFind(object):\n def __init__(self, n=1):\n self.par = [i for i in range(n)] # \u30b0\u30eb\u30fc\u30d7\u756a\u53f7\n self.rank = [0 for _ in range(n)]\n self.num = [1 for _ in range(n)]\n\n def find(self, x):\n \"\"\"\n x \u304c\u5c5e\u3059\u308b\u30b0\u30eb\u30fc\u30d7\u3092\u63a2\u7d22\n \"\"\"\n if self.par[x] == x:\n return x\n else:\n self.par[x] = self.find(self.par[x])\n return self.par[x]\n\n def union(self, x, y):\n \"\"\"\n x \u3068 y \u306e\u30b0\u30eb\u30fc\u30d7\u3092\u7d50\u5408\n \"\"\"\n x = self.find(x)\n y = self.find(y)\n if x != y:\n if self.rank[x] < self.rank[y]:\n x, y = y, x\n if self.rank[x] == self.rank[y]:\n self.rank[x] += 1\n self.par[y] = x\n self.num[x] += self.num[y]\n self.num[y] = 0\n\n def is_same(self, x, y):\n \"\"\"\n x \u3068 y \u304c\u540c\u3058\u30b0\u30eb\u30fc\u30d7\u304b\u5426\u304b\n \"\"\"\n return self.find(x) == self.find(y)\n\n\nN, M = map(int, input().split())\nL = [list(map(int, input().split())) for i in range(M)]\nA = [0] * M\nD = N * (N - 1) \/\/ 2\nu = UnionFind(N)\na = 0\nfor i in reversed(range(M)):\n # u.union(L[i][0]-1, L[i][1]-1)\n # a = 0\n # for j in range(N):\n # # print(i, j, u.num[j])\n # if u.num[j] >= 2:\n # a += u.num[j] * (u.num[j] - 1) \/\/ 2\n A[i] = a\n # print(A[i])\n if u.find(L[i][0] - 1) != u.find(L[i][1] - 1):\n if u.num[u.find(L[i][0] - 1)] > 1:\n a -= u.num[u.find(L[i][0] - 1)] * (u.num[u.find(L[i][0] - 1)] - 1) \/\/ 2\n if u.num[u.find(L[i][1] - 1)] > 1:\n a -= u.num[u.find(L[i][1] - 1)] * (u.num[u.find(L[i][1] - 1)] - 1) \/\/ 2\n u.union(L[i][0] - 1, L[i][1] - 1)\n # if u.find(L[i][0] - 1) != u.find(L[i][1] - 1):\n a += u.num[u.find(L[i][0] - 1)] * (u.num[u.find(L[i][0] - 1)] - 1) \/\/ 2\n\nfor i in range(M):\n print(D - A[i])\n","change":"replace","i1":43,"i2":53,"j1":43,"j2":62,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03108","language":"Python","original_status":"Time Limit Exceeded","pass":"n, m = map(int, input().split())\npar = [-1 for i in range(n)] # \u89aa\u3060\u3063\u305f\u5834\u5408\u306f-(\u305d\u306e\u96c6\u5408\u306e\u30b5\u30a4\u30ba)\n\n\n# x\u304c\u3069\u306e\u30b0\u30eb\u30fc\u30d7\u306b\u5c5e\u3057\u3066\u3044\u308b\u304b\u8abf\u3079\u308b\ndef find(x):\n if par[x] < 0:\n return x\n else:\n par[x] = find(par[x])\n return find(par[x])\n\n\n# \u81ea\u5206\u306e\u3044\u308b\u30b0\u30eb\u30fc\u30d7\u306e\u6570\ndef size(x):\n return -par[find(x)]\n\n\n# x\u3068y\u306e\u5c5e\u3059\u308b\u96c6\u5408\u3092\u4f75\u5408\ndef unite(x, y):\n # \u6839\u3092\u63a2\u3059\n x, y = find(x), find(y)\n\n # \u6839\u304c\u4e00\u7dd2\n if x == y:\n return\n\n # \u5927\u304d\u3044\u65b9\u306b\u5c0f\u3055\u3044\u65b9\u3092\u304f\u3063\u3064\u3051\u308b\n if size(x) < size(y):\n x, y = y, x\n\n # x\u306e\u30b5\u30a4\u30ba\u3092\u66f4\u65b0\n par[x] += par[y]\n # y\u306e\u89aa\u3092x\u306b\u3059\u308b\n par[y] = x\n\n\n# \u540c\u3058\u96c6\u5408\u306b\u5c5e\u3059\u308b\u304b\u5224\u5b9a\ndef same(x, y):\n return find(x) == find(y)\n\n\nbridges = [list(map(int, input().split())) for _ in range(m)]\nbridges.reverse()\nhuben = n * (n - 1) \/\/ 2\nans = []\nfor i in range(m):\n ans.append(huben)\n a, b = bridges[i]\n a, b = a - 1, b - 1\n if not same(a, b):\n huben -= size(a) * size(b)\n unite(a, b)\nfor i in range(m):\n print(ans[::-1][i])\n","fail":"n, m = map(int, input().split())\npar = [-1] * n # \u89aa\u3060\u3063\u305f\u5834\u5408\u306f-(\u305d\u306e\u96c6\u5408\u306e\u30b5\u30a4\u30ba)\n\n\n# x\u304c\u3069\u306e\u30b0\u30eb\u30fc\u30d7\u306b\u5c5e\u3057\u3066\u3044\u308b\u304b\u8abf\u3079\u308b\ndef find(x):\n if par[x] < 0:\n return x\n else:\n par[x] = find(par[x])\n return find(par[x])\n\n\n# \u81ea\u5206\u306e\u3044\u308b\u30b0\u30eb\u30fc\u30d7\u306e\u6570\ndef size(x):\n return -par[find(x)]\n\n\n# x\u3068y\u306e\u5c5e\u3059\u308b\u96c6\u5408\u3092\u4f75\u5408\ndef unite(x, y):\n # \u6839\u3092\u63a2\u3059\n x, y = find(x), find(y)\n\n # \u6839\u304c\u4e00\u7dd2\n if x == y:\n return\n\n # \u5927\u304d\u3044\u65b9\u306b\u5c0f\u3055\u3044\u65b9\u3092\u304f\u3063\u3064\u3051\u308b\n if size(x) < size(y):\n x, y = y, x\n\n # x\u306e\u30b5\u30a4\u30ba\u3092\u66f4\u65b0\n par[x] += par[y]\n # y\u306e\u89aa\u3092x\u306b\u3059\u308b\n par[y] = x\n\n\n# \u540c\u3058\u96c6\u5408\u306b\u5c5e\u3059\u308b\u304b\u5224\u5b9a\ndef same(x, y):\n return find(x) == find(y)\n\n\nbridges = [list(map(int, input().split())) for _ in range(m)]\nbridges.reverse()\nhuben = n * (n - 1) \/\/ 2\nans = []\nfor i in range(m):\n ans.append(huben)\n a, b = bridges[i]\n a, b = a - 1, b - 1\n if same(a, b):\n continue\n else:\n huben -= size(a) * size(b)\n unite(a, b)\nans = ans[::-1]\nfor i in range(m):\n print(ans[i])\n","change":"replace","i1":1,"i2":55,"j1":1,"j2":58,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03108","language":"Python","original_status":"Runtime Error","pass":"n, m = map(int, input().split())\npar = [-1] * n # \u89aa\u3060\u3063\u305f\u5834\u5408\u306f-(\u305d\u306e\u96c6\u5408\u306e\u30b5\u30a4\u30ba)\n\n\n# x\u304c\u3069\u306e\u30b0\u30eb\u30fc\u30d7\u306b\u5c5e\u3057\u3066\u3044\u308b\u304b\u8abf\u3079\u308b\ndef find(x):\n if par[x] < 0:\n return x\n else:\n par[x] = find(par[x])\n return find(par[x])\n\n\n# \u81ea\u5206\u306e\u3044\u308b\u30b0\u30eb\u30fc\u30d7\u306e\u6570\ndef size(x):\n return -par[find(x)]\n\n\n# x\u3068y\u306e\u5c5e\u3059\u308b\u96c6\u5408\u3092\u4f75\u5408\ndef unite(x, y):\n # \u6839\u3092\u63a2\u3059\n x, y = find(x), find(y)\n\n # \u6839\u304c\u4e00\u7dd2\n if x == y:\n return\n\n # \u5927\u304d\u3044\u65b9\u306b\u5c0f\u3055\u3044\u65b9\u3092\u304f\u3063\u3064\u3051\u308b\n if size(x) < size(y):\n x, y = y, x\n\n # x\u306e\u30b5\u30a4\u30ba\u3092\u66f4\u65b0\n par[x] += par[y]\n # y\u306e\u89aa\u3092x\u306b\u3059\u308b\n par[y] = x\n\n\n# \u540c\u3058\u96c6\u5408\u306b\u5c5e\u3059\u308b\u304b\u5224\u5b9a\ndef same(x, y):\n return find(x) == find(y)\n\n\nbridges = [list(map(int, input().split())) for _ in range(m)]\nbridges.reverse()\nhuben = n * (n - 1) \/\/ 2\nans = []\n\nfor i in range(m):\n ans.append(huben)\n a, b = bridges[i]\n a, b = a - 1, b - 1\n if same(a, b):\n continue\n else:\n huben -= size(a) * size(b)\n unite(a, b)\nans = ans.reverse()\nfor i in range(m):\n print(ans[i])\n","fail":"n, m = map(int, input().split())\npar = [-1] * n # \u89aa\u3060\u3063\u305f\u5834\u5408\u306f-(\u305d\u306e\u96c6\u5408\u306e\u30b5\u30a4\u30ba)\n\n\n# x\u304c\u3069\u306e\u30b0\u30eb\u30fc\u30d7\u306b\u5c5e\u3057\u3066\u3044\u308b\u304b\u8abf\u3079\u308b\ndef find(x):\n if par[x] < 0:\n return x\n else:\n par[x] = find(par[x])\n return find(par[x])\n\n\n# \u81ea\u5206\u306e\u3044\u308b\u30b0\u30eb\u30fc\u30d7\u306e\u6570\ndef size(x):\n return -par[find(x)]\n\n\n# x\u3068y\u306e\u5c5e\u3059\u308b\u96c6\u5408\u3092\u4f75\u5408\ndef unite(x, y):\n # \u6839\u3092\u63a2\u3059\n x, y = find(x), find(y)\n\n # \u6839\u304c\u4e00\u7dd2\n if x == y:\n return\n\n # \u5927\u304d\u3044\u65b9\u306b\u5c0f\u3055\u3044\u65b9\u3092\u304f\u3063\u3064\u3051\u308b\n if size(x) < size(y):\n x, y = y, x\n\n # x\u306e\u30b5\u30a4\u30ba\u3092\u66f4\u65b0\n par[x] += par[y]\n # y\u306e\u89aa\u3092x\u306b\u3059\u308b\n par[y] = x\n\n\n# \u540c\u3058\u96c6\u5408\u306b\u5c5e\u3059\u308b\u304b\u5224\u5b9a\ndef same(x, y):\n return find(x) == find(y)\n\n\nbridges = [list(map(int, input().split())) for _ in range(m)]\nbridges.reverse()\nhuben = n * (n - 1) \/\/ 2\nans = []\nfor i in range(m):\n ans.append(huben)\n a, b = bridges[i]\n a, b = a - 1, b - 1\n if same(a, b):\n continue\n else:\n huben -= size(a) * size(b)\n unite(a, b)\nans.reverse()\nfor i in range(m):\n print(ans[i])\n","change":"replace","i1":46,"i2":57,"j1":46,"j2":56,"error":"TypeError: 'NoneType' object is not subscriptable","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03108\/Python\/s038545963.py\", line 59, in \n print(ans[i])\nTypeError: 'NoneType' object is not subscriptable\n","stdout":null} {"problem_id":"p03108","language":"Python","original_status":"Runtime Error","pass":"class UnionFind:\n def __init__(self, nodes):\n self._parents = {k: k for k in nodes}\n self._ranks = {k: 0 for k in nodes}\n self._sizes = {k: 1 for k in nodes}\n\n def union(self, x, y):\n x_root = self.find(x)\n y_root = self.find(y)\n if x_root != y_root:\n if self._ranks[x_root] < self._ranks[y_root]:\n self._parents[y_root] = x_root\n self._ranks[x_root] += 1\n self._sizes[x_root] += self._sizes[y_root]\n else:\n self._parents[x_root] = y_root\n self._ranks[y_root] += 1\n self._sizes[y_root] += self._sizes[x_root]\n\n def find(self, x):\n if self._parents[x] == x:\n return x\n self._parents[x] = self.find(self._parents[x])\n return self._parents[x]\n\n def size(self, x):\n return self._sizes[self.find(x)]\n\n\nn, m = map(int, input().split())\n\nbridges = []\nfor _ in range(m):\n bridges.append(list(map(int, input().split())))\n\n\ndef c2(n):\n # n \u304b\u30892\u500b\u9078\u3076\u7d44\u307f\u5408\u308f\u305b nC2\n return int(n * (n - 1) \/ 2)\n\n\nbridges.reverse()\nuf = UnionFind(nodes=[i + 1 for i in range(n)])\n# \u4fbf\u5229\u3055; \u3064\u306a\u304c\u3063\u3066\u308b\u5cf6\u306e\u7d44\u307f\u5408\u308f\u305b\u306e\u6570\nuseful = 0\nuseful_history = []\n\nfor bridge in bridges:\n useful_history.append(useful)\n\n if uf.find(bridge[0]) != uf.find(bridge[1]):\n # \u65b0\u3057\u304f\u3064\u306a\u304c\u3063\u305f\u306e\u3067\u4fbf\u5229\u3055\u3092\u66f4\u65b0\n size0 = uf.size(bridge[0])\n size1 = uf.size(bridge[1])\n useful += c2(size0 + size1) - c2(size0) - c2(size1)\n uf.union(bridge[0], bridge[1])\n\nfor u in reversed(useful_history):\n print(useful - u)\n","fail":"class UnionFind:\n def __init__(self, nodes):\n self._parents = {k: k for k in nodes}\n self._ranks = {k: 0 for k in nodes}\n self._sizes = {k: 1 for k in nodes}\n\n def union(self, x, y):\n \"\"\"\n x \u304c\u5c5e\u3059\u308b\u6728\u3068 y \u304c\u5c5e\u3059\u308b\u6728\u3092\u4f75\u5408\n :param x:\n :param y:\n :return:\n \"\"\"\n x = self.find(x)\n y = self.find(y)\n if x != y:\n # rank \u304c\u5c0f\u3055\u3044\u65b9\u304c\u4e0b\n if self._ranks[x] > self._ranks[y]:\n self._parents[y] = x\n self._sizes[x] += self._sizes[y]\n else:\n self._parents[x] = y\n self._sizes[y] += self._sizes[x]\n if self._ranks[x] == self._ranks[y]:\n self._ranks[y] += 1\n\n def find(self, x):\n \"\"\"\n x \u304c\u5c5e\u3059\u308b\u6728\u306e root\n :param x:\n :return:\n \"\"\"\n if self._parents[x] == x:\n return x\n self._parents[x] = self.find(self._parents[x])\n return self._parents[x]\n\n def size(self, x):\n \"\"\"\n x \u304c\u5c5e\u3059\u308b\u6728\u306e\u30ce\u30fc\u30c9\u6570\n :param x:\n :return:\n \"\"\"\n return self._sizes[self.find(x)]\n\n\nn, m = map(int, input().split())\n\nbridges = []\nfor _ in range(m):\n bridges.append(list(map(int, input().split())))\n\n\ndef c2(n):\n # n \u304b\u30892\u500b\u9078\u3076\u7d44\u307f\u5408\u308f\u305b nC2\n return int(n * (n - 1) \/ 2)\n\n\nbridges.reverse()\nuf = UnionFind(nodes=[i + 1 for i in range(n)])\n# \u4fbf\u5229\u3055; \u3064\u306a\u304c\u3063\u3066\u308b\u5cf6\u306e\u7d44\u307f\u5408\u308f\u305b\u306e\u6570\nuseful = 0\nuseful_history = []\n\nfor bridge in bridges:\n useful_history.append(useful)\n\n if uf.find(bridge[0]) != uf.find(bridge[1]):\n # \u65b0\u3057\u304f\u3064\u306a\u304c\u3063\u305f\u306e\u3067\u4fbf\u5229\u3055\u3092\u66f4\u65b0\n size0 = uf.size(bridge[0])\n size1 = uf.size(bridge[1])\n useful += c2(size0 + size1) - c2(size0) - c2(size1)\n uf.union(bridge[0], bridge[1])\n\nfor u in reversed(useful_history):\n print(useful - u)\n","change":"replace","i1":7,"i2":26,"j1":7,"j2":43,"error":"0","stderr":null,"stdout":"0\n0\n4\n5\n6\n"} {"problem_id":"p03108","language":"Python","original_status":"Time Limit Exceeded","pass":"class UnionFind:\n def __init__(self, n):\n self.v = [-1 for _ in range(n)] # \u6839(\u8ca0): \u9023\u7d50\u9802\u70b9\u6570 * (-1) \/ \u5b50(\u6b63): \u6839\u306e\u9802\u70b9\u756a\u53f7(0-indexed)\n\n def find(self, x): # x\u3092\u542b\u3080\u6728\u306b\u304a\u3051\u308b\u6839\u306e\u9802\u70b9\u756a\u53f7\u3092\u8fd4\u3059\n if self.v[x] < 0: # (\u8ca0)\u306f\u6839\n return x\n else: # \u6839\u306e\u9802\u70b9\u756a\u53f7\n self.v[x] = self.find(self.v[x]) # unite\u3067\u306f, \u65e7\u6839\u306b\u5c5e\u3059\u308b\u9802\u70b9\u306e\u6839\u304c\u65e7\u6839\u306e\u307e\u307e\u306a\u306e\u3067\u66f4\u65b0\n return self.v[x]\n\n def unite(self, x, y): # \u9055\u3046\u6839\u306b\u5c5e\u3057\u3066\u3044\u305f\u3089rank\u304c\u4f4e\u304f\u306a\u308b\u3088\u3046\u306b\u9023\u7d50\n x = self.find(x)\n y = self.find(y)\n if x == y:\n return\n if -self.v[x] < -self.v[y]: # size\u6bd4\u8f03, \u3000(-1) * (\u9023\u7d50\u9802\u70b9\u6570 * (-1)), (\u6b63)\u540c\u58eb\u306e\u5927\u5c0f\u6bd4\u8f03\n x, y = y, x # \u9023\u7d50\u9802\u70b9\u6570\u304c\u5c11\u306a\u3044\u65b9\u3092y\u306b\u3059\u308b\u3068, find\u3067\u306e\u66f4\u65b0\u56de\u6570\u304c\u6e1b\u308b\uff1f\n self.v[x] += self.v[y] # \u9023\u7d50\u9802\u70b9\u6570\u306e\u548c\u3092\u53d6\u308b, \u9023\u7d50\u9802\u70b9\u6570 * (-1)\n self.v[y] = x # \u9023\u7d50\u9802\u70b9\u6570\u304c\u5c11\u306a\u3044y(\u5f15\u6570y\u306e\u6839\u306e\u9802\u70b9\u756a\u53f7)\u306e\u6839\u3092x(\u5f15\u6570x\u306e\u6839\u306e\u9802\u70b9\u756a\u53f7)\u306b\u3059\u308b\n\n def root(self, x):\n return self.v[x] < 0 # (\u8ca0)\u306f\u6839\n\n def same(self, x, y):\n return self.find(x) == self.find(y) # \u540c\u3058\u6839\u306b\u5c5e\u3059\u308b\u304b\n\n def size(self, x):\n return -self.v[self.find(x)] # \u9023\u7d50\u9802\u70b9\u6570\u3092\u8fd4\u3059\n\n\nN, M = map(int, input().split())\ne = []\nuf = UnionFind(N)\nfor _ in range(M):\n a, b = map(int, input().split())\n a -= 1\n b -= 1\n e.append((a, b))\n\ninit = N * (N - 1) \/\/ 2\nans = [init for _ in range(M)]\n\nfor i in sorted(range(M), reverse=True):\n cc = 0\n for v in range(N):\n if uf.root(v):\n set_size = uf.size(v)\n cc += set_size * (set_size - 1) \/\/ 2\n ans[i] -= cc\n a, b = e[i]\n uf.unite(a, b)\n\nfor i in range(M):\n print(ans[i])\n","fail":"class UnionFind:\n def __init__(self, n):\n self.v = [-1 for _ in range(n)] # \u6839(\u8ca0): \u9023\u7d50\u9802\u70b9\u6570 * (-1) \/ \u5b50(\u6b63): \u6839\u306e\u9802\u70b9\u756a\u53f7(0-indexed)\n\n def find(self, x): # x\u3092\u542b\u3080\u6728\u306b\u304a\u3051\u308b\u6839\u306e\u9802\u70b9\u756a\u53f7\u3092\u8fd4\u3059\n if self.v[x] < 0: # (\u8ca0)\u306f\u6839\n return x\n else: # \u6839\u306e\u9802\u70b9\u756a\u53f7\n self.v[x] = self.find(self.v[x]) # unite\u3067\u306f, \u65e7\u6839\u306b\u5c5e\u3059\u308b\u9802\u70b9\u306e\u6839\u304c\u65e7\u6839\u306e\u307e\u307e\u306a\u306e\u3067\u66f4\u65b0\n return self.v[x]\n\n def unite(self, x, y): # \u9055\u3046\u6839\u306b\u5c5e\u3057\u3066\u3044\u305f\u3089rank\u304c\u4f4e\u304f\u306a\u308b\u3088\u3046\u306b\u9023\u7d50\n x = self.find(x)\n y = self.find(y)\n if x == y:\n return\n if -self.v[x] < -self.v[y]: # size\u6bd4\u8f03, \u3000(-1) * (\u9023\u7d50\u9802\u70b9\u6570 * (-1)), (\u6b63)\u540c\u58eb\u306e\u5927\u5c0f\u6bd4\u8f03\n x, y = y, x # \u9023\u7d50\u9802\u70b9\u6570\u304c\u5c11\u306a\u3044\u65b9\u3092y\u306b\u3059\u308b\u3068, find\u3067\u306e\u66f4\u65b0\u56de\u6570\u304c\u6e1b\u308b\uff1f\n self.v[x] += self.v[y] # \u9023\u7d50\u9802\u70b9\u6570\u306e\u548c\u3092\u53d6\u308b, \u9023\u7d50\u9802\u70b9\u6570 * (-1)\n self.v[y] = x # \u9023\u7d50\u9802\u70b9\u6570\u304c\u5c11\u306a\u3044y(\u5f15\u6570y\u306e\u6839\u306e\u9802\u70b9\u756a\u53f7)\u306e\u6839\u3092x(\u5f15\u6570x\u306e\u6839\u306e\u9802\u70b9\u756a\u53f7)\u306b\u3059\u308b\n\n def root(self, x):\n return self.v[x] < 0 # (\u8ca0)\u306f\u6839\n\n def same(self, x, y):\n return self.find(x) == self.find(y) # \u540c\u3058\u6839\u306b\u5c5e\u3059\u308b\u304b\n\n def size(self, x):\n return -self.v[self.find(x)] # \u9023\u7d50\u9802\u70b9\u6570\u3092\u8fd4\u3059\n\n\nN, M = map(int, input().split())\ne = []\nfor _ in range(M):\n a, b = map(int, input().split())\n a -= 1\n b -= 1\n e.append((a, b))\n\ninit = N * (N - 1) \/\/ 2\nuf = UnionFind(N)\n\nans = [-1 for _ in range(M)]\ncc = 0\nfor i in sorted(range(M), reverse=True):\n ans[i] = init - cc\n a, b = e[i]\n sa, sb = uf.size(a), uf.size(b)\n if sa == 1:\n if sb == 1:\n cc += 1\n else: # sb > 1\n cc -= sb * (sb - 1) \/\/ 2\n cc += sb * (sb + 1) \/\/ 2\n else:\n if sb == 1:\n cc -= sa * (sa - 1) \/\/ 2\n cc += sa * (sa + 1) \/\/ 2\n else:\n # sa > 1 and sb > 1\n if uf.same(a, b):\n pass\n else:\n cc -= sa * (sa - 1) \/\/ 2\n cc -= sb * (sb - 1) \/\/ 2\n cc += (sa + sb) * (sa + sb - 1) \/\/ 2\n uf.unite(a, b)\n\nfor i in range(M):\n print(ans[i])\n","change":"replace","i1":33,"i2":51,"j1":33,"j2":66,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03108","language":"Python","original_status":"Time Limit Exceeded","pass":"import sys\nfrom itertools import combinations\n\ninput = sys.stdin.readline\n\n\nclass UnionFind:\n \"\"\"Union Find class.\n\n \"Path compression\" and \"Union by rank\" are used.\n\n References:\n \n \"\"\"\n\n def __init__(self, N):\n self.N = N\n self.__make_set()\n self.elem = {i: set([i]) for i in range(1, N + 1)}\n\n def __make_set(self):\n self.parent = list(range(self.N + 1))\n self.rank = [0] * (self.N + 1)\n\n def find(self, x):\n if self.parent[x] != x:\n self.parent[x] = self.find(self.parent[x])\n return self.parent[x]\n\n def union(self, x, y):\n x_root = self.find(x)\n y_root = self.find(y)\n\n if x_root == y_root:\n return\n\n x_rank = self.rank[x_root]\n y_rank = self.rank[y_root]\n if x_rank > y_rank:\n self.parent[y_root] = x_root\n self.union_elem(y_root, x_root)\n elif x_rank < y_rank:\n self.parent[x_root] = y_root\n self.union_elem(x_root, y_root)\n else:\n self.parent[y_root] = x_root\n self.rank[x_root] += 1\n self.union_elem(y_root, x_root)\n\n def union_elem(self, src_root, dst_root):\n self.elem[dst_root] |= self.elem[src_root]\n del self.elem[src_root]\n\n def elem_counts(self):\n return [len(s) for s in self.elem.values()]\n\n\ndef main():\n N, M = map(int, input().split())\n A = [0] * M\n B = [0] * M\n for i in range(M):\n A[i], B[i] = map(int, input().split())\n\n uf = UnionFind(N)\n ans = [0] * M\n for i in reversed(range(M)):\n ans[i] = sum(a * b for a, b in combinations(uf.elem_counts(), r=2))\n uf.union(A[i], B[i])\n\n print(\"\\\\n\".join(map(str, ans)))\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"import sys\nfrom itertools import combinations\n\ninput = sys.stdin.readline\n\n\nclass UnionFind:\n \"\"\"Union Find class.\n\n \"Path compression\" and \"Union by rank\" are used.\n\n References:\n \n \"\"\"\n\n def __init__(self, N):\n self.N = N\n self.__make_set()\n\n def __make_set(self):\n self._parent = list(range(self.N + 1))\n self._rank = [0] * (self.N + 1)\n self._size = [1] * (self.N + 1)\n\n def find(self, x):\n if self._parent[x] != x:\n self._parent[x] = self.find(self._parent[x])\n return self._parent[x]\n\n def union(self, x, y):\n x_root = self.find(x)\n y_root = self.find(y)\n\n if x_root == y_root:\n return\n\n x_rank = self._rank[x_root]\n y_rank = self._rank[y_root]\n if x_rank > y_rank:\n self._parent[y_root] = x_root\n self._size[x_root] += self._size[y_root]\n elif x_rank < y_rank:\n self._parent[x_root] = y_root\n self._size[y_root] += self._size[x_root]\n else:\n self._parent[y_root] = x_root\n self._rank[x_root] += 1\n self._size[x_root] += self._size[y_root]\n\n def same_set(self, x, y):\n return self.find(x) == self.find(y)\n\n def size(self, x):\n return self._size[self.find(x)]\n\n\ndef main():\n N, M = map(int, input().split())\n A = [0] * M\n B = [0] * M\n for i in range(M):\n A[i], B[i] = map(int, input().split())\n\n uf = UnionFind(N)\n ans = [0] * M\n ans[-1] = N * (N - 1) \/\/ 2\n for i in reversed(range(M - 1)):\n a, b = A[i + 1], B[i + 1]\n if uf.same_set(a, b):\n ans[i] = ans[i + 1]\n else:\n ans[i] = ans[i + 1] - uf.size(a) * uf.size(b)\n uf.union(a, b)\n\n print(\"\\\\n\".join(map(str, ans)))\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":18,"i2":69,"j1":18,"j2":73,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03108","language":"Python","original_status":"Time Limit Exceeded","pass":"import sys\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\nsys.setrecursionlimit(20000000)\n\n\nclass UnionFind:\n def __init__(self, n_nodes):\n self.n_nodes = n_nodes\n self.parent = [i for i in range(n_nodes)]\n self.rank = [1] * n_nodes\n self.size = [1] * n_nodes\n\n def find(self, x):\n if self.parent[x] == x:\n return x\n else:\n self.parent[x] = self.find(self.parent[x])\n return self.parent[x]\n\n def unite(self, x, y):\n x = self.find(x)\n y = self.find(y)\n if x == y:\n return\n if self.rank[x] > self.rank[y]:\n self.parent[y] = x\n self.size[x] += self.size[y]\n else:\n self.parent[x] = y\n self.size[y] += self.size[x]\n if self.rank[x] == self.rank[y]:\n self.rank[y] += 1\n\n def check(self, x, y):\n return self.find(x) == self.find(y)\n\n def get_parent_list(self):\n return [i for i in range(self.n_nodes) if self.find(i) == i]\n\n def get_n_groups(self):\n return len(self.get_parent_list())\n\n def get_members(self, x):\n parent = self.find(x)\n return [i for i in range(self.n_nodes) if self.find(i) == parent]\n\n def get_members_dict(self):\n return {par: self.get_members(par) for par in self.get_parent_list()}\n\n\ndef main():\n N, M = map(int, input().split())\n Bridge = [list(map(int, input().split())) for _ in range(M)]\n answer = [N * (N - 1) \/\/ 2]\n UF = UnionFind(N)\n for i in range(M):\n AB = Bridge[M - i - 1]\n before = len(UF.get_members(AB[0] - 1))\n UF.unite(AB[0] - 1, AB[1] - 1)\n after = len(UF.get_members(AB[0] - 1))\n last = answer[-1]\n if before == after:\n answer.append(last)\n else:\n answer.append(last - (after - before) * before)\n\n answer = answer[::-1]\n print(*answer[1:], sep=\"\\\\n\")\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"import sys\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\nsys.setrecursionlimit(20000000)\n\n\nclass UnionFind:\n def __init__(self, n_nodes):\n self.n_nodes = n_nodes\n self.parent = [i for i in range(n_nodes)]\n self.rank = [1] * n_nodes\n self.size = [1] * n_nodes\n\n def find(self, x):\n if self.parent[x] == x:\n return x\n else:\n self.parent[x] = self.find(self.parent[x])\n return self.parent[x]\n\n def unite(self, x, y):\n x = self.find(x)\n y = self.find(y)\n if x == y:\n return\n if self.rank[x] > self.rank[y]:\n self.parent[y] = x\n self.size[x] += self.size[y]\n else:\n self.parent[x] = y\n self.size[y] += self.size[x]\n if self.rank[x] == self.rank[y]:\n self.rank[y] += 1\n\n def check(self, x, y):\n return self.find(x) == self.find(y)\n\n def get_parent_list(self):\n return [i for i in range(self.n_nodes) if self.find(i) == i]\n\n def get_n_groups(self):\n return len(self.get_parent_list())\n\n def get_members(self, x):\n parent = self.find(x)\n return [i for i in range(self.n_nodes) if self.find(i) == parent]\n\n def get_members_dict(self):\n return {par: self.get_members(par) for par in self.get_parent_list()}\n\n\ndef main():\n N, M = map(int, input().split())\n Bridge = [list(map(int, input().split())) for _ in range(M)]\n answer = [N * (N - 1) \/\/ 2]\n UF = UnionFind(N)\n for i in range(M):\n AB = Bridge[M - i - 1]\n A = AB[0] - 1\n B = AB[1] - 1\n if UF.check(A, B):\n last = answer[-1]\n answer.append(last)\n continue\n else:\n before = UF.size[UF.find(A)]\n UF.unite(AB[0] - 1, AB[1] - 1)\n after = UF.size[UF.find(A)]\n last = answer[-1]\n if before == after:\n answer.append(last)\n else:\n answer.append(last - (after - before) * before)\n\n answer = answer[::-1]\n print(*answer[1:], sep=\"\\\\n\")\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":62,"i2":70,"j1":62,"j2":77,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03108","language":"Python","original_status":"Time Limit Exceeded","pass":"N, M = map(int, input().split())\nA = []\nB = []\nfor _ in range(M):\n a, b = map(int, input().split())\n A.append(a - 1)\n B.append(b - 1)\n\nuf = [-1] * N\nvalues = []\nfor i in range(M - 1, -1, -1):\n a = A[i]\n b = B[i]\n\n cur_a = a\n while 0 <= uf[cur_a]:\n cur_a = uf[cur_a]\n num_a = -uf[cur_a]\n root_a = cur_a\n\n cur_b = b\n while 0 <= uf[cur_b]:\n cur_b = uf[cur_b]\n num_b = -uf[cur_b]\n root_b = cur_b\n\n if root_a != root_b:\n values.append(num_a * num_b)\n\n uf[root_b] += uf[root_a]\n cur = uf[root_a]\n uf[root_a] = root_b\n while 0 <= cur and 0 <= uf[cur]:\n nxt = uf[cur]\n uf[cur] = root_b\n cur = nxt\n else:\n values.append(0)\n\ntotal = 0\nfor v in reversed(values):\n total += v\n print(total)\n","fail":"import io\nimport sys\n\nlines = sys.stdin.read().splitlines()[::-1]\n\n\ndef readline():\n return lines.pop()\n\n\nN, M = map(int, readline().split())\nA = []\nB = []\nfor _ in range(M):\n a, b = map(int, readline().split())\n A.append(a - 1)\n B.append(b - 1)\n\nuf = [-1] * N\nvalues = []\nfor i in range(M - 1, -1, -1):\n a = A[i]\n b = B[i]\n\n cur = a\n while 0 <= uf[cur]:\n cur = uf[cur]\n num_a = -uf[cur]\n root_a = cur\n cur = a\n while 0 <= uf[cur]:\n nxt = uf[cur]\n uf[cur] = root_a\n cur = nxt\n\n cur = b\n while 0 <= uf[cur]:\n cur = uf[cur]\n num_b = -uf[cur]\n root_b = cur\n cur = b\n while 0 <= uf[cur]:\n nxt = uf[cur]\n uf[cur] = root_b\n cur = nxt\n\n if root_a != root_b:\n values.append(num_a * num_b)\n\n if num_a < num_b:\n uf[root_b] += uf[root_a]\n cur = uf[root_a]\n uf[root_a] = root_b\n while 0 <= cur and 0 <= uf[cur]:\n nxt = uf[cur]\n uf[cur] = root_b\n cur = nxt\n else:\n uf[root_a] += uf[root_b]\n cur = uf[root_b]\n uf[root_b] = root_a\n while 0 <= cur and 0 <= uf[cur]:\n nxt = uf[cur]\n uf[cur] = root_a\n cur = nxt\n else:\n values.append(0)\n\ntotal = 0\nout = io.StringIO()\nfor v in reversed(values):\n total += v\n print(total, file=out)\nprint(out.getvalue())\n","change":"replace","i1":0,"i2":43,"j1":0,"j2":74,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03110","language":"Python","original_status":"Runtime Error","pass":"n = int(input())\nans = 0\nfor _ in range(n):\n x, y = map(int, input().split())\n if y == \"JPY\":\n ans += x\n else:\n ans += 380000\nprint(ans)\n","fail":"n = int(input())\nans = 0\nfor _ in range(n):\n x, y = input().split()\n x = float(x)\n if y == \"JPY\":\n ans += x\n else:\n ans += x * 380000.0\nprint(ans)\n","change":"replace","i1":3,"i2":8,"j1":3,"j2":9,"error":"ValueError: invalid literal for int() with base 10: 'JPY'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03110\/Python\/s397276903.py\", line 4, in \n x, y = map(int, input().split())\nValueError: invalid literal for int() with base 10: 'JPY'\n","stdout":null} {"problem_id":"p03110","language":"Python","original_status":"Runtime Error","pass":"N = int(input())\n\nmoney = 0\nfor _ in range(N):\n x, u = map(int, input().split())\n if u == \"JPY\":\n money += x\n else:\n money += x * 380000\nprint(money)\n","fail":"N = int(input())\n\nmoney = 0\nfor _ in range(N):\n x, u = input().split()\n if u == \"JPY\":\n money += float(x)\n else:\n money += float(x) * 380000\nprint(money)\n","change":"replace","i1":4,"i2":9,"j1":4,"j2":9,"error":"ValueError: invalid literal for int() with base 10: 'JPY'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03110\/Python\/s996181332.py\", line 5, in \n x, u = map(int, input().split())\nValueError: invalid literal for int() with base 10: 'JPY'\n","stdout":null} {"problem_id":"p03111","language":"Python","original_status":"Runtime Error","pass":"from math import inf\nfrom collections import deque\n\nN, A, B, C = map(int, input().split())\nls = [0]\nfor _ in range(N):\n ls.append(int(input()))\nls.sort()\n\nq = deque()\nq.append((0, -30, 0, 0, 0))\nminmp = inf\nwhile len(q):\n n, mp, a, b, c = q.pop()\n if n == N:\n if min(a, b, c) == 0:\n continue\n minmp = min(minmp, mp + abs(a - A) + abs(b - B) + abs(c - C))\n else:\n q.append((n + 1, mp, a, b, c))\n q.append((n + 1, mp + 10, a + ls[n + 1], b, c))\n q.append((n + 1, mp + 10, a, b + ls[n + 1], c))\n q.append((n + 1, mp + 10, a, b, c + ls[n + 1]))\n\nprint(minmp)\n","fail":"try:\n from math import inf\nexcept:\n inf = float(\"inf\")\nfrom collections import deque\n\nN, A, B, C = map(int, input().split())\nls = [0]\nfor _ in range(N):\n ls.append(int(input()))\nls.sort()\n\nq = deque()\nq.append((0, -30, 0, 0, 0))\nminmp = inf\nwhile len(q):\n n, mp, a, b, c = q.pop()\n if n == N:\n if min(a, b, c) == 0:\n continue\n minmp = min(minmp, mp + abs(a - A) + abs(b - B) + abs(c - C))\n else:\n q.append((n + 1, mp, a, b, c))\n q.append((n + 1, mp + 10, a + ls[n + 1], b, c))\n q.append((n + 1, mp + 10, a, b + ls[n + 1], c))\n q.append((n + 1, mp + 10, a, b, c + ls[n + 1]))\n\nprint(minmp)\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":4,"error":"0","stderr":null,"stdout":23.0} {"problem_id":"p03111","language":"Python","original_status":"Time Limit Exceeded","pass":"import itertools\n\nN, A, B, C = map(int, input().split())\nL = [int(input()) for n in range(N)]\nP = []\n\nfor n in range(1, N + 1):\n P.extend(itertools.combinations([n for n in range(N)], n))\n\nadd_len = {s: sum(L[i] for i in s) for s in P}\n\n\ndef cost(v, s):\n return 10 * (len(s) - 1) + abs(v - add_len[s])\n\n\nres = 2 << 30\nfor a in P:\n cost_a = cost(A, a)\n if res < cost_a:\n continue\n\n for b in P:\n cost_b = cost(B, b)\n if res < cost_b:\n continue\n\n if len(set(a) & set(b)):\n continue\n\n for c in P:\n cost_c = cost(C, c)\n if res < cost_c:\n continue\n\n if len(set(a) & set(c)) or len(set(b) & set(c)):\n continue\n res = min(res, cost_a + cost_b + cost_c)\n\nprint(res)\n","fail":"import itertools\n\nN, A, B, C = map(int, input().split())\nL = [int(input()) for n in range(N)]\nP = []\n\nfor n in range(1, N + 1):\n P.extend(itertools.combinations([n for n in range(N)], n))\n\nadd_len = {s: sum(L[i] for i in s) for s in P}\n\n\ndef cost(v, s):\n return 10 * (len(s) - 1) + abs(v - add_len[s])\n\n\nres = 2 << 30\nfor a in P:\n cost_a = cost(A, a)\n if res < cost_a:\n continue\n\n for b in P:\n cost_b = cost(B, b)\n if res < cost_b:\n continue\n\n set_a = set(a)\n set_b = set(b)\n if len(set_a & set_b):\n continue\n\n for c in P:\n cost_c = cost(C, c)\n if res < cost_c:\n continue\n\n set_c = set(c)\n if len(set_a & set_c) or len(set_b & set_c):\n continue\n res = min(res, cost_a + cost_b + cost_c)\n\nprint(res)\n","change":"replace","i1":27,"i2":36,"j1":27,"j2":39,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03113","language":"Python","original_status":"Runtime Error","pass":"def solve(n, k, aaa):\n buf = []\n prev_last = -1\n\n for t in range(k + 1):\n ma, mi = min((a, i + 1) for i, a in enumerate(aaa) if i + 1 != prev_last)\n others = set(range(1, n + 1)) - {prev_last, mi}\n buf.extend(others)\n if t == k:\n aaa[mi] += 1\n else:\n buf.append(mi)\n\n for i in range(n):\n if i + 1 != prev_last:\n aaa[i] -= 1\n if aaa[i] < 0:\n print(-1)\n return\n\n prev_last = mi\n\n print(len(buf))\n print(*buf)\n\n\nn, k = map(int, input().split())\naaa = list(map(int, input().split()))\nsolve(n, k, aaa)\n","fail":"def solve(n, k, aaa):\n buf = []\n prev_last = -1\n\n for t in range(k + 1):\n ma, mi = min((a, i + 1) for i, a in enumerate(aaa) if i + 1 != prev_last)\n others = set(range(1, n + 1)) - {prev_last, mi}\n buf.extend(others)\n buf.append(mi)\n # print(buf)\n\n for i in range(n):\n if i + 1 != prev_last:\n aaa[i] -= 1\n if aaa[i] < 0:\n print(-1)\n return\n\n prev_last = mi\n\n print(len(buf))\n print(*buf)\n\n\nn, k = map(int, input().split())\naaa = list(map(int, input().split()))\nsolve(n, k, aaa)\n","change":"replace","i1":8,"i2":12,"j1":8,"j2":10,"error":"IndexError: list index out of range","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03113\/Python\/s607630341.py\", line 29, in \n solve(n, k, aaa)\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03113\/Python\/s607630341.py\", line 10, in solve\n aaa[mi] += 1\nIndexError: list index out of range\n","stdout":null} {"problem_id":"p03125","language":"Python","original_status":"Runtime Error","pass":"a = int(input())\nb = int(input())\nr = a + b if b % a == 0 else b - a\nprint(r)\n","fail":"a, b = list(map(int, input().split()))\nr = a + b if b % a == 0 else b - a\nprint(r)\n","change":"replace","i1":0,"i2":2,"j1":0,"j2":1,"error":"ValueError: invalid literal for int() with base 10: '4 12'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03125\/Python\/s844412029.py\", line 1, in \n a = int(input())\nValueError: invalid literal for int() with base 10: '4 12'\n","stdout":null} {"problem_id":"p03125","language":"Python","original_status":"Runtime Error","pass":"a, b = [int(x) for x in input().split()]\nprint([a + b, b - a][int(b % a)])\n","fail":"a, b = [int(x) for x in input().split()]\nprint([a + b, b - a][int(bool(b % a))])\n","change":"replace","i1":1,"i2":2,"j1":1,"j2":2,"error":"0","stderr":null,"stdout":16.0} {"problem_id":"p03125","language":"Python","original_status":"Runtime Error","pass":"# -*- coding: utf-8 -*-\nimport sys\n\n\ndef func_a(argv):\n A = int(argv[0]) if int(argv[0]) >= 1 else 0\n B = int(argv[1]) if int(argv[1]) <= 20 else 0\n\n if A * B == 0:\n pass\n else:\n if B % A == 0:\n print(A + B)\n else:\n print(B - A)\n\n\nif __name__ == \"__main__\":\n func_a(sys.argv)\n","fail":"# -*- coding: utf-8 -*-\n\n\ndef func_a():\n argv = input().split(\" \")\n A = int(argv[0]) if int(argv[0]) >= 1 else 0\n B = int(argv[1]) if int(argv[1]) <= 20 else 0\n\n if A * B == 0:\n pass\n else:\n if B % A == 0:\n print(A + B)\n else:\n print(B - A)\n\n\nif __name__ == \"__main__\":\n func_a()\n","change":"replace","i1":1,"i2":19,"j1":1,"j2":19,"error":"ValueError: invalid literal for int() with base 10: '\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03125\/Python\/s435981808.py'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03125\/Python\/s435981808.py\", line 19, in \n func_a(sys.argv)\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03125\/Python\/s435981808.py\", line 6, in func_a\n A = int(argv[0]) if int(argv[0]) >= 1 else 0\nValueError: invalid literal for int() with base 10: '\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03125\/Python\/s435981808.py'\n","stdout":null} {"problem_id":"p03125","language":"Python","original_status":"Runtime Error","pass":"a, b = map(int, input())\nif b % a == 0:\n print(a + b)\nelse:\n print(b - a)\n","fail":"a, b = map(int, input().split())\nif b % a == 0:\n print(a + b)\nelse:\n print(b - a)\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"ValueError: invalid literal for int() with base 10: ' '","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03125\/Python\/s517301094.py\", line 1, in \n a, b = map(int, input())\nValueError: invalid literal for int() with base 10: ' '\n","stdout":null} {"problem_id":"p03125","language":"Python","original_status":"Runtime Error","pass":"A, B = list(map(int, input()))\n\nif B % A == 0:\n print(A + B)\nelse:\n print(B - A)\n","fail":"A, B = list(map(int, input().split()))\n\nif B % A == 0:\n print(A + B)\nelse:\n print(B - A)\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"ValueError: invalid literal for int() with base 10: ' '","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03125\/Python\/s504979530.py\", line 1, in \n A, B = list(map(int, input()))\nValueError: invalid literal for int() with base 10: ' '\n","stdout":null} {"problem_id":"p03126","language":"Python","original_status":"Runtime Error","pass":"N, M = map(int, input().split())\na_k = [list(map(int, input().split())) for i in range(N)]\na_k.sort()\n\na_non = []\nfor i in range(1, len(a_k)):\n if len(a_k[0]) <= 1:\n break\n\n for j in range(1, len(a_k[0])):\n if a_k[0][j] not in a_k[i][1:]:\n a_non.append(j)\n\nfor j in range(len(a_non)):\n a_k[0].pop(a_non[j])\n\n\nprint(len(a_k[0]) - 1)\n","fail":"N, M = map(int, input().split())\nk = [i[1:] for i in [list(map(int, input().split())) for i in range(N)]]\nk_1 = [flatten for inner in k for flatten in inner]\ncount_k = 0\nfor i in range(1, M + 1):\n if k_1.count(i) == N:\n count_k += 1\n\nprint(count_k)\n","change":"replace","i1":1,"i2":18,"j1":1,"j2":9,"error":0,"stderr":null,"stdout":1} {"problem_id":"p03126","language":"Python","original_status":"Runtime Error","pass":"n, m = map(int, input().split())\nans = [0] * m\n\nfor _ in range(n):\n a = list(map(int, input().split()))\n for i in a[1:]:\n ans[i] += 1\n\nprint(ans.count(n))\n","fail":"n, m = map(int, input().split())\nans = [0] * m\nfor _ in range(n):\n a = list(map(int, input().split()))\n\n for i in a[1:]:\n ans[i - 1] += 1\n\nprint(ans.count(n))\n","change":"replace","i1":2,"i2":7,"j1":2,"j2":7,"error":0,"stderr":null,"stdout":1} {"problem_id":"p03126","language":"Python","original_status":"Runtime Error","pass":"N, M = map(int, input().split())\nloved_by_everyone = [0] * M\nfor _ in range(N):\n like_list = list(map(int, input().split()))\n for like in like_list[1:]:\n loved_by_everyone[like] += 1\n\nkinds = 0\nfor food in loved_by_everyone:\n kinds += 1 if food == N else 0\nprint(kinds)\n","fail":"N, M = map(int, input().split())\nloved_by_everyone = [0] * M\nfor _ in range(N):\n like_list = list(map(int, input().split()))\n for like in like_list[1:]:\n loved_by_everyone[like - 1] += 1\n\nkinds = 0\nfor food in loved_by_everyone:\n kinds += 1 if food == N else 0\nprint(kinds)\n","change":"replace","i1":5,"i2":6,"j1":5,"j2":6,"error":0,"stderr":null,"stdout":1} {"problem_id":"p03126","language":"Python","original_status":"Runtime Error","pass":"N, M = map(int, input().split())\nfavorites = {*tuple(range(1, M + 1))}\nfor _ in range(N):\n K, *fav = map(int, input().split())\n favorites = favorites & set(fav)\nprint(len(favorites))\n","fail":"N, M = map(int, input().split())\nfavorites = set(i for i in range(1, M + 1))\nfor _ in range(N):\n K, *fav = map(int, input().split())\n favorites = favorites & set(fav)\nprint(len(favorites))\n","change":"replace","i1":1,"i2":2,"j1":1,"j2":2,"error":0,"stderr":null,"stdout":1} {"problem_id":"p03127","language":"Python","original_status":"Runtime Error","pass":"from math import gcd\n\nN = int(input())\nA = [int(x) for x in input().split()]\n\nans = A[0]\n\nfor i in range(1, N):\n ans = gcd(ans, A[i])\n\nprint(ans)\n","fail":"def gcd(a, b):\n if b == 0:\n return a\n return gcd(b, a % b)\n\n\nN = int(input())\nA = [int(x) for x in input().split()]\n\nans = A[0]\n\nfor i in range(1, N):\n ans = gcd(ans, A[i])\n\nprint(ans)\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":5,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p03127","language":"Python","original_status":"Runtime Error","pass":"import sys\n\nsys.setrecursionlimit(20000)\n\n\ndef inpl():\n return list(map(int, input().split()))\n\n\ndef gcd(a, b):\n la = max(a, b)\n sm = min(a, b)\n if la % sm == 0:\n return sm\n else:\n return gcd(sm, la - sm)\n\n\nn = int(input())\nA = inpl()\n\nans = gcd(A[0], A[1])\nfor a in A:\n ans = gcd(ans, a)\nprint(ans)\n","fail":"import sys\n\nsys.setrecursionlimit(20000)\n\n\ndef inpl():\n return list(map(int, input().split()))\n\n\ndef gcd(a, b):\n la = max(a, b)\n sm = min(a, b)\n if la % sm == 0:\n return sm\n else:\n return gcd(sm, la - sm)\n\n\nn = int(input())\nA = inpl()\nA.sort()\nans = gcd(A[0], A[1])\nfor a in A:\n ans = gcd(ans, a)\nprint(ans)\n","change":"replace","i1":20,"i2":21,"j1":20,"j2":21,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p03127","language":"Python","original_status":"Time Limit Exceeded","pass":"import fractions\n\nN = int(input())\nAi = list(map(int, input().split()))\nif Ai == [Ai[0]] * len(Ai):\n print(Ai[0])\n quit()\n\ni = 1\nmin = 1000000000\nfor a in Ai:\n for a2 in Ai[i:]:\n a_gcd = fractions.gcd(a, a2)\n if min > a_gcd:\n min = a_gcd\n if min <= 2:\n print(min)\n quit()\n i += 1\n\nprint(min)\n","fail":"import fractions\n\nN = int(input())\nAi = list(map(int, input().split()))\nif Ai == [Ai[0]] * len(Ai):\n print(Ai[0])\n quit()\n\n# Ai.sort()\n\ni = 1\nmin = 1000000000\na = Ai[0]\nfor a2 in Ai[1:]:\n a_gcd = fractions.gcd(a, a2)\n if min > a_gcd:\n min = a_gcd\n if min <= 2:\n print(min)\n quit()\n\nprint(min)\n","change":"replace","i1":8,"i2":19,"j1":8,"j2":20,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03127","language":"Python","original_status":"Runtime Error","pass":"from functools import reduce\nfrom functools import gcd\n\nN = int(input())\nA = [int(i) for i in input().split()]\n\nprint(reduce(gcd, A))\n","fail":"from functools import reduce\nfrom fractions import gcd\n\nN = int(input())\nA = [int(i) for i in input().split()]\n\nprint(reduce(gcd, A))\n","change":"replace","i1":1,"i2":2,"j1":1,"j2":2,"error":"ImportError: cannot import name 'gcd' from 'functools' (\/usr\/lib\/python3.10\/functools.py)","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03127\/Python\/s208362126.py\", line 2, in \n from functools import gcd\nImportError: cannot import name 'gcd' from 'functools' (\/usr\/lib\/python3.10\/functools.py)\n","stdout":null} {"problem_id":"p03127","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = list(map(int, input().split()))\n\nwhile True:\n if len(A) == 1:\n break\n max_i = A.index(max(A))\n min_i = A.index(min(A))\n life = A[max_i] % A[min_i]\n if life == 0:\n A.pop(max_i)\n else:\n A[max_i] = life\n\nprint(A[0])\n","fail":"N = int(input())\nA = list(map(int, input().split()))\n\nwhile True:\n if len(A) == 1:\n break\n pop_i = []\n A.sort()\n for i in range(1, len(A)):\n life = A[i] % A[0]\n if life == 1:\n print(life)\n exit()\n else:\n A[i] = life\n A = [n for n in A if n > 0]\n\nprint(A[0])\n","change":"replace","i1":6,"i2":13,"j1":6,"j2":16,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03127","language":"Python","original_status":"Runtime Error","pass":"import math\n\ninput()\na = sorted((map(int, input().split())))\nans = a[0]\nfor i in range(1, len(a)):\n ans = math.gcd(ans, a[i])\nprint(ans)\n","fail":"def gcd(b, a):\n while b:\n a, b = b, a % b\n return a\n\n\ninput()\na = sorted((map(int, input().split())))\nans = a[0]\nfor i in range(1, len(a)):\n ans = gcd(ans, a[i])\nprint(ans)\n","change":"replace","i1":0,"i2":7,"j1":0,"j2":11,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p03127","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = list(map(int, input().split()))\n\nwhile len(a) >= 2:\n min_a = min(a)\n\n # \u6700\u5c0f\u5024\u304c\uff12\u3064\u3042\u308b\u5834\u5408\u306b\u4e00\u56de\u306fskip\u3059\u308b\n flag = False\n for i in range(len(a)):\n if a[i] == min_a and not flag:\n flag = True\n continue\n if flag or a[i] != min_a:\n a[i] = a[i] % min_a\n while True:\n if a.count(0) > 0:\n a.remove(0)\n else:\n break\nprint(a[0])\n","fail":"def gcd(a, b):\n if a < b:\n a, b = b, a\n while a % b != 0:\n a, b = b, a % b\n return b\n\n\nn = int(input())\na = list(map(int, input().split()))\n\nans = a[0]\nfor i in range(1, len(a)):\n ans = gcd(ans, a[i])\nprint(ans)\n","change":"replace","i1":0,"i2":20,"j1":0,"j2":15,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03127","language":"Python","original_status":"Runtime Error","pass":"from math import gcd\n\nN = int(input())\nA = sorted([int(n) for n in input().split()], reverse=True)\n\nx = A[0]\nfor i in range(1, N):\n x = gcd(x, A[i])\nprint(x)\n","fail":"from fractions import gcd\n\nN = int(input())\nA = sorted([int(n) for n in input().split()], reverse=True)\n\nx = A[0]\nfor i in range(1, N):\n x = gcd(x, A[i])\nprint(x)\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p03127","language":"Python","original_status":"Runtime Error","pass":"n = int(input())\n\nzombies = [int(c) for c in input().split()]\n\n\ndef gcd(a, b):\n mod = a % b\n if mod == 0:\n return b\n else:\n return gcd(b, mod)\n\n\ndef saidai_koyakusu(n, ns):\n if len(ns) == 1:\n return ns[0]\n return gcd(n, saidai_koyakusu(ns[0], ns[1:]))\n\n\nif len(zombies) == 1:\n print(zombies[0])\nelse:\n print(saidai_koyakusu(zombies[0], zombies[1:]))\n","fail":"n = int(input())\n\nzombies = [int(c) for c in input().split()]\n\n\ndef gcd(a, b):\n c = a % b\n if c == 0:\n return b\n else:\n return gcd(b, c)\n\n\nm = zombies[0]\nfor i in range(1, len(zombies)):\n m = gcd(m, zombies[i])\n\nprint(m)\n","change":"replace","i1":6,"i2":23,"j1":6,"j2":18,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p03127","language":"Python","original_status":"Runtime Error","pass":"\"\"\" AtCoder \"\"\"\n\nimport math\n\nN = int(input())\nA = list(map(int, input().split()))\n\nans = A[0]\n\nfor i in range(1, N):\n ans = math.gcd(ans, A[i])\n\nprint(ans)\n","fail":"\"\"\" AtCoder \"\"\"\n\nfrom fractions import gcd\n\nN = int(input())\nA = list(map(int, input().split()))\n\nans = A[0]\n\nfor i in range(1, N):\n ans = gcd(ans, A[i])\n\nprint(ans)\n","change":"replace","i1":2,"i2":11,"j1":2,"j2":11,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p03127","language":"Python","original_status":"Runtime Error","pass":"import sys\n\nreadline = sys.stdin.buffer.readline\n\n\ndef sss(A, N):\n A.sort()\n if A[0] == 0:\n A.remove(0)\n for i in range(1, len(A)):\n A[i] = A[i] % A[0]\n if A[0] == sum(A):\n print(sum(A))\n else:\n return sss(A, N)\n\n\ndef main():\n N = int(readline())\n A = list(map(int, readline().split()))\n\n sss(A, N)\n\n\nmain()\n","fail":"import sys\n\nreadline = sys.stdin.buffer.readline\n\n\ndef sss(A, N):\n A.sort()\n while A[0] == 0:\n A.remove(0)\n for i in range(1, len(A)):\n A[i] = A[i] % A[0]\n if A[0] == sum(A):\n print(sum(A))\n else:\n return sss(A, N)\n\n\ndef main():\n N = int(readline())\n A = list(map(int, readline().split()))\n\n sss(A, N)\n\n\nmain()\n","change":"replace","i1":7,"i2":8,"j1":7,"j2":8,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p03127","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = sorted(list(map(int, input().split())))\nwhile True:\n a = sorted(list(set(a)))\n tmp = sorted(a[:20])\n for i in tmp:\n if i == a[0]:\n continue\n elif i % a[0] == 0:\n a.remove(i)\n else:\n a.append(i % a[0])\n a.remove(i)\n if len(a) == 1:\n break\nprint(a[0])\n","fail":"n = int(input())\na = sorted(list(map(int, input().split())))\nwhile True:\n a = sorted(list(set(a)))\n tmp = sorted(a[:])\n for i in tmp:\n if i == a[0]:\n continue\n elif i % a[0] == 0:\n a.remove(i)\n else:\n a.append(i % a[0])\n if i % a[0] == 1:\n print(1)\n exit()\n a.remove(i)\n if len(a) == 1:\n break\nprint(a[0])\n","change":"replace","i1":4,"i2":12,"j1":4,"j2":15,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03127","language":"Python","original_status":"Runtime Error","pass":"import math\n\nN = int(input())\nA = [int(i) for i in input().split()]\nans = A[N - 1]\nfor i in range(N - 1):\n ans = math.gcd(ans, A[i])\nprint(ans)\n","fail":"def gcd(x, y):\n if y > x:\n x, y = y, x\n while y != 0:\n x, y = y, x % y\n return x\n\n\nN = int(input())\nA = [int(i) for i in input().split()]\nans = A[N - 1]\nfor i in range(N - 1):\n ans = gcd(ans, A[i])\nprint(ans)\n","change":"replace","i1":0,"i2":7,"j1":0,"j2":13,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p03127","language":"Python","original_status":"Runtime Error","pass":"from functools import gcd\n\nn = int(input())\nA = list(map(int, input().split()))\n\na = A[0]\nfor i in range(1, n):\n a = gcd(a, A[i])\n\nprint(a)\n","fail":"from fractions import gcd\n\nn = int(input())\nA = [int(i) for i in input().split()]\n\na = A[0]\nfor i in range(1, n):\n a = gcd(a, A[i])\n\nprint(a)\n","change":"replace","i1":0,"i2":4,"j1":0,"j2":4,"error":"ImportError: cannot import name 'gcd' from 'functools' (\/usr\/lib\/python3.10\/functools.py)","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03127\/Python\/s946665504.py\", line 1, in \n from functools import gcd\nImportError: cannot import name 'gcd' from 'functools' (\/usr\/lib\/python3.10\/functools.py)\n","stdout":null} {"problem_id":"p03127","language":"Python","original_status":"Runtime Error","pass":"import math\n\nN = int(input())\nA = list(map(int, input().split()))\n\nans = A[0]\nfor i in range(1, N):\n ans = math.gcd(ans, A[i])\nprint(ans)\n","fail":"import fractions\n\nN = int(input())\nA = list(map(int, input().split()))\n\nans = A[0]\nfor i in range(1, N):\n ans = fractions.gcd(ans, A[i])\nprint(ans)\n","change":"replace","i1":0,"i2":8,"j1":0,"j2":8,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p03127","language":"Python","original_status":"Runtime Error","pass":"import math\nfrom functools import reduce\n\n\nN = int(input())\nA = [int(i) for i in input().split()]\nprint(reduce(math.gcd, A))\n","fail":"from fractions import gcd\nfrom functools import reduce\n\nN = int(input())\nA = [int(i) for i in input().split()]\nprint(reduce(gcd, A))\n","change":"replace","i1":0,"i2":7,"j1":0,"j2":6,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p03127","language":"Python","original_status":"Runtime Error","pass":"import math\nfrom functools import reduce\n\ninput()\nprint(reduce(math.gcd, map(int, input().split())))\n","fail":"from fractions import gcd\nfrom functools import reduce\n\ninput()\nprint(reduce(gcd, map(int, input().split())))\n","change":"replace","i1":0,"i2":5,"j1":0,"j2":5,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p03127","language":"Python","original_status":"Runtime Error","pass":"from math import gcd\n\nn = int(input())\na = list(map(int, input().split()))\n\nret = gcd(a[0], a[1])\nfor e in a[2:]:\n ret = gcd(ret, e)\n\nprint(ret)\n","fail":"n = int(input())\na = list(map(int, input().split()))\n\n\ndef gcd(x, y):\n while y != 0:\n x, y = y, x % y\n\n return x\n\n\nret = gcd(a[0], a[1])\n\nfor e in a[2:]:\n ret = gcd(ret, e)\n\nprint(ret)\n","change":"replace","i1":0,"i2":6,"j1":0,"j2":13,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p03127","language":"Python","original_status":"Runtime Error","pass":"import fraction\nfrom functools import reduce\n\nN = int(input())\nAs = map(int, input().split())\n\nprint(reduce(fraction.gcd, As))\n","fail":"import fractions\nfrom functools import reduce\n\nN = int(input())\nAs = map(int, input().split())\n\nprint(reduce(fractions.gcd, As))\n","change":"replace","i1":0,"i2":7,"j1":0,"j2":7,"error":"ModuleNotFoundError: No module named 'fraction'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03127\/Python\/s866739157.py\", line 1, in \n import fraction\nModuleNotFoundError: No module named 'fraction'\n","stdout":null} {"problem_id":"p03127","language":"Python","original_status":"Runtime Error","pass":"from fractions import gcd\n\nn = int(input())\na = list(map(int, input().split()))\n\nprint(gcd(a))\n","fail":"from fractions import gcd\nfrom functools import reduce\n\nn = int(input())\na = list(map(int, input().split()))\n\nprint(reduce(gcd, a))\n","change":"replace","i1":1,"i2":6,"j1":1,"j2":7,"error":"ImportError: cannot import name 'gcd' from 'fractions' (\/usr\/lib\/python3.10\/fractions.py)","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03127\/Python\/s745389063.py\", line 1, in \n from fractions import gcd\nImportError: cannot import name 'gcd' from 'fractions' (\/usr\/lib\/python3.10\/fractions.py)\n","stdout":null} {"problem_id":"p03127","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\nlst = [int(i) for i in input().split()]\n\nif all([i % min(lst) == 0 for i in lst]):\n print(min(lst))\n exit()\n\ngcm = 1\nj = 2\nlmt = int(min(lst) ** 0.5) + 1\nwhile j <= lmt:\n if all([i % j == 0 for i in lst]):\n lst = [i \/ j for i in lst]\n gcm *= j\n else:\n j += 1\n\nprint(gcm)\n","fail":"from functools import reduce\n\nn = int(input())\nlst = [int(i) for i in input().split()]\n\n\ndef gcd(x, y):\n while y != 0:\n x, y = y, x % y\n return x\n\n\nprint(reduce(gcd, lst))\n","change":"replace","i1":0,"i2":18,"j1":0,"j2":13,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03127","language":"Python","original_status":"Time Limit Exceeded","pass":"# -*- coding: utf-8 -*-\nN = map(int, input())\nA = list(map(int, input().split()))\n\nwhile len(A) >= 2:\n x = A.pop(A.index(max(A)))\n y = min(A)\n n = x % y\n if n == 0:\n pass\n else:\n A.append(n)\n\nprint(A[0])\n","fail":"# -*- coding: utf-8 -*-\nN = map(int, input())\nA = list(map(int, input().split()))\n\nwhile len(A) >= 2:\n idx = A.index(min(A))\n x = A.pop(idx)\n B = list()\n for i in range(len(A)):\n if A[i] % x != 0:\n B.append(A[i] % x)\n B.append(x)\n A = B[:]\n\nprint(A[0])\n","change":"replace","i1":5,"i2":12,"j1":5,"j2":13,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03127","language":"Python","original_status":"Runtime Error","pass":"import functools\nimport math\n\nn = int(input())\na = list(map(int, input().split()))\n\ngcd = functools.reduce(math.gcd, a)\nprint(gcd)\n","fail":"n = int(input())\nx = list(map(int, input().split()))\n\n\ndef gcd(a, b):\n if b == 0:\n return a\n return gcd(b, a % b)\n\n\nif n == 1:\n print(x[0])\nelse:\n element = gcd(x[0], x[1])\n if n == 2:\n print(element)\n else:\n for i in range(2, n):\n element = gcd(element, x[i])\n print(element)\n","change":"replace","i1":0,"i2":8,"j1":0,"j2":20,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p03127","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = list(map(int, input().split()))\n\n\ndef bubble_sort(lst):\n for i in reversed(range(len(lst))):\n for j in range(i):\n if lst[j] > lst[j + 1]:\n lst[j], lst[j + 1] = lst[j + 1], lst[j]\n\n\nbubble_sort(a)\nzero_monster_indexes = []\n\nwhile True:\n for monster_i in range(1, len(a)):\n if a[monster_i] == 0:\n zero_monster_indexes.append(monster_i)\n else:\n a[monster_i] %= a[0]\n\n if a[monster_i] == 0:\n zero_monster_indexes.append(monster_i)\n\n for zero_monster_index in reversed(zero_monster_indexes):\n a.pop(zero_monster_index)\n zero_monster_indexes.clear()\n\n bubble_sort(a)\n\n if len(a) == 1:\n break\n\nprint(a[0])\n","fail":"n = int(input())\na = list(map(int, input().split()))\n\na = sorted(a)\nzero_monster_indexes = []\n\nwhile True:\n for monster_i in range(1, len(a)):\n if a[monster_i] == 0:\n zero_monster_indexes.append(monster_i)\n else:\n a[monster_i] %= a[0]\n\n if a[monster_i] == 0:\n zero_monster_indexes.append(monster_i)\n\n for zero_monster_index in reversed(zero_monster_indexes):\n a.pop(zero_monster_index)\n zero_monster_indexes.clear()\n\n a = sorted(a)\n if len(a) == 1:\n break\n\nprint(a[0])\n","change":"replace","i1":3,"i2":30,"j1":3,"j2":21,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03128","language":"Python","original_status":"Time Limit Exceeded","pass":"N, M = map(int, input().split())\nA = set(list(map(int, input().split())))\n\nMAX_N = int(1e4)\ndp = [[-1 for i in range(10)] for i in range(MAX_N + 10)]\nfor j in range(1, 9 + 1):\n dp[0][j] = 0\n\nmc = [2, 5, 5, 4, 5, 6, 3, 7, 6]\n\nfor i in range(N + 1):\n for j in range(1, 9 + 1):\n if j not in A:\n continue\n\n if i < mc[j - 1]:\n continue\n\n for k in range(1, j + 1):\n tmp = dp[i - mc[j - 1]][k]\n if tmp == -1:\n continue\n if tmp == 0:\n tmp = \"\"\n tmp = str(tmp)\n dp[i][j] = max(dp[i][j], int(tmp + str(j)), int(str(j) + tmp))\n\n\nans = 0\nfor j in range(1, 9 + 1):\n ans = max(ans, dp[N][j])\nprint(ans)\n","fail":"import math\n\n\nN, M = map(int, input().split())\nA = list(map(int, input().split()))\n\nMAX_N = int(1e4)\ndp = [-1 for i in range(MAX_N + 20)]\ndp[0] = 0\n\nmc = [2, 5, 5, 4, 5, 6, 3, 7, 6]\n\nfor i in range(N + 1):\n for j in A:\n tmp = dp[i]\n if tmp == -1:\n continue\n if tmp == 0:\n dp[i + mc[j - 1]] = max(dp[i + mc[j - 1]], j)\n else:\n dp[i + mc[j - 1]] = max(dp[i + mc[j - 1]], tmp * 10 + j)\n\nans = dp[N]\nprint(ans)\n","change":"replace","i1":0,"i2":31,"j1":0,"j2":23,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03128","language":"Python","original_status":"Runtime Error","pass":"n, m = map(int, input().split())\na = list(map(int, input().split()))\n\ndp = dict.fromkeys(range(n + 1)) # dp[n]: n\u672c\u4f7f\u3046\u3068\u304d\u306e\u6841\u6570\ndp[0] = 0\n\nnum = {1: 2, 2: 5, 3: 5, 4: 4, 5: 5, 6: 6, 7: 3, 8: 7, 9: 6}\nanum = sorted(\n dict(filter(lambda e: e[0] in a, num.items())).items(), reverse=True\n) # \u5f8c\u306e\u8a08\u7b97\u7528\u306bsort\u3057\u3066\u304a\u304f\n\nfor i in range(n):\n dp[i + 1] = dp[i]\n for e in anum:\n if i + 1 - e[1] >= 0:\n dp[i + 1] = max(dp[i + 1], dp[i + 1 - e[1]] + 1)\n\nans = \"\"\nwhile dp[n] > 1:\n for e in anum: # anum \u306f\u964d\u9806sort\u3055\u308c\u3066\u3044\u308b\u306e\u3067, \u5927\u304d\u3044\u9806\u306b\u78ba\u8a8d\n if n - e[1] >= 0:\n if dp[n - e[1]] == dp[n] - 1:\n ans += str(e[0])\n n -= e[1]\n break\n\n# \u672b\u5c3e\u6841\u306f n =0(\u3061\u3087\u3046\u3069\u4f7f\u3044\u5207\u308b\u3088\u3046\u306b\u6c7a\u5b9a)\nans += str(list(filter(lambda e: e[1] == n, anum))[0][0])\n\nprint(ans)\n","fail":"n, m = map(int, input().split())\na = list(map(int, input().split()))\n\ndp = dict.fromkeys(range(n + 1)) # dp[n]: n\u672c\u4f7f\u3046\u3068\u304d\u306e\u6841\u6570\ndp[0] = 0\n\nnum = {1: 2, 2: 5, 3: 5, 4: 4, 5: 5, 6: 6, 7: 3, 8: 7, 9: 6}\nanum = sorted(\n dict(filter(lambda e: e[0] in a, num.items())).items(), reverse=True\n) # \u5f8c\u306e\u8a08\u7b97\u7528\u306bsort\u3057\u3066\u304a\u304f\n\nfor i in range(n):\n dp[i + 1] = -float(\"inf\")\n for e in anum:\n if i + 1 - e[1] >= 0:\n dp[i + 1] = max(dp[i + 1], dp[i + 1 - e[1]] + 1)\n\nans = \"\"\nwhile dp[n] > 1:\n for e in anum: # anum \u306f\u964d\u9806sort\u3055\u308c\u3066\u3044\u308b\u306e\u3067, \u5927\u304d\u3044\u9806\u306b\u78ba\u8a8d\n if n - e[1] >= 0:\n if dp[n - e[1]] == dp[n] - 1:\n ans += str(e[0])\n n -= e[1]\n break\n\n# \u672b\u5c3e\u6841\u306f n =0(\u3061\u3087\u3046\u3069\u4f7f\u3044\u5207\u308b\u3088\u3046\u306b\u6c7a\u5b9a)\nans += str(list(filter(lambda e: e[1] == n, anum))[0][0])\n\nprint(ans)\n","change":"replace","i1":12,"i2":13,"j1":12,"j2":13,"error":"0","stderr":null,"stdout":777773.0} {"problem_id":"p03135","language":"Python","original_status":"Runtime Error","pass":"num = int(input().split())\nans = num[0] \/ num[1]\nprint(ans)\n","fail":"num = list(map(int, input().split()))\nans = num[0] \/ num[1]\nprint(ans)\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"TypeError: int() argument must be a string, a bytes-like object or a real number, not 'list'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03135\/Python\/s676135149.py\", line 1, in \n num = int(input().split())\nTypeError: int() argument must be a string, a bytes-like object or a real number, not 'list'\n","stdout":null} {"problem_id":"p03136","language":"Python","original_status":"Runtime Error","pass":"N = int(input())\nlist_L = map(int, input().split())\n\nmax_ = list_L.pop(list_L.index(max(list_L)))\n\nif max_ > sum(list_L):\n print(\"Yes\")\nelse:\n print(\"No\")\n","fail":"N = int(input())\nlist_L = list(map(int, input().split()))\n\nmax_ = list_L.pop(list_L.index(max(list_L)))\n\nif max_ >= sum(list_L):\n print(\"No\")\nelse:\n print(\"Yes\")\n","change":"replace","i1":1,"i2":9,"j1":1,"j2":9,"error":"AttributeError: 'map' object has no attribute 'pop'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03136\/Python\/s177830460.py\", line 4, in \n max_ = list_L.pop(list_L.index(max(list_L)))\nAttributeError: 'map' object has no attribute 'pop'\n","stdout":null} {"problem_id":"p03136","language":"Python","original_status":"Runtime Error","pass":"N = input()\nL = map(int, input().split())\nx = sorted(L)\nLmax = max(L)\ny = x[0:-1]\nysum = sum(y)\nprint(\"Yes\" if Lmax < ysum else \"No\")\n","fail":"N = int(input())\nL = list(map(int, input().split()))\nx = sorted(L)\nLmax = max(L)\ny = x[0:-1]\nysum = sum(y)\nprint(\"Yes\" if Lmax < ysum else \"No\")\n","change":"replace","i1":0,"i2":2,"j1":0,"j2":2,"error":"ValueError: max() arg is an empty sequence","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03136\/Python\/s642487988.py\", line 4, in \n Lmax = max(L)\nValueError: max() arg is an empty sequence\n","stdout":null} {"problem_id":"p03137","language":"Python","original_status":"Runtime Error","pass":"import sys\n\nn, m = map(int, input().split())\nx = list(map(int, input().split()))\nif m == 1:\n print(0)\n sys.exit()\nif n == 1:\n print(max(x) - min(x))\n sys.exit()\nx.sort()\na = []\nfor i in range(m - 1):\n a.append(abs(x[i] - x[i + 1]))\nans = sum(a)\na.sort(reverse=True)\nfor i in range(n - 1):\n ans -= a[i]\nprint(max(0, ans))\n","fail":"import sys\n\nn, m = map(int, input().split())\nx = list(map(int, input().split()))\nif m == 1:\n print(0)\n sys.exit()\nif n == 1:\n print(max(x) - min(x))\n sys.exit()\nif n >= m:\n print(0)\n sys.exit()\nx.sort()\na = []\nfor i in range(m - 1):\n a.append(abs(x[i] - x[i + 1]))\nans = sum(a)\na.sort(reverse=True)\nfor i in range(n - 1):\n ans -= a[i]\nprint(max(0, ans))\n","change":"insert","i1":10,"i2":10,"j1":10,"j2":13,"error":"0","stderr":null,"stdout":5.0} {"problem_id":"p03137","language":"Python","original_status":"Runtime Error","pass":"N, M = list(map(int, input().split()))\nX = list(map(int, input().split()))\n\nif N == 1:\n ans = max(X) - min(X)\n print(ans)\n exit()\n\nif M == 1:\n ans = 0\n print(ans)\n exit()\n\nXs = sorted(X)\n\ndiff = []\nfor i in range(M - 1):\n tmp = Xs[i + 1] - Xs[i]\n diff.append(tmp)\n\nrest = N - 2\nfor _ in range(rest):\n if diff[0] > diff[len(diff) - 1]:\n diff.pop(0)\n else:\n diff.pop()\n\nans = 0\n\nfor _ in range(len(diff) - 1):\n if diff[0] > diff[len(diff) - 1]:\n ans += diff[len(diff) - 1]\n diff.pop()\n else:\n ans += diff[0]\n diff.pop(0)\n\nprint(ans)\n","fail":"N, M = list(map(int, input().split()))\nX = list(map(int, input().split()))\n\nif N == 1:\n ans = max(X) - min(X)\n print(ans)\n exit()\n\nif (M == 1) or (N >= M):\n ans = 0\n print(ans)\n exit()\n\nXs = sorted(X)\n\ndiff = []\nfor i in range(M - 1):\n tmp = Xs[i + 1] - Xs[i]\n diff.append(tmp)\n\ndiffs = sorted(diff)\nprint(sum(diffs[: (M - 1) - (N - 1)]))\n","change":"replace","i1":8,"i2":38,"j1":8,"j2":22,"error":"0","stderr":null,"stdout":5.0} {"problem_id":"p03137","language":"Python","original_status":"Runtime Error","pass":"def main():\n N, M = map(int, input().split())\n X = list(map(int, input().split()))\n X_sort = sorted(X)\n diff = []\n for i in range(M - 1):\n diff.append(X_sort[i + 1] - X_sort[i])\n diff_sort = sorted(diff)\n if M == 1:\n print(\"0\")\n return\n for _ in range(N - 1):\n diff_sort.pop()\n ans = 0\n for d in diff_sort:\n ans += d\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"def main():\n N, M = map(int, input().split())\n X = list(map(int, input().split()))\n if N >= M:\n print(\"0\")\n return\n X_sort = sorted(X)\n diff = []\n for i in range(M - 1):\n diff.append(X_sort[i + 1] - X_sort[i])\n diff_sort = sorted(diff)\n if N != 1:\n for _ in range(N - 1):\n diff_sort.pop()\n ans = 0\n for d in diff_sort:\n ans += d\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":3,"i2":13,"j1":3,"j2":14,"error":"0","stderr":null,"stdout":5.0} {"problem_id":"p03137","language":"Python","original_status":"Time Limit Exceeded","pass":"N, M = map(int, input().split())\nX = list(map(int, input().split()))\n\nX.sort()\nif N >= M:\n ans = 0\nelse:\n x_diff = [X[i + 1] - X[i] for i in range(len(X) - 1)]\n for _ in range(N - 1):\n x_diff.remove(max(x_diff))\n ans = sum(x_diff)\n\nprint(ans)\n","fail":"N, M = map(int, input().split())\nX = list(map(int, input().split()))\n\nX.sort()\nif N >= M:\n ans = 0\nelse:\n x_diff = [\n xn - x for xn, x in zip(X[1:], X[:-1])\n ] # [X[i + 1] - X[i] for i in range(len(X) - 1)]\n # for _ in range(N - 1):\n # x_diff.remove(max(x_diff))\n x_diff.sort(reverse=True)\n ans = sum(x_diff[N - 1 :])\n\nprint(ans)\n","change":"replace","i1":7,"i2":11,"j1":7,"j2":14,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03137","language":"Python","original_status":"Runtime Error","pass":"N, M = map(int, input().split())\nx = list(map(int, input().split()))\n\nx.sort()\ns = [0] * (M - 1)\nfor i in range(M - 1):\n s[i] = x[i + 1] - x[i]\n\ns.sort(reverse=True)\n\nres = sum(s)\nif M == 1:\n print(0)\n quit()\nelse:\n for i in range(N - 1):\n res -= s[i]\n\nprint(res)\n","fail":"N, M = map(int, input().split())\nx = list(map(int, input().split()))\nif N >= M:\n print(0)\n quit()\n\n\nx.sort()\ns = [0] * (M - 1)\nfor i in range(M - 1):\n s[i] = x[i + 1] - x[i]\n\ns.sort(reverse=True)\n\nres = sum(s)\nif M == 1:\n print(0)\n quit()\nelse:\n for i in range(N - 1):\n res -= s[i]\n\nprint(res)\n","change":"insert","i1":2,"i2":2,"j1":2,"j2":6,"error":"0","stderr":null,"stdout":5.0} {"problem_id":"p03137","language":"Python","original_status":"Runtime Error","pass":"def main():\n N, M = map(int, input().split())\n X = sorted(list(map(int, input().split())))\n\n if M == 1:\n print(0)\n elif N == 1:\n print(max(X) - min(X))\n else:\n dx = [abs(X[m] - X[m + 1]) for m in range(M - 1)]\n for _ in range(N - 1):\n dx.pop(dx.index(max(dx)))\n print(sum(dx))\n\n\nmain()\n","fail":"def main():\n N, M = map(int, input().split())\n X = sorted(list(map(int, input().split())))\n\n if M == 1:\n print(0)\n elif N == 1:\n print(max(X) - min(X))\n else:\n if N > M:\n N = M\n dx = sorted([abs(X[m] - X[m + 1]) for m in range(M - 1)])\n print(sum(dx[: M - N]))\n\n\nmain()\n","change":"replace","i1":9,"i2":13,"j1":9,"j2":13,"error":"0","stderr":null,"stdout":5.0} {"problem_id":"p03141","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na, b = [], []\nfor _ in range(n):\n x, y = map(int, input().split())\n a.append(x)\n b.append(y)\n\n\nwho = True\ndishes = list(range(n))\ntakahashi = aoki = 0\nwhile dishes:\n if who:\n dishes.sort(key=lambda dish: (b[dish], a[dish]))\n takahashi += a[dishes.pop()]\n else:\n dishes.sort(key=lambda dish: (a[dish], b[dish]))\n aoki += b[dishes.pop()]\n who = not who\n\nprint(takahashi - aoki)\n","fail":"n = int(input())\ndishes = []\nfor _ in range(n):\n a, b = map(int, input().split())\n dishes.append((a, b, a + b))\ndishes.sort(key=lambda dish: dish[2], reverse=True)\n\nx = y = 0\nfor i in range(n):\n a, b, _ = dishes[i]\n if i % 2 == 0:\n x += a\n else:\n y += b\n\nprint(x - y)\n","change":"replace","i1":1,"i2":21,"j1":1,"j2":16,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03141","language":"Python","original_status":"Time Limit Exceeded","pass":"# Different Strokes\nn = int(input())\na, b = list(), list()\nfor _ in range(n):\n a_, b_ = map(int, input().split())\n a.append(a_)\n b.append(b_)\na_sort = sorted(a)\nb_sort = sorted(b)\nans = 0\nwhile True:\n const = b_sort.pop()\n indexes = list()\n for i in range(len(b)):\n if b[i] == const:\n indexes.append(i)\n m = 0\n ind = 0\n for i in indexes:\n if a[i] >= m:\n ind = i\n m = a[i]\n ans += m\n a_sort.remove(m)\n del a[ind]\n del b[ind]\n if not a:\n exit(print(ans))\n\n const = a_sort.pop()\n indexes = list()\n for i in range(len(a)):\n if a[i] == const:\n indexes.append(i)\n m = 0\n ind = 0\n for i in indexes:\n if b[i] >= m:\n ind = i\n m = b[i]\n ans -= m\n b_sort.remove(m)\n del a[ind]\n del b[ind]\n if not a:\n exit(print(ans))\n","fail":"# Different Strokes\nn = int(input())\na, b = list(), list()\nab = list()\nfor i in range(n):\n a_, b_ = map(int, input().split())\n a.append(a_)\n b.append(b_)\n ab.append((a_, b_))\nans = 0\nab.sort(key=(lambda x: sum(x)), reverse=True)\nfor i, ab_ in enumerate(ab):\n if i % 2 == 0:\n ans += ab_[0]\n else:\n ans -= ab_[1]\nprint(ans)\n","change":"replace","i1":3,"i2":46,"j1":3,"j2":17,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03141","language":"Python","original_status":"Time Limit Exceeded","pass":"def main():\n n = int(input())\n A = []\n B = []\n C = []\n for _ in range(n):\n a, b = map(int, input().split())\n A.append(a)\n B.append(b)\n C.append(a + b)\n ans = 0\n isA = True\n while C:\n index = C.index(max(C))\n C.pop(index)\n if isA:\n ans += A[index]\n else:\n ans -= B[index]\n isA = not isA\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"def main():\n n = int(input())\n A = []\n B = []\n C = {}\n for i in range(n):\n a, b = map(int, input().split())\n A.append(a)\n B.append(b)\n C[str(i)] = a + b\n ans = 0\n isA = True\n for k, v in sorted(C.items(), key=lambda x: -x[1]):\n if isA:\n ans += A[int(k)]\n else:\n ans -= B[int(k)]\n isA = not isA\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":4,"i2":19,"j1":4,"j2":17,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03141","language":"Python","original_status":"Time Limit Exceeded","pass":"def main():\n N = int(input())\n a = []\n b = []\n for _ in range(N):\n ai, bi = map(int, input().split())\n a.append(ai)\n b.append(bi)\n ans = 0\n s = 1\n while True:\n if sum(a) == 0:\n print(ans)\n exit()\n ma = a.pop()\n ans += ma * s\n b.pop()\n t = a\n a = b\n b = t\n s *= -1\n\n\nmain()\n","fail":"def main():\n N = int(input())\n ab = [[int(i) for i in input().split()] for _ in range(N)]\n ab = sorted(ab, key=lambda x: x[0] + x[1], reverse=True)\n ans = 0\n for i in range(N):\n if i % 2 == 0:\n ans += ab[i][0]\n else:\n ans -= ab[i][1]\n print(ans)\n\n\nmain()\n","change":"replace","i1":2,"i2":21,"j1":2,"j2":11,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03142","language":"Python","original_status":"Runtime Error","pass":"#!\/usr\/bin\/env python3\nN, M = map(int, input().split())\ng = [[] for _ in range(N)]\nrg = [[] for _ in range(N)]\nfor _ in range(N - 1 + M):\n A, B = (int(x) - 1 for x in input().split())\n g[A].append(B)\n rg[B].append(A)\n\n\ndef dfs(s):\n global ts\n global used\n used[s] = True\n for t in g[s]:\n if not used[t]:\n dfs(t)\n ts.append(s)\n\n\ndef tsort():\n global ts\n for i in range(N):\n dfs(i)\n ts = ts[::-1]\n\n\nused = [False] * N\nts = []\ntsort()\n\nmp = [None] * N\nfor i, x in enumerate(ts):\n mp[x] = i\n\nans = [0] * N\nfor t in ts[1:]:\n if rg[t]:\n ans[t] = ts[max(mp[s] for s in rg[t])] + 1\n\nfor x in ans:\n print(x)\n","fail":"#!\/usr\/bin\/env python3\nimport sys\n\nsys.setrecursionlimit(100000)\nN, M = map(int, input().split())\ng = [[] for _ in range(N)]\nrg = [[] for _ in range(N)]\nfor _ in range(N - 1 + M):\n A, B = (int(x) - 1 for x in input().split())\n g[A].append(B)\n rg[B].append(A)\n\n\ndef dfs(s):\n global ts\n global used\n used[s] = True\n for t in g[s]:\n if not used[t]:\n dfs(t)\n ts.append(s)\n\n\ndef tsort():\n global ts\n for i in range(N):\n dfs(i)\n ts = ts[::-1]\n\n\nused = [False] * N\nts = []\ntsort()\n\nmp = [None] * N\nfor i, x in enumerate(ts):\n mp[x] = i\n\nans = [0] * N\nfor t in ts[1:]:\n if rg[t]:\n ans[t] = ts[max(mp[s] for s in rg[t])] + 1\n\nfor x in ans:\n print(x)\n","change":"insert","i1":1,"i2":1,"j1":1,"j2":4,"error":"0","stderr":null,"stdout":"0\n1\n2\n"} {"problem_id":"p03142","language":"Python","original_status":"Time Limit Exceeded","pass":"n, m = map(int, input().split())\ng = [[] for _ in range(n)]\ninv = [0] * n\nfor _ in range(n - 1 + m):\n a, b = map(int, input().split())\n g[a - 1].append(b - 1)\n inv[b - 1] += 1\nfor i in range(n):\n if inv[i] == 0:\n root = i\n break\nd = [0] * n\ns = [root]\nwhile s:\n p = s.pop()\n for node in g[p]:\n d[node] = max(d[node], d[p] + 1)\n s.append(node)\nans = [0] * n\nfor i in range(n):\n for node in g[i]:\n if d[node] == d[i] + 1:\n ans[node] = i + 1\nfor x in ans:\n print(x)\n","fail":"n, m = map(int, input().split())\ng = [[] for _ in range(n)]\ninv = [0] * n\nfor _ in range(n - 1 + m):\n a, b = map(int, input().split())\n g[a - 1].append(b - 1)\n inv[b - 1] += 1\nfor i in range(n):\n if inv[i] == 0:\n root = i\n break\nd = [0] * n\ns = [root]\nwhile s:\n p = s.pop()\n for node in g[p]:\n inv[node] -= 1\n if inv[node] == 0:\n d[node] = max(d[node], d[p] + 1)\n s.append(node)\nans = [0] * n\nfor i in range(n):\n for node in g[i]:\n if d[node] == d[i] + 1:\n ans[node] = i + 1\nfor x in ans:\n print(x)\n","change":"replace","i1":16,"i2":18,"j1":16,"j2":20,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03145","language":"Python","original_status":"Runtime Error","pass":"h, w, _ = [int(i) for i in input()]\nans = h * w \/\/ 2\nprint(ans)\n","fail":"h, w, _ = [int(i) for i in input().split()]\nans = h * w \/\/ 2\nprint(ans)\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"ValueError: invalid literal for int() with base 10: ' '","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03145\/Python\/s129162499.py\", line 1, in \n h, w, _ = [int(i) for i in input()]\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03145\/Python\/s129162499.py\", line 1, in \n h, w, _ = [int(i) for i in input()]\nValueError: invalid literal for int() with base 10: ' '\n","stdout":null} {"problem_id":"p03145","language":"Python","original_status":"Runtime Error","pass":"def main() -> None:\n ab, bc, ca = map(int, input())\n print(ab * bc \/\/ 2)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"def main() -> None:\n ab, bc, ca = map(int, input().split())\n print(ab * bc \/\/ 2)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":1,"i2":2,"j1":1,"j2":2,"error":"ValueError: invalid literal for int() with base 10: ' '","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03145\/Python\/s388138041.py\", line 7, in \n main()\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03145\/Python\/s388138041.py\", line 2, in main\n ab, bc, ca = map(int, input())\nValueError: invalid literal for int() with base 10: ' '\n","stdout":null} {"problem_id":"p03145","language":"Python","original_status":"Runtime Error","pass":"LL = list(map(int, input().split())).sort()\nR = LL[0] * LL[1] \/\/ 2\nprint(R)\n","fail":"LL = list(map(int, input().split()))\nLL.sort()\nR = LL[0] * LL[1] \/\/ 2\nprint(R)\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":2,"error":"TypeError: 'NoneType' object is not subscriptable","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03145\/Python\/s826877996.py\", line 2, in \n R = LL[0] * LL[1] \/\/ 2\nTypeError: 'NoneType' object is not subscriptable\n","stdout":null} {"problem_id":"p03145","language":"Python","original_status":"Runtime Error","pass":"s = int(input())\nan = []\nan.append(s)\nn = s\nwhile an.count(4) != 2:\n if n % 2 == 0:\n n \/= 2\n an.append(int(n))\n else:\n n = 3 * n + 1\n an.append(int(n))\nif an.index(1 or 2) == 0:\n print(4)\nelse:\n print(an.index(4) + 4)\n","fail":"x, y, z = map(int, input().split())\nprint(int(x * y \/ 2))\n","change":"replace","i1":0,"i2":15,"j1":0,"j2":2,"error":"ValueError: invalid literal for int() with base 10: '3 4 5'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03145\/Python\/s174683495.py\", line 1, in \n s = int(input())\nValueError: invalid literal for int() with base 10: '3 4 5'\n","stdout":null} {"problem_id":"p03145","language":"Python","original_status":"Runtime Error","pass":"a, b, c = map(int, input())\n\nprint(a * b \/ 2)\n","fail":"a, b, c = map(int, input().split())\n\nprint(int(a * b \/ 2))\n","change":"replace","i1":0,"i2":3,"j1":0,"j2":3,"error":"ValueError: invalid literal for int() with base 10: ' '","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03145\/Python\/s543024524.py\", line 1, in \n a, b, c = map(int, input())\nValueError: invalid literal for int() with base 10: ' '\n","stdout":null} {"problem_id":"p03145","language":"Python","original_status":"Runtime Error","pass":"from typing import List\n\n\ndef main() -> None:\n ab, bc, _ = get_params()\n print(area(ab, bc))\n\n\ndef get_params() -> List[int]:\n return [int(s) for s in input().split()]\n\n\ndef area(ab: int, bc: int) -> int:\n return ab * bc \/\/ 2\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"def main():\n ab, bc, _ = get_params()\n print(area(ab, bc))\n\n\ndef get_params():\n return [int(s) for s in input().split()]\n\n\ndef area(ab, bc):\n return ab * bc \/\/ 2\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":0,"i2":13,"j1":0,"j2":10,"error":"0","stderr":null,"stdout":6.0} {"problem_id":"p03145","language":"Python","original_status":"Runtime Error","pass":"AB, BC, CA = int(input())\n\nprint((AB * BC) \/\/ 2)\n","fail":"AB, BC, CA = map(int, input().split())\n\nprint((AB * BC) \/\/ 2)\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"ValueError: invalid literal for int() with base 10: '3 4 5'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03145\/Python\/s114139853.py\", line 1, in \n AB, BC, CA = int(input())\nValueError: invalid literal for int() with base 10: '3 4 5'\n","stdout":null} {"problem_id":"p03146","language":"Python","original_status":"Runtime Error","pass":"s = int(input())\nan = []\nan.append(s)\nn = s\nif an.index(1 or 2) == 0:\n print(4)\nwhile an.count(4) != 2:\n if n % 2 == 0:\n n \/= 2\n an.append(int(n))\n else:\n n = 3 * n + 1\n an.append(int(n))\nprint(an.index(4) + 4)\n","fail":"s = int(input())\nan = []\nan.append(s)\nn = s\nwhile an.count(4) != 2:\n if n % 2 == 0:\n n \/= 2\n an.append(int(n))\n else:\n n = 3 * n + 1\n an.append(int(n))\nif an.index(1) == 0:\n print(4)\nelif an.index(2) == 0:\n print(4)\nelse:\n print(an.index(4) + 4)\n","change":"replace","i1":4,"i2":14,"j1":4,"j2":17,"error":"ValueError: 1 is not in list","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03146\/Python\/s842061170.py\", line 5, in \n if an.index(1 or 2) == 0:\nValueError: 1 is not in list\n","stdout":null} {"problem_id":"p03146","language":"Python","original_status":"Runtime Error","pass":"s = int(input())\na = [s]\nz = set(s)\nidx = 1\nfor i in range(10**8):\n idx += 1\n if a[i] % 2 == 0:\n ai = a[i] \/\/ 2\n else:\n ai = 3 * a[i] + 1\n if ai in z:\n print(idx)\n exit()\n a.append(ai)\n z.add(ai)\n","fail":"s = int(input())\na = [s]\nz = set([s])\nidx = 1\nfor i in range(10**8):\n idx += 1\n if a[i] % 2 == 0:\n ai = a[i] \/\/ 2\n else:\n ai = 3 * a[i] + 1\n if ai in z:\n print(idx)\n exit()\n a.append(ai)\n z.add(ai)\n","change":"replace","i1":2,"i2":3,"j1":2,"j2":3,"error":"TypeError: 'int' object is not iterable","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03146\/Python\/s047431119.py\", line 3, in \n z = set(s)\nTypeError: 'int' object is not iterable\n","stdout":null} {"problem_id":"p03147","language":"Python","original_status":"Runtime Error","pass":"N = int(input())\nH = list(map(int, input().split()))\nans = 0\n\nwhile max(H) > 0:\n grp = [[]]\n for i, h in enumerate(H):\n if h == 0:\n if len(grp[-1]) > 0:\n grp.append([])\n else:\n grp[-1].append((i, h))\n for g in grp:\n mi = min([h for _, h in g])\n ans += mi\n for i, _ in g:\n H[i] -= mi\n\nprint(ans)\n","fail":"N = int(input())\nH = list(map(int, input().split()))\nans = 0\n\nwhile max(H) > 0:\n grp = [[]]\n for i, h in enumerate(H):\n if h == 0:\n if len(grp[-1]) > 0:\n grp.append([])\n else:\n grp[-1].append((i, h))\n for g in grp:\n if len(g) == 0:\n continue\n mi = min([h for _, h in g])\n ans += mi\n for i, _ in g:\n H[i] -= mi\n\nprint(ans)\n","change":"insert","i1":13,"i2":13,"j1":13,"j2":15,"error":"ValueError: min() arg is an empty sequence","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03147\/Python\/s431171639.py\", line 14, in \n mi = min([h for _, h in g])\nValueError: min() arg is an empty sequence\n","stdout":null} {"problem_id":"p03147","language":"Python","original_status":"Runtime Error","pass":"import sys\n\n\ndef input():\n return sys.stdin.readline().rstrip()\n\n\ndef main():\n N = int(input())\n h = list(map(int, input().split()))\n\n dflag = 0\n cmin = 0\n cmax = h[0]\n count = 0\n for i in range(1, N):\n if h[i - 1] < h[i] and dflag == 1:\n count += cmax - cmin\n cmax = h[i]\n dflag = 0\n cmin = h[i - 1]\n\n elif h[i - 1] > h[i]:\n dflag = 1\n\n elif h[i - 1] < h[i]:\n cmax = h[i]\n\n if dflag == 1:\n count += cmax - cmin\n else:\n count += max(cmax, h[i]) - cmin\n\n print(count)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"import sys\n\n\ndef input():\n return sys.stdin.readline().rstrip()\n\n\ndef main():\n N = int(input())\n if N == 1:\n print(input())\n exit()\n h = list(map(int, input().split()))\n\n dflag = 0\n cmin = 0\n cmax = h[0]\n count = 0\n for i in range(1, N):\n if h[i - 1] < h[i] and dflag == 1:\n count += cmax - cmin\n cmax = h[i]\n dflag = 0\n cmin = h[i - 1]\n\n elif h[i - 1] > h[i]:\n dflag = 1\n\n elif h[i - 1] < h[i]:\n cmax = h[i]\n\n if dflag == 1:\n count += cmax - cmin\n else:\n count += max(cmax, h[i]) - cmin\n\n print(count)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"insert","i1":9,"i2":9,"j1":9,"j2":12,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p03148","language":"Python","original_status":"Time Limit Exceeded","pass":"import operator\nimport collections\n\nn, k = map(int, input().split())\nsushies = []\nfor _ in range(n):\n t, d = map(int, input().split())\n sushies.append((t, d))\n\nsushies.sort(key=operator.itemgetter(1), reverse=True)\n\ndishes = sushies[:k]\nc = collections.Counter(t for t, d in dishes)\na = sum(d for t, d in dishes)\nanswer = a + len(c) ** 2\n\nfor t, d in sushies[k:]:\n if t in c:\n continue\n\n x = -1\n for i in reversed(range(k)):\n if c[dishes[i][0]] > 1:\n x = i\n break\n\n if x == -1:\n break\n\n a = a + d - dishes[x][1]\n c[t] += 1\n c[dishes[x][0]] -= 1\n del dishes[x]\n dishes.append((t, d))\n\n answer = max(answer, a + len(c) ** 2)\n\nprint(answer)\n","fail":"import operator\nimport collections\n\nn, k = map(int, input().split())\nsushies = []\nfor _ in range(n):\n t, d = map(int, input().split())\n sushies.append((t, d))\n\nsushies.sort(key=operator.itemgetter(1), reverse=True)\n\ndishes = sushies[:k]\nc = collections.Counter(t for t, d in dishes)\na = sum(d for t, d in dishes)\nanswer = a + len(c) ** 2\nx = k - 1\nfor t, d in sushies[k:]:\n if t in c:\n continue\n\n while x >= 0:\n if c[dishes[x][0]] > 1:\n break\n x -= 1\n\n if x == -1:\n break\n\n a = a + d - dishes[x][1]\n c[t] += 1\n c[dishes[x][0]] -= 1\n del dishes[x]\n dishes.append((t, d))\n\n answer = max(answer, a + len(c) ** 2)\n\nprint(answer)\n","change":"replace","i1":15,"i2":25,"j1":15,"j2":24,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03148","language":"Python","original_status":"Runtime Error","pass":"import heapq\n\nn, k = map(int, input().split())\nsushi = [list(map(int, input().split())) for _ in range(n)]\nsushi.sort(key=lambda x: x[1])\nt = {}\nx = []\nz = 0\nfor i in range(n - 1, n - k - 1, -1):\n ti, di = sushi[i]\n if ti in t.keys():\n heapq.heappush(x, di)\n t[ti] += 1\n else:\n t[ti] = 1\n z += di\n\nans = z + len(t.keys()) ** 2\nfor i in range(n - k - 1, -1, -1):\n ti, di = sushi[i]\n if ti not in t.keys():\n t[ti] = 1\n z += di - heapq.heappop(x)\n ans = max(ans, z + len(t.keys()) ** 2)\n k += 1\n\nprint(ans)\n","fail":"import heapq\n\nn, k = map(int, input().split())\nsushi = [list(map(int, input().split())) for _ in range(n)]\nsushi.sort(key=lambda x: x[1])\nt = {}\nx = []\nz = 0\nfor i in range(n - 1, n - k - 1, -1):\n ti, di = sushi[i]\n if ti in t.keys():\n heapq.heappush(x, di)\n t[ti] += 1\n else:\n t[ti] = 1\n z += di\n\np = len(t.keys())\nans = z + p**2\nfor i in range(n - k - 1, -1, -1):\n if len(x) == 0:\n break\n ti, di = sushi[i]\n if ti not in t.keys():\n t[ti] = 1\n z += di - heapq.heappop(x)\n p += 1\n ans = max(ans, z + p**2)\n\nprint(ans)\n","change":"replace","i1":17,"i2":25,"j1":17,"j2":28,"error":"0","stderr":null,"stdout":26.0} {"problem_id":"p03148","language":"Python","original_status":"Time Limit Exceeded","pass":"from itertools import permutations\n\nN, K = map(int, input().split())\ninputs = [[int(i) for i in input().split()] for _ in range(N)]\n\nans = 0\nfor items in permutations(inputs, K):\n tmp = 0\n sets = set()\n for i in range(K):\n tmp += items[i][1]\n sets.add(items[i][0])\n tmp += len(sets) * len(sets)\n ans = max(ans, tmp)\n\nprint(ans)\n","fail":"N, K = map(int, input().split())\n\ninputs = []\npriority_queue = []\nqueue = []\nsets = set()\n\nfor _ in range(N):\n key, value = map(int, input().split())\n inputs.append((value, key))\n\ninputs.sort(reverse=True) # value\u3067\u964d\u9806\u306e\u30bd\u30fc\u30c8\u3092\u304b\u3051\u3066\u308b\n\nfor i in range(K):\n value, key = inputs[i]\n if key in sets:\n queue.append(value)\n else:\n priority_queue.append(value)\n sets.add(key)\n\nsum_priority_queue = sum(priority_queue)\nsum_queue = sum(queue)\nkinds = len(sets)\nans = sum_priority_queue + sum_queue + kinds**2\nfor i in range(K, N):\n if not queue:\n break\n value, key = inputs[i]\n if key in sets:\n continue\n sets.add(key)\n sum_queue -= queue.pop()\n sum_priority_queue += value\n kinds += 1\n ans = max(ans, sum_priority_queue + sum_queue + kinds**2)\n\nprint(ans)\n","change":"replace","i1":0,"i2":14,"j1":0,"j2":36,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03148","language":"Python","original_status":"Runtime Error","pass":"from collections import defaultdict\nfrom heapq import heappush, heappop\n\n\nn, k = map(int, input().split())\ndic = defaultdict(list)\nfor _ in range(n):\n t, d = map(int, input().split())\n dic[t].append(d)\n\nmaxs = []\nfor key in dic:\n dic[key].sort()\n maxs.append((dic[key].pop(), key))\n\nmaxs.sort(reverse=True)\nqueSize = 0\nque = []\nqueScore = 0\ndefaultScore = 0\ncnt = 0\nans = 0\nfor v, key in maxs:\n defaultScore += v + cnt * 2 + 1\n cnt += 1\n for add in dic[key]:\n heappush(que, add)\n queSize += 1\n queScore += add\n while queSize > k - cnt:\n queScore -= heappop(que)\n queSize -= 1\n ans = max(ans, defaultScore + queScore)\n\nprint(ans)\n","fail":"from collections import defaultdict\nfrom heapq import heappush, heappop\n\n\nn, k = map(int, input().split())\ndic = defaultdict(list)\nfor _ in range(n):\n t, d = map(int, input().split())\n dic[t].append(d)\n\nmaxs = []\nfor key in dic:\n dic[key].sort()\n maxs.append((dic[key].pop(), key))\n\nmaxs.sort(reverse=True)\nqueSize = 0\nque = []\nqueScore = 0\ndefaultScore = 0\ncnt = 0\nans = 0\nfor v, key in maxs:\n defaultScore += v + cnt * 2 + 1\n cnt += 1\n if cnt >= k:\n ans = max(ans, defaultScore)\n break\n for add in dic[key]:\n heappush(que, add)\n queSize += 1\n queScore += add\n while queSize > k - cnt:\n queScore -= heappop(que)\n queSize -= 1\n ans = max(ans, defaultScore + queScore)\n\nprint(ans)\n","change":"insert","i1":25,"i2":25,"j1":25,"j2":28,"error":"0","stderr":null,"stdout":26.0} {"problem_id":"p03150","language":"Python","original_status":"Runtime Error","pass":"s = input()\nkey = \"keyence\"\nptr = 0\n\nfor c in s:\n if c == key[ptr]:\n ptr += 1\n\nprint(\"YES\" if ptr == 7 else \"NO\")\n","fail":"s = list(input())\nls = len(s)\nkey = \"keyence\"\nif \"\".join(s) == key:\n print(\"YES\")\n exit()\nf = False\nfor l in range(ls):\n for r in range(l + 1, ls):\n f |= \"\".join([\"\".join(s[:l]), \"\".join(s[r:])]) == key\n\nprint(\"YES\" if f else \"NO\")\n","change":"replace","i1":0,"i2":9,"j1":0,"j2":12,"error":"0","stderr":null,"stdout":"YES\n"} {"problem_id":"p03150","language":"Python","original_status":"Runtime Error","pass":"S = input()\n\ntarget = \"keyence\"\nnow = 0\nstart = None\nend = None\nfor i in range(len(S)):\n if target[now] == S[i]:\n now += 1\n if start is not None and end is None:\n end = i\n elif start is not None:\n continue\n else:\n start = i\n\nif start is None:\n pred = S\nelif end is None:\n pred = S[:start]\nelse:\n pred = S[:start] + S[end:]\n\nif pred == target:\n print(\"YES\")\nelse:\n print(\"NO\")\n","fail":"S = input()\n\ntarget = \"keyence\"\nN = len(target)\n\nfor i in range(8):\n s = S[:i] + S[len(S) - N + i :]\n if s == target:\n print(\"YES\")\n break\nelse:\n print(\"NO\")\n","change":"replace","i1":3,"i2":25,"j1":3,"j2":10,"error":"0","stderr":null,"stdout":"YES\n"} {"problem_id":"p03150","language":"Python","original_status":"Runtime Error","pass":"S = str(input())\ns = input()\nfor i in range(len(s)):\n for j in range(i, len(s)):\n a = s[:i] + s[j:]\n if a == \"keyence\":\n print(\"YES\")\n exit()\nprint(\"NO\")\n","fail":"s = str(input())\nfor i in range(len(s)):\n for j in range(i, len(s)):\n a = s[:i] + s[j:]\n if a == \"keyence\":\n print(\"YES\")\n exit()\nprint(\"NO\")\n","change":"replace","i1":0,"i2":2,"j1":0,"j2":1,"error":"EOFError: EOF when reading a line","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03150\/Python\/s743625929.py\", line 2, in \n s = input()\nEOFError: EOF when reading a line\n","stdout":null} {"problem_id":"p03150","language":"Python","original_status":"Runtime Error","pass":"# 2019\/01\/13\n# KEYENCE Programming Contest 2019 - B\n\n# Input\ns = input()\n\n# Init\nkey_str = \"keyence\"\nsearch_idx = 0\nokflg = 0\nngcnt = 0\n\n# Search\nfor idx in range(len(s)):\n if s[idx] == key_str[search_idx]:\n search_idx += 1\n okflg = 1\n else:\n if okflg == 1:\n ngcnt += 1\n okflg = 0\n if ngcnt > 1:\n break\n\n# Check\nif search_idx == len(key_str):\n ans = \"YES\"\nelse:\n ans = \"NO\"\n\n# Output\nprint(ans)\n","fail":"# 2019\/01\/13\n# KEYENCE Programming Contest 2019 - B\n\n# Input\ns = input()\n\n# Init\nkey_str = \"keyence\"\nans = \"NO\"\nsearch_idx = 0\n\n# Search\nif s[0] == key_str[0]:\n # Pattern 2 or 3\n for idx in range(len(s)):\n if s[idx] == key_str[search_idx]:\n search_idx += 1\n if search_idx == len(key_str):\n # Pattern 3\n ans = \"YES\"\n break\n\n else:\n # Pattern 2\n for idx2 in range(len(s) - len(key_str) + search_idx, len(s)):\n if s[idx2] == key_str[search_idx]:\n search_idx += 1\n if search_idx == len(key_str):\n ans = \"YES\"\n break\nelse:\n # Pattern 1\n for idx in range(len(s) - len(key_str), len(s)):\n if s[idx] == key_str[search_idx]:\n search_idx += 1\n if search_idx == len(key_str):\n ans = \"YES\"\n break\n\n# Output\nprint(ans)\n","change":"replace","i1":8,"i2":29,"j1":8,"j2":38,"error":"0","stderr":null,"stdout":"YES\n"} {"problem_id":"p03150","language":"Python","original_status":"Runtime Error","pass":"s = input()\nw = list(\"keyence\")\n\nst = \"\"\ni_w = 0\ndelete = []\n\nfor i in s:\n if i == w[i_w]:\n i_w += 1\n if not st == \"\":\n delete.append(st)\n st = \"\"\n else:\n st += i\nelse:\n if not st == \"\":\n delete.append(st)\n\nif i_w == 7 and len(delete) <= 1:\n ans = \"YES\"\nelse:\n ans = \"NO\"\nprint(ans)\n","fail":"s = input()\n\nw = \"keyence\"\nans = \"NO\"\n\n# keyencexxxxx\nif s[:7] == w:\n ans = \"YES\"\n\n# xxxxkeyence\nif s[-7:] == w:\n ans = \"YES\"\n\n# key xxx ence\nfor i in range(1, 7):\n ss = w[:i]\n tt = w[-7 + i :]\n if s[: len(ss)] == ss and s[-len(tt) :] == tt:\n ans = \"YES\"\n break\n\nprint(ans)\n","change":"replace","i1":1,"i2":23,"j1":1,"j2":21,"error":"0","stderr":null,"stdout":"YES\n"} {"problem_id":"p03151","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\nA = list(map(int, input().split()))\nB = list(map(int, input().split()))\nL_over = []\nL_short = []\nfor i in range(n):\n c = A[i] - B[i]\n if c > 0:\n L_over.append(c)\n elif c < 0:\n L_short.append(-c)\nL_over.sort(reverse=True)\nif sum(L_over) < sum(L_short):\n print(-1)\nelse:\n cnt = len(L_short)\n p = 0\n for i in range(len(L_over)):\n if p >= sum(L_short):\n break\n p += L_over[i]\n cnt += 1\n print(cnt)\n","fail":"n = int(input())\nA = list(map(int, input().split()))\nB = list(map(int, input().split()))\nover = []\nshort = 0\ncnt = 0\nfor i in range(n):\n c = A[i] - B[i]\n if c > 0:\n over.append(c)\n elif c < 0:\n short -= c\n cnt += 1\nif sum(over) < short:\n print(-1)\nelse:\n over.sort(reverse=True)\n s = 0\n i = 0\n while s < short:\n s += over[i]\n i += 1\n cnt += i\n print(cnt)\n","change":"replace","i1":3,"i2":22,"j1":3,"j2":23,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03155","language":"Python","original_status":"Runtime Error","pass":"N, W, H = map(int, input().split())\n\nprint((N - W + 1) * (N - H + 1))\n","fail":"N = int(input())\nW = int(input())\nH = int(input())\n\nprint((N - W + 1) * (N - H + 1))\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":3,"error":"ValueError: not enough values to unpack (expected 3, got 1)","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03155\/Python\/s974033507.py\", line 1, in \n N, W, H = map(int, input().split())\nValueError: not enough values to unpack (expected 3, got 1)\n","stdout":null} {"problem_id":"p03157","language":"Python","original_status":"Runtime Error","pass":"def dfs(i, j, c):\n visited[i][j] = 1\n current.append((i, j))\n for di, dj in (1, 0), (-1, 0), (0, 1), (0, -1):\n ni, nj = i + di, j + dj\n if not (0 <= ni < H and 0 <= nj < W and not visited[ni][nj]):\n continue\n if S[ni][nj] == c:\n continue\n dfs(ni, nj, not c)\n\n\nH, W = map(int, input().split())\nS = [[c == \"#\" for c in input()] for _ in range(H)]\n\nans = 0\nvisited = [[0] * W for _ in range(H)]\nfor i in range(H):\n for j in range(W):\n if S[i][j] and not visited[i][j]:\n current = []\n dfs(i, j, True)\n b, w = 0, 0\n for k, l in current:\n if S[k][l]:\n b += 1\n else:\n w += 1\n ans += b * w\nprint(ans)\n","fail":"from sys import setrecursionlimit\n\n\ndef dfs(i, j, c):\n visited[i][j] = 1\n current.append((i, j))\n for di, dj in (1, 0), (-1, 0), (0, 1), (0, -1):\n ni, nj = i + di, j + dj\n if not (0 <= ni < H and 0 <= nj < W and not visited[ni][nj]):\n continue\n if S[ni][nj] == c:\n continue\n dfs(ni, nj, not c)\n\n\nsetrecursionlimit(2 * 10**5)\nH, W = map(int, input().split())\nS = [[c == \"#\" for c in input()] for _ in range(H)]\n\nans = 0\nvisited = [[0] * W for _ in range(H)]\nfor i in range(H):\n for j in range(W):\n if S[i][j] and not visited[i][j]:\n current = []\n dfs(i, j, True)\n b, w = 0, 0\n for k, l in current:\n if S[k][l]:\n b += 1\n else:\n w += 1\n ans += b * w\nprint(ans)\n","change":"replace","i1":0,"i2":12,"j1":0,"j2":16,"error":0,"stderr":null,"stdout":10} {"problem_id":"p03157","language":"Python","original_status":"Runtime Error","pass":"import sys\n\n\ndef input():\n return sys.stdin.readline()[:-1]\n\n\ndef ii(t: type = int):\n return t(input())\n\n\ndef il(t: type = int):\n return list(map(t, input().split()))\n\n\ndef imi(N: int, t: type = int):\n return [ii(t) for _ in range(N)]\n\n\ndef iml(N: int, t: type = int):\n return [il(t) for _ in range(N)]\n\n\nH, W = il()\nS = imi(H, str)\nsharp_pos = []\nfor i in range(H):\n for j in range(W):\n if S[i][j] == \"#\":\n sharp_pos.append((i, j))\nc = 0\nk = 0\npre_cx, pre_cy = 0, 0\n\nboard = S[:]\nC = 0\n\n\ndef saiki(pos_list, ignore=None):\n global C\n for cx, cy in pos_list:\n p_list = []\n if ignore is None:\n ignore = []\n wanna_char = \".\" if board[cx][cy] == \"#\" else \"#\"\n for d in ((-1, 0), (0, -1), (1, 0), (0, 1)):\n tx = cx + d[1]\n ty = cy + d[0]\n if (\n tx >= 0\n and ty >= 0\n and tx < H\n and ty < W\n and (tx, ty) not in ignore\n and board[tx][ty] == wanna_char\n ):\n ignore.append((cx, cy))\n p_list.append((tx, ty))\n C += 1\n saiki(p_list, ignore)\n\n\nsaiki(sharp_pos)\nprint(C)\n","fail":"import sys\nfrom itertools import product\n\nsys.setrecursionlimit(200000)\n\n\ndef input():\n return sys.stdin.readline()[:-1]\n\n\ndef ii(t: type = int):\n return t(input())\n\n\ndef il(t: type = int):\n return list(map(t, input().split()))\n\n\ndef imi(N: int, t: type = int):\n return [ii(t) for _ in range(N)]\n\n\ndef iml(N: int, t: type = int):\n return [il(t) for _ in range(N)]\n\n\nclass UnionFind:\n def __init__(self, n):\n self.par = [i for i in range(n + 1)]\n self.rank = [0] * (n + 1)\n\n # \u691c\u7d22\n def find(self, x):\n if self.par[x] == x:\n return x\n else:\n self.par[x] = self.find(self.par[x])\n return self.par[x]\n\n # \u4f75\u5408\n def union(self, x, y):\n x = self.find(x)\n y = self.find(y)\n if self.rank[x] < self.rank[y]:\n self.par[x] = y\n else:\n self.par[y] = x\n if self.rank[x] == self.rank[y]:\n self.rank[x] += 1\n\n # \u540c\u3058\u96c6\u5408\u306b\u5c5e\u3059\u308b\u304b\u5224\u5b9a\n def same_check(self, x, y):\n return self.find(x) == self.find(y)\n\n\nH, W = il()\nS = imi(H, str)\ntree = UnionFind(H * W)\nfor i, j in product(range(H), range(W)):\n for d in ((-1, 0), (0, -1), (1, 0), (0, 1)):\n x = i + d[0]\n y = j + d[1]\n if 0 <= x < H and 0 <= y < W:\n if S[i][j] != S[x][y]:\n tree.union((i * W + j), (x * W + y))\n\ndot = [0] * (H * W)\nsharp = [0] * (H * W)\nfor i, j in product(range(H), range(W)):\n if S[i][j] == \".\":\n dot[tree.find(i * W + j)] += 1\n else:\n sharp[tree.find(i * W + j)] += 1\n\nans = 0\nfor i in range(H * W):\n ans += dot[i] * sharp[i]\nprint(ans)\n","change":"replace","i1":1,"i2":64,"j1":1,"j2":78,"error":0,"stderr":null,"stdout":10} {"problem_id":"p03157","language":"Python","original_status":"Runtime Error","pass":"def dfs(x, y, matrix, visited, isWhite):\n global black, white\n dxy = [[1, 0], [-1, 0], [0, -1], [0, 1]]\n visited[y][x] = True\n w = len(matrix[0])\n h = len(matrix)\n\n for dx, dy in dxy:\n nx = x + dx\n ny = y + dy\n\n if nx < 0 or w <= nx or ny < 0 or h <= ny:\n continue\n\n if visited[ny][nx] is True:\n continue\n\n if (matrix[ny][nx] == \"#\" and isWhite is False) or (\n matrix[ny][nx] == \".\" and isWhite is True\n ):\n continue\n\n if matrix[ny][nx] == \"#\":\n black += 1\n else:\n white += 1\n\n isWhite = not isWhite\n dfs(nx, ny, matrix, visited, isWhite)\n isWhite = not isWhite\n\n return\n\n\nh, w = map(int, input().split())\nmatrix = [\"\"] * h\nfor i in range(h):\n matrix[i] = input()\n\nans = 0\nvisited = [[False] * w for _ in range(h)]\n\nfor i in range(h):\n for j in range(w):\n if matrix[i][j] == \"#\" and visited[i][j] is False:\n black = 1\n white = 0\n dfs(j, i, matrix, visited, False)\n ans += black * white\n\nprint(ans)\n","fail":"import sys\n\nsys.setrecursionlimit(10**6)\n\n\ndef dfs(x, y, matrix, visited, isWhite):\n global black, white\n dxy = [[1, 0], [-1, 0], [0, -1], [0, 1]]\n visited[y][x] = True\n w = len(matrix[0])\n h = len(matrix)\n\n for dx, dy in dxy:\n nx = x + dx\n ny = y + dy\n\n if nx < 0 or w <= nx or ny < 0 or h <= ny:\n continue\n\n if visited[ny][nx] is True:\n continue\n\n if (matrix[ny][nx] == \"#\" and isWhite is False) or (\n matrix[ny][nx] == \".\" and isWhite is True\n ):\n continue\n\n if matrix[ny][nx] == \"#\":\n black += 1\n else:\n white += 1\n\n isWhite = not isWhite\n dfs(nx, ny, matrix, visited, isWhite)\n isWhite = not isWhite\n\n return\n\n\nh, w = map(int, input().split())\nmatrix = [\"\"] * h\nfor i in range(h):\n matrix[i] = input()\n\nans = 0\nvisited = [[False] * w for _ in range(h)]\n\nfor i in range(h):\n for j in range(w):\n if matrix[i][j] == \"#\" and visited[i][j] is False:\n black = 1\n white = 0\n dfs(j, i, matrix, visited, False)\n ans += black * white\n\nprint(ans)\n","change":"insert","i1":0,"i2":0,"j1":0,"j2":5,"error":0,"stderr":null,"stdout":10} {"problem_id":"p03160","language":"Python","original_status":"Runtime Error","pass":"# -*- coding: utf-8 -*-\n# Input#\nn = int(input())\n# n, k = map(int, input().split())\nh = list(map(int, input().split()))\n\nh = [-1] + h\n\nans = 0\n\nmemo = [-1] * (n + 1)\nmemo[1] = 0\nmemo[2] = abs(h[2] - h[1])\n\n\ndef dp(i):\n if memo[i] != -1:\n return memo[i]\n else:\n hop1 = dp(i - 1) + abs(h[i] - h[i - 1])\n hop2 = dp(i - 2) + abs(h[i] - h[i - 2])\n memo[i] = min(hop1, hop2)\n return memo[i]\n\n\nfor i in range(n):\n tmp = dp(i)\n\nans = dp(n)\n\nprint(\"{}\".format(ans))\n","fail":"# -*- coding: utf-8 -*-\n# Input#\nn = int(input())\n# n, k = map(int, input().split())\nh = list(map(int, input().split()))\n\nh = [-1] + h\n\nans = 0\n\nmemo = [-1] * (n + 1)\nmemo[1] = 0\nmemo[2] = abs(h[2] - h[1])\n\n\ndef dp(i):\n if memo[i] != -1:\n return memo[i]\n else:\n hop1 = dp(i - 1) + abs(h[i] - h[i - 1])\n hop2 = dp(i - 2) + abs(h[i] - h[i - 2])\n memo[i] = min(hop1, hop2)\n return memo[i]\n\n\nfor i in range(n):\n if i == 0 or i == 1 or i == 2:\n continue\n hop1 = memo[i - 1] + abs(h[i] - h[i - 1])\n hop2 = memo[i - 2] + abs(h[i] - h[i - 2])\n memo[i] = min(hop1, hop2)\n\nans = dp(n)\n\nprint(\"{}\".format(ans))\n","change":"replace","i1":26,"i2":27,"j1":26,"j2":31,"error":"0","stderr":null,"stdout":30.0} {"problem_id":"p03160","language":"Python","original_status":"Runtime Error","pass":"\"\"\"\nauthor : halo2halo\ndate : 4, Feb, 2020\n\"\"\"\n\nimport sys\n\n# import itertools\n# import math\n\n# import numpy as np\n\nread = sys.stdin.buffer.read\nreadline = sys.stdin.buffer.readline\nreadlines = sys.stdin.buffer.readlines\n\nN, *H = map(int, readline().split())\ndp = [0] * N\ndp[1] = abs(H[1] - H[0])\n\nfor i in range(2, N):\n dp[i] = min(dp[i - k] + abs(H[i] - H[i - k]) for k in [1, 2])\n\nans = dp[-1]\nprint(ans)\n","fail":"\"\"\"\nauthor : halo2halo\ndate : 4, Feb, 2020\n\"\"\"\n\nimport sys\n\n# import itertools\n# import math\n\n# import numpy as np\n\nread = sys.stdin.buffer.read\nreadline = sys.stdin.buffer.readline\nreadlines = sys.stdin.buffer.readlines\n\nN, *H = map(int, read().split())\ndp = [0] * N\ndp[1] = abs(H[1] - H[0])\n\nfor i in range(2, N):\n dp[i] = min(dp[i - k] + abs(H[i] - H[i - k]) for k in [1, 2])\n\nans = dp[-1]\nprint(ans)\n","change":"replace","i1":16,"i2":17,"j1":16,"j2":17,"error":"IndexError: list index out of range","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03160\/Python\/s149948517.py\", line 19, in \n dp[1] = abs(H[1] - H[0])\nIndexError: list index out of range\n","stdout":null} {"problem_id":"p03160","language":"Python","original_status":"Runtime Error","pass":"import sys\n\n# import numpy as np\n\n\ndef main():\n f = sys.stdin.buffer\n N, K = map(int, f.readline().split())\n H = list(map(int, f.readline().split()))\n dp = [0] * N\n for i in range(1, N):\n dp[i] = min(\n dp[i - k - 1] + abs(H[i] - H[i - k - 1]) for k in range(K) if i - k - 1 >= 0\n )\n print(dp[-1])\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"n = int(input())\nh = list(map(int, input().split()))\np0, p1 = 0, abs(h[1] - h[0])\nfor i in range(2, n):\n p2 = min(p1 + abs(h[i] - h[i - 1]), p0 + abs(h[i] - h[i - 2]))\n p0, p1 = p1, p2\nprint(p1)\n","change":"replace","i1":0,"i2":19,"j1":0,"j2":7,"error":"ValueError: not enough values to unpack (expected 2, got 1)","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03160\/Python\/s516514400.py\", line 19, in \n main()\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03160\/Python\/s516514400.py\", line 8, in main\n N, K = map(int, f.readline().split())\nValueError: not enough values to unpack (expected 2, got 1)\n","stdout":null} {"problem_id":"p03160","language":"Python","original_status":"Runtime Error","pass":"import sys\nimport threading\n\nsys.setrecursionlimit(200000000)\nthreading.stack_size(134217728)\n\n\nclass SearchProblem(object):\n def __init__(self, N, H):\n self.N = N\n self.H = H\n\n def isEnd(self, i):\n return i == self.N\n\n def succ(self, i):\n res = []\n if i + 1 <= self.N:\n res.append((i + 1, abs(self.H[i + 1] - self.H[i])))\n if i + 2 <= self.N:\n res.append((i + 2, abs(self.H[i + 2] - self.H[i])))\n return res\n\n\ndef solve(problem: SearchProblem):\n memo = {}\n\n def future_cost(s):\n if s in memo:\n return memo[s]\n\n if problem.isEnd(s):\n memo[s] = 0\n return 0\n else:\n memo[s] = min(\n cost + future_cost(next_state) for next_state, cost in problem.succ(s)\n )\n return memo[s]\n\n return future_cost(1)\n\n\ndef main():\n N = int(input())\n H = [None] + [int(x) for x in input().split(\" \")]\n problem = SearchProblem(N, H)\n print(solve(problem))\n\n\nif __name__ == \"__main__\":\n main_thread = threading.Thread(target=main)\n main_thread.start()\n main_thread.join()\n","fail":"def solve(n):\n table = [0 for i in range(N + 1)]\n for i in range(1, n + 1):\n if i == 1:\n table[1] = 0\n elif i == 2:\n table[2] = abs(H[2] - H[1])\n else:\n table[i] = min(\n table[i - 1] + abs(H[i] - H[i - 1]), table[i - 2] + abs(H[i] - H[i - 2])\n )\n return table[n]\n\n\nif __name__ == \"__main__\":\n N = int(input())\n H = [0] + [int(x) for x in input().split(\" \")]\n\n print(solve(N))\n","change":"replace","i1":0,"i2":54,"j1":0,"j2":19,"error":"RuntimeError: can't start new thread","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03160\/Python\/s452152081.py\", line 53, in \n main_thread.start()\n File \"\/usr\/lib\/python3.10\/threading.py\", line 935, in start\n _start_new_thread(self._bootstrap, ())\nRuntimeError: can't start new thread\n","stdout":null} {"problem_id":"p03160","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\nh = list(map(int, input().split()))\n\n# dp[i][j]: \u8db3\u5834i\u307e\u3067\u898b\u305f\u6642 j\u307e\u3067\u306e\u6700\u5c0f\u30b3\u30b9\u30c8\ndp = [[0 for j in range(n)] for i in range(n)]\n\ndp[1][1] = abs(h[1] - h[0])\n\nfor i in range(n):\n if i == 0 or i == 1:\n continue\n\n dp[i] = dp[i - 1]\n\n cost1jump = dp[i - 1][i - 1] + abs(h[i] - h[i - 1])\n cost2jump = dp[i - 1][i - 2] + abs(h[i] - h[i - 2])\n dp[i][i] = min(cost1jump, cost2jump)\n\nprint(dp[-1][-1])\n","fail":"n = int(input())\nh = list(map(int, input().split()))\n\n# dp[i][j]: \u8db3\u5834i\u307e\u3067\u898b\u305f\u6642 j\u307e\u3067\u306e\u6700\u5c0f\u30b3\u30b9\u30c8\ndp = [0 for i in range(n)]\n\ndp[1] = abs(h[1] - h[0])\n\nfor i in range(n):\n if i == 0 or i == 1:\n continue\n\n cost1jump = dp[i - 1] + abs(h[i] - h[i - 1])\n cost2jump = dp[i - 2] + abs(h[i] - h[i - 2])\n dp[i] = min(cost1jump, cost2jump)\n\nprint(dp[-1])\n","change":"replace","i1":4,"i2":19,"j1":4,"j2":17,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03160","language":"Python","original_status":"Runtime Error","pass":"import math\n\nN = int(input())\nheights = list(map(int, input().strip().split()))\n\ndp = [math.inf for _ in range(N)]\n\ndp[0] = 0\nif len > 1:\n dp[1] = abs(heights[1] - heights[0])\n\n\nfor i in range(2, N):\n dp[i] = min(\n dp[i],\n dp[i - 1] + abs(heights[i] - heights[i - 1]),\n dp[i - 2] + abs(heights[i] - heights[i - 2]),\n )\n\nprint(dp[N - 1])\n","fail":"N = int(input())\nheights = list(map(int, input().strip().split()))\n\ndp = [float(\"inf\") for _ in range(N)]\n\ndp[0] = 0\nif N > 1:\n dp[1] = abs(heights[1] - heights[0])\n\n\nfor i in range(2, N):\n dp[i] = min(\n dp[i],\n dp[i - 1] + abs(heights[i] - heights[i - 1]),\n dp[i - 2] + abs(heights[i] - heights[i - 2]),\n )\n\nprint(dp[N - 1])\n","change":"replace","i1":0,"i2":9,"j1":0,"j2":7,"error":"TypeError: '>' not supported between instances of 'builtin_function_or_method' and 'int'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03160\/Python\/s290255807.py\", line 9, in \n if len > 1:\nTypeError: '>' not supported between instances of 'builtin_function_or_method' and 'int'\n","stdout":null} {"problem_id":"p03160","language":"Python","original_status":"Runtime Error","pass":"def sub():\n N = int(input())\n hs = [int(e) for e in input().split()]\n\n def optimal_value(a_index):\n if a_index >= N - 1:\n return 0\n\n if a_index < N - 2:\n a = optimal_value(a_index + 1) + abs(hs[a_index + 1] - hs[a_index])\n b = optimal_value(a_index + 2) + abs(hs[a_index + 2] - hs[a_index])\n return min(a, b)\n else:\n return optimal_value(a_index + 1) + abs(hs[a_index + 1] - hs[a_index])\n\n print(optimal_value(0))\n\n\nsub()\n","fail":"def sub():\n N = int(input())\n hs = [int(e) for e in input().split()]\n optimal_values = [None for _ in range(N)]\n optimal_values[0] = 0\n for i in range(1, N):\n if i > 1:\n a = optimal_values[i - 1] + abs(hs[i] - hs[i - 1])\n b = optimal_values[i - 2] + abs(hs[i] - hs[i - 2])\n optimal_values[i] = min(a, b)\n else:\n optimal_values[i] = optimal_values[i - 1] + abs(hs[i] - hs[i - 1])\n print(optimal_values[-1])\n\n\nsub()\n","change":"replace","i1":3,"i2":16,"j1":3,"j2":13,"error":"0","stderr":null,"stdout":30.0} {"problem_id":"p03160","language":"Python","original_status":"Runtime Error","pass":"N = int(input())\nh = [int(i) for i in input().split()]\n\nmemo = [float(\"inf\")] * N\nmemo[0], memo[1] = 0, abs(h[1] - h[0])\n\n\ndef frog(ith):\n if memo[ith] != float(\"inf\"):\n return memo[ith]\n memo[ith] = min(\n frog(ith - 1) + abs(h[ith] - h[ith - 1]),\n frog(ith - 2) + abs(h[ith] - h[ith - 2]),\n )\n return memo[ith]\n\n\nprint(frog(N - 1))\n","fail":"import sys\n\nsys.setrecursionlimit(500000)\nN = int(input())\nh = [int(i) for i in input().split()]\n\nmemo = [float(\"inf\")] * N\nmemo[0], memo[1] = 0, abs(h[1] - h[0])\n\n\ndef frog(ith):\n if memo[ith] != float(\"inf\"):\n return memo[ith]\n memo[ith] = min(\n frog(ith - 1) + abs(h[ith] - h[ith - 1]),\n frog(ith - 2) + abs(h[ith] - h[ith - 2]),\n )\n return memo[ith]\n\n\nprint(frog(N - 1))\n","change":"insert","i1":0,"i2":0,"j1":0,"j2":3,"error":"0","stderr":null,"stdout":30.0} {"problem_id":"p03160","language":"Python","original_status":"Runtime Error","pass":"import functools\nimport threading\nimport sys\n\n\nclass SearchProblem(object):\n def __init__(self, N, H):\n self.N = N\n self.H = H\n\n def isEnd(self, i):\n return i == self.N\n\n def succ(self, i):\n res = []\n if i + 1 <= self.N:\n res.append((i + 1, abs(self.H[i + 1] - self.H[i])))\n if i + 2 <= self.N:\n res.append((i + 2, abs(self.H[i + 2] - self.H[i])))\n return res\n\n\ndef solve(problem: SearchProblem):\n @functools.lru_cache(maxsize=None)\n def future_cost(s):\n if problem.isEnd(s):\n return 0\n else:\n return min(\n cost + future_cost(next_state) for next_state, cost in problem.succ(s)\n )\n\n return future_cost(1)\n\n\ndef main():\n N = int(input())\n H = [None] + [int(x) for x in input().split(\" \")]\n problem = SearchProblem(N, H)\n print(solve(problem))\n\n\nif __name__ == \"__main__\":\n\n sys.setrecursionlimit(1024 * 1024)\n threading.stack_size(128 * 1024 * 1024)\n threading.Thread(target=main).start()\n","fail":"import functools\nimport threading\nimport sys\n\n\nclass SearchProblem(object):\n def __init__(self, N, H):\n self.N = N\n self.H = H\n\n def isEnd(self, i):\n return i == self.N\n\n def succ(self, i):\n res = []\n if i + 1 <= self.N:\n res.append((i + 1, abs(self.H[i + 1] - self.H[i])))\n if i + 2 <= self.N:\n res.append((i + 2, abs(self.H[i + 2] - self.H[i])))\n return res\n\n\ndef solve(problem: SearchProblem):\n @functools.lru_cache(maxsize=None)\n def future_cost(s):\n if problem.isEnd(s):\n return 0\n else:\n return min(\n cost + future_cost(next_state) for next_state, cost in problem.succ(s)\n )\n\n return future_cost(1)\n\n\ndef main():\n N = int(input())\n H = [None] + [int(x) for x in input().split(\" \")]\n problem = SearchProblem(N, H)\n print(solve(problem))\n\n\nif __name__ == \"__main__\":\n\n sys.setrecursionlimit(1024 * 1024 * 2)\n threading.stack_size(128 * 1024 * 1024 * 2)\n threading.Thread(target=main).start()\n","change":"replace","i1":44,"i2":46,"j1":44,"j2":46,"error":"RuntimeError: can't start new thread","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03160\/Python\/s280441279.py\", line 47, in \n threading.Thread(target=main).start()\n File \"\/usr\/lib\/python3.10\/threading.py\", line 935, in start\n _start_new_thread(self._bootstrap, ())\nRuntimeError: can't start new thread\n","stdout":null} {"problem_id":"p03160","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\ninitial_vals = list(map(int, input().split(\" \")))\n\n\ntable = [[None for x in range(n)] for x in range(n)]\n\n\ndef calc(from_stone, to_stone):\n if table[from_stone][to_stone] is not None:\n return table[from_stone][to_stone]\n elif (to_stone - from_stone) == 1:\n table[from_stone][to_stone] = abs(\n initial_vals[from_stone] - initial_vals[to_stone]\n )\n return table[from_stone][to_stone]\n elif (to_stone - from_stone) == 2:\n table[from_stone][to_stone] = min(\n abs(initial_vals[from_stone] - initial_vals[to_stone - 1])\n + abs(initial_vals[to_stone - 1] - initial_vals[to_stone]),\n abs(initial_vals[from_stone] - initial_vals[to_stone]),\n )\n return table[from_stone][to_stone]\n else:\n table[from_stone][to_stone] = min(\n calc(from_stone, to_stone - 1) + calc(to_stone - 1, to_stone),\n calc(from_stone, to_stone - 2) + calc(to_stone - 2, to_stone),\n )\n return table[from_stone][to_stone]\n\n\nprint(calc(0, n - 1))\n","fail":"n = int(input())\ninitial_vals = list(map(int, input().split(\" \")))\n\n\n# print(calc(0, n - 1))\n\n\narr = [0 for x in range(n)]\n\narr[1] = abs(initial_vals[0] - initial_vals[1])\n\nfor i in range(2, len(arr)):\n arr[i] = min(\n arr[i - 1] + abs(initial_vals[i - 1] - initial_vals[i]),\n arr[i - 2] + abs(initial_vals[i - 2] - initial_vals[i]),\n )\n\nprint(arr[n - 1])\n","change":"replace","i1":4,"i2":31,"j1":4,"j2":18,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03161","language":"Python","original_status":"Time Limit Exceeded","pass":"import functools\nimport threading\nimport sys\n\n\nclass SearchProblem(object):\n def __init__(self, N, H, K):\n self.N = N\n self.H = H\n self.K = K\n\n def isEnd(self, i):\n return i == self.N\n\n def succ(self, i):\n return [\n (i + k, abs(self.H[i + k] - self.H[i]))\n for k in range(1, self.K + 1)\n if i + k <= self.N\n ]\n\n\ndef solve(problem: SearchProblem):\n @functools.lru_cache(maxsize=None)\n def future_cost(s):\n if problem.isEnd(s):\n return 0\n else:\n return min(\n cost + future_cost(next_state) for next_state, cost in problem.succ(s)\n )\n\n return future_cost(1)\n\n\ndef main():\n N, K = [int(x) for x in input().split(\" \")]\n H = [None] + [int(x) for x in input().split(\" \")]\n problem = SearchProblem(N, H, K)\n print(solve(problem))\n\n\nif __name__ == \"__main__\":\n\n sys.setrecursionlimit(1024 * 1024 * 2)\n threading.stack_size(128 * 1024 * 1024 * 2)\n threading.Thread(target=main).start()\n","fail":"import functools\nimport threading\nimport sys\n\n\ndef main():\n @functools.lru_cache(maxsize=None)\n def solve(n):\n if n == 1:\n return 0\n else:\n return min(\n solve(n - k) + abs(H[n] - H[n - k])\n for k in range(1, K + 1)\n if n - k >= 1\n )\n\n N, K = [int(x) for x in input().split(\" \")]\n H = [None] + [int(x) for x in input().split(\" \")]\n print(solve(N))\n\n\nif __name__ == \"__main__\":\n\n sys.setrecursionlimit(1024 * 1024 * 2)\n threading.stack_size(128 * 1024 * 1024 * 2)\n threading.Thread(target=main).start()\n","change":"replace","i1":5,"i2":40,"j1":5,"j2":20,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03161","language":"Python","original_status":"Time Limit Exceeded","pass":"n, k = map(int, input().split())\nh = list(map(int, input().split()))\na = [0] * n\na[0] = 0\nfor i in range(1, n):\n a[i] = min([a[j] + abs(h[i] - h[j]) for j in range(max(0, i - k), i)])\nprint(a[-1])\n","fail":"def main():\n n, k = map(int, input().split())\n h = list(map(int, input().split()))\n a = [0 for i in range(n)]\n for i in range(1, n):\n a[i] = min([a[j] + abs(h[i] - h[j]) for j in range(max(0, i - k), i)])\n print(a[-1])\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":0,"i2":7,"j1":0,"j2":11,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03161","language":"Python","original_status":"Runtime Error","pass":"import math\n\nN, K = map(int, input().split())\nlst = [int(x) for x in input().split()]\ndp = [math.inf] * N\ndp[0] = 0\ndp[1] = abs(lst[0] - lst[1])\nfor i in range(2, N):\n j = K\n while j > 0:\n if i - j >= 0:\n dp[i] = min(dp[i], dp[i - j] + abs(lst[i - j] - lst[i]))\n j -= 1\nprint(dp[-1])\n","fail":"import numpy as np\n\nN, K = map(int, input().split())\nlst = np.array([int(x) for x in input().split()])\ndp = np.zeros(N, dtype=int)\n\nfor i in range(1, N):\n start = max(i - K, 0)\n dp[i] = np.min(dp[start:i] + np.abs(lst[start:i] - lst[i]))\nprint(dp[-1])\n","change":"replace","i1":0,"i2":13,"j1":0,"j2":9,"error":"0","stderr":null,"stdout":30.0} {"problem_id":"p03161","language":"Python","original_status":"Runtime Error","pass":"import sys\n\nimport numba as nb\n\ninput = sys.stdin.readline\nINF = float(\"inf\")\n\n\n@nb.njit\ndef solve(N, K, h):\n dp = [0] * N\n for i in range(1, N):\n min_cost = INF\n for k in range(1, min(K + 1, i + 1)):\n cost = dp[i - k] + abs(h[i] - h[i - k])\n if cost < min_cost:\n min_cost = cost\n dp[i] = min_cost\n return dp[-1]\n\n\ndef main():\n N, K = map(int, input().split())\n h = tuple(map(int, input().split()))\n\n ans = solve(N, K, h)\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"import sys\n\nimport numba as nb\nimport numpy as np\n\ninput = sys.stdin.readline\nINF = float(\"inf\")\n\n\n@nb.njit\ndef solve(N, K, h):\n dp = [0] * N\n for i in range(1, N):\n min_cost = INF\n for k in range(1, min(K + 1, i + 1)):\n cost = dp[i - k] + abs(h[i] - h[i - k])\n if cost < min_cost:\n min_cost = cost\n dp[i] = min_cost\n return dp[-1]\n\n\ndef main():\n N, K = map(int, input().split())\n h = np.array(input().split(), dtype=np.int64)\n\n ans = solve(N, K, h)\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":3,"i2":24,"j1":3,"j2":25,"error":"ModuleNotFoundError: No module named 'numba'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03161\/Python\/s994511645.py\", line 3, in \n import numba as nb\nModuleNotFoundError: No module named 'numba'\n","stdout":null} {"problem_id":"p03161","language":"Python","original_status":"Time Limit Exceeded","pass":"import math\n\nn, k = map(int, input().split())\nh = list(map(int, input().split()))\n\ndp = [math.inf] * n\ndp[0] = 0\nfor i in range(1, n):\n for j in range(max(0, i - k), i):\n dp[i] = min(dp[i], dp[j] + abs(h[i] - h[j]))\nprint(dp[n - 1])\n","fail":"import math\n\nn, k = map(int, input().split())\nh = list(map(int, input().split()))\n\ndp = [math.inf] * n\ndp[0] = 0\nfor i in range(1, n):\n dp[i] = min(dp[j] + abs(h[i] - h[j]) for j in range(max(0, i - k), i))\nprint(dp[n - 1])\n","change":"replace","i1":8,"i2":10,"j1":8,"j2":9,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03161","language":"Python","original_status":"Time Limit Exceeded","pass":"import sys\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef main():\n n, k = map(int, input().split())\n h = list(map(int, input().split()))\n dp = [0] * n\n dp[0] = 0\n dp[1] = abs(h[0] - h[1])\n\n for i in range(2, n):\n dp[i] = min(abs(h[i] - h[j]) + dp[j] for j in range(max(0, i - k), i))\n print(dp[n - 1])\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"import sys\nimport numpy as np\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef main():\n n, k = map(int, input().split())\n h = np.array(input().split(), dtype=np.int64)\n dp = np.zeros(n, dtype=np.int64)\n\n for i in range(1, n):\n j = max(0, i - k)\n dp[i] = np.min(np.abs(h[i] - h[j:i]) + dp[j:i])\n print(dp[n - 1])\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":1,"i2":16,"j1":1,"j2":16,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03161","language":"Python","original_status":"Runtime Error","pass":"import sys\n\ninput = sys.stdin.readline\n\nN, K = map(int, input().split())\nh = list(map(int, (input().split())))\n\ndp = [sys.maxsize] * N\n\ndp[0] = 0\n\nfor i in range(1, N):\n s = max(0, i - K)\n dp[i] = min(dp[s:i] + abs(h[s:i] - h[i]))\n\nprint(dp[N - 1])\n","fail":"import sys\nimport numpy as np\n\ninput = sys.stdin.readline\n\nN, K = map(int, input().split())\nh = np.array(list(map(int, (input().split()))))\n\ndp = np.full(N, sys.maxsize, dtype=int)\n\ndp[0] = 0\n\nfor i in range(1, N):\n s = max(0, i - K)\n dp[i] = min(dp[s:i] + abs(h[i] - h[s:i]))\n\nprint(dp[N - 1])\n","change":"replace","i1":1,"i2":14,"j1":1,"j2":15,"error":"TypeError: unsupported operand type(s) for -: 'list' and 'int'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03161\/Python\/s304743671.py\", line 14, in \n dp[i] = min(dp[s:i] + abs(h[s:i] - h[i]))\nTypeError: unsupported operand type(s) for -: 'list' and 'int'\n","stdout":null} {"problem_id":"p03161","language":"Python","original_status":"Time Limit Exceeded","pass":"N, K = map(int, input().split())\nH = list(map(int, input().split()))\nH = [H[0]] * K + H\n\n# dp[i] := \u8db3\u5834i\u306b\u6765\u308b\u306e\u306b\u304b\u304b\u308b\u6700\u5c0f\u306e\u30b3\u30b9\u30c8\nINF = 10**18\ndp = [INF] * (K + N)\ndp[0] = 0\nfor i in range(1, N + K):\n for j in range(1, K + 1):\n v = dp[i - j] + abs(H[i] - H[i - j])\n dp[i] = min(dp[i], v)\n# print('dp', dp)\nans = dp[-1]\nprint(ans)\n","fail":"N, K = map(int, input().split())\nH = list(map(int, input().split()))\nH = [H[0]] * K + H\n\n# dp[i] := \u8db3\u5834i\u306b\u6765\u308b\u306e\u306b\u304b\u304b\u308b\u6700\u5c0f\u306e\u30b3\u30b9\u30c8\nINF = 10**18\ndp = [INF] * (K + N)\ndp[0] = 0\nfor i in range(K, N + K):\n h = H[i]\n dp[i] = min(x + abs(y - h) for x, y in zip(dp[i - K : i], H[i - K : i]))\n# for j in range(1, K + 1):\n# v = dp[i - j] + abs(H[i] - H[i - j])\n# dp[i] = min(dp[i], v)\n# print('dp', dp)\nans = dp[-1]\nprint(ans)\n","change":"replace","i1":8,"i2":12,"j1":8,"j2":14,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03161","language":"Python","original_status":"Time Limit Exceeded","pass":"#!\/usr\/bin\/env python\n# -*- coding: utf-8 -*-\n\nN, K = map(int, input().split())\nh = list(map(int, input().split()))\n\n# dp[i] = \u8db3\u5834i\u306b\u79fb\u52d5\u3059\u308b\u306e\u306b\u5fc5\u8981\u306a\u6700\u5c0f\u30b3\u30b9\u30c8\ndp = [0 for _ in range(N)]\n\n# DP\u914d\u5217\u66f4\u65b0\nfor i in range(1, N):\n # \u6700\u5c0f\u30b3\u30b9\u30c8\u3067\u66f4\u65b0\u3059\u308b\n max_k = min([i, K]) + 1\n dp[i] = min([dp[i - k] + abs(h[i] - h[i - k]) for k in range(1, max_k)])\n\nprint(dp[-1])\n","fail":"#!\/usr\/bin\/env python\n# -*- coding: utf-8 -*-\nimport numpy as np\n\nN, K = map(int, input().split())\nh = list(map(int, input().split()))\n# \u9ad8\u901f\u5316\u306e\u305f\u3081\u306bnumpy\u4f7f\u3046\nh = np.array(h)\n\n# dp[i] = \u8db3\u5834i\u306b\u79fb\u52d5\u3059\u308b\u306e\u306b\u5fc5\u8981\u306a\u6700\u5c0f\u30b3\u30b9\u30c8\ndp = [0 for _ in range(N)]\n# \u9ad8\u901f\u5316\u306e\u305f\u3081\u306bnumpy\u4f7f\u3046\ndp = np.array(dp)\n\n# DP\u914d\u5217\u66f4\u65b0\n\"\"\"\nTLE\u3060\u3063\u305f\u3084\u3064\nfor i in range(1, N):\n # \u6700\u5c0f\u30b3\u30b9\u30c8\u3067\u66f4\u65b0\u3059\u308b\n max_k = min([i, K]) + 1\n dp[i] = min([dp[i - k] + abs(h[i] - h[i - k]) for k in range(1, max_k)])\n\"\"\"\nfor i in range(1, N):\n # \u6700\u5c0f\u30b3\u30b9\u30c8\u3067\u66f4\u65b0\u3059\u308b\n # K\u500b\u307e\u3068\u3081\u3066\u79fb\u52d5\u30b3\u30b9\u30c8\u3092\u8a08\u7b97\u3059\u308b\u3053\u3068\u3067\u9ad8\u901f\u5316\n # \u305f\u3060\u3057\u30de\u30a4\u30ca\u30b9\u304b\u3089\u30b9\u30bf\u30fc\u30c8\u3059\u308b\u3088\u3046\u306a\u5024\u306f\u30b9\u30ad\u30c3\u30d7\u3059\u308b\n s = max(0, i - K)\n dp[i] = np.min(dp[s:i] + np.abs(h[s:i] - h[i]))\n\nprint(dp[-1])\n","change":"replace","i1":2,"i2":14,"j1":2,"j2":28,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03161","language":"Python","original_status":"Time Limit Exceeded","pass":"from math import inf\n\nn, k = map(int, input().split())\na = [int(i) for i in input().split()]\ndp = [inf for _ in range(n)]\ndp[0] = 0\nfor i in range(1, n):\n for j in range(1, k + 1):\n if i - j >= 0:\n dp[i] = min(dp[i], abs(a[i] - a[i - j]) + dp[i - j])\n\nprint(dp[-1])\n","fail":"from math import inf\n\nn, k = map(int, input().split())\na = [int(i) for i in input().split()]\ndp = [inf for _ in range(n)]\ndp[0] = 0\nfor i in range(1, n):\n for j in range(1, k + 1):\n if i - j >= 0:\n dp[i] = min(dp[i], abs(a[i] - a[i - j]) + dp[i - j])\n else:\n break\n\nprint(dp[-1])\n","change":"insert","i1":10,"i2":10,"j1":10,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03161","language":"Python","original_status":"Time Limit Exceeded","pass":"#!\/usr\/bin\/env python3\n# vim: set fileencoding=utf-8\n\n# pylint: disable=unused-import, invalid-name, missing-docstring, bad-continuation\n\n\n\"\"\"Module docstring\n\"\"\"\n\nimport sys\nfrom collections import deque\n\n\ndef solve(values, nb, max_jump_size):\n max_jump_size = min(nb, max_jump_size)\n cost_to = deque([0])\n new_cost = 0\n for i in range(1, nb):\n new_cost = min(\n cost_to[-k] + abs(values[i] - values[i - k])\n for k in range(1, max_jump_size + 1)\n if i - k >= 0\n )\n if i > max_jump_size:\n cost_to.popleft()\n cost_to.append(new_cost)\n return new_cost\n\n\ndef do_job():\n \"Do the work\"\n # first line is number of test cases\n N, K = map(int, input().split())\n values = list(map(int, input().split()))\n result = solve(values, N, K)\n print(result)\n\n\ndef print_output(testcase, result) -> None:\n \"Formats and print result\"\n if result is None:\n result = \"IMPOSSIBLE\"\n print(\"Case #{}: {}\".format(testcase + 1, result))\n\n\ndef main(argv=None):\n \"Program wrapper.\"\n if argv is None:\n argv = sys.argv[1:]\n do_job()\n return 0\n\n\nif __name__ == \"__main__\":\n import doctest\n\n doctest.testmod()\n sys.exit(main())\n","fail":"#!\/usr\/bin\/env python3\n# vim: set fileencoding=utf-8\n\n# pylint: disable=unused-import, invalid-name, missing-docstring, bad-continuation\n\n\n\"\"\"Module docstring\n\"\"\"\n\nimport sys\nfrom collections import deque\n\n\ndef solve(values, nb, max_jump_size):\n max_jump_size = min(nb, max_jump_size)\n cost_to = [0]\n for i in range(1, nb):\n new_cost = min(\n cost_to[i - k] + abs(values[i] - values[i - k])\n for k in range(1, max_jump_size + 1)\n if i - k >= 0\n )\n cost_to.append(new_cost)\n return new_cost\n\n\ndef do_job():\n \"Do the work\"\n # first line is number of test cases\n N, K = map(int, input().split())\n values = list(map(int, input().split()))\n result = solve(values, N, K)\n print(result)\n\n\ndef print_output(testcase, result) -> None:\n \"Formats and print result\"\n if result is None:\n result = \"IMPOSSIBLE\"\n print(\"Case #{}: {}\".format(testcase + 1, result))\n\n\ndef main(argv=None):\n \"Program wrapper.\"\n if argv is None:\n argv = sys.argv[1:]\n do_job()\n return 0\n\n\nif __name__ == \"__main__\":\n import doctest\n\n doctest.testmod()\n sys.exit(main())\n","change":"replace","i1":15,"i2":25,"j1":15,"j2":22,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03161","language":"Python","original_status":"Time Limit Exceeded","pass":"import sys\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef main():\n n, k = map(int, input().split())\n h = list(map(int, input().split()))\n dp = [0] * n\n dp[0] = 0\n dp[1] = abs(h[0] - h[1])\n\n for i in range(2, n):\n dp[i] = min(abs(h[i] - h[j]) + dp[j] for j in range(max(0, i - k), i))\n print(dp[n - 1])\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"import sys\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef main():\n size, jumps = map(int, input().split())\n array = list(map(int, input().split()))\n dp = [999999999] * size\n dp[0] = 0\n dp[1] = abs(array[0] - array[1])\n for i in range(2, size):\n dp[i] = min(\n abs(array[i] - array[j]) + dp[j] for j in range(max(0, i - jumps), i)\n )\n print(dp[size - 1])\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":8,"i2":17,"j1":8,"j2":18,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03161","language":"Python","original_status":"Runtime Error","pass":"N, K = map(int, input().split())\nH = list(map(int, input().split()))\ndp = [1 << 62] * N\ndp[0] = 0\nfor i in range(1, N):\n for j in range(i, min(i + 1 + K, N)):\n cost = abs(H[i - 1] - H[i + j])\n dp[i + j] = min(dp[i + j], dp[i - 1] + cost)\nprint(dp[-1])\n","fail":"N, K = map(int, input().split())\nH = list(map(int, input().split()))\ndp = [1 << 62] * N\ndp[0] = 0\nfor i in range(1, N):\n for j in range(i, min(i + K, N)):\n cost = abs(H[i - 1] - H[j])\n dp[j] = min(dp[j], dp[i - 1] + cost)\nprint(dp[-1])\n","change":"replace","i1":5,"i2":8,"j1":5,"j2":8,"error":"IndexError: list index out of range","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03161\/Python\/s787574815.py\", line 7, in \n cost = abs(H[i - 1] - H[i + j])\nIndexError: list index out of range\n","stdout":null} {"problem_id":"p03161","language":"Python","original_status":"Runtime Error","pass":"N, K = map(int, input().split())\nh = list(map(int, input().split()))\ninf = 10**9\ndp = [inf] * N\ndp[0] = 0\n\n\ndef chmin(num: int, sbn: int):\n dp[num + sbn] = min((dp[num + sbn], dp[num] + abs(h[i + sbn] - h[num])))\n\n\nfor i in range(N):\n for sbn in range(K):\n try:\n chmin(dp, i, sbn + 1)\n except IndexError:\n break\nprint(dp[-1])\n","fail":"N, K = map(int, input().split())\nh = list(map(int, input().split()))\ninf = 10**9\ndp = [inf] * N\ndp[0] = 0\n\n\ndef chmin(num: int, sbn: int):\n dp[num + sbn] = min((dp[num + sbn], dp[num] + abs(h[i + sbn] - h[num])))\n\n\nfor i in range(N):\n for sbn in range(K):\n try:\n chmin(i, sbn + 1)\n except IndexError:\n break\nprint(dp[-1])\n","change":"replace","i1":14,"i2":15,"j1":14,"j2":15,"error":"TypeError: chmin() takes 2 positional arguments but 3 were given","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03161\/Python\/s825976309.py\", line 15, in \n chmin(dp, i, sbn + 1)\nTypeError: chmin() takes 2 positional arguments but 3 were given\n","stdout":null} {"problem_id":"p03161","language":"Python","original_status":"Time Limit Exceeded","pass":"#!\/usr\/bin\/env python3\n\nN, K = list(map(int, input().split()))\nh_list = list(map(int, input().split()))\ndp_list = [float(\"inf\")] * N\ndp_list[0] = 0\n\nfor i in range(1, N):\n # j\u756a\u76ee\u306e\u8db3\u5834\u304b\u3089i\u756a\u76ee\u306e\u8db3\u5834\u306b\u98db\u3076\n min_cost = float(\"inf\")\n for j in range(max(i - K, 0), i):\n\n # j\u756a\u76ee\u306e\u8db3\u5834\u307e\u3067\u306e\u6700\u9069\u30b3\u30b9\u30c8\n cum_cost = dp_list[j]\n\n # j\u756a\u76ee\u306e\u8db3\u5834\u304b\u3089\u98db\u3093\u3060\u5834\u5408\u306e\u30b3\u30b9\u30c8\n cost = dp_list[j] + abs(h_list[j] - h_list[i])\n if cost < min_cost:\n min_cost = cost\n\n # \u6700\u9069\u30b3\u30b9\u30c8\u3067\u66f4\u65b0\n dp_list[i] = min_cost\n\nans = dp_list[-1]\nprint(ans)\n","fail":"#!\/usr\/bin\/env python3\nimport numpy as np\n\nN, K = list(map(int, input().split()))\nh_list = list(map(int, input().split()))\nh_list = np.array(h_list)\ndp_list = np.zeros(N)\ndp_list[0] = 0\n\nfor i in range(1, N):\n # j\u756a\u76ee\u306e\u8db3\u5834\u304b\u3089i\u756a\u76ee\u306e\u8db3\u5834\u306b\u98db\u3076\n\n min_j = max(i - K, 0)\n cost_list = dp_list[min_j:i] + np.abs(h_list[i] - h_list[min_j:i])\n # \u6700\u9069\u30b3\u30b9\u30c8\u3067\u66f4\u65b0\n dp_list[i] = np.min(cost_list)\n\nans = int(dp_list[-1])\nprint(ans)\n","change":"replace","i1":1,"i2":24,"j1":1,"j2":18,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03161","language":"Python","original_status":"Runtime Error","pass":"import numpy as np\n\n# \u5165\u529b\nn, k = list(map(int, input().split()))\nh = list(map(int, input().split()))\n\n# \u65b9\u91dd\n# i\u756a\u76ee\u306e\u8db3\u5834\u306b\u3044\u308b\u3068\u3044\u3046\u72b6\u614b\u306b\u5bfe\u3057\u3066\n# \u305d\u306e\u8db3\u5834\u306b\u6700\u3082\u5c11\u306a\u3044\u30b3\u30b9\u30c8\u3092\u8a18\u9332\u3059\u308b\uff0e\n\ndp = np.zeros(n)\nfor i in range(1, n):\n st = max(0, i - k)\n dp[i] = np.min(dp[st:i] + np.abs(h[i] - h[st:i]))\n\nprint(dp[n - 1])\n","fail":"import numpy as np\n\n# \u5165\u529b\nn, k = list(map(int, input().split()))\nh = np.array(list(map(int, input().split())))\n\n# \u65b9\u91dd\n# i\u756a\u76ee\u306e\u8db3\u5834\u306b\u3044\u308b\u3068\u3044\u3046\u72b6\u614b\u306b\u5bfe\u3057\u3066\n# \u305d\u306e\u8db3\u5834\u306b\u6700\u3082\u5c11\u306a\u3044\u30b3\u30b9\u30c8\u3092\u8a18\u9332\u3059\u308b\uff0e\n\ndp = np.zeros(n, dtype=np.int)\nfor i in range(1, n):\n st = max(0, i - k)\n dp[i] = np.min(dp[st:i] + np.abs(h[i] - h[st:i]))\n\nprint(dp[-1])\n","change":"replace","i1":4,"i2":16,"j1":4,"j2":16,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03161","language":"Python","original_status":"Time Limit Exceeded","pass":"#!\/usr\/bin\/env python3\n\nN, K = list(map(int, input().split()))\nh_list = list(map(int, input().split()))\ndp_list = [float(\"inf\")] * N\ndp_list[0] = 0\n\nfor i in range(1, N):\n # j\u756a\u76ee\u306e\u8db3\u5834\u304b\u3089i\u756a\u76ee\u306e\u8db3\u5834\u306b\u98db\u3076\n\n for j in range(max(i - K, 0), i + 1):\n\n # j\u756a\u76ee\u306e\u8db3\u5834\u307e\u3067\u306e\u6700\u9069\u30b3\u30b9\u30c8\n cum_cost = dp_list[j]\n\n # j\u756a\u76ee\u306e\u8db3\u5834\u304b\u3089\u98db\u3093\u3060\u5834\u5408\u306e\u30b3\u30b9\u30c8\n cost = dp_list[j] + abs(h_list[j] - h_list[i])\n\n # \u6700\u9069\u30b3\u30b9\u30c8\u3067\u66f4\u65b0\n dp_list[i] = min(dp_list[i], cost)\n\nans = dp_list[-1]\nprint(ans)\n","fail":"N, K = list(map(int, input().split()))\nh_list = list(map(int, input().split()))\ndp_list = [float(\"inf\")] * N\ndp_list[0] = 0\n\nfor i in range(1, N):\n # j\u756a\u76ee\u306e\u8db3\u5834\u304b\u3089i\u756a\u76ee\u306e\u8db3\u5834\u306b\u98db\u3076\n\n for j in range(max(i - K, 0), i + 1):\n\n # j\u756a\u76ee\u306e\u8db3\u5834\u307e\u3067\u306e\u6700\u9069\u30b3\u30b9\u30c8\n cum_cost = dp_list[j]\n\n # j\u756a\u76ee\u306e\u8db3\u5834\u304b\u3089\u98db\u3093\u3060\u5834\u5408\u306e\u30b3\u30b9\u30c8\n cost = dp_list[j] + abs(h_list[j] - h_list[i])\n\n # \u6700\u9069\u30b3\u30b9\u30c8\u3067\u66f4\u65b0\n dp_list[i] = min(dp_list[i], cost)\n\nans = dp_list[-1]\nprint(ans)\n","change":"delete","i1":0,"i2":2,"j1":0,"j2":0,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03161","language":"Python","original_status":"Time Limit Exceeded","pass":"n, k, *L = map(int, open(0).read().split())\n\n# dp = [float(\"inf\")] * n\ndp = [0] * n\n\nfor i in range(1, n):\n j = max(0, i - k)\n dp[i] = min([DP + abs(L[i] - COST) for DP, COST in zip(dp[j:i], L[j:i])])\n\nprint(dp[-1])\n","fail":"n, k, *L = map(int, open(0).read().split())\n\n# dp = [float(\"inf\")] * n\ndp = [0] * n\n\nfor i in range(1, n):\n j = max(0, i - k)\n e = L[i]\n dp[i] = min([DP + abs(e - COST) for DP, COST in zip(dp[j:i], L[j:i])])\n\nprint(dp[-1])\n","change":"replace","i1":7,"i2":8,"j1":7,"j2":9,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03161","language":"Python","original_status":"Time Limit Exceeded","pass":"# DP(\u8cb0\u3046DP)\nN, K = map(int, input().split())\nh = list(map(int, input().split()))\n\ndp = [0] * N\nfor i in range(1, N):\n dp[i] = min(dp[j] + abs(h[i] - h[j]) for j in range(max(0, i - K), i))\nprint(dp[N - 1])\n","fail":"# DP(\u8cb0\u3046DP)\ndef main():\n N, K = map(int, input().split())\n h = list(map(int, input().split()))\n\n dp = [0] * N\n for i in range(1, N):\n dp[i] = min(dp[j] + abs(h[i] - h[j]) for j in range(max(0, i - K), i))\n print(dp[N - 1])\n\n\nmain()\n","change":"replace","i1":1,"i2":8,"j1":1,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03161","language":"Python","original_status":"Time Limit Exceeded","pass":"n, k = map(int, input().split())\nh = tuple(map(int, input().split()))\n\nINF = 10**10\ndp = [INF] * n\ndp[0] = 0\n# dp[i] = (\u8db3\u5834i\u306b\u305f\u3069\u308a\u7740\u3044\u305f\u6642\u70b9\u3067\u306e\u30b3\u30b9\u30c8\u306e\u6700\u5c0f\u5024)\n\nfor i in range(n):\n for j in range(i + 1, min(i + k + 1, n)):\n if dp[j] > dp[i] + abs(h[j] - h[i]):\n dp[j] = dp[i] + abs(h[j] - h[i])\n\nprint(dp[n - 1])\n","fail":"n, k = map(int, input().split())\nh = tuple(map(int, input().split()))\n\nINF = 10**10\ndp = [INF] * n\ndp[0] = 0\n# dp[i] = (\u8db3\u5834i\u306b\u305f\u3069\u308a\u7740\u3044\u305f\u6642\u70b9\u3067\u306e\u30b3\u30b9\u30c8\u306e\u6700\u5c0f\u5024)\n\nfor i in range(1, n):\n dp[i] = min(dp[j] + abs(h[j] - h[i]) for j in range(max(0, i - k), i))\n\nprint(dp[n - 1])\n","change":"replace","i1":8,"i2":12,"j1":8,"j2":10,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03161","language":"Python","original_status":"Time Limit Exceeded","pass":"N, K = map(int, input().split())\nh = [0] + list(map(int, input().split()))\ndp = [float(\"inf\") for _ in range(N + 1)]\n\ndp[1] = 0\nfor i in range(2, N + 1):\n dp[i] = min(dp[j] + abs(h[i] - h[j]) for j in range(max(0, i - K), i))\n\nprint(dp[-1])\n","fail":"def main():\n N, K = map(int, input().split())\n h = [0] + list(map(int, input().split()))\n dp = [float(\"inf\") for _ in range(N + 1)]\n\n dp[1] = 0\n for i in range(2, N + 1):\n dp[i] = min(dp[j] + abs(h[i] - h[j]) for j in range(max(0, i - K), i))\n\n print(dp[-1])\n\n\nmain()\n","change":"replace","i1":0,"i2":9,"j1":0,"j2":13,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03161","language":"Python","original_status":"Runtime Error","pass":"N, K = map(int, input().split())\nhlist = list(map(int, input().split())) + [0] * K\ninf = float(\"inf\")\ndp = [inf] * (N * K)\n\n\ndef abs_sbn(a, b):\n return abs(hlist[b] - hlist[a])\n\n\ndp[0] = 0\nfor i in range(N):\n for j in range(1, K + 1):\n dp[i + j] = min(dp[i + j], dp[i] + abs_sbn(i, i + j))\n\nprint(dp[N - 1])\n","fail":"N, K = map(int, input().split())\nhlist = list(map(int, input().split())) + [0] * (K + 2)\ninf = float(\"inf\")\ndp = [inf] * (N * K + 2)\n\n\ndef abs_sbn(a, b):\n return abs(hlist[b] - hlist[a])\n\n\ndp[0] = 0\nfor i in range(N):\n for j in range(1, K + 1):\n dp[i + j] = min(dp[i + j], dp[i] + abs_sbn(i, i + j))\n\nprint(dp[N - 1])\n","change":"replace","i1":1,"i2":4,"j1":1,"j2":4,"error":"0","stderr":null,"stdout":30.0} {"problem_id":"p03162","language":"Python","original_status":"Runtime Error","pass":"# dp[i\u65e5\u76ee][i-1\u65e5\u76ee\u306b\u3069\u308c\u3092\u9078\u3093\u3060\u304b] = i\u65e5\u76ee\u307e\u3067\u306e\u6700\u5927\u306e\u5e78\u798f\u5ea6\nn = int(input())\na, b, c = [0 for _ in range(n)], [0 for _ in range(n)], [0 for _ in range(n)]\nfor i in range(n):\n a[i], b[i], c[i] = map(int, input().split())\n\ndp = [[-1 for _ in range(3)] for _ in range(n + 1)]\nfor i in range(3):\n dp[0][i] = 0\n\n\ndef rec(i, choice):\n if dp[i][choice] > 0:\n return dp[i][choice]\n if i == n:\n return 0\n ret = 0 # \u30eb\u30fc\u30d7\u3058\u3083\u306a\u304f\u3066if\u3067\u3084\u3063\u3066\u308b\u306e\u3067\u305d\u308c\u305e\u308c\u78ba\u5b9f\u306b\u5927\u304d\u3044\u5024\u304c\u5165\u308b\uff08\u306e\u3067\u66f4\u65b0\u3059\u308b\u5fc5\u8981\u304c\u306a\u3044\uff09\n if choice == 0:\n ret = a[i] + max(rec(i + 1, 1), rec(i + 1, 2))\n elif choice == 1:\n ret = b[i] + max(rec(i + 1, 0), rec(i + 1, 2))\n elif choice == 2:\n ret = c[i] + max(rec(i + 1, 0), rec(i + 1, 1))\n dp[i][choice] = ret\n return ret\n\n\nprint(max(rec(0, 0), rec(0, 1), rec(0, 2)))\n","fail":"# dp[i\u65e5\u76ee][i-1\u65e5\u76ee\u306b\u3069\u308c\u3092\u9078\u3093\u3060\u304b] = i\u65e5\u76ee\u307e\u3067\u306e\u6700\u5927\u306e\u5e78\u798f\u5ea6\nimport sys\n\nsys.setrecursionlimit(10**8)\n\nn = int(input())\na, b, c = [0 for _ in range(n)], [0 for _ in range(n)], [0 for _ in range(n)]\nfor i in range(n):\n a[i], b[i], c[i] = map(int, input().split())\n\ndp = [[-1 for _ in range(3)] for _ in range(n + 1)]\nfor i in range(3):\n dp[0][i] = 0\n\n\ndef rec(i, choice):\n if dp[i][choice] > 0:\n return dp[i][choice]\n if i == n:\n return 0\n ret = 0 # \u30eb\u30fc\u30d7\u3058\u3083\u306a\u304f\u3066if\u3067\u3084\u3063\u3066\u308b\u306e\u3067\u305d\u308c\u305e\u308c\u78ba\u5b9f\u306b\u5927\u304d\u3044\u5024\u304c\u5165\u308b\uff08\u306e\u3067\u66f4\u65b0\u3059\u308b\u5fc5\u8981\u304c\u306a\u3044\uff09\n if choice == 0:\n ret = a[i] + max(rec(i + 1, 1), rec(i + 1, 2))\n elif choice == 1:\n ret = b[i] + max(rec(i + 1, 0), rec(i + 1, 2))\n elif choice == 2:\n ret = c[i] + max(rec(i + 1, 0), rec(i + 1, 1))\n dp[i][choice] = ret\n return ret\n\n\nprint(max(rec(0, 0), rec(0, 1), rec(0, 2)))\n","change":"insert","i1":1,"i2":1,"j1":1,"j2":5,"error":0,"stderr":null,"stdout":210} {"problem_id":"p03163","language":"Python","original_status":"Time Limit Exceeded","pass":"import sys\n\ninput = sys.stdin.readline\n\n\ndef chmax(a, b):\n if a > b:\n return a\n else:\n return b\n\n\ndef main():\n N, W = map(int, input().split())\n wv = [None] * N\n for i in range(N):\n wv[i] = tuple(map(int, input().split()))\n\n dp = [[0] * (W + 1) for _ in range(N + 1)]\n for i, (w, v) in enumerate(wv, start=1):\n dp_i = dp[i]\n dp_im = dp[i - 1]\n for j in range(1, W + 1):\n if j < w:\n dp_i[j] = dp_im[j]\n else:\n dp_i[j] = chmax(dp_im[j - w] + v, dp_im[j])\n\n ans = dp[-1][-1]\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"import sys\n\nimport numba as nb\nimport numpy as np\n\ninput = sys.stdin.readline\n\n\n@nb.njit(\"i8(i8, i8)\")\ndef chmax(a, b):\n if a > b:\n return a\n else:\n return b\n\n\n@nb.njit(\"i8(i8,i8,i8[:,:])\")\ndef solve(N, W, wv):\n dp = [[0] * (W + 1) for _ in range(N + 1)]\n for i in range(1, N + 1):\n w, v = wv[i - 1]\n for j in range(1, W + 1):\n if j < w:\n dp[i][j] = dp[i - 1][j]\n else:\n dp[i][j] = chmax(dp[i - 1][j - w] + v, dp[i - 1][j])\n return dp[-1][-1]\n\n\ndef main():\n N, W = map(int, input().split())\n wv = np.zeros(shape=(N, 2), dtype=np.int64)\n for i in range(N):\n w, v = map(int, input().split())\n wv[i] = w, v\n\n ans = solve(N, W, wv)\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":1,"i2":29,"j1":1,"j2":37,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03163","language":"Python","original_status":"Runtime Error","pass":"N, W = map(int, input().split())\nwv = []\nfor _ in range(N):\n wv.append(list(map(int, input().split())))\n# print(wv)\ndp = [[0] * 110 for _ in range(100100)]\n\n\nfor i in range(N):\n for sum_w in range(W + 1):\n\n if wv[i][0] <= sum_w:\n dp[i + 1][sum_w] = max(dp[i + 1][sum_w], dp[i][sum_w - wv[i][0]] + wv[i][1])\n\n dp[i + 1][sum_w] = max(dp[i + 1][sum_w], dp[i][sum_w])\nprint(dp[N][W])\n","fail":"N, W = map(int, input().split())\nwv = []\nfor _ in range(N):\n wv.append(list(map(int, input().split())))\n# print(wv)\ndp = [[0] * 100100 for _ in range(110)]\n\n\nfor i in range(N):\n for sum_w in range(W + 1):\n\n if wv[i][0] <= sum_w:\n dp[i + 1][sum_w] = max(dp[i + 1][sum_w], dp[i][sum_w - wv[i][0]] + wv[i][1])\n\n dp[i + 1][sum_w] = max(dp[i + 1][sum_w], dp[i][sum_w])\nprint(dp[N][W])\n","change":"replace","i1":5,"i2":6,"j1":5,"j2":6,"error":"1","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03163\/Python\/s607479372.py\", line 6, in \n dp = [[0] * 110 for _ in range(100100)]\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03163\/Python\/s607479372.py\", line 6, in \n dp = [[0] * 110 for _ in range(100100)]\nMemoryError\n","stdout":null} {"problem_id":"p03163","language":"Python","original_status":"Time Limit Exceeded","pass":"import sys\n\ninput = sys.stdin.readline\n\n\ndef main():\n N, W = map(int, input().split())\n wv = [None] * N\n for i in range(N):\n wv[i] = tuple(map(int, input().split()))\n\n dp = [[0] * (W + 1) for _ in range(N + 1)]\n for i, (w, v) in enumerate(wv, start=1):\n dp_i = dp[i]\n dp_im = dp[i - 1]\n for j in range(1, W + 1):\n if j < w:\n dp_i[j] = dp_im[j]\n elif dp_im[j - w] + v > dp_im[j]:\n dp_i[j] = dp_im[j - w] + v\n else:\n dp_i[j] = dp_im[j]\n\n ans = dp[-1][-1]\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"import sys\n\ninput = sys.stdin.readline\n\n\ndef main():\n N, W = map(int, input().split())\n wv = [None] * N\n for i in range(N):\n wv[i] = tuple(map(int, input().split()))\n\n dp = [[0] * (W + 1) for _ in range(N + 1)]\n for i, (w, v) in enumerate(wv, start=1):\n dp_i = dp[i]\n dp_im = dp[i - 1]\n for j in range(1, W + 1):\n if j < w:\n dp_i[j] = dp_im[j]\n else:\n a = dp_im[j - w] + v\n b = dp_im[j]\n if a > b:\n dp_i[j] = a\n else:\n dp_i[j] = b\n\n ans = dp[-1][-1]\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":18,"i2":22,"j1":18,"j2":25,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03163","language":"Python","original_status":"Time Limit Exceeded","pass":"import numpy as np\n\nN, W = map(int, input().split())\ndp = np.full((N + 1, W + 1), -np.inf, dtype=np.int64)\ndp[0][0] = 0\nfor i in range(N):\n w, v = map(int, input().split())\n for j in range(W + 1):\n dp[i + 1][j] = max(dp[i + 1][j], dp[i][j])\n if j + w <= W:\n dp[i + 1][j + w] = max(dp[i + 1][j + w], dp[i][j] + v)\nprint(max(dp[-1]))\n","fail":"import numpy as np\nfrom numba import njit, i8\n\n\n@njit(i8(i8, i8, i8[:], i8[:]), cache=True)\ndef solve(N, W, weights, values):\n dp = np.full((N + 1, W + 1), 0, dtype=np.int64)\n dp[0][0] = 0\n for i in range(N):\n for j in range(W + 1):\n dp[i + 1][j] = max(dp[i + 1][j], dp[i][j])\n if j + weights[i] <= W:\n dp[i + 1][j + weights[i]] = max(\n dp[i + 1][j + weights[i]], dp[i][j] + values[i]\n )\n return dp[-1].max()\n\n\nN, W = map(int, input().split())\nweights = np.zeros(N, dtype=np.int64)\nvalues = np.zeros(N, dtype=np.int64)\nfor i in range(N):\n w, v = map(int, input().split())\n weights[i] = w\n values[i] = v\nprint(solve(N, W, weights, values))\n","change":"replace","i1":1,"i2":12,"j1":1,"j2":26,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03163","language":"Python","original_status":"Time Limit Exceeded","pass":"import numpy as np\n\nn, w = map(int, input().strip().split())\ndata = [list(map(int, input().strip().split())) for _ in range(n)]\n\n# i\u756a\u76ee\u306b\u91cd\u3055\u304cj\u4ee5\u4e0b\u3068\u306a\u308b\u3088\u3046\u306b\u9078\u3093\u3060\u3068\u304d\u306e\u4fa1\u5024\u306e\u7dcf\u548c\u306e\u6700\u5927\u5024\ndp = np.zeros((n, w + 1), dtype=np.int64)\n\nfor i in range(0, n):\n for j in range(w + 1):\n # i \u756a\u76ee\u306e\u54c1\u7269\u306e\u91cd\u3055\u3068\u4fa1\u5024\n wi, vi = data[i]\n if i == 0:\n take = vi if j - wi >= 0 else 0\n miss = 0\n dp[i][j] = max(take, miss)\n else:\n # i\u756a\u76ee\u306e\u54c1\u7269\u3092\u5165\u308c\u308b\u5834\u5408\n take = dp[i - 1][j - wi] + vi if j - wi >= 0 else 0\n # \u5165\u308c\u306a\u3044\u5834\u5408\n miss = dp[i - 1][j]\n dp[i][j] = max(take, miss)\n\nprint(np.max(dp[n - 1]))\n","fail":"n, w = map(int, input().strip().split())\ndata = [list(map(int, input().strip().split())) for _ in range(n)]\n\n# i\u756a\u76ee\u306b\u91cd\u3055\u304cj\u4ee5\u4e0b\u3068\u306a\u308b\u3088\u3046\u306b\u9078\u3093\u3060\u3068\u304d\u306e\u4fa1\u5024\u306e\u7dcf\u548c\u306e\u6700\u5927\u5024\ndp = [[0] * (w + 1) for _ in range(n)]\n\nfor i in range(0, n):\n for j in range(w + 1):\n # i \u756a\u76ee\u306e\u54c1\u7269\u306e\u91cd\u3055\u3068\u4fa1\u5024\n wi, vi = data[i]\n if i == 0:\n take = vi if j - wi >= 0 else 0\n miss = 0\n dp[i][j] = max(take, miss)\n else:\n # i\u756a\u76ee\u306e\u54c1\u7269\u3092\u5165\u308c\u308b\u5834\u5408\n take = dp[i - 1][j - wi] + vi if j - wi >= 0 else 0\n # \u5165\u308c\u306a\u3044\u5834\u5408\n miss = dp[i - 1][j]\n dp[i][j] = max(take, miss)\n\nprint(max(dp[n - 1]))\n","change":"replace","i1":0,"i2":24,"j1":0,"j2":22,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03163","language":"Python","original_status":"Time Limit Exceeded","pass":"import numpy as np\n\nn, max_weight = map(int, input().split())\nWV = np.array([input().split() for _ in range(n)], np.int64)\n\nW, V = zip(*WV)\ndp = np.zeros((n + 1, max_weight + 1), np.int64)\n\n# O(NW)\nfor i in range(n):\n for w in range(1, max_weight + 1):\n if w >= W[i]:\n dp[i + 1, w] = max(dp[i, w], dp[i, w - W[i]] + V[i])\n else:\n dp[i + 1, w] = dp[i, w]\n\nprint(dp[n, max_weight])\n","fail":"n, max_weight = map(int, input().split())\nWV = [list(map(int, input().split())) for _ in range(n)]\nW, V = zip(*WV)\ndp = list([0] * (max_weight + 1) for _ in range(n + 1))\nfor i in range(n):\n for w in range(1, max_weight + 1):\n if w >= W[i]:\n dp[i + 1][w] = max(dp[i][w], dp[i][w - W[i]] + V[i])\n else:\n dp[i + 1][w] = dp[i][w]\n\nprint(dp[n][max_weight])\n","change":"replace","i1":0,"i2":17,"j1":0,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03163","language":"Python","original_status":"Time Limit Exceeded","pass":"def knapsack1(weight_value, w):\n cur = [0] * (w + 1)\n nxt = cur.copy()\n\n for weight, value in weight_value:\n for i in range(1, weight):\n nxt[i] = cur[i]\n for i in range(weight, w + 1):\n nxt[i] = max(cur[i], cur[i - weight] + value)\n cur, nxt = nxt, cur\n return cur[w]\n\n\ndef main():\n n, w = [int(x) for x in input().split()]\n weight_value = [None] * n\n for i in range(n):\n weight_value[i] = [int(x) for x in input().split()]\n return knapsack1(weight_value, w)\n\n\nprint(main())\n","fail":"def knapsack1(weight_value, w):\n cur = [0] * (w + 1)\n nxt = [0] * (w + 1)\n\n for weight, value in weight_value:\n for i in range(1, weight):\n nxt[i] = cur[i]\n for i in range(weight, w + 1):\n nxt[i] = max(cur[i], cur[i - weight] + value)\n cur, nxt = nxt, cur\n return cur[w]\n\n\ndef main():\n n, w = [int(x) for x in input().split()]\n weight_value = [None] * n\n for i in range(n):\n weight_value[i] = [int(x) for x in input().split()]\n return knapsack1(weight_value, w)\n\n\nprint(main())\n","change":"replace","i1":2,"i2":3,"j1":2,"j2":3,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03163","language":"Python","original_status":"Time Limit Exceeded","pass":"\"\"\"\nAtCoder Educational DP Contest\nhttps:\/\/atcoder.jp\/contests\/dp\/tasks\/dp_d\n\nD - Knapsack 1\n\"\"\"\nINF = 100000007\n\n\ndef solve(wv_pairs):\n dp = [0] * (W + 1)\n for i in range(N):\n w_i, v_i = wv_pairs[i]\n for ww in range(W, w_i - 1, -1):\n dp[ww] = max(dp[ww], dp[ww - w_i] + v_i)\n return max(dp[ww] for ww in range(W + 1))\n\n\nN, W = map(int, input().split())\npairs = [[int(s) for s in input().split()] for _ in range(N)]\nres = solve(pairs)\nprint(res)\n","fail":"\"\"\"\nAtCoder Educational DP Contest\nhttps:\/\/atcoder.jp\/contests\/dp\/tasks\/dp_d\n\nD - Knapsack 1\n\"\"\"\n\n\ndef solve(wv_pairs):\n dp = [0] * (W + 1)\n for i in range(N):\n w_i, v_i = wv_pairs[i]\n for ww in range(W, w_i - 1, -1):\n dp[ww] = max(dp[ww], dp[ww - w_i] + v_i)\n return max(dp)\n\n\nN, W = map(int, input().split())\npairs = [[int(s) for s in input().split()] for _ in range(N)]\nres = solve(pairs)\nprint(res)\n","change":"replace","i1":6,"i2":16,"j1":6,"j2":15,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03163","language":"Python","original_status":"Time Limit Exceeded","pass":"N, W = map(int, input().split())\ngoods = []\nfor _ in range(N):\n goods.append(tuple(map(int, input().split())))\n\ntable = [[0] * (W + 1) for _ in range(N + 1)]\nfor n in range(N):\n for w in range(W + 1):\n addn = table[n][w - goods[n][0]] + goods[n][1] if w - goods[n][0] >= 0 else 0\n table[n + 1][w] = max(table[n][w], addn)\nprint(table[N][W])\n","fail":"import numpy as np\n\nN, W = map(int, input().split())\ngoods = [tuple(map(int, input().split())) for _ in range(N)]\n\ntable = np.zeros((N + 1, W + 1), dtype=np.int64)\nfor n in range(N):\n tmp = np.zeros(W + 1, dtype=np.int64)\n tmp[goods[n][0] :] = table[n][: W + 1 - goods[n][0]] + goods[n][1]\n table[n + 1] = np.maximum(table[n], tmp)\nprint(table[N][W])\n","change":"replace","i1":0,"i2":10,"j1":0,"j2":10,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03163","language":"Python","original_status":"Time Limit Exceeded","pass":"import numpy as np\n\n# \u5165\u529b\nn, w = map(int, input().split())\nwvList = []\nwv = np.array([list(map(int, input().split())) for i in range(n)])\n\n# \u8003\u3048\u308bDP\u30c6\u30fc\u30d6\u30eb\u306f\n# \u91cd\u3055\u306e\u7dcf\u548c\u3068\u4f7f\u3046\u8377\u7269\u306b\u95a2\u3059\u308b\u3082\u306e\n# \u884c\u304c\u91cd\u3055\u306e\u4e0a\u9650\n# \u5217\u304c\u4f7f\u3048\u308b\u8377\u7269\u306e\u6570\u306b\u76f8\u5f53\ndp = np.zeros((w + 1, n + 1), dtype=np.int)\nfor i in range(1, n + 1):\n # \u66f4\u65b0\u306e\u767a\u60f3(w\u306b\u610f\u5473\u306f\u306a\u3044)\n # \u4f7f\u3048\u308b\u8377\u7269\u304c\u5897\u3048\u305f\u304c\uff0c\u5229\u7528\u306f\u3057\u306a\u3044\n # dp[w, i] = dp[w, i - 1]\n # \u8377\u7269\u3092\u65b0\u3057\u304f\u8a31\u53ef\u3055\u308c\u305f\u8377\u7269\u3092\u4f7f\u3046\n # dp[w, i] = dp[w - wNew, i-1] + newValue\n # \u3053\u306e\u3046\u3061\u306e\u4fa1\u5024\u306e\u5927\u304d\u3044\u65b9\u3092\u4f7f\u3046\n dp[:, i] = dp[:, i - 1]\n wNew, vNew = wv[i - 1, 0], wv[i - 1, 1]\n dp[wNew:, :] = np.fmax(dp[wNew:, :], vNew + dp[:-wNew, :])\n\nprint(dp[w, n])\n","fail":"import numpy as np\n\n\ndef main():\n N, W = list(map(int, input().split(\" \")))\n items = np.array([list(map(int, input().split(\" \"))) for _ in range(N)])\n dp = np.zeros((N, W + 1))\n dp[0, items[0, 0] :] = items[0, 1]\n for n in range(1, N):\n weight, value = items[n, 0], items[n, 1]\n dp[n, :] = dp[n - 1, :]\n dp[n, weight:] = np.fmax(dp[n, weight:], value + dp[n - 1, :(-weight)])\n print(int(dp[N - 1, W]))\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":2,"i2":24,"j1":2,"j2":17,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03163","language":"Python","original_status":"Time Limit Exceeded","pass":"def main():\n N, W = map(int, input().split())\n wl = []\n vl = []\n for _ in range(N):\n w, v = map(int, input().split())\n wl.append(w)\n vl.append(v)\n dp = [[0] * (W + 1) for _ in range(N + 1)]\n for i in range(N):\n for j in range(W + 1):\n if wl[i] > j:\n dp[i + 1][j] = dp[i][j]\n else:\n dp[i + 1][j] = max(dp[i][j], dp[i][j - wl[i]] + vl[i])\n print(dp[N][W])\n\n\nmain()\n","fail":"def main():\n N, W = map(int, input().split())\n WV = []\n for _ in range(N):\n w, v = map(int, input().split())\n WV.append((w, v))\n dp = [[0] * (W + 1) for _ in range(N + 1)]\n for i in range(N):\n for j in range(W + 1):\n if j >= WV[i][0]:\n dp[i + 1][j] = max(dp[i][j], dp[i][j - WV[i][0]] + WV[i][1])\n else:\n dp[i + 1][j] = dp[i][j]\n print(dp[-1][-1])\n\n\nmain()\n","change":"replace","i1":2,"i2":16,"j1":2,"j2":14,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03163","language":"Python","original_status":"Time Limit Exceeded","pass":"#!\/usr\/bin\/env python3\n# vim: set fileencoding=utf-8\n\n# pylint: disable=unused-import, invalid-name, missing-docstring, bad-continuation\n\n\n\"\"\"Module docstring\n\"\"\"\n\nimport sys\n\nEMPTY = (0, 0, frozenset())\n\n\ndef solve(values, _nb, max_capacity):\n dp = [0] * (max_capacity + 1)\n for w, v in values:\n # dp = dp[:w] + [max(dp[j], dp[j - w] + v) for j in range(w, max_capacity + 1)]\n dp[w:] = [max(dpj, dpjw + v) for dpj, dpjw in zip(dp[w:], dp[:-w])]\n return dp[-1]\n\n\ndef solve_slow(values, nb, max_capacity):\n dp = [[0 for _ in range(max_capacity + 1)] for _ in range(nb + 1)]\n for i in range(1, nb + 1):\n w, v = values[i - 1]\n for j in range(1, max_capacity + 1):\n if w <= j:\n dp[i][j] = max(dp[i - 1][j], dp[i - 1][j - w] + v)\n else:\n dp[i][j] = dp[i - 1][j]\n # print(\"\\\\n\".join(map(str, dp)))\n return dp[nb][max_capacity]\n\n\ndef do_job():\n \"Do the work\"\n # first line is number of test cases\n N, W = map(int, input().split())\n values = []\n for _ in range(N):\n values.append(list(map(int, input().split())))\n result = solve(values, N, W)\n print(result)\n\n\ndef print_output(testcase, result) -> None:\n \"Formats and print result\"\n if result is None:\n result = \"IMPOSSIBLE\"\n print(\"Case #{}: {}\".format(testcase + 1, result))\n\n\ndef main(argv=None):\n \"Program wrapper.\"\n if argv is None:\n argv = sys.argv[1:]\n do_job()\n return 0\n\n\nif __name__ == \"__main__\":\n import doctest\n\n doctest.testmod()\n sys.exit(main())\n","fail":"# DP\ndef main():\n N, W = map(int, input().split())\n\n dp = [-1] * (W + 1)\n dp[0] = 0\n for _ in range(N):\n w, v = map(int, input().split())\n for i in range(W - w, -1, -1):\n if dp[i] == -1:\n continue\n if dp[i + w] < dp[i] + v:\n dp[i + w] = dp[i] + v\n print(max(dp))\n\n\nmain()\n","change":"replace","i1":0,"i2":66,"j1":0,"j2":17,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03163","language":"Python","original_status":"Time Limit Exceeded","pass":"#!\/usr\/bin\/env python3\n# vim: set fileencoding=utf-8\n\n# pylint: disable=unused-import, invalid-name, missing-docstring, bad-continuation\n\n\n\"\"\"Module docstring\n\"\"\"\n\nimport sys\n\nEMPTY = (0, 0, frozenset())\n\n\ndef solve(values, _nb, max_capacity):\n dp = [0] * (max_capacity + 1)\n for w, v in values:\n for j in range(max_capacity, w - 1, -1):\n if dp[j] < dp[j - w] + v:\n dp[j] = dp[j - w] + v\n return dp[max_capacity]\n\n\ndef solve_better(values, _nb, max_capacity):\n dp = [0] * (max_capacity + 1)\n for w, v in values:\n # dp = dp[:w] + [max(dp[j], dp[j - w] + v) for j in range(w, max_capacity + 1)]\n dp[w:] = [max(dpj, dpjw + v) for dpj, dpjw in zip(dp[w:], dp[:-w])]\n return dp[max_capacity]\n\n\ndef solve_slow(values, nb, max_capacity):\n dp = [[0 for _ in range(max_capacity + 1)] for _ in range(nb + 1)]\n for i in range(1, nb + 1):\n w, v = values[i - 1]\n for j in range(1, max_capacity + 1):\n if w <= j:\n dp[i][j] = max(dp[i - 1][j], dp[i - 1][j - w] + v)\n else:\n dp[i][j] = dp[i - 1][j]\n # print(\"\\\\n\".join(map(str, dp)))\n return dp[nb][max_capacity]\n\n\ndef do_job():\n \"Do the work\"\n # first line is number of test cases\n N, W = map(int, input().split())\n values = []\n for _ in range(N):\n values.append(list(map(int, input().split())))\n result = solve(values, N, W)\n print(result)\n\n\ndef print_output(testcase, result) -> None:\n \"Formats and print result\"\n if result is None:\n result = \"IMPOSSIBLE\"\n print(\"Case #{}: {}\".format(testcase + 1, result))\n\n\ndef main(argv=None):\n \"Program wrapper.\"\n if argv is None:\n argv = sys.argv[1:]\n do_job()\n return 0\n\n\nif __name__ == \"__main__\":\n import doctest\n\n doctest.testmod()\n sys.exit(main())\n","fail":"#!\/usr\/bin\/env python3\n# vim: set fileencoding=utf-8\n\n# pylint: disable=unused-import, invalid-name, missing-docstring, bad-continuation\n\n\n\"\"\"Module docstring\n\"\"\"\n\nimport sys\n\nEMPTY = (0, 0, frozenset())\n\n\ndef solve(values, _nb, max_capacity):\n dp = [0] * (max_capacity + 1)\n for w, v in values:\n for j in range(max_capacity, w - 1, -1):\n tmp = dp[j - w] + v\n if dp[j] < tmp:\n dp[j] = tmp\n return dp[max_capacity]\n\n\ndef solve_better(values, _nb, max_capacity):\n dp = [0] * (max_capacity + 1)\n for w, v in values:\n # dp = dp[:w] + [max(dp[j], dp[j - w] + v) for j in range(w, max_capacity + 1)]\n dp[w:] = [max(dpj, dpjw + v) for dpj, dpjw in zip(dp[w:], dp[:-w])]\n return dp[max_capacity]\n\n\ndef solve_slow(values, nb, max_capacity):\n dp = [[0 for _ in range(max_capacity + 1)] for _ in range(nb + 1)]\n for i in range(1, nb + 1):\n w, v = values[i - 1]\n for j in range(1, max_capacity + 1):\n if w <= j:\n dp[i][j] = max(dp[i - 1][j], dp[i - 1][j - w] + v)\n else:\n dp[i][j] = dp[i - 1][j]\n # print(\"\\\\n\".join(map(str, dp)))\n return dp[nb][max_capacity]\n\n\ndef do_job():\n \"Do the work\"\n # first line is number of test cases\n N, W = map(int, input().split())\n values = []\n for _ in range(N):\n values.append(list(map(int, input().split())))\n result = solve(values, N, W)\n print(result)\n\n\ndef print_output(testcase, result) -> None:\n \"Formats and print result\"\n if result is None:\n result = \"IMPOSSIBLE\"\n print(\"Case #{}: {}\".format(testcase + 1, result))\n\n\ndef main(argv=None):\n \"Program wrapper.\"\n if argv is None:\n argv = sys.argv[1:]\n do_job()\n return 0\n\n\nif __name__ == \"__main__\":\n import doctest\n\n doctest.testmod()\n sys.exit(main())\n","change":"replace","i1":18,"i2":20,"j1":18,"j2":21,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03163","language":"Python","original_status":"Time Limit Exceeded","pass":"import sys\n\n\ndef main():\n input = sys.stdin.readline\n\n N, W = map(int, input().split())\n dp = [0] * (W + 1)\n\n WV = (map(int, input().split()) for _ in range(N))\n\n for w, v in WV:\n for j in range(W, w - 1, -1):\n dp[j] = max(dp[j], dp[j - w] + v)\n\n print(dp[-1])\n\n\nmain()\n","fail":"import sys\n\n\ndef main():\n input = sys.stdin.readline\n\n N, W = map(int, input().split())\n dp = [0] * (W + 1)\n\n WV = (map(int, input().split()) for _ in range(N))\n\n for w, v in WV:\n for j in range(W, w - 1, -1):\n tmp = dp[j - w] + v\n if tmp > dp[j]:\n dp[j] = tmp\n\n print(dp[-1])\n\n\nmain()\n","change":"replace","i1":13,"i2":14,"j1":13,"j2":16,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03163","language":"Python","original_status":"Time Limit Exceeded","pass":"# DP\nN, W = map(int, input().split())\n\ndp = [-1] * (W + 1)\ndp[0] = 0\nfor _ in range(N):\n w, v = map(int, input().split())\n for i in range(W - w, -1, -1):\n if dp[i] == -1:\n continue\n if dp[i + w] < dp[i] + v:\n dp[i + w] = dp[i] + v\nprint(max(dp))\n","fail":"# DP\ndef main():\n N, W = map(int, input().split())\n\n dp = [-1] * (W + 1)\n dp[0] = 0\n for _ in range(N):\n w, v = map(int, input().split())\n for i in range(W - w, -1, -1):\n if dp[i] == -1:\n continue\n if dp[i + w] < dp[i] + v:\n dp[i + w] = dp[i] + v\n print(max(dp))\n\n\nmain()\n","change":"replace","i1":1,"i2":13,"j1":1,"j2":17,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03163","language":"Python","original_status":"Runtime Error","pass":"def knapsack1(weight_value, w):\n cur = [0] * (w + 1)\n nxt = cur.copy()\n\n for weight, value in weight_value:\n for i in range(1, weight):\n nxt[i] = cur[i]\n for i in range(weight, w + 1):\n nxt[i] = max(cur[i], cur[i - weight] + value)\n cur, nxt = nxt, cur\n return cur[w]\n\n\ndef main():\n n, w = [int(x) for x in input().split()]\n weight_value = [None] * n\n for i in range(n):\n weight_value[i] = [int(x) for x in input().split()]\n return knapsack1(weight_value, w)\n\n\nprint(main())\n","fail":"def knapsack1(weight_value, w):\n cur = [0] * (w + 1)\n\n for weight, value in weight_value:\n for i in reversed(range(weight, w + 1)):\n cur[i] = max(cur[i], cur[i - weight] + value)\n\n return cur[w]\n\n\ndef main():\n n, w = [int(x) for x in input().split()]\n weight_value = [None] * n\n for i in range(n):\n weight_value[i] = [int(x) for x in input().split()]\n return knapsack1(weight_value, w)\n\n\nprint(main())\n","change":"replace","i1":2,"i2":10,"j1":2,"j2":7,"error":"0","stderr":null,"stdout":90.0} {"problem_id":"p03164","language":"Python","original_status":"Runtime Error","pass":"n, w = [int(i) for i in input().split()]\na = [0] * (w + 1)\nfor _ in range(n):\n b, c = [int(i) for i in input().split()]\n for i in reversed(range(w + 1)):\n if i + b >= w + 1:\n continue\n d = i + b\n a[d] = max(a[d], a[i] + c)\nprint(a[-1])\n","fail":"n, w = [int(i) for i in input().split()]\ndp = [10**18] * (10**5 + 1)\ndp[0] = 0\nfor _ in range(n):\n u, v = [int(i) for i in input().split()]\n for i in reversed(range(len(dp))):\n if i + v < len(dp) and dp[i] + u <= w:\n dp[i + v] = min(dp[i + v], dp[i] + u)\nans = 0\nfor i, j in enumerate(dp):\n if j != 10**18:\n ans = max(ans, i)\nprint(ans)\n","change":"replace","i1":1,"i2":10,"j1":1,"j2":13,"error":"0","stderr":null,"stdout":90.0} {"problem_id":"p03164","language":"Python","original_status":"Runtime Error","pass":"n, w = map(int, input().split())\ngoods = [list(map(int, input().split())) for _ in range(n)]\ndp = [[0] * (w + 1) for _ in range(n)]\nfor i in range(n):\n for j in range(w + 1):\n if 0 <= j - goods[i][0]:\n dp[i][j] = max(dp[i - 1][j], dp[i - 1][j - goods[i][0]] + goods[i][1])\n dp[i][j] = max(dp[i][j], dp[i - 1][j])\nprint(dp[n - 1][w])\n","fail":"n, w = map(int, input().split())\ngoods = [list(map(int, input().split())) for _ in range(n)]\ndp = [[float(\"INF\")] * (10**5 + 1) for _ in range(n + 1)]\ndp[0][0] = 0\n\nfor i in range(n):\n for j in range(10**5 + 1):\n if 0 <= j - goods[i][1]:\n dp[i + 1][j] = min(dp[i + 1][j], dp[i][j - goods[i][1]] + goods[i][0])\n dp[i + 1][j] = min(dp[i + 1][j], dp[i][j])\n\n\nM = 0\nfor i in range(10**5 + 1):\n if dp[n][i] <= w:\n M = i\nprint(M)\n","change":"replace","i1":2,"i2":9,"j1":2,"j2":17,"error":"0","stderr":null,"stdout":90.0} {"problem_id":"p03164","language":"Python","original_status":"Runtime Error","pass":"N, W = map(int, input().split())\n\nitems = [list(map(int, input().split())) for _ in range(N)]\nv_sum = sum([item[1] for item in items])\n\ninf = float(\"inf\")\ndp = [inf for _ in range(v_sum + 1)]\n\ndp[0] = 0\nfor i in range(N):\n for j in range(v_sum, -1, -1):\n if dp[j] >= dp[j - items[i][1] + items[i][0]]:\n dp[j] = dp[j - items[i][1]] + items[i][0]\n\nfor i in range(v_sum, -1, -1):\n if dp[i] <= W:\n print(i)\n exit()\n","fail":"N, W = map(int, input().split())\n\nitems = [list(map(int, input().split())) for _ in range(N)]\nv_sum = sum([item[1] for item in items])\n\ninf = float(\"inf\")\ndp = [inf for _ in range(v_sum + 1)]\n\ndp[0] = 0\nfor i in range(N):\n for j in range(v_sum, -1, -1):\n if dp[j] > dp[j - items[i][1]] + items[i][0]:\n dp[j] = dp[j - items[i][1]] + items[i][0]\n\nfor i in range(v_sum, -1, -1):\n if dp[i] <= W:\n print(i)\n exit()\n","change":"replace","i1":11,"i2":12,"j1":11,"j2":12,"error":"0","stderr":null,"stdout":90.0} {"problem_id":"p03164","language":"Python","original_status":"Time Limit Exceeded","pass":"N, W = [int(_) for _ in input().split()]\nWV = [[int(_) for _ in input().split()] for _ in range(N)]\ndp = {}\ndp[0] = 0\nfor w, v in WV:\n dp_o = dp.copy()\n for k in dp_o:\n if k + w <= W:\n dp[k + w] = max(dp_o.get(k + w, 0), dp_o[k] + v)\nprint(max([v for k, v in dp.items()]))\n","fail":"N, W = [int(_) for _ in input().split()]\nWV = [[int(_) for _ in input().split()] for _ in range(N)]\ndp = {}\ndp[0] = 0\nfor w, v in WV:\n dp_o = dp.copy()\n for k in dp_o:\n dp[k + v] = min(dp_o.get(k + v, float(\"inf\")), dp_o[k] + w)\nprint(max([k for k, v in dp.items() if v <= W]))\n","change":"replace","i1":7,"i2":10,"j1":7,"j2":9,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03164","language":"Python","original_status":"Time Limit Exceeded","pass":"n, w = map(int, input().split())\nx = [list(map(int, input().split())) for _ in range(n)]\n\ndp = [[0 for j in range(w + 1)] for i in range(2)]\n\nfor i, (wi, vi) in enumerate(x):\n dp_pre = dp[1 - i % 2]\n dp_cur = dp[i % 2]\n for j in range(1, wi):\n dp_cur[j] = dp_pre[j]\n for j in range(wi, w + 1):\n dp_cur[j] = max(dp_pre[j], dp_pre[j - wi] + vi)\nprint(max(dp_cur))\n","fail":"n, w = map(int, input().split())\nx = [list(map(int, input().split())) for _ in range(n)]\n\nv = sum([vi for _, vi in x])\ndp = [[2 * 10**9 for j in range(v + 1)] for i in range(2)]\ndp[0][0] = 0\ndp[1][0] = 0\n\nfor i, (wi, vi) in enumerate(x):\n dp_pre = dp[1 - i % 2]\n dp_cur = dp[i % 2]\n for j in range(1, vi):\n dp_cur[j] = dp_pre[j]\n for j in range(vi, v + 1):\n dp_cur[j] = min(dp_pre[j], dp_pre[j - vi] + wi)\nans = 0\nfor vi, wi in enumerate(dp_cur):\n if wi <= w:\n ans = max(ans, vi)\nprint(ans)\n","change":"replace","i1":3,"i2":13,"j1":3,"j2":20,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03164","language":"Python","original_status":"Runtime Error","pass":"import sys\n\ninput = sys.stdin.readline\n\n\ndef nap(n, cap):\n val = [0] * (cap + 1)\n for _ in range(n):\n w, v = map(int, input().split())\n for wk in range(cap, w - 1, -1):\n nv = val[wk - w] + v\n if val[wk] < nv:\n val[wk] = nv\n return max(val)\n\n\nn, cap = map(int, input().split())\nprint(nap(n, cap))\n","fail":"import sys\n\ninput = sys.stdin.readline\n\n\ndef nap(n, cap):\n mxk = 0\n inf = 10**10\n wei = [0] + [inf] * 100000\n for _ in range(n):\n w, v = map(int, input().split())\n for vk in range(100000, v - 1, -1):\n nw = wei[vk - v] + w\n if nw > cap:\n continue\n if wei[vk] > nw:\n wei[vk] = nw\n if vk > mxk:\n mxk = vk\n return mxk\n\n\nn, cap = map(int, input().split())\nprint(nap(n, cap))\n","change":"replace","i1":6,"i2":14,"j1":6,"j2":20,"error":"0","stderr":null,"stdout":90.0} {"problem_id":"p03164","language":"Python","original_status":"Runtime Error","pass":"#!\/usr\/bin\/env python3\n# vim: set fileencoding=utf-8\n\n# pylint: disable=unused-import, invalid-name, missing-docstring, bad-continuation\n\n\n\"\"\"Module docstring\n\"\"\"\n\nimport sys\n\n\ndef solve(values, _nb, max_capacity):\n dp = [0] * (max_capacity + 1)\n for w, v in values:\n for j in range(max_capacity, w - 1, -1):\n tmp = dp[j - w] + v\n if dp[j] < tmp:\n dp[j] = tmp\n return dp[max_capacity]\n\n\ndef solve_better(values, _nb, max_capacity):\n dp = [0] * (max_capacity + 1)\n for w, v in values:\n # dp = dp[:w] + [max(dp[j], dp[j - w] + v) for j in range(w, max_capacity + 1)]\n dp[w:] = [max(dpj, dpjw + v) for dpj, dpjw in zip(dp[w:], dp[:-w])]\n return dp[max_capacity]\n\n\ndef solve_slow(values, nb, max_capacity):\n dp = [[0 for _ in range(max_capacity + 1)] for _ in range(nb + 1)]\n for i in range(1, nb + 1):\n w, v = values[i - 1]\n for j in range(1, max_capacity + 1):\n if w <= j:\n dp[i][j] = max(dp[i - 1][j], dp[i - 1][j - w] + v)\n else:\n dp[i][j] = dp[i - 1][j]\n # print(\"\\\\n\".join(map(str, dp)))\n return dp[nb][max_capacity]\n\n\ndef do_job():\n \"Do the work\"\n # first line is number of test cases\n N, W = map(int, input().split())\n values = []\n for _ in range(N):\n values.append(list(map(int, input().split())))\n result = solve(values, N, W)\n print(result)\n\n\ndef print_output(testcase, result) -> None:\n \"Formats and print result\"\n if result is None:\n result = \"IMPOSSIBLE\"\n print(\"Case #{}: {}\".format(testcase + 1, result))\n\n\ndef main(argv=None):\n \"Program wrapper.\"\n if argv is None:\n argv = sys.argv[1:]\n do_job()\n return 0\n\n\nif __name__ == \"__main__\":\n import doctest\n\n doctest.testmod()\n sys.exit(main())\n","fail":"#!\/usr\/bin\/env python3\n# vim: set fileencoding=utf-8\n\n# pylint: disable=unused-import, invalid-name, missing-docstring, bad-continuation\n\n\n\"\"\"Module docstring\n\"\"\"\n\nimport sys\nfrom collections import defaultdict\n\n\ndef solve(values, _nb, max_capacity):\n dp = {}\n dp[0] = 0\n for w, v in values:\n keys = sorted(dp.keys(), reverse=True)\n for vk in keys:\n if vk + v in dp:\n dp[vk + v] = min(dp[vk + v], dp[vk] + w)\n else:\n dp[vk + v] = dp[vk] + w\n result = 0\n for v, w in dp.items():\n if w <= max_capacity and v > result:\n result = v\n return result\n\n\ndef solve_better(values, _nb, max_capacity):\n dp = [0] * (max_capacity + 1)\n for w, v in values:\n # dp = dp[:w] + [max(dp[j], dp[j - w] + v) for j in range(w, max_capacity + 1)]\n dp[w:] = [max(dpj, dpjw + v) for dpj, dpjw in zip(dp[w:], dp[:-w])]\n return dp[max_capacity]\n\n\ndef solve_slow(values, nb, max_capacity):\n dp = [[0 for _ in range(max_capacity + 1)] for _ in range(nb + 1)]\n for i in range(1, nb + 1):\n w, v = values[i - 1]\n for j in range(1, max_capacity + 1):\n if w <= j:\n dp[i][j] = max(dp[i - 1][j], dp[i - 1][j - w] + v)\n else:\n dp[i][j] = dp[i - 1][j]\n # print(\"\\\\n\".join(map(str, dp)))\n return dp[nb][max_capacity]\n\n\ndef do_job():\n \"Do the work\"\n # first line is number of test cases\n N, W = map(int, input().split())\n values = []\n for _ in range(N):\n values.append(list(map(int, input().split())))\n result = solve(values, N, W)\n print(result)\n\n\ndef print_output(testcase, result) -> None:\n \"Formats and print result\"\n if result is None:\n result = \"IMPOSSIBLE\"\n print(\"Case #{}: {}\".format(testcase + 1, result))\n\n\ndef main(argv=None):\n \"Program wrapper.\"\n if argv is None:\n argv = sys.argv[1:]\n do_job()\n return 0\n\n\nif __name__ == \"__main__\":\n import doctest\n\n doctest.testmod()\n sys.exit(main())\n","change":"replace","i1":10,"i2":20,"j1":10,"j2":28,"error":"0","stderr":null,"stdout":90.0} {"problem_id":"p03164","language":"Python","original_status":"Time Limit Exceeded","pass":"# E - Knapsack 2\nfrom collections import defaultdict\n\n\ndef main():\n N, W, *WV = map(int, open(0).read().split())\n dp = defaultdict(int)\n dp[0] = 0\n for w, v in zip(*[iter(WV)] * 2):\n for cur_w, cur_v in tuple(dp.items()):\n if w + cur_w <= W:\n dp[w + cur_w] = max(dp[w + cur_w], v + cur_v)\n print(max(dp.values()))\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"# E - Knapsack 2\nfrom collections import defaultdict\n\n\ndef main():\n INF = 1 << 30\n N, W, *WV = map(int, open(0).read().split())\n dp = defaultdict(lambda: INF) # dp[i] := minimum weight at value i\n dp[0] = 0\n for w, v in zip(*[iter(WV)] * 2):\n for cur_v, cur_w in tuple(dp.items()):\n if w + cur_w <= W:\n dp[v + cur_v] = min(dp[v + cur_v], w + cur_w)\n print(max(dp.keys()))\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":5,"i2":13,"j1":5,"j2":14,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03164","language":"Python","original_status":"Runtime Error","pass":"N, W = map(int, input().split())\n\nM = 100000\ndp = [-1] * (M + 1)\ndp[0] = W\nfor _ in range(N):\n w, v = map(int, input().split())\n for i in range(M + 1, -1, -1):\n if dp[i] == -1:\n continue\n if dp[i + v] < dp[i] - w:\n dp[i + v] = dp[i] - w\n\nfor i in range(M + 1, -1, -1):\n if dp[i] != -1:\n print(i)\n break\n","fail":"N, W = map(int, input().split())\n\nM = 100000\ndp = [-1] * (M + 1)\ndp[0] = W\nfor _ in range(N):\n w, v = map(int, input().split())\n for i in range(M, -1, -1):\n if dp[i] == -1:\n continue\n if dp[i + v] < dp[i] - w:\n dp[i + v] = dp[i] - w\n\nfor i in range(M, -1, -1):\n if dp[i] != -1:\n print(i)\n break\n","change":"replace","i1":7,"i2":14,"j1":7,"j2":14,"error":"IndexError: list index out of range","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03164\/Python\/s113274274.py\", line 9, in \n if dp[i] == -1:\nIndexError: list index out of range\n","stdout":null} {"problem_id":"p03165","language":"Python","original_status":"Time Limit Exceeded","pass":"s = input()\nt = input()\n\nlens = len(s)\nlent = len(t)\n\n# dp = [[None] * lent for _ in range(lens)]\n# def dfs(aindex=0, bindex=0):\n# if aindex >= lens:\n# return 0\n# if bindex >= lent:\n# return 0\n#\n# if dp[aindex][bindex] is not None:\n# return dp[aindex][bindex]\n#\n# if s[aindex] == t[bindex]:\n# r = dfs(aindex + 1, bindex + 1) + 1\n# else:\n# r = max(dfs(aindex + 1, bindex), dfs(aindex, bindex + 1))\n# dp[aindex][bindex] = r\n# return r\n#\n# print(dfs())\n\nshift = [1 << x for x in range(3000 + 1)]\n\ndp = [[0] * (lent + 1) for _ in range(lens + 1)]\n# pattern = [[0] * (lent + 1) for _ in range(lens + 1)]\npattern = [[[0] * 3000 for _ in range(lent + 1)] for _ in range(lens + 1)]\n# dp = [[(0, 0) for _ in range(lent + 1)] for _ in range(lens + 1)]\nfor aindex in range(lens - 1, -1, -1):\n for bindex in range(lent - 1, -1, -1):\n if s[aindex] == t[bindex]:\n r = dp[aindex + 1][bindex + 1] + 1\n # p = s[aindex] + pattern[aindex + 1][bindex + 1]\n # p = (1 << aindex) + pattern[aindex + 1][bindex + 1]\n p = pattern[aindex + 1][bindex + 1][:]\n p[aindex] += 1\n else:\n if dp[aindex + 1][bindex] > dp[aindex][bindex + 1]:\n r = dp[aindex + 1][bindex]\n p = pattern[aindex + 1][bindex]\n else:\n r = dp[aindex][bindex + 1]\n p = pattern[aindex][bindex + 1]\n # r = max(dp[aindex + 1][bindex], dp[aindex][bindex + 1])\n dp[aindex][bindex] = r\n pattern[aindex][bindex] = p\nfor aindex in range(lens):\n if pattern[0][0][aindex]:\n print(s[aindex], end=\"\")\n","fail":"s = input()\nt = input()\n\nlens = len(s)\nlent = len(t)\n\n# dp = [[None] * lent for _ in range(lens)]\n# def dfs(aindex=0, bindex=0):\n# if aindex >= lens:\n# return 0\n# if bindex >= lent:\n# return 0\n#\n# if dp[aindex][bindex] is not None:\n# return dp[aindex][bindex]\n#\n# if s[aindex] == t[bindex]:\n# r = dfs(aindex + 1, bindex + 1) + 1\n# else:\n# r = max(dfs(aindex + 1, bindex), dfs(aindex, bindex + 1))\n# dp[aindex][bindex] = r\n# return r\n#\n# print(dfs())\n\nshift = [1 << x for x in range(3000 + 1)]\n\ndp = [[0] * (lent + 1) for _ in range(lens + 1)]\nfor aindex in range(lens - 1, -1, -1):\n for bindex in range(lent - 1, -1, -1):\n if s[aindex] == t[bindex]:\n r = dp[aindex + 1][bindex + 1] + 1\n else:\n r = max(dp[aindex + 1][bindex], dp[aindex][bindex + 1])\n dp[aindex][bindex] = r\n\nans = \"\"\nls = len(s)\nlt = len(t)\nls = 0\nlt = 0\nwhile ls < lens and lt < lent:\n if dp[ls][lt] == dp[ls + 1][lt]:\n ls += 1\n elif dp[ls][lt] == dp[ls][lt + 1]:\n lt += 1\n else:\n ans += t[lt]\n ls += 1\n lt += 1\nprint(ans)\n","change":"replace","i1":28,"i2":52,"j1":28,"j2":51,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03165","language":"Python","original_status":"Time Limit Exceeded","pass":"#!python3\n\n# input\ns = input()\nt = input()\n\n\ndef main():\n sn, tn = len(s), len(t)\n dp = [[(0, \"\")] * (tn + 1) for _ in range(sn + 1)]\n for i in range(1, sn + 1):\n for j in range(1, tn + 1):\n if s[i - 1] == t[j - 1]:\n dp[i][j] = (dp[i - 1][j - 1][0] + 1, s[i - 1])\n else:\n dp[i][j] = max(dp[i][j - 1], dp[i - 1][j])\n ans = []\n i, j = sn, tn\n while i != 0 and j != 0:\n if s[i - 1] == t[j - 1]:\n ans.append(dp[i][j][1])\n i, j = i - 1, j - 1\n else:\n if dp[i][j - 1][0] < dp[i - 1][j][0]:\n i -= 1\n else:\n j -= 1\n print(\"\".join(ans[::-1]))\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"#!python3\n\n# input\ns = input()\nt = input()\n\n\ndef main():\n sn, tn = len(s), len(t)\n dp = [[0] * (tn + 1) for _ in range(sn + 1)]\n w = [[None] * (tn + 1) for _ in range(sn + 1)]\n for i in range(1, sn + 1):\n for j in range(1, tn + 1):\n if s[i - 1] == t[j - 1]:\n dp[i][j] = dp[i - 1][j - 1] + 1\n w[i][j] = s[i - 1]\n else:\n dp[i][j] = max(dp[i][j - 1], dp[i - 1][j])\n ans = []\n i, j = sn, tn\n while i != 0 and j != 0:\n if s[i - 1] == t[j - 1]:\n ans.append(w[i][j])\n i, j = i - 1, j - 1\n else:\n if dp[i][j - 1] < dp[i - 1][j]:\n i -= 1\n else:\n j -= 1\n print(\"\".join(ans[::-1]))\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":9,"i2":24,"j1":9,"j2":26,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03165","language":"Python","original_status":"Time Limit Exceeded","pass":"def main():\n s = input()\n sl = len(s)\n t = input()\n tl = len(t)\n\n # dp[s][t]: value\n dp = [[(0, \"\") for _ in range(tl + 1)] for _ in range(sl + 1)]\n\n for si in range(sl):\n for ti in range(tl):\n if s[si] == t[ti]:\n dp[si + 1][ti + 1] = (dp[si][ti][0] + 1, dp[si][ti][1] + s[si])\n else:\n dp[si + 1][ti + 1] = max(dp[si + 1][ti], dp[si][ti + 1])\n\n # import pprint\n # print(\"dp={}\".format(pprint.pformat(dp)))\n\n print(dp[sl][tl][1])\n\n\nmain()\n","fail":"def main():\n s = input()\n sl = len(s)\n t = input()\n tl = len(t)\n\n # dp[s][t]: value\n dp = [[(0) for _ in range(tl + 1)] for _ in range(sl + 1)]\n\n for si in range(sl):\n for ti in range(tl):\n if s[si] == t[ti]:\n dp[si + 1][ti + 1] = dp[si][ti] + 1\n else:\n dp[si + 1][ti + 1] = max(dp[si + 1][ti], dp[si][ti + 1])\n\n # import pprint\n # print(\"dp={}\".format(pprint.pformat(dp)))\n\n ret = []\n si, ti = sl, tl\n while 0 < si and 0 < ti:\n if dp[si][ti] == dp[si - 1][ti]:\n si -= 1\n elif dp[si][ti] == dp[si][ti - 1]:\n ti -= 1\n else:\n ret.insert(0, s[si - 1])\n si -= 1\n ti -= 1\n\n print(\"\".join(ret))\n\n\nmain()\n","change":"replace","i1":7,"i2":20,"j1":7,"j2":32,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03165","language":"Python","original_status":"Time Limit Exceeded","pass":"#!\/usr\/bin\/env python3\n# vim: set fileencoding=utf-8\n\n# pylint: disable=unused-import, invalid-name, missing-docstring, bad-continuation\n\n\n\"\"\"Module docstring\n\"\"\"\n\nimport sys\n\n\ndef solve(s, t):\n v = [0] * (len(s) + 1)\n dp = [v]\n for ti in t:\n u, v = v, v.copy()\n dp.append(v)\n ll, ul = 0, 0\n for j, sj in enumerate(s):\n uj = u[j + 1]\n if sj == ti:\n v[j + 1] = 1 + ul\n ll = 1 + ul\n else:\n if ll > uj:\n v[j + 1] = ll\n else:\n ll = uj\n ul = uj\n i = len(t)\n j = len(s)\n k = dp[i][j]\n selected = []\n while k > 0:\n if dp[i - 1][j] == k:\n i -= 1\n elif dp[i][j - 1] == k:\n j -= 1\n else:\n selected.append(t[i - 1])\n k -= 1\n i -= 1\n j -= 1\n return \"\".join(selected[::-1])\n\n\ndef do_job():\n \"Do the work\"\n s = input()\n t = input()\n result = solve(s, t)\n print(result)\n\n\ndef print_output(testcase, result) -> None:\n \"Formats and print result\"\n if result is None:\n result = \"IMPOSSIBLE\"\n print(\"Case #{}: {}\".format(testcase + 1, result))\n\n\ndef main(argv=None):\n \"Program wrapper.\"\n if argv is None:\n argv = sys.argv[1:]\n do_job()\n return 0\n\n\nif __name__ == \"__main__\":\n import doctest\n\n doctest.testmod()\n sys.exit(main())\n","fail":"#!\/usr\/bin\/env python3\n# vim: set fileencoding=utf-8\n\n# pylint: disable=unused-import, invalid-name, missing-docstring, bad-continuation\n\n\n\"\"\"Module docstring\n\"\"\"\n\nimport sys\n\n\ndef solve(s, t):\n v = [0] * (len(s) + 1)\n dp = [v]\n for _, ti in enumerate(t, 1):\n u, v = v, v.copy()\n dp.append(v)\n ll, ul = 0, 0\n for j, sj in enumerate(s, 1):\n uj = u[j]\n if sj == ti:\n v[j] = 1 + ul\n ll = 1 + ul\n else:\n if ll > uj:\n v[j] = ll\n else:\n ll = uj\n ul = uj\n i = len(t)\n j = len(s)\n k = dp[i][j]\n selected = []\n while k > 0:\n if dp[i - 1][j] == k:\n i -= 1\n elif dp[i][j - 1] == k:\n j -= 1\n else:\n selected.append(t[i - 1])\n k -= 1\n i -= 1\n j -= 1\n return \"\".join(selected[::-1])\n\n\ndef do_job():\n \"Do the work\"\n s = input()\n t = input()\n result = solve(s, t)\n print(result)\n\n\ndef print_output(testcase, result) -> None:\n \"Formats and print result\"\n if result is None:\n result = \"IMPOSSIBLE\"\n print(\"Case #{}: {}\".format(testcase + 1, result))\n\n\ndef main(argv=None):\n \"Program wrapper.\"\n if argv is None:\n argv = sys.argv[1:]\n do_job()\n return 0\n\n\nif __name__ == \"__main__\":\n import doctest\n\n doctest.testmod()\n sys.exit(main())\n","change":"replace","i1":15,"i2":27,"j1":15,"j2":27,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03165","language":"Python","original_status":"Runtime Error","pass":"def get_lcs(S: str, T: str):\n N, M = len(S), len(T)\n dp = [[0] * (M + 1) for _ in range(N + 1)]\n for i, s in enumerate(S):\n for j, t in enumerate(T):\n if s == t:\n dp[i + 1][j + 1] = dp[i][j] + 1\n else:\n dp[i + 1][j + 1] = max(dp[i + 1][j], dp[i][j + 1])\n\n reversed_lcs = \"\"\n while N and M:\n if S[N - 1] == T[M - 1]:\n N -= 1\n M -= 1\n reversed_lcs += S[N]\n if dp[N - 1][M] > dp[N][M - 1]:\n N -= 1\n else:\n M -= 1\n return reversed_lcs[::-1]\n\n\ndef main():\n S, T = open(0).read().split()\n print(get_lcs(S, T))\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"# F - LCS\ndef get_lcs(str_1: str, str_2: str):\n dp = [[0] * (len(str_2) + 1) for _ in range(len(str_1) + 1)]\n for i, s in enumerate(str_1):\n for j, t in enumerate(str_2):\n if s == t:\n dp[i + 1][j + 1] = dp[i][j] + 1\n else:\n dp[i + 1][j + 1] = max(dp[i + 1][j], dp[i][j + 1])\n\n i, j = len(str_1), len(str_2)\n reversed_lcs = \"\"\n while i and j:\n if str_1[i - 1] == str_2[j - 1]:\n i -= 1\n j -= 1\n reversed_lcs += str_1[i]\n continue\n if dp[i - 1][j] > dp[i][j - 1]:\n i -= 1\n else:\n j -= 1\n return reversed_lcs[::-1]\n\n\ndef main():\n S, T = open(0).read().split()\n print(get_lcs(S, T))\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":0,"i2":20,"j1":0,"j2":22,"error":"WA","stderr":null,"stdout":"ayb\n"} {"problem_id":"p03166","language":"Python","original_status":"Runtime Error","pass":"import sys\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef dfs(v):\n if dp[v] >= 0:\n return dp[v]\n res = 0\n for nv in g[v]:\n res = max(res, dfs(nv) + 1)\n dp[v] = res\n return res\n\n\nn, m = map(int, input().split())\ng = {i: set() for i in range(1, n + 1)}\nfor _ in range(m):\n x, y = map(int, input().split())\n g[x].add(y)\n\ndp = [-1] * (n + 1)\nfor v in g:\n dp[v] = max(dp[v], dfs(v))\nprint(max(dp))\n","fail":"import sys\n\nsys.setrecursionlimit(10**7)\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef dfs(v):\n if dp[v] >= 0:\n return dp[v]\n res = 0\n for nv in g[v]:\n res = max(res, dfs(nv) + 1)\n dp[v] = res\n return res\n\n\nn, m = map(int, input().split())\ng = {i: set() for i in range(1, n + 1)}\nfor _ in range(m):\n x, y = map(int, input().split())\n g[x].add(y)\n\ndp = [-1] * (n + 1)\nfor v in g:\n dp[v] = max(dp[v], dfs(v))\nprint(max(dp))\n","change":"insert","i1":1,"i2":1,"j1":1,"j2":3,"error":"0","stderr":null,"stdout":3.0} {"problem_id":"p03166","language":"Python","original_status":"Runtime Error","pass":"from collections import defaultdict\n\n\ndef longest_path(n, edges):\n adj_list = defaultdict(list)\n for x, y in edges: # x -> y\n adj_list[y].append(x)\n\n distances = [None] * n\n\n def dfs(x):\n if distances[x] is None:\n if adj_list[x]:\n for y in adj_list[x]:\n dfs(y)\n distances[x] = max((distances[y] + 1 for y in adj_list[x]))\n else:\n distances[x] = 0\n\n for x in range(n):\n dfs(x)\n\n return max(distances)\n\n\ndef main():\n n, m = [int(x) for x in input().split()]\n edges = [None] * m\n for i in range(m):\n edges[i] = [int(x) - 1 for x in input().split()]\n\n return longest_path(n, edges)\n\n\nprint(main())\n","fail":"from collections import defaultdict, deque\n\n\ndef longest_path(n, edges):\n adj_list = defaultdict(list)\n for x, y in edges: # x -> y\n adj_list[y].append(x)\n\n state = [0] * n\n distances = [0] * n\n stack = deque(range(n))\n\n while stack:\n x = stack.pop()\n if state[x] == 0:\n state[x] = 1\n stack.append(x)\n stack.extend(adj_list[x])\n elif state[x] == 1:\n state[x] = 2\n if adj_list[x]:\n distances[x] = max(distances[y] for y in adj_list[x]) + 1\n\n return max(distances)\n\n\ndef main():\n n, m = [int(x) for x in input().split()]\n edges = [None] * m\n for i in range(m):\n edges[i] = [int(x) - 1 for x in input().split()]\n\n return longest_path(n, edges)\n\n\nprint(main())\n","change":"replace","i1":0,"i2":21,"j1":0,"j2":22,"error":"0","stderr":null,"stdout":3.0} {"problem_id":"p03166","language":"Python","original_status":"Runtime Error","pass":"def dfs(v):\n if d[v] != -1:\n return d[v]\n res = -1\n for u in e[v]:\n res = max(res, dfs(u))\n res += 1\n d[v] = res\n return res\n\n\nn, m = map(int, input().split())\ne = tuple(set() for _ in range(n))\nfor _ in range(m):\n x, y = map(int, input().split())\n x -= 1\n y -= 1\n e[x].add(y)\n\nd = [-1] * n\nres = -1\nfor v in range(n):\n res = max(res, dfs(v))\nprint(res)\n","fail":"import sys\n\nsys.setrecursionlimit(10**7)\n\n\ndef dfs(v):\n if d[v] != -1:\n return d[v]\n res = -1\n for u in e[v]:\n res = max(res, dfs(u))\n res += 1\n d[v] = res\n return res\n\n\nn, m = map(int, input().split())\ne = tuple(set() for _ in range(n))\nfor _ in range(m):\n x, y = map(int, input().split())\n x -= 1\n y -= 1\n e[x].add(y)\n\nd = [-1] * n\nres = -1\nfor v in range(n):\n res = max(res, dfs(v))\nprint(res)\n","change":"insert","i1":0,"i2":0,"j1":0,"j2":5,"error":"0","stderr":null,"stdout":3.0} {"problem_id":"p03166","language":"Python","original_status":"Runtime Error","pass":"def rec(vv):\n res = 0\n for nv in g[vv]:\n if p[nv] >= 0:\n res = max(res, p[nv] + 1)\n else:\n res = max(res, rec(nv) + 1)\n p[vv] = res\n return res\n\n\nN, M = map(int, input().split())\ng = [[] for _ in range(N)]\np = [-1 for _ in range(N)]\n\nfor _ in range(M):\n x, y = map(int, input().split())\n x -= 1\n y -= 1\n g[x].append(y)\n\nans = 0\nfor v in range(N):\n ans = max(ans, rec(v))\nprint(ans)\n","fail":"import sys\n\nsys.setrecursionlimit(10**9)\n\n\ndef rec(vv):\n if p[vv] >= 0:\n return p[vv]\n\n res = 0\n for nv in g[vv]:\n res = max(res, rec(nv) + 1)\n p[vv] = res\n return res\n\n\nN, M = map(int, input().split())\ng = [[] for _ in range(N)]\np = [-1 for _ in range(N)]\n\nfor _ in range(M):\n x, y = map(int, input().split())\n x -= 1\n y -= 1\n g[x].append(y)\n\nans = 0\nfor v in range(N):\n ans = max(ans, rec(v))\nprint(ans)\n","change":"replace","i1":0,"i2":7,"j1":0,"j2":12,"error":"0","stderr":null,"stdout":3.0} {"problem_id":"p03166","language":"Python","original_status":"Time Limit Exceeded","pass":"# -*- coding: utf-8 -*-\nfrom collections import deque\n\nfrom sys import setrecursionlimit\n\nsetrecursionlimit(1000000)\n\nINF = float(\"inf\")\n# Input#\n# n = int(input())\nn, m = map(int, input().split())\n# a = list(map(int, input().split()))\n\nd = deque()\nd_tmp = deque()\nx = [-1]\ny = [-1]\n\nfor _ in [0] * m:\n x_in, y_in = map(int, input().split())\n # x.append(x_in)\n # y.append(y_in)\n d.append((x_in, y_in))\n\nmemo = [-1] * (n + 1)\nans = -1\n\n\ndef dp(i):\n global ans\n if memo[i] == -1:\n ret = 0\n for x_in, y_in in d:\n if x_in == i:\n tmp = dp(y_in) + 1\n if tmp > ret:\n ret = tmp\n memo[i] = ret\n if ret > ans:\n ans = ret\n return ret\n else:\n return memo[i]\n\n\nfor i, _ in d:\n if memo[i] == -1:\n dp(i)\n\nprint(\"{}\".format(ans))\n","fail":"# -*- coding: utf-8 -*-\nfrom collections import deque\n\nfrom sys import setrecursionlimit\n\nsetrecursionlimit(1000000)\n\nINF = float(\"inf\")\n# Input#\n# n = int(input())\nn, m = map(int, input().split())\n# a = list(map(int, input().split()))\n\nd = deque()\nd_tmp = deque()\nx = [-1]\ny = [[-1] for _ in range((n + 1))]\n\nfor _ in [0] * m:\n x_in, y_in = map(int, input().split())\n # x.append(x_in)\n y[x_in].append(y_in)\n d.append((x_in, y_in))\n\nmemo = [-1] * (n + 1)\nans = -1\n\n\ndef dp(i):\n global ans\n if memo[i] == -1:\n ret = 0\n for x_in in y[i][1:]:\n tmp = dp(x_in) + 1\n if tmp > ret:\n ret = tmp\n memo[i] = ret\n if ret > ans:\n ans = ret\n return ret\n else:\n return memo[i]\n\n\nfor i, _ in d:\n if memo[i] == -1:\n dp(i)\n\nprint(\"{}\".format(ans))\n","change":"replace","i1":16,"i2":37,"j1":16,"j2":36,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03166","language":"Python","original_status":"Runtime Error","pass":"def get_kyori(i):\n if kos[i] == []:\n kyori[i] = 0\n return 0\n if kyori[i] > -1:\n return kyori[i]\n re = 0\n for ko in kos[i]:\n new = get_kyori(ko) + 1\n if re < new:\n re = new\n kyori[i] = re\n return re\n\n\nn, m = map(int, input().split())\nkos = [[] for _ in range(n + 1)]\nkyori = [-1] * (n + 1)\nfor _ in range(m):\n oya, ko = map(int, input().split())\n kos[oya] += [ko]\n\nfor i in range(1, n + 1):\n if kyori[i] == -1:\n kyori[i] = get_kyori(i)\n\nprint(max(kyori[1:]))\n","fail":"import sys\n\ninput = sys.stdin.readline\nsys.setrecursionlimit(10**6)\n\n\ndef get_kyori(i):\n if kos[i] == []:\n kyori[i] = 0\n return 0\n if kyori[i] > -1:\n return kyori[i]\n re = 0\n for ko in kos[i]:\n new = get_kyori(ko) + 1\n if re < new:\n re = new\n kyori[i] = re\n return re\n\n\nn, m = map(int, input().split())\nkos = [[] for _ in range(n + 1)]\nkyori = [-1] * (n + 1)\nfor _ in range(m):\n oya, ko = map(int, input().split())\n kos[oya] += [ko]\n\nfor i in range(1, n + 1):\n if kyori[i] == -1:\n kyori[i] = get_kyori(i)\n\nprint(max(kyori[1:]))\n","change":"insert","i1":0,"i2":0,"j1":0,"j2":6,"error":"0","stderr":null,"stdout":3.0} {"problem_id":"p03166","language":"Python","original_status":"Time Limit Exceeded","pass":"import sys\nfrom functools import lru_cache\n\nsys.setrecursionlimit(1000000)\n\n\n@lru_cache(maxsize=None)\ndef dfs(v):\n lv = links[v]\n return max(map(dfs, lv)) + 1 if lv else 0\n\n\nn, m = map(int, input().split())\nsss = set(range(n))\nlinks = [set() for _ in range(n)]\nfor line in sys.stdin.readlines():\n x, y = map(int, line.split())\n x -= 1\n y -= 1\n sss.discard(y)\n links[x].add(y)\n\nprint(max(map(dfs, sss)))\n","fail":"import sys\n\nsys.setrecursionlimit(1000000)\n\n\ndef dfs(v):\n if cache[v] > -1:\n return cache[v]\n lv = links[v]\n cache[v] = ret = max(map(dfs, lv)) + 1 if lv else 0\n return ret\n\n\nn, m = map(int, input().split())\nsss = set(range(n))\nlinks = [set() for _ in range(n)]\ncache = [-1] * n\nfor line in sys.stdin.readlines():\n x, y = map(int, line.split())\n x -= 1\n y -= 1\n sss.discard(y)\n links[x].add(y)\n\nprint(max(map(dfs, sss)))\n","change":"replace","i1":1,"i2":15,"j1":1,"j2":17,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03166","language":"Python","original_status":"Runtime Error","pass":"import sys\nfrom functools import lru_cache\n\nsys.setrecursionlimit(100000)\n\n\n@lru_cache(maxsize=None)\ndef dfs(v):\n lv = links[v]\n return max(map(dfs, lv)) + 1 if lv else 0\n\n\nn, m = map(int, input().split())\nsss = set(range(n))\nlinks = [set() for _ in range(n)]\nfor line in sys.stdin.readlines():\n x, y = map(int, line.split())\n x -= 1\n y -= 1\n sss.discard(y)\n links[x].add(y)\n\nprint(max(map(dfs, sss)))\n","fail":"import sys\nfrom functools import lru_cache\n\nsys.setrecursionlimit(1000000)\n\n\n@lru_cache(maxsize=None)\ndef dfs(v):\n lv = links[v]\n return max(map(dfs, lv)) + 1 if lv else 0\n\n\nn, m = map(int, input().split())\nsss = set(range(n))\nlinks = [set() for _ in range(n)]\nfor line in sys.stdin.readlines():\n x, y = map(int, line.split())\n x -= 1\n y -= 1\n sss.discard(y)\n links[x].add(y)\n\nprint(max(map(dfs, sss)))\n","change":"replace","i1":3,"i2":4,"j1":3,"j2":4,"error":"0","stderr":null,"stdout":3.0} {"problem_id":"p03168","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nP = list(map(float, input().split()))\n\ndp = [0] * (N + 1)\ndp[0] = 1\nfor i in range(1, N + 1):\n tmp = dp\n dp = [0] * (N + 1)\n for j in range(N):\n if j < N:\n dp[j + 1] += tmp[j] * P[i - 1]\n dp[j] += tmp[j] * (1 - P[i - 1])\n\nnum = 0\nfor i in range(N \/\/ 2 + 1, N + 1):\n num += dp[i]\n\nprint(num)\n","fail":"N = int(input())\nP = list(map(float, input().split()))\n# dp = [[0] * (N + 1) for i in range(N + 1)]\n# dp[0][0] = 1.0\n# for i in range(1, N + 1):\n# for j in range(N):\n# if j < N:\n# dp[i][j + 1] += dp[i - 1][j] * P[i - 1]\n# dp[i][j] += dp[i - 1][j] * (1 - P[i - 1])\n#\n# num = 0\n# for i in range(N \/\/ 2 + 1, N + 1):\n# num += dp[N][i]\n#\n# print(num)\n\n\ndp = [0] * (N + 1)\ndp[0] = 1\nfor i in range(1, N + 1):\n tmp = dp\n dp = [0] * (N + 1)\n for j in range(N):\n if j < N:\n dp[j + 1] += tmp[j] * P[i - 1]\n dp[j] += tmp[j] * (1 - P[i - 1])\n\nnum = 0\nfor i in range(N \/\/ 2 + 1, N + 1):\n num += dp[i]\n\nprint(num)\n","change":"insert","i1":2,"i2":2,"j1":2,"j2":16,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03168","language":"Python","original_status":"Time Limit Exceeded","pass":"# -*- coding: utf-8 -*-\n# from collections import deque\nfrom sys import setrecursionlimit\n\nsetrecursionlimit(1000000)\n\n\n# INF = float(\"inf\")\n\n# d = deque()\n# ---Input---#\nn = int(input())\n# n, k = map(int, input().split())\np = list(map(float, input().split()))\np = [-1] + p\n\nmemo = [[-1 for _ in [0] * (n + 1)] for _ in [0] * (n + 1)]\nmemo[0][0] = 1\nfor i in range(len(p))[1:]:\n memo[0][i] = 0\n memo[i][0] = memo[i - 1][0] * (1 - p[i])\nmemo[0][0] = 1\n\n\ndef dp(i, j):\n if memo[i][j] == -1:\n memo[i][j] = dp(i - 1, j) * (1 - p[i]) + dp(i - 1, j - 1) * p[i]\n return memo[i][j]\n\n\nans = 0\ntar = int(n \/ 2) + 1\nfor i in range(n + 1)[tar:]:\n ans += dp(n, i)\n\n\nprint(\"{}\".format(ans))\n","fail":"# -*- coding: utf-8 -*-\n# from collections import deque\nfrom sys import setrecursionlimit\n\nsetrecursionlimit(1000000)\n\n\n# INF = float(\"inf\")\n\n# d = deque()\n# ---Input---#\nn = int(input())\n# n, k = map(int, input().split())\np = list(map(float, input().split()))\np = [-1] + p\n\nmemo = [[-1 for _ in [0] * (n + 1)] for _ in [0] * (n + 1)]\nmemo[0][0] = 1\nfor i in range(len(p))[1:]:\n memo[0][i] = 0\n memo[i][0] = memo[i - 1][0] * (1 - p[i])\nmemo[0][0] = 1\n\n\ndef dp(i, j):\n if memo[i][j] == -1:\n memo[i][j] = dp(i - 1, j) * (1 - p[i]) + dp(i - 1, j - 1) * p[i]\n return memo[i][j]\n\n\nans = 0\ntar = int(n \/ 2) + 1\nfor i in range(n + 1):\n dp(i, i)\n dp(i, n)\n\nfor i in range(n + 1)[tar:]:\n ans += dp(n, i)\n\n\nprint(\"{}\".format(ans))\n","change":"insert","i1":32,"i2":32,"j1":32,"j2":36,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03169","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nA = list(map(int, input().split()))\n\n\ndp = [[[-1.0 for _ in range(N + 1)] for _ in range(N + 1)] for _ in range(N + 1)]\n\n\ndef solve(n1, n2, n3):\n\n if dp[n1][n2][n3] >= 0.0:\n return dp[n1][n2][n3]\n if n1 == n2 == n3 == 0:\n return 0.0\n\n cnt = n1 + n2 + n3\n ret = 0\n if n3 >= 1:\n ret += solve(n1, n2 + 1, n3 - 1) * n3\n if n2 >= 1:\n ret += solve(n1 + 1, n2 - 1, n3) * n2\n if n1 >= 1:\n ret += solve(n1 - 1, n2, n3) * n1\n\n ret = (ret + N) \/ cnt\n dp[n1][n2][n3] = ret\n return ret\n\n\na1, a2, a3 = 0, 0, 0\nfor i in range(N):\n if A[i] == 1:\n a1 += 1\n elif A[i] == 2:\n a2 += 1\n elif A[i] == 3:\n a3 += 1\n\nprint(solve(a1, a2, a3))\n","fail":"import numpy as np\nfrom numba import njit\n\n\n@njit(cache=True)\ndef solve(dp, N, n1, n2, n3):\n\n if dp[n1][n2][n3] >= 0.0:\n return dp[n1][n2][n3]\n if n1 == n2 == n3 == 0:\n return 0.0\n\n cnt = n1 + n2 + n3\n ret = 0\n if n3 >= 1:\n ret += solve(dp, N, n1, n2 + 1, n3 - 1) * n3\n if n2 >= 1:\n ret += solve(dp, N, n1 + 1, n2 - 1, n3) * n2\n if n1 >= 1:\n ret += solve(dp, N, n1 - 1, n2, n3) * n1\n\n ret = (ret + N) \/ cnt\n dp[n1][n2][n3] = ret\n return ret\n\n\ndef main():\n N = int(input())\n A = list(map(int, input().split()))\n\n dp = np.full((N + 1, N + 1, N + 1), -1, dtype=np.float64)\n\n a1, a2, a3 = 0, 0, 0\n for i in range(N):\n if A[i] == 1:\n a1 += 1\n elif A[i] == 2:\n a2 += 1\n elif A[i] == 3:\n a3 += 1\n\n print(solve(dp, N, a1, a2, a3))\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":0,"i2":38,"j1":0,"j2":46,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03171","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\na = list(map(int, input().split()))\ndp = [[0] * n for _ in range(n)]\nfor i in range(n):\n dp[i][i] = a[i]\n\nfor i in range(n - 2, -1, -1):\n for j in range(i + 1, n):\n dp[i][j] = max(a[i] - dp[i + 1][j], a[j] - dp[i][j - 1])\n\nprint(dp[0][n - 1])\n","fail":"def main():\n n = int(input())\n a = list(map(int, input().split()))\n dp = [0] * (n * n)\n for i in range(n):\n dp[i + i * n] = a[i]\n for i in range(n - 2, -1, -1):\n for j in range(i + 1, n):\n dp[i + j * n] = max(a[i] - dp[i + 1 + j * n], a[j] - dp[i + (j - 1) * n])\n print(dp[(n - 1) * n])\n\n\nmain()\n","change":"replace","i1":0,"i2":11,"j1":0,"j2":13,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03171","language":"Python","original_status":"Time Limit Exceeded","pass":"def kukan(n, a):\n dp = [[0] * n for _ in range(n)]\n for i in range(n):\n dp[i][i] = a[i]\n for i in range(n - 2, -1, -1):\n for j in range(i + 1, n):\n dp[i][j] = max(a[i] - dp[i + 1][j], a[j] - dp[i][j - 1])\n return dp[0][n - 1]\n\n\nn = int(input())\na = list(map(int, input().split()))\nprint(kukan(n, a))\n","fail":"def kukan(n, a):\n dp = [[0] * n for _ in range(n)]\n for i in range(n):\n dp[i][i] = a[i]\n for i in range(n - 2, -1, -1):\n for j in range(i + 1, n):\n L = a[i] - dp[i + 1][j]\n R = a[j] - dp[i][j - 1]\n dp[i][j] = L if L > R else R\n return dp[0][n - 1]\n\n\nn = int(input())\na = list(map(int, input().split()))\nprint(kukan(n, a))\n","change":"replace","i1":6,"i2":7,"j1":6,"j2":9,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03173","language":"Python","original_status":"Time Limit Exceeded","pass":"# https:\/\/atcoder.jp\/contests\/dp\/tasks\/dp_n\n\nimport itertools as it\n\nINF = 1000000007\nN = int(input())\nxs = [int(s) for s in input().split()]\nacc = list(it.accumulate([0] + xs))\n\ndp = [[INF] * (N + 1) for _ in range(N)]\n\nfor i in range(N):\n dp[i][i + 1] = 0\n\nfor w in range(2, N + 1):\n for i in range(N - w + 1):\n j = i + w\n dp[i][j] = min(dp[i][k] + dp[k][j] + acc[j] - acc[i] for k in range(i + 1, j))\n\nprint(dp[0][N])\n","fail":"# https:\/\/atcoder.jp\/contests\/dp\/tasks\/dp_n\n\nimport itertools as it\n\nINF = 1 << 62\nN = int(input())\nxs = [int(s) for s in input().split()]\nacc = list(it.accumulate([0] + xs))\n\ndp = [[INF] * (N + 1) for _ in range(N)]\n\nfor i in range(N):\n dp[i][i + 1] = 0\n\nfor w in range(2, N + 1):\n for i in range(N - w + 1):\n j = i + w\n subcost = min(dp[i][k] + dp[k][j] for k in range(i + 1, j))\n dp[i][j] = subcost + acc[j] - acc[i]\n\nprint(dp[0][N])\n","change":"replace","i1":4,"i2":18,"j1":4,"j2":19,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03176","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\nheights = [int(c) for c in input().split()]\nbeauty = [int(c) for c in input().split()]\n\ndp = list(beauty)\n\nfor i in range(n):\n max_beauty = beauty[i]\n for j in range(i):\n if heights[i] > heights[j] and beauty[i] + dp[j] > max_beauty:\n max_beauty = beauty[i] + dp[j]\n\n dp[i] = max_beauty\n\nans = max(dp)\nprint(ans)\n","fail":"n = int(input())\nheights = [int(c) for c in input().split()]\nbeauty = [int(c) for c in input().split()]\n\n\nbase = 1\nwhile base <= n:\n base *= 2\n\ntree = [0] * (2 * base)\n\ndp = [0] * (n + 1)\nfor i in range(n):\n x = heights[i] + base\n best = 0\n while x > 1:\n if x % 2 == 1:\n best = max(best, tree[x - 1])\n x \/\/= 2\n\n dp[heights[i]] = best + beauty[i]\n\n j = base + heights[i]\n while j >= 1:\n tree[j] = max(tree[j], dp[heights[i]])\n j \/\/= 2\n\n # for j in range(i):\n # if heights[i] > heights[j] and beauty[i] + dp[j] > max_beauty:\n # max_beauty = beauty[i] + dp[j]\n\n\nans = max(dp)\nprint(ans)\n","change":"replace","i1":4,"i2":13,"j1":4,"j2":31,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03176","language":"Python","original_status":"Runtime Error","pass":"def get(i):\n mx = 0\n while i > 0:\n if bit[i] > mx:\n mx = bit[i]\n i -= i & -i\n return mx\n\n\ndef update(i, x):\n while i < n + 1:\n if x > bit[i]:\n bit[i] = x\n i += i & -i\n\n\ndef f(hs, a_s):\n for h, a in zip(hs, a_s):\n update(h, get(h - 1) + a)\n print(max(bit))\n\n\nn = int(input())\nhs = list(map(int, input().split()))\na_s = list(map(int, input().split()))\nbit = [0] * (n + 1)\nf(n, hs, a_s)\n","fail":"def get(i):\n mx = 0\n while i > 0:\n if bit[i] > mx:\n mx = bit[i]\n i -= i & -i\n return mx\n\n\ndef update(i, x):\n while i < n + 1:\n if x > bit[i]:\n bit[i] = x\n i += i & -i\n\n\ndef f(hs, a_s):\n for h, a in zip(hs, a_s):\n update(h, get(h - 1) + a)\n print(max(bit))\n\n\nn = int(input())\nhs = list(map(int, input().split()))\na_s = list(map(int, input().split()))\nbit = [0] * (n + 1)\nf(hs, a_s)\n","change":"replace","i1":26,"i2":27,"j1":26,"j2":27,"error":"TypeError: f() takes 2 positional arguments but 3 were given","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03176\/Python\/s612498010.py\", line 27, in \n f(n, hs, a_s)\nTypeError: f() takes 2 positional arguments but 3 were given\n","stdout":null} {"problem_id":"p03176","language":"Python","original_status":"Time Limit Exceeded","pass":"def f(n, hs, a_s):\n sum_a = [0] * n\n sum_a[0] = a_s[0]\n for ai, a in enumerate(a_s[1:]):\n mx = 0\n h = hs[ai + 1]\n for i in range(ai + 1):\n if h > hs[i]:\n if sum_a[i] > mx:\n mx = sum_a[i]\n sum_a[ai + 1] = a + mx\n return sum_a[-1]\n\n\nn = int(input())\nhs = list(map(int, input().split()))\na_s = list(map(int, input().split()))\nprint(f(n, hs, a_s))\n","fail":"def get(i):\n mx = 0\n while i > 0:\n if bit[i] > mx:\n mx = bit[i]\n i -= i & -i\n return mx\n\n\ndef update(i, x):\n while i < n + 1:\n if x > bit[i]:\n bit[i] = x\n i += i & -i\n\n\nn = int(input())\nhs = list(map(int, input().split()))\na_s = list(map(int, input().split()))\n\nbit = [0] * (n + 1)\nfor h, a in zip(hs, a_s):\n update(h, get(h - 1) + a)\nprint(max(bit))\n","change":"replace","i1":0,"i2":18,"j1":0,"j2":24,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03181","language":"Python","original_status":"Time Limit Exceeded","pass":"# \u3053\u308c\u306f\u9006\u5143\u3092\u7528\u3044\u3066\u3084\u308b\u65b9\u6cd5\nfrom collections import deque\nimport sys\n\ninput = sys.stdin.buffer.readline\n\n\nn, m = map(int, input().split())\ngraph = [[] for _ in range(n + 1)]\nfor _ in range(n - 1):\n x, y = map(int, input().split())\n graph[x].append(y)\n graph[y].append(x)\n\n# dp1\u306f\u8449\u5411\u304d\u306b\u898b\u305f\u3068\u304d\u306e\u5857\u308a\u65b9\n# \u81ea\u8eab\u304c\u9ed2\u3044\u6642\u3001\u4e0b\u306e\u5019\u88dc\u306f\u3069\u3046\u306a\u308b\u304b\uff1f\ndp1 = [0] * (n + 1)\n# dp2\u306f\u6839\u5411\u304d\u306b\u898b\u305f\u3068\u304d\u306e\u5857\u308a\u65b9\n# \u81ea\u8eab\u304c\u9ed2\u3044\u6642\u3001\u89aa\u5074\u306e\u5019\u88dc\u306f\u3069\u3046\u306a\u308b\u304b\uff1f\ndp2 = [0] * (n + 1)\n\n# 1\u56de\u76ee\nstart = 1\npar = [-1] * (n + 1)\nque = deque([start])\ntopo = []\nwhile que:\n v = que.popleft()\n topo.append(v)\n for u in graph[v]:\n if par[v] == u:\n continue\n par[u] = v\n que.append(u)\n\nfor v in topo[::-1]:\n dp1[v] = 1\n for u in graph[v]:\n if u == par[v]:\n continue\n dp1[v] *= dp1[u] + 1\n\n# dp\u306f\u6b32\u3057\u3044\u7b54\u3048\u3068\u3057\u3066\u304a\u304f\n# dp1\u3068dp2\u304b\u3089\u6c42\u3081\u308b\ndp = [0] * (n + 1)\n\nfor v in topo:\n # dp2\u306e\u8a08\u7b97\n p = par[v]\n if p == -1:\n dp[v] = dp1[v]\n dp[v] %= m\n continue\n dp2[v] = dp1[p]\n dp2[v] \/\/= dp1[v] + 1 # \u89aa\u5074\u306b\u95a2\u3057\u3066\u81ea\u8eab\u306e\u95a2\u4e0e\u306f\u6d88\u3059\n pp = par[p] # \u89aa\u306e\u89aa\n if pp != -1: # \u89aa\u306e\u89aa\u304c\u3044\u308b\u306a\u3089\u3070\n dp2[v] *= dp2[p] + 1 # \u767d=1\u304b\u9ed2=dp2[pp]\u304b\n\n # dp\u306e\u8a08\u7b97\n dp[v] = dp1[v] * (dp2[v] + 1)\n dp[v] %= m\nprint(*dp[1:], sep=\"\\\\n\")\n","fail":"# \u3053\u308c\u306f\u9006\u5143\u3092\u7528\u3044\u3066\u3084\u308b\uff1f\n# \u3053\u306e\u554f\u984c\u306e\u5834\u5408\u3001\u9006\u5143\u3092\u3046\u307e\u304f\u8a2d\u5b9a\u3059\u308b\u306e\u304c\u96e3\u3057\u3044\u306e\u3067\n# \u5de6\u53f3\u304b\u3089\u306emerge\u306b\u306a\u308a\u305d\u3046\nfrom collections import deque\nimport sys\n\ninput = sys.stdin.buffer.readline\n\n\nn, m = map(int, input().split())\n# \u5404\u3005\u306e\u9802\u70b9\u306e\u6b21\u6570\ndeg = [0] * (n + 1)\n# \u96a3\u63a5\u30ea\u30b9\u30c8\u306b\u30b0\u30e9\u30d5\u3092\u307e\u3068\u3081\u308b\ngraph = [[] for _ in range(n + 1)]\nfor _ in range(n - 1):\n x, y = map(int, input().split())\n graph[x].append(y)\n graph[y].append(x)\n deg[x] += 1\n deg[y] += 1\n\n# dp1\u306f\u8449\u5411\u304d\u306b\u898b\u305f\u3068\u304d\u306e\u5857\u308a\u65b9\n# \u81ea\u8eab\u304c\u9ed2\u3044\u6642\u3001\u4e0b\u306e\u5019\u88dc\u306f\u3069\u3046\u306a\u308b\u304b\uff1f\ndp1 = [0] * (n + 1)\n\n# dp2\u306f\u6839\u5411\u304d\u306b\u898b\u305f\u3068\u304d\u306e\u5857\u308a\u65b9\n# \u81ea\u8eab\u304c\u9ed2\u3044\u6642\u3001\u89aa\u5074\u306e\u5019\u88dc\u306f\u3069\u3046\u306a\u308b\u304b\uff1f\ndp2 = [0] * (n + 1)\n\n# 1\u56de\u76ee\nstart = 1\npar = [-1] * (n + 1)\nque = deque([start])\ntopo = []\nwhile que:\n v = que.popleft()\n topo.append(v)\n for i in range(deg[v]):\n u = graph[v][i]\n if par[v] == u:\n continue\n par[u] = v\n que.append(u)\n\n# dp\u3059\u308b\u3064\u3044\u3067\u306bi=0\u304b\u3089\u306e\u7a4d\u3068i=deg[v]-1\u304b\u3089\u306e\u7a4d\u3092\u53d6\u3063\u3066\u304a\u304f\u304b\u3002\ndpl = [[] for _ in range(n + 1)]\ndpr = [[] for _ in range(n + 1)]\n\n# \u9802\u70b9\u756a\u53f7\u304b\u3089\u4f55\u756a\u76ee\u304b\u304c\u308f\u304b\u308b\u3088\u3046\u306b\u3057\u305f\u3044\u304b\u3089\u8f9e\u66f8\u3067\u6301\u3063\u3066\u304a\u304f\uff1f\nedge_num = [{} for _ in range(n + 1)]\n\nfor v in topo[::-1]:\n temp = 1\n for i in range(deg[v]):\n u = graph[v][i]\n edge_num[v][u] = i # edge_num[v]\u3067\u9802\u70b9v\u306b\u95a2\u3059\u308b\u8f9e\u66f8\u3002\u9802\u70b9u\u304b\u3089idx\u304c\u6b32\u3057\u3044\u306e\u3067\u8a18\u9332\n if u == par[v]:\n dpl[v].append(temp)\n continue\n temp *= dp1[u] + 1\n temp %= m\n dpl[v].append(temp)\n dp1[v] = temp\n temp = 1\n for i in range(deg[v] - 1, -1, -1):\n u = graph[v][i]\n if u == par[v]:\n dpr[v].append(temp)\n continue\n temp *= dp1[u] + 1\n temp %= m\n dpr[v].append(temp)\n# \u3053\u308c\u3067\u666e\u901a\u306e\u6728DP\u306b\u52a0\u3048\u3066\n# \u5de6\u53f3\u304b\u3089\u306e\u7d2f\u7a4d\u7a4d\n# \u9802\u70b9\u756a\u53f7\u304b\u3089idx\u3078\u306e\u8f9e\u66f8\n# \u3092\u7372\u5f97\u3057\u305f\u306f\u305a\n\n# dp\u306f\u6b32\u3057\u3044\u7b54\u3048\u3068\u3057\u3066\u304a\u304f\n# dp1\u3068dp2\u304b\u3089\u6c42\u3081\u308b\ndp = [0] * (n + 1)\n\nfor v in topo:\n # dp2\u306e\u8a08\u7b97\n p = par[v]\n if p == -1: # \u4f8b\u5916\u3001\u89aa\u304c\u3044\u306a\u3044\n dp[v] = dp1[v]\n dp[v] %= m\n continue\n # \u6839\u5074\u306e\u51e6\u7406\n # \u81ea\u5206\u4ee5\u5916\u306e\u7a4d\u3092\u4f5c\u308a\u305f\u3044\n idx = edge_num[p][v]\n num = deg[p]\n dp2[v] = 1\n if idx - 1 >= 0:\n dp2[v] *= dpl[p][idx - 1]\n dp2[v] %= m\n if num - 2 - idx >= 0:\n dp2[v] *= dpr[p][num - 2 - idx]\n dp2[v] %= m\n # \u6839\u5074\u306e\u6839\u5074\u306e\u51e6\u7406\n pp = par[p] # \u89aa\u306e\u89aa\n if pp != -1: # \u89aa\u306e\u89aa\u304c\u3044\u308b\u306a\u3089\u3070\n dp2[v] *= dp2[p] + 1 # \u767d=1\u304b\u9ed2=dp2[pp]\u304b\n dp2[v] %= m\n # dp\u306e\u8a08\u7b97\n dp[v] = dp1[v] * (dp2[v] + 1)\n dp[v] %= m\nprint(*dp[1:], sep=\"\\\\n\")\n","change":"replace","i1":0,"i2":59,"j1":0,"j2":104,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03194","language":"Python","original_status":"Time Limit Exceeded","pass":"N, P = list(map(int, input().split()))\nif N == 1:\n print(P)\n exit()\nelif P == 1:\n print(\"1\")\n exit()\n\nans = 1\ntmp = P\n\nfor i in range(2, P):\n po = pow(i, N)\n while tmp % po == 0:\n tmp = tmp \/\/ po\n ans = ans * i\n # print(i, tmp, ans)\n\n if tmp < po:\n break\n\nprint(ans)\n","fail":"N, P = list(map(int, input().split()))\nif N == 1:\n print(P)\n exit()\nelif P == 1:\n print(\"1\")\n exit()\n\nans = 1\ntmp = P\n\nfor i in range(2, int(pow(P, 1 \/ N)) + 1):\n po = pow(i, N)\n while tmp % po == 0:\n tmp = tmp \/\/ po\n ans = ans * i\n # print(i, tmp, ans)\n\n if tmp < po:\n break\n\nprint(ans)\n","change":"replace","i1":11,"i2":12,"j1":11,"j2":12,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03194","language":"Python","original_status":"Runtime Error","pass":"import sympy\n\nn, p = map(int, input().split())\na = sympy.factorint(p)\nans = 1\nfor i, j in a.items():\n if j >= n:\n ans *= i\nprint(ans)\n","fail":"def usage():\n c, n = map(int, input().split())\n if c == 1:\n print(n)\n return 0\n ans = 1\n fct = factorize(n)\n for i in range(len(fct)):\n if fct[i][1] >= c:\n ans *= fct[i][0] ** (fct[i][1] \/\/ c)\n print(ans)\n\n\ndef factorize(n):\n fct = []\n b, e = 2, 0\n while b * b <= n:\n while n % b == 0:\n n = n \/\/ b\n e = e + 1\n if e > 0:\n fct.append((b, e))\n b, e = b + 1, 0\n if n > 1:\n fct.append((n, 1))\n return fct\n\n\nif __name__ == \"__main__\":\n usage()\n","change":"replace","i1":0,"i2":9,"j1":0,"j2":30,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p03195","language":"Python","original_status":"Runtime Error","pass":"N = int(input())\na = [int(input()) for _ in range(N)] * [0, 0]\na.sort()\nif len(a) >= 2:\n res = a[-2]\nelse:\n res = a[-1]\nres += sum(a[:-2])\nprint(\"second\" if res % 2 == 0 else \"first\")\n","fail":"N = int(input())\na = [int(input()) % 2 for _ in range(N)]\nres = sum(a)\nprint(\"first\" if res > 0 else \"second\")\n","change":"replace","i1":1,"i2":9,"j1":1,"j2":4,"error":"TypeError: can't multiply sequence by non-int of type 'list'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03195\/Python\/s025451632.py\", line 2, in \n a = [int(input()) for _ in range(N)] * [0, 0]\nTypeError: can't multiply sequence by non-int of type 'list'\n","stdout":null} {"problem_id":"p03196","language":"Python","original_status":"Time Limit Exceeded","pass":"def main():\n N, P = map(int, input().split())\n\n left = 0\n right = 10**12\n while left + 1 < right:\n mid = (left + right) \/\/ 2\n if mid**N <= P:\n left = mid\n else:\n right = mid\n\n cnt = 0\n for j in range(left, 0, -1):\n if P % (j**N) == 0:\n print(j)\n break\n else:\n cnt += 1\n\n j = left\n cnt = 0\n while P % (j**N) != 0:\n cnt += 1\n j = left \/\/ cnt\n\n\nmain()\n","fail":"def factorization(n):\n arr = []\n temp = n\n for i in range(2, int(-(-(n**0.5) \/\/ 1)) + 1):\n if temp % i == 0:\n cnt = 0\n while temp % i == 0:\n cnt += 1\n temp \/\/= i\n arr.append([i, cnt])\n\n if temp != 1:\n arr.append([temp, 1])\n\n if arr == []:\n arr.append([n, 1])\n\n return arr\n\n\ndef main():\n N, P = map(int, input().split())\n A = factorization(P)\n\n B = []\n for a, b in A:\n if b >= N:\n B.append((a, b \/\/ N))\n\n ans = 1\n for a, b in B:\n ans *= a**b\n print(ans)\n\n\nmain()\n","change":"replace","i1":0,"i2":25,"j1":0,"j2":33,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03196","language":"Python","original_status":"Runtime Error","pass":"N, P = map(int, input().split())\nP_prime = []\nwhile P % 2 == 0:\n P_prime.append(2)\n P \/\/= 2\nodd = 3\nwhile odd * odd <= P:\n if P % odd == 0:\n P_prime.append(odd)\n P \/\/= odd\n else:\n odd += 2\nif P != 1:\n P_prime.append(P)\nedge = [0]\nfor i in range(len(P_prime) - 1):\n if P_prime[i] != P_prime[i + 1]:\n edge.append(i)\nedge.append(len(P_prime) - 1)\nans = 1\nfor i in range(len(edge) - 1):\n ans *= pow(P_prime[edge[i + 1]], (edge[i + 1] - edge[i]) \/\/ N)\nprint(ans)\n","fail":"import collections as cl\n\nN, P = map(int, input().split())\nif P == 1:\n print(1)\n exit()\nP_prime = []\nwhile P % 2 == 0:\n P_prime.append(2)\n P \/\/= 2\nodd = 3\nwhile odd * odd <= P:\n if P % odd == 0:\n P_prime.append(odd)\n P \/\/= odd\n else:\n odd += 2\nif P != 1:\n P_prime.append(P)\n\nans = 1\ndic_P = cl.Counter(P_prime)\nfor prime, num in dic_P.items():\n ans *= pow(prime, num \/\/ N)\nprint(ans)\n","change":"replace","i1":0,"i2":22,"j1":0,"j2":24,"error":"WA","stderr":null,"stdout":1.0} {"problem_id":"p03196","language":"Python","original_status":"Time Limit Exceeded","pass":"N, P = map(int, input().split())\n\ndiv = 2\nres = 1\nwhile div * div <= P:\n cnt = 0\n tmp = P\n while P % div == 0:\n tmp \/= div\n cnt += 1\n\n if cnt == N:\n res *= div\n cnt = 0\n div += 1\n\nprint(res)\n","fail":"N, P = map(int, input().split())\n\nif N == 1:\n print(P)\n exit()\n\ndiv = 2\nres = 1\nR = P\n\nwhile div * div <= R and div <= P:\n cnt = 0\n while P % div == 0:\n P \/= div\n cnt += 1\n\n if cnt == N:\n res *= div\n cnt = 0\n div += 1\n\nprint(res)\n","change":"replace","i1":1,"i2":9,"j1":1,"j2":14,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03196","language":"Python","original_status":"Time Limit Exceeded","pass":"n, p = map(int, input().split())\nprime = set()\nans = 1\nfor i in range(2, p + 1):\n for x in prime:\n if i % x == 0:\n break\n else:\n prime.add(i)\n cnt = 0\n while p % i == 0:\n p \/\/= i\n cnt += 1\n if cnt >= n:\n ans *= i * (cnt \/\/ n)\n\nprint(ans)\n","fail":"from copy import deepcopy\nfrom math import ceil\n\nn, p = map(int, input().split())\nans = 1\nq = deepcopy(p)\nfor i in range(2, int(p**0.5) + 2):\n cnt = 0\n while p % i == 0:\n p \/\/= i\n cnt += 1\n if cnt > 0:\n ans *= i ** (cnt \/\/ n)\n\nprint(ans if p != q and n != 1 else q)\n","change":"replace","i1":0,"i2":17,"j1":0,"j2":15,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03196","language":"Python","original_status":"Time Limit Exceeded","pass":"def prime_factorization(n):\n res = []\n for i in range(2, int(pow(n, 0.5)) + 1):\n if n % i == 0:\n ex = 0\n while n % i == 0:\n ex += 1\n n \/\/= i\n res.append([i, ex])\n if n != 1:\n res.append([n, 1])\n return res\n\n\nn, p = map(int, input().split())\nres = prime_factorization(p)\nans = [1 for _ in range(n)]\nfor p in res:\n k = p[1]\n while k:\n for i in range(n):\n if k == 0:\n break\n ans[i] *= p[0]\n k -= 1\n\nprint(min(ans))\n","fail":"n, p = map(int, input().split())\n\nres = []\nfor i in range(2, int(pow(p, 0.5)) + 1):\n if p % i == 0:\n ex = 0\n while p % i == 0:\n ex += 1\n p \/\/= i\n res.append([i, ex])\nif p != 1:\n res.append([p, 1])\n\nans = 1\nfor p in res:\n k = p[1]\n while k:\n if k < n:\n k = 0\n else:\n ans *= p[0]\n k -= n\nprint(ans)\n","change":"replace","i1":0,"i2":27,"j1":0,"j2":23,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03196","language":"Python","original_status":"Runtime Error","pass":"def main():\n N, P = map(int, input().split())\n if N == 1:\n print(P)\n return\n primes = []\n i = 2\n while i**N <= P:\n isprime = True\n for p in primes:\n if i % p == 0:\n isprime = False\n break\n if isprime:\n primes.append(i)\n i += 1\n\n F = {}\n i = 0\n while P > 1 and i < len(primes):\n factor = primes[i]\n while P % factor == 0:\n if factor not in F:\n F[factor] = 0\n F[factor] += 1\n P \/\/= factor\n i += 1\n retval = 1\n for p in F:\n if F[p] >= N:\n retval *= p\n print(retval)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"def main():\n N, P = map(int, input().split())\n if N == 1:\n print(P)\n return\n if N >= 40:\n print(1)\n return\n\n i = 2\n retval = 1\n while P > 1 and i**N <= P:\n cnt = 0\n while P % i == 0:\n cnt += 1\n P \/\/= i\n retval *= i ** (cnt \/\/ N)\n i += 1\n print(retval)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":5,"i2":31,"j1":5,"j2":18,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p03197","language":"Python","original_status":"Runtime Error","pass":"print(\"second\" if all([int(input()) % 2 == 0 for i in range(input())]) else \"first\")\n","fail":"print(\"second\" if all([int(input()) % 2 == 0 for i in range(int(input()))]) else \"first\")\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"TypeError: 'str' object cannot be interpreted as an integer","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03197\/Python\/s329085131.py\", line 1, in \n print(\"second\" if all([int(input()) % 2 == 0 for i in range(input())]) else \"first\")\nTypeError: 'str' object cannot be interpreted as an integer\n","stdout":null} {"problem_id":"p03200","language":"Python","original_status":"Time Limit Exceeded","pass":"S = input()[::-1]\nc = 0\nwhile S.find(\"WB\") != -1:\n S = S.replace(\"WB\", \"BW\", 1)\n c += 1\nprint(c)\n","fail":"S = input()\nS = S[::-1]\ny = -1\n\n\ndef x():\n global y\n y += 1\n return y\n\n\nc = [i - x() for i in range(len(S)) if S[i] == \"B\"]\nprint(sum(c))\n","change":"replace","i1":0,"i2":6,"j1":0,"j2":13,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03200","language":"Python","original_status":"Time Limit Exceeded","pass":"s = input()\n\ncount = 0\n\nwhile True:\n cnt = s.count(\"BW\")\n if cnt > 0:\n s = s.replace(\"BW\", \"WB\")\n count += cnt\n else:\n break\n\nprint(count)\n","fail":"s = list(input())\n\ncount = 0\nw_cnt = 0\n\nfor index in range(len(s))[::-1]:\n if s[index] == \"W\":\n w_cnt += 1\n else:\n count += w_cnt\n\nprint(count)\n","change":"replace","i1":0,"i2":11,"j1":0,"j2":10,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03200","language":"Python","original_status":"Time Limit Exceeded","pass":"S = input()\nans = 0\nprev = None\nwhile prev != ans:\n prev = ans\n ans += S.count(\"BW\")\n S = S.replace(\"BW\", \"WB\")\nprint(ans)\n","fail":"S = input()\nans = 0\nblack = 0\nfor c in S:\n if c == \"B\":\n black += 1\n else:\n ans += black\nprint(ans)\n","change":"replace","i1":2,"i2":7,"j1":2,"j2":8,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03200","language":"Python","original_status":"Time Limit Exceeded","pass":"import numpy as np\n\n\ndef main():\n s = input()\n\n b = np.array([])\n cnt = 0\n for i, e in enumerate(s):\n if e == \"B\":\n b = np.append(b, i)\n cnt += 1\n\n b_fin = np.arange(len(s) - cnt, len(s))\n\n ans = int(np.sum(b_fin - b))\n\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"import numpy as np\n\n\ndef main():\n s = input()\n\n b = []\n cnt = 0\n for i, e in enumerate(s):\n if e == \"B\":\n b.append(i)\n cnt += 1\n\n b = np.array(b)\n b_fin = np.arange(len(s) - cnt, len(s))\n\n ans = int(np.sum(b_fin - b))\n\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":6,"i2":13,"j1":6,"j2":14,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03200","language":"Python","original_status":"Time Limit Exceeded","pass":"S = input()\n\ncnt = 0\nwhile \"BW\" in S:\n cnt += S.count(\"BW\")\n S = S.replace(\"BW\", \"WB\")\n\nprint(cnt)\n","fail":"S = input()\n\nans = 0\ncnt = 0\nfor i in range(len(S)):\n if S[i] == \"B\":\n cnt += 1\n else:\n ans += cnt\nprint(ans)\n","change":"replace","i1":2,"i2":8,"j1":2,"j2":10,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03200","language":"Python","original_status":"Time Limit Exceeded","pass":"s = input()\nreverse_count = 0\nwhile \"BW\" in s:\n reverse_count += s.count(\"BW\")\n s = s.replace(\"BW\", \"WB\")\nprint(reverse_count)\n","fail":"s = list(input())\nW_count = 0\nans = 0\nfor i in range(len(s)):\n if s[i] == \"W\":\n ans += i - W_count\n W_count += 1\nprint(ans)\n","change":"replace","i1":0,"i2":6,"j1":0,"j2":8,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03200","language":"Python","original_status":"Time Limit Exceeded","pass":"s = list(input())\nnum_list = [s[:i].count(\"B\") if s[i] == \"W\" else 0 for i in range(1, len(s))]\nprint(str(sum(num_list)))\n","fail":"s = list(\"BWBWBW\" * 10000)\n\ns = list(input())\nret, counter = 0, 0\nfor a in s:\n if a == \"B\":\n counter += 1\n else:\n ret += counter\nprint(str(ret))\n","change":"replace","i1":0,"i2":3,"j1":0,"j2":10,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03200","language":"Python","original_status":"Time Limit Exceeded","pass":"S = input()\nans = 0\nwhile \"BW\" in S:\n S = S.replace(\"BW\", \"WB\", 1)\n ans += 1\n\nprint(ans)\n","fail":"S = input()\nb_cnt = 0\nans = 0\nfor c in S:\n if c == \"B\":\n b_cnt += 1\n else:\n ans += b_cnt\n\nprint(ans)\n","change":"replace","i1":1,"i2":5,"j1":1,"j2":8,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03200","language":"Python","original_status":"Time Limit Exceeded","pass":"def resolve():\n s = input()\n ans = 0\n for i in range(len(s)):\n if s[i] == \"W\":\n ans += s[:i].count(\"B\")\n print(ans)\n\n\nif __name__ == \"__main__\":\n resolve()\n","fail":"def resolve():\n s = input()\n ans = 0\n b = 0\n for i in range(len(s)):\n if s[i] == \"W\":\n ans += b\n else:\n b += 1\n print(ans)\n\n\nif __name__ == \"__main__\":\n resolve()\n","change":"replace","i1":3,"i2":6,"j1":3,"j2":9,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03201","language":"Python","original_status":"Runtime Error","pass":"N, *A = map(int, open(0).read().split())\n\nS = set(A)\n\nA.sort(reverse=True)\n\nans = 0\nfor a in A:\n b = 2 ** a.bit_length() - a\n if a != b and b in S:\n S.remove(a)\n S.remove(b)\n ans += 1\n\nprint(ans)\n","fail":"from collections import Counter\n\nN, *A = map(int, open(0).read().split())\n\nC = Counter(A)\nA.sort(reverse=True)\n\nans = 0\nfor a in A:\n if C[a] == 0:\n continue\n C[a] -= 1\n\n b = 2 ** a.bit_length() - a\n if C[b] > 0:\n C[b] -= 1\n ans += 1\n\nprint(ans)\n","change":"replace","i1":0,"i2":12,"j1":0,"j2":16,"error":"0","stderr":null,"stdout":1.0} {"problem_id":"p03201","language":"Python","original_status":"Time Limit Exceeded","pass":"# from math import log2\nfrom math import log\nfrom bisect import bisect_left\n\n\ndef log2(x):\n return log(x, 2)\n\n\ndef getComp(n):\n return (1 << (1 + int(log2(n)))) - n\n\n\nN = int(input())\nA = [int(s) for s in input().split()]\nA.sort()\n\ncount = 0\ni = len(A)\nwhile i > 0:\n i -= 1\n comp = getComp(A[i])\n j = bisect_left(A, comp)\n if i == j or A[j] != comp:\n continue\n if i < j:\n A.pop(j)\n A.pop(i)\n else:\n A.pop(i)\n A.pop(j)\n count += 1\n i -= 1\n\nprint(count)\n","fail":"# from math import log2\nfrom math import log\nfrom bisect import bisect_left\n\n\ndef log2(x):\n return log(x, 2)\n\n\ndef getComp(n):\n return (1 << (1 + int(log2(n)))) - n\n\n\nN = int(input())\nA = [int(s) for s in input().split()]\nA.sort()\nB = []\nC = []\ni = 0\nwhile i < len(A):\n j = i\n count = 1\n while i + 1 < len(A) and A[j] == A[i + 1]:\n count += 1\n i += 1\n B.append(A[j])\n C.append(count)\n i += 1\n\ncount = 0\ni = len(B) - 1\nwhile i >= 0:\n comp = getComp(B[i])\n j = bisect_left(B, comp)\n if i == j and C[i] < 2:\n i -= 1\n continue\n if B[j] != comp:\n i -= 1\n continue\n if not C[i] or not C[j]:\n i -= 1\n continue\n C[i] -= 1\n C[j] -= 1\n count += 1\n\nprint(count)\n","change":"replace","i1":16,"i2":33,"j1":16,"j2":46,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03202","language":"Python","original_status":"Time Limit Exceeded","pass":"input()\nA = [int(_) for _ in input().split()]\nA = [A[0]] + [j for i, j in zip(A, A[1:]) if i >= j]\nN = len(A)\n\n\ndef cut(array, index):\n if index < 1:\n return []\n for _ in range(len(array)):\n if index <= array[_][0]:\n return array[:_] + [(index, array[_][1])]\n\n\ndef is_possible(K):\n dp = [(A[0], 0)]\n for a in A[1:]:\n if a <= dp[-1][0]:\n dp = cut(dp, a)\n else:\n dp += [(a, 0)]\n is_added = False\n for j in range(len(dp) - 1, -1, -1):\n if dp[j][1] < K - 1:\n dp = cut(dp, dp[j][0] - 1) + [(dp[j][0], dp[j][1] + 1)]\n if dp[-1][0] < a:\n dp += [(a, 0)]\n is_added = True\n break\n if not is_added:\n return False\n return True\n\n\ndef bis(x, y):\n if y == x + 1:\n return y\n elif is_possible((x + y) \/\/ 2):\n return bis(x, (x + y) \/\/ 2)\n else:\n return bis((x + y) \/\/ 2, y)\n\n\nprint(bis(0, N))\n","fail":"import random\n\ninput()\nA = [int(_) for _ in input().split()]\nA = [A[0]] + [j for i, j in zip(A, A[1:]) if i >= j]\nN = len(A)\n\n\ndef cut(array, index):\n if index < 1:\n return []\n if index <= array[0][0]:\n return [(index, array[0][1])]\n for _ in range(len(array) - 1, 0, -1):\n if array[_ - 1][0] < index:\n return array[:_] + [(index, array[_][1])]\n\n\ndef is_possible(K):\n dp = [(A[0], 0)]\n for a in A[1:]:\n if a <= dp[-1][0]:\n dp = cut(dp, a)\n else:\n dp += [(a, 0)]\n is_added = False\n for j in range(len(dp) - 1, -1, -1):\n if dp[j][1] < K - 1:\n dp = cut(dp, dp[j][0] - 1) + [(dp[j][0], dp[j][1] + 1)]\n if dp[-1][0] < a:\n dp += [(a, 0)]\n is_added = True\n break\n if not is_added:\n return False\n return True\n\n\ndef bis(x, y):\n if y == x + 1:\n return y\n elif is_possible((x + y) \/\/ 2):\n return bis(x, (x + y) \/\/ 2)\n else:\n return bis((x + y) \/\/ 2, y)\n\n\nprint(bis(0, N))\n","change":"replace","i1":0,"i2":11,"j1":0,"j2":15,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03206","language":"Python","original_status":"Runtime Error","pass":"def solve():\n d = int(input())\n eves = 25 - d\n return \"Christmas\" + \" Eve\" + eves\n\n\nif __name__ == \"__main__\":\n print(solve())\n","fail":"def solve():\n d = int(input())\n eves = 25 - d\n return \"Christmas\" + \" Eve\" * eves\n\n\nif __name__ == \"__main__\":\n print(solve())\n","change":"replace","i1":3,"i2":4,"j1":3,"j2":4,"error":"TypeError: can only concatenate str (not \"int\") to str","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03206\/Python\/s602998179.py\", line 8, in \n print(solve())\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03206\/Python\/s602998179.py\", line 4, in solve\n return \"Christmas\" + \" Eve\" + eves\nTypeError: can only concatenate str (not \"int\") to str\n","stdout":null} {"problem_id":"p03206","language":"Python","original_status":"Runtime Error","pass":"print(f\"Christmas {' '.join(['Eve'] * (25 - int(input())))}\".strip())\n","fail":"print(\"Christmas {}\".format(\" \".join([\"Eve\"] * (25 - int(input())))).strip())\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"0","stderr":null,"stdout":"Christmas\n"} {"problem_id":"p03207","language":"Python","original_status":"Runtime Error","pass":"N = input()\np = [int(input()) for i in range(N)]\nprint(sum(p) - max(p) \/\/ 2)\n","fail":"N = int(input())\np = [int(input()) for i in range(N)]\nprint(sum(p) - max(p) \/\/ 2)\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"TypeError: 'str' object cannot be interpreted as an integer","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03207\/Python\/s736160846.py\", line 2, in \n p = [int(input()) for i in range(N)]\nTypeError: 'str' object cannot be interpreted as an integer\n","stdout":null} {"problem_id":"p03207","language":"Python","original_status":"Runtime Error","pass":"N = int(input())\np = [int(input()) for _ in N]\nprint(sum(p) - max(p) \/\/ 2)\n","fail":"N = int(input())\np = [int(input()) for _ in range(N)]\nprint(sum(p) - max(p) \/\/ 2)\n","change":"replace","i1":1,"i2":2,"j1":1,"j2":2,"error":"TypeError: 'int' object is not iterable","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03207\/Python\/s805819022.py\", line 2, in \n p = [int(input()) for _ in N]\nTypeError: 'int' object is not iterable\n","stdout":null} {"problem_id":"p03207","language":"Python","original_status":"Runtime Error","pass":"input_ = input()\n\nm = 0\ns = 0\nfor i in input_.splitlines():\n n = int(i)\n if i > max:\n max = i\n sum += n\n\nprint(sum - (max \/ 2))\n","fail":"n = input()\na = []\nfor i in range(int(n)):\n a.append(int(input()))\n\nprint(int(sum(a) - (max(a) \/ 2)))\n","change":"replace","i1":0,"i2":11,"j1":0,"j2":6,"error":"TypeError: '>' not supported between instances of 'str' and 'builtin_function_or_method'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03207\/Python\/s128564026.py\", line 7, in \n if i > max:\nTypeError: '>' not supported between instances of 'str' and 'builtin_function_or_method'\n","stdout":null} {"problem_id":"p03207","language":"Python","original_status":"Runtime Error","pass":"n = int(input())\n\nmax_index = 0\nmax_price = 0\nprice_list = []\n\nfor i in range(0, n + 1):\n p = int(input())\n price_list.append(p)\n if max_price < p:\n max_index = i\n\nsum = 0\nfor i, p in enumerate(price_list):\n if i == max_index:\n sum += p \/ 2\n else:\n sum += p\n\nprint(sum)\n","fail":"n = int(input())\n\nmax_index = 0\nmax_price = 0\nprice_list = []\n\nfor i in range(0, n):\n p = int(input())\n price_list.append(p)\n if max_price < p:\n max_price = p\n max_index = i\n\np_sum = 0\nfor i, p in enumerate(price_list):\n if i == max_index:\n p_sum += p \/ 2\n else:\n p_sum += p\n\nprint(int(p_sum))\n","change":"replace","i1":6,"i2":20,"j1":6,"j2":21,"error":"EOFError: EOF when reading a line","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03207\/Python\/s849232280.py\", line 8, in \n p = int(input())\nEOFError: EOF when reading a line\n","stdout":null} {"problem_id":"p03208","language":"Python","original_status":"Runtime Error","pass":"n, k = map(int, input().split())\nh = sorted([int(input()) for _ in range(n)])\nans = 1000000000\n\nfor i in range(n - k + 1):\n ans = min(ans, h[i + k - 11] - h[i])\n\nprint(ans)\n","fail":"n, k = map(int, input().split())\nh = sorted([int(input()) for _ in range(n)])\nans = 1000000000\n\nfor i in range(n - k + 1):\n ans = min(ans, h[i + k - 1] - h[i])\n\nprint(ans)\n","change":"replace","i1":5,"i2":6,"j1":5,"j2":6,"error":"IndexError: list index out of range","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03208\/Python\/s843004810.py\", line 6, in \n ans = min(ans, h[i + k - 11] - h[i])\nIndexError: list index out of range\n","stdout":null} {"problem_id":"p03208","language":"Python","original_status":"Runtime Error","pass":"def main(n: int, k: int, h: list):\n h.sort()\n\n print(min([h[i + k - 1] - h[i] for i in range(n - k + 1)]))\n\n\nif __name__ == \"__main__\":\n n, k = map(int, input().split())\n h = [input() for _ in range(n)]\n\n main(n, k, h)\n","fail":"def main(n: int, k: int, h: list):\n h.sort()\n\n print(min([h[i + k - 1] - h[i] for i in range(n - k + 1)]))\n\n\nif __name__ == \"__main__\":\n n, k = map(int, input().split())\n h = [int(input()) for _ in range(n)]\n\n main(n, k, h)\n","change":"replace","i1":8,"i2":9,"j1":8,"j2":9,"error":"TypeError: unsupported operand type(s) for -: 'str' and 'str'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03208\/Python\/s200032587.py\", line 11, in \n main(n, k, h)\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03208\/Python\/s200032587.py\", line 4, in main\n print(min([h[i + k - 1] - h[i] for i in range(n - k + 1)]))\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03208\/Python\/s200032587.py\", line 4, in \n print(min([h[i + k - 1] - h[i] for i in range(n - k + 1)]))\nTypeError: unsupported operand type(s) for -: 'str' and 'str'\n","stdout":null} {"problem_id":"p03209","language":"Python","original_status":"Runtime Error","pass":"N, X = map(int, input().split())\n\n\ndef f(n):\n # \u30ec\u30d9\u30ebn\u306e\u7dcf\u6570\n if n == 0:\n return 1\n else:\n return 2 * f(n - 1) + 3\n\n\ndef g(n):\n # \u30ec\u30d9\u30ebn\u306ep\u306e\u6570\n if n == 0:\n return 1\n else:\n return 2 * g(n - 1) + 1\n\n\ndef dfs(n, x):\n # \u7dcf\u6570\n m = f(n)\n # \u771f\u3093\u4e2d\n a = (m + 1) \/\/ 2\n\n if x == a:\n return g(n - 1) + 1\n elif x == 1:\n return 0\n elif x < a:\n return dfs(n - 1, x - 1)\n elif x >= a:\n return g(n - 1) + 1 + dfs(n - 1, x - a)\n elif x == m:\n return 2 * g(n - 1) + 1\n\n\nans = dfs(N, X)\nprint(ans)\n","fail":"N, X = map(int, input().split())\n\n\ndef f(n):\n # \u30ec\u30d9\u30ebn\u306e\u7dcf\u6570\n if n == 0:\n return 1\n else:\n return 2 * f(n - 1) + 3\n\n\ndef g(n):\n # \u30ec\u30d9\u30ebn\u306ep\u306e\u6570\n if n == 0:\n return 1\n else:\n return 2 * g(n - 1) + 1\n\n\ndef dfs(n, x):\n # \u7dcf\u6570\n m = f(n)\n # \u771f\u3093\u4e2d\n a = (m + 1) \/\/ 2\n\n if n == 0:\n return 1\n elif x == 1:\n return 0\n elif x < a:\n return dfs(n - 1, x - 1)\n elif x == a:\n return g(n - 1) + 1\n elif x >= a:\n return g(n - 1) + 1 + dfs(n - 1, x - a)\n elif x == m:\n return 2 * g(n - 1) + 1\n\n\nans = dfs(N, X)\nprint(ans)\n","change":"replace","i1":25,"i2":31,"j1":25,"j2":33,"error":0,"stderr":null,"stdout":4} {"problem_id":"p03210","language":"Python","original_status":"Runtime Error","pass":"#!\/usr\/bin\/env python3\n\na = int(input())\na, b = list(map(int, input().split()))\na = list(str(input()))\n","fail":"#!\/usr\/bin\/env python3\n\nx = int(input())\n\nif x == 3 or x == 5 or x == 7:\n print(\"YES\")\nelse:\n print(\"NO\")\n","change":"replace","i1":2,"i2":5,"j1":2,"j2":8,"error":"EOFError: EOF when reading a line","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03210\/Python\/s739413400.py\", line 4, in \n a, b = list(map(int, input().split()))\nEOFError: EOF when reading a line\n","stdout":null} {"problem_id":"p03211","language":"Python","original_status":"Runtime Error","pass":"import math\n\nstr = list(input()) # \u4e00\u6587\u5b57\u305a\u3064\u683c\u7d0d\nans = math.inf\n\nfor i in range(len(str) - 1):\n sa = abs(int(str[i - 1]) * 100 + int(str[i]) * 10 + int(str[i + 1]) - 753)\n\n ans = min(ans, sa)\n\nprint(ans)\n","fail":"str = list(input()) # \u4e00\u6587\u5b57\u305a\u3064\u683c\u7d0d\nans = 1000\n\nfor i in range(len(str) - 2):\n sa = abs(int(str[i]) * 100 + int(str[i + 1]) * 10 + int(str[i + 2]) - 753)\n ans = min(ans, sa)\n\nprint(ans)\n","change":"replace","i1":0,"i2":8,"j1":0,"j2":5,"error":0,"stderr":null,"stdout":34} {"problem_id":"p03215","language":"Python","original_status":"Time Limit Exceeded","pass":"from itertools import accumulate\n\nN, K = map(int, input().split())\nAs = list(map(int, input().split()))\n\naccAs = [0] + list(accumulate(As))\n\nBs = []\nfor L in range(N):\n for R in range(L, N):\n Bs.append(accAs[R + 1] - accAs[L])\n\nans = 0\nfor d in reversed(range(50)):\n num = sum([(B >> d) & 1 for B in Bs])\n if num >= K:\n ans += 1 << d\n Bs = [B if (B >> d) & 1 else 0 for B in Bs]\n\nprint(ans)\n","fail":"from itertools import accumulate\n\nN, K = map(int, input().split())\nAs = list(map(int, input().split()))\n\naccAs = [0] + list(accumulate(As))\n\nBs = []\nfor L in range(N):\n for R in range(L, N):\n Bs.append(accAs[R + 1] - accAs[L])\n\nans = 0\nfor d in reversed(range(40)):\n num = sum([(B >> d) & 1 for B in Bs])\n if num >= K:\n ans += 1 << d\n Bs = [B for B in Bs if (B >> d) & 1]\n\nprint(ans)\n","change":"replace","i1":13,"i2":18,"j1":13,"j2":18,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03219","language":"Python","original_status":"Runtime Error","pass":"x, y = map(int, input().split())\n\nprint(int(x + y \/ 2))\nx, y = map(int, input().split())\n\nprint(int(x + y \/ 2))\n","fail":"x, y = map(int, input().split())\n\nprint(int(x + y \/ 2))\n","change":"delete","i1":3,"i2":6,"j1":3,"j2":3,"error":"EOFError: EOF when reading a line","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03219\/Python\/s372051841.py\", line 4, in \n x, y = map(int, input().split())\nEOFError: EOF when reading a line\n","stdout":110.0} {"problem_id":"p03219","language":"Python","original_status":"Runtime Error","pass":"x, y = int(input())\n\nprint(x + y \/ 2)\n","fail":"x, y = map(int, input().split())\n\nprint(x + int(y \/ 2))\n","change":"replace","i1":0,"i2":3,"j1":0,"j2":3,"error":"ValueError: invalid literal for int() with base 10: '81 58'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03219\/Python\/s824577501.py\", line 1, in \n x, y = int(input())\nValueError: invalid literal for int() with base 10: '81 58'\n","stdout":null} {"problem_id":"p03219","language":"Python","original_status":"Runtime Error","pass":"def solve():\n x, y = map(int, input())\n return x + y \/\/ 2\n\n\nif __name__ == \"__main__\":\n print(solve())\n","fail":"def solve():\n x, y = map(int, input().split())\n return x + y \/\/ 2\n\n\nif __name__ == \"__main__\":\n print(solve())\n","change":"replace","i1":1,"i2":2,"j1":1,"j2":2,"error":"ValueError: invalid literal for int() with base 10: ' '","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03219\/Python\/s803037603.py\", line 7, in \n print(solve())\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03219\/Python\/s803037603.py\", line 2, in solve\n x, y = map(int, input())\nValueError: invalid literal for int() with base 10: ' '\n","stdout":null} {"problem_id":"p03220","language":"Python","original_status":"Runtime Error","pass":"n = int(input())\nt, a = map(int, input().split())\nb = [abs(a - (t - i * 0.006)) for i in list(map(int, input().split()))]\nprint(b.index(min(b) + 1))\n","fail":"n = int(input())\nt, a = map(int, input().split())\nb = [abs(a - (t - i * 0.006)) for i in list(map(int, input().split()))]\nprint(b.index(min(b)) + 1)\n","change":"replace","i1":3,"i2":4,"j1":3,"j2":4,"error":"ValueError: 2.0 is not in list","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03220\/Python\/s852227382.py\", line 4, in \n print(b.index(min(b) + 1))\nValueError: 2.0 is not in list\n","stdout":null} {"problem_id":"p03220","language":"Python","original_status":"Runtime Error","pass":"n = int(input())\nt, a = map(int, input().split())\nlist = [int(i) for i in input().split()]\n\ndif_list = []\nanswer = 0\n\nfor i in range(n):\n t_i = t - list(i) * 0.006\n t_i_dif = abs(a - t_i)\n dif_list.append(t_i_dif)\n if min(dif_list) == t_i_dif:\n answer = i + 1\n\nprint(answer)\n","fail":"n = int(input())\nt, a = map(int, input().split())\nlist = [int(i) for i in input().split()]\n\ndif_list = []\nanswer = 0\n\nfor i in range(n):\n t_i = t - list[i] * 0.006\n t_i_dif = abs(a - t_i)\n dif_list.append(t_i_dif)\n if min(dif_list) == t_i_dif:\n answer = i + 1\n\nprint(answer)\n","change":"replace","i1":8,"i2":9,"j1":8,"j2":9,"error":"TypeError: 'list' object is not callable","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03220\/Python\/s862713349.py\", line 9, in \n t_i = t - list(i) * 0.006\nTypeError: 'list' object is not callable\n","stdout":null} {"problem_id":"p03220","language":"Python","original_status":"Runtime Error","pass":"n = int(input())\nt, a = map(int, input().split())\nt *= 1000\na *= 1000\nlst = list(map(int, input().split()))\ntmp = abs(t - 6 * lst[0] - a)\ntmpa = 0\nfor i in range(1, n):\n temp = abs(t - 6 * lst[i] - a)\n if temp < tmp:\n tmp = tmp\n tmpa = i\nprint(tmpa + 1)\nn = int(input())\nt, a = map(int, input().split())\nt *= 1000\na *= 1000\nlst = list(map(int, input().split()))\ntmp = abs(t - 6 * lst[0] - a)\ntmpa = 0\nfor i in range(1, n):\n temp = abs(t - 6 * lst[i] - a)\n if temp < tmp:\n tmp = temp\n tmpa = i\nprint(tmpa + 1)\n","fail":"n = int(input())\nt, a = map(int, input().split())\nt *= 1000\na *= 1000\nlst = list(map(int, input().split()))\ntmp = abs(t - 6 * lst[0] - a)\ntmpa = 0\nfor i in range(1, n):\n temp = abs(t - 6 * lst[i] - a)\n if temp < tmp:\n tmp = temp\n tmpa = i\nprint(tmpa + 1)\n","change":"delete","i1":0,"i2":13,"j1":0,"j2":0,"error":"EOFError: EOF when reading a line","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03220\/Python\/s164286419.py\", line 14, in \n n = int(input())\nEOFError: EOF when reading a line\n","stdout":1.0} {"problem_id":"p03221","language":"Python","original_status":"Time Limit Exceeded","pass":"import sys\nfrom collections import defaultdict\n\nn, m = map(int, sys.stdin.readline().strip().split(\" \", 2))\ncount_city = defaultdict(list)\n\nfor line in sys.stdin:\n p, y = map(int, line.strip().split(\" \", 2))\n count_city[p].append(y)\n\n\nfor p, yl in count_city.iteritems():\n count_city[p] = sorted(yl)\n\n sys.stdin.seek(0)\n n, m = map(int, sys.stdin.readline().strip().split(\" \", 2))\n\nfor line in sys.stdin:\n p, y = map(int, line.strip().split(\" \", 2))\n print(\"{:0=6}{:0=6}\".format(p, count_city[p].index(y) + 1))\n","fail":"import sys\nfrom collections import defaultdict\n\nn, m = map(int, sys.stdin.readline().strip().split(\" \", 2))\nlist_city = defaultdict(list)\n\nfor line in sys.stdin:\n p, y = map(int, line.strip().split(\" \", 2))\n list_city[p].append(y)\n\ncount_city = {}\nfor p, yl in list_city.iteritems():\n count_city[p] = {y: i + 1 for i, y in enumerate(sorted(yl))}\n\n\nsys.stdin.seek(0)\nn, m = map(int, sys.stdin.readline().strip().split(\" \", 2))\n\nfor line in sys.stdin:\n p, y = map(int, line.strip().split(\" \", 2))\n print(\"{:0=6}{:0=6}\".format(p, count_city[p][y]))\n","change":"replace","i1":4,"i2":20,"j1":4,"j2":21,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03221","language":"Python","original_status":"Runtime Error","pass":"N, M = [int(i) for i in input().split(\" \")]\np = list()\ny = list()\nyd = {}\nfor i in range(0, M):\n pi, yi = [int(i) for i in input().split(\" \")]\n p.append(pi)\n y.append(yi)\n if pi in yd.keys():\n yd[pi].append(yi)\n else:\n yd[pi] = [yi]\n\nydid = {}\nfor i in yd.keys():\n num = 1\n for j in sorted(yd[p[i]]):\n ydid[j] = num\n num = num + 1\n\nfor i in range(0, M):\n print(\"{:06}{:06}\".format(p[i], ydid[y[i]]))\n","fail":"N, M = [int(i) for i in input().split(\" \")]\np = list()\ny = list()\nyd = {}\nfor i in range(0, M):\n pi, yi = [int(i) for i in input().split(\" \")]\n p.append(pi)\n y.append(yi)\n if pi in yd.keys():\n yd[pi].append(yi)\n else:\n yd[pi] = [yi]\n\nydid = {}\nfor i in yd.keys():\n num = 1\n for j in sorted(yd[i]):\n ydid[j] = num\n num = num + 1\n\nfor i in range(0, M):\n print(\"{:06}{:06}\".format(p[i], ydid[y[i]]))\n","change":"replace","i1":16,"i2":17,"j1":16,"j2":17,"error":"0","stderr":null,"stdout":"000001000002\n000002000001\n000001000001\n"} {"problem_id":"p03221","language":"Python","original_status":"Time Limit Exceeded","pass":"N, M = map(int, input().split())\nP = [0] * M\nY = [0] * M\n\ndata = [[] for i in range(N + 1)]\n\nfor i in range(M):\n P[i], Y[i] = map(int, input().split())\n data[P[i]].append(Y[i])\n\nfor key in set(P):\n data[key].sort()\n\nfor i in range(M):\n x = data[P[i]].index(Y[i]) + 1\n id_number = \"{:06}{:06}\".format(P[i], x)\n print(id_number)\n","fail":"N, M = map(int, input().split())\nP = [0] * M\nY = [0] * M\n\ndata = [[] for _ in range(N + 1)]\n\nfor i in range(M):\n P[i], Y[i] = map(int, input().split())\n data[P[i]].append(Y[i])\n\nfor k in set(P):\n data[k].sort()\n\nx = [{} for _ in range(N + 1)]\n\nfor k in set(P):\n c = 0\n for v in data[k]:\n c += 1\n x[k][v] = c\n\nfor i in range(M):\n id_number = \"{:06}{:06}\".format(P[i], x[P[i]][Y[i]])\n print(id_number)\n","change":"replace","i1":4,"i2":16,"j1":4,"j2":23,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03221","language":"Python","original_status":"Time Limit Exceeded","pass":"N, M = map(int, input().split())\nP = []\nY = []\nD = {}\nfor i in range(M):\n p, y = map(int, input().split())\n P.append(p)\n Y.append(y)\n if p not in D:\n D[p] = [(i, y)]\n else:\n D[p].append((i, y))\n\nfor p in P:\n D[p].sort(key=lambda p: p[1])\n\nans = []\nfor p, pairs in D.items():\n for x, pair in enumerate(pairs):\n x += 1\n i = pair[0]\n y = pair[1]\n out = \"{0:06d}{1:06d}\".format(p, x)\n ans.append((i, out))\nans.sort(key=lambda p: p[0])\nfor an in ans:\n print(an[1])\n","fail":"N, M = map(int, input().split())\nD = {}\nfor i in range(M):\n p, y = map(int, input().split())\n if p not in D:\n D[p] = [(i, y)]\n else:\n D[p].append((i, y))\n\nfor p in D.keys():\n D[p].sort(key=lambda p: p[1])\n\nans = [None for i in range(M)]\nfor p, pairs in D.items():\n for x, pair in enumerate(pairs):\n x += 1\n i = pair[0]\n y = pair[1]\n out = \"{0:06d}{1:06d}\".format(p, x)\n ans[i] = out\n # ans.append((i, out))\n# ans.sort(key=lambda p: p[0])\nfor an in ans:\n print(an)\n","change":"replace","i1":1,"i2":27,"j1":1,"j2":24,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03221","language":"Python","original_status":"Time Limit Exceeded","pass":"n, m = map(int, input().split())\np = [0] * m\ny = [0] * m\n\nd = {}\n\nfor i in range(m):\n p[i], y[i] = map(int, input().split())\n\n if not p[i] in d:\n d[p[i]] = []\n\n d[p[i]].append(y[i])\n\nfor v in d.values():\n v.sort()\n\nfor i in range(m):\n print(\"{:06}{:06}\".format(p[i], d[p[i]].index(y[i]) + 1))\n","fail":"from operator import itemgetter\n\n\nn, m = map(int, input().split())\np = [0] * m\ny = [0] * m\n\nd = {}\n\nfor i in range(m):\n p[i], y[i] = map(int, input().split())\n\n if not p[i] in d:\n d[p[i]] = []\n\n d[p[i]].append([y[i], i])\n\nfor v in d.values():\n v.sort(key=itemgetter(0))\n\nans = [None] * m\n\nfor k, v in d.items():\n for i, vv in enumerate(v):\n ans[vv[1]] = str(k).zfill(6) + str(i + 1).zfill(6)\n\nprint(\"\\\\n\".join(ans))\n","change":"replace","i1":0,"i2":19,"j1":0,"j2":27,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03221","language":"Python","original_status":"Time Limit Exceeded","pass":"# -*- coding: utf-8 -*-\n\nn, m = map(int, input().split())\npy = [list(map(int, input().split())) for _ in range(m)]\n\ndct = {}\nfor i in range(m):\n if py[i][0] in dct.keys():\n dct[py[i][0]].append(py[i][1])\n else:\n dct[py[i][0]] = [py[i][1]]\n\nfor key in dct.keys():\n dct[key].sort()\n\nfor i in range(m):\n print(\"{:06}{:06}\".format(py[i][0], dct[py[i][0]].index(py[i][1]) + 1))\n","fail":"# -*- coding: utf-8 -*-\n\nimport bisect\n\nn, m = map(int, input().split())\npy = [list(map(int, input().split())) for _ in range(m)]\n\ndct = {}\nfor i in range(m):\n if py[i][0] in dct.keys():\n dct[py[i][0]].append(py[i][1])\n else:\n dct[py[i][0]] = [py[i][1]]\n\nfor key in dct.keys():\n dct[key].sort()\n\nfor i in range(m):\n print(\"{:06}{:06}\".format(py[i][0], bisect.bisect(dct[py[i][0]], py[i][1])))\n","change":"replace","i1":1,"i2":17,"j1":1,"j2":19,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03221","language":"Python","original_status":"Time Limit Exceeded","pass":"n, m = map(int, input().split())\ncity = []\np_list = []\nfor i in range(m):\n p, y = map(int, input().split())\n city.append([p, y, i])\ncity.sort(key=lambda x: x[1])\ncity.sort()\nn = 0\nfor i in range(m):\n p_list.append(city[i][0])\nmax_p = max(p_list)\n\nfor i in range(max_p + 1):\n for j in range(p_list.count(i)):\n city[n].append(str(p_list[n]).zfill(6) + (str(j + 1)).zfill(6))\n n += 1\n\ncity.sort(key=lambda x: x[2])\nfor i in range(m):\n print(city[i][3])\n","fail":"n, m = map(int, input().split())\ntmp = [list(map(int, input().split())) for i in range(m)]\ncity = [[] for i in range(n + 1)]\nanswers = [\"\"] * m\n\nfor i, (pref, year) in enumerate(tmp):\n city[pref].append([year, i])\n\nfor i in range(n + 1):\n for j, (year, index) in enumerate(sorted(city[i])):\n ans = str(i).zfill(6) + str(j + 1).zfill(6)\n answers[index] = ans\n\nprint(*answers, sep=\"\\\\n\")\n","change":"replace","i1":1,"i2":21,"j1":1,"j2":14,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03221","language":"Python","original_status":"Time Limit Exceeded","pass":"import numpy as np\n\nn, m = list(map(int, input().split()))\npy = np.array([list(map(int, input().split())) for _ in range(m)])\n\npy = np.array(py)\norder = np.argsort(py[:, 1])\nargsorted = py[order]\n\ncount_below_same_class = []\nvisited = dict()\nvisited_keys = []\nfor i in range(m):\n p = argsorted[i, 0]\n if p not in visited_keys:\n count_below_same_class.append(0)\n visited[p] = 0\n visited_keys.append(p)\n else:\n count_below_same_class.append(visited[p] + 1)\n visited[p] += 1\n\ninv_order = np.argsort(order)\n\nfor i in range(m):\n first = str(py[i, 0]).zfill(6)\n second = str(count_below_same_class[inv_order[i]] + 1).zfill(6)\n print(first + second)\n","fail":"n, m = map(int, input().split())\npd = [list(map(int, input().split())) for _ in range(m)]\n\nfrom collections import defaultdict\n\ndict = defaultdict(list)\nfor i, (p, d) in enumerate(pd):\n dict[p].append((d, i))\n\nans = [\"\" for _ in range(m)]\nfor key in dict:\n v = dict[key]\n v.sort()\n\n for i, (y, idx) in enumerate(v):\n tmp = str(key).zfill(6) + str(i + 1).zfill(6)\n ans[idx] = tmp\n\nfor a in ans:\n print(a)\n","change":"replace","i1":0,"i2":28,"j1":0,"j2":20,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03228","language":"Python","original_status":"Time Limit Exceeded","pass":"A, B, K = map(int, input().split())\nc = 0\nwhile True:\n if A % 2 == 0:\n pass\n else:\n A -= 1\n\n B += A \/ 2\n A -= A \/ 2\n c += 1\n\n if B % 2 == 0:\n pass\n else:\n B -= 1\n\n A += B \/ 2\n B -= B \/ 2\n c += 1\n\n if c == K:\n break\n\nprint(int(A), int(B))\n","fail":"import numpy as np\n\nA, B, K = map(int, input().split())\ncoo = np.array([A, B])\nc = 0\nfor _ in range(K):\n if coo[0] % 2 == 0:\n pass\n else:\n coo[0] -= 1\n\n half = coo[0] \/ 2\n coo[1] += half\n coo[0] -= half\n coo = coo[::-1]\n\nif K % 2 == 0:\n print(*coo)\nelse:\n print(*coo[::-1])\n","change":"replace","i1":0,"i2":25,"j1":0,"j2":20,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03229","language":"Python","original_status":"Runtime Error","pass":"from collections import deque\n\nN = int(input())\nA = deque(sorted([int(input()) for i in range(N)]))\nB = A.copy()\nans = deque([A.popleft()])\nwhile A:\n if A:\n ans.appendleft(A.pop())\n if A:\n ans.append(A.pop())\n if A:\n ans.appendleft(A.popleft())\n if A:\n ans.append(A.popleft())\nres_1 = 0\nans = list(ans)\nfor i in range(N - 1):\n res_1 += abs(ans[i] - ans[i + 1])\nans = deque([B.pop()])\nwhile B:\n if B:\n ans.appendleft(B.popleft())\n if B:\n ans.append(B.popleft())\n if B:\n ans.appendleft(B.pop())\n if B:\n ans.append(B.pop())\nres_2 = 0\nans = list(ans)\nfor i in range(N - 1):\n res_2 += abs(ans[i] - ans[i + 1])\nprint(max(res_1, res_2))\n","fail":"from collections import deque\nimport copy\n\nN = int(input())\nA = deque(sorted([int(input()) for i in range(N)]))\nB = copy.copy(A)\nans = deque([A.popleft()])\nwhile A:\n if A:\n ans.appendleft(A.pop())\n if A:\n ans.append(A.pop())\n if A:\n ans.appendleft(A.popleft())\n if A:\n ans.append(A.popleft())\nres_1 = 0\nans = list(ans)\nfor i in range(N - 1):\n res_1 += abs(ans[i] - ans[i + 1])\nans = deque([B.pop()])\nwhile B:\n if B:\n ans.appendleft(B.popleft())\n if B:\n ans.append(B.popleft())\n if B:\n ans.appendleft(B.pop())\n if B:\n ans.append(B.pop())\nres_2 = 0\nans = list(ans)\nfor i in range(N - 1):\n res_2 += abs(ans[i] - ans[i + 1])\nprint(max(res_1, res_2))\n","change":"replace","i1":1,"i2":5,"j1":1,"j2":6,"error":"0","stderr":null,"stdout":21.0} {"problem_id":"p03229","language":"Python","original_status":"Runtime Error","pass":"import sys\nfrom collections import deque\n\ninput = sys.stdin.readline\n\n\ndef main():\n N = int(input())\n A = [0] * N\n for i in range(N):\n A[i] = int(input())\n\n A.sort()\n d = deque(A)\n min_A = d.popleft()\n max_A = d.pop()\n ans = max_A - min_A\n v1 = min_A\n v2 = max_A\n while d:\n if len(d) == 1:\n v = d.pop()\n ans += max(abs(v1 - v), abs(v2 - v))\n else:\n v_min = d[0]\n v_max = d[-1]\n diff = 0\n is_popleft = True\n if diff < abs(v1 - v_min):\n diff = abs(v1 - v_min)\n next_v1 = v_min\n next_v2 = v2\n if diff < abs(v2 - v_min):\n diff = abs(v2 - v_min)\n next_v1 = v_min\n next_v2 = v1\n if diff < abs(v1 - v_max):\n diff = abs(v1 - v_max)\n next_v1 = v_max\n next_v2 = v2\n is_popleft = False\n if diff < abs(v2 - v_max):\n diff = abs(v2 - v_max)\n next_v1 = v_max\n next_v2 = v1\n is_popleft = False\n ans += diff\n v1, v2 = next_v1, next_v2\n if is_popleft:\n d.popleft()\n else:\n d.pop()\n\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"import sys\nfrom collections import deque\n\ninput = sys.stdin.readline\n\n\ndef main():\n N = int(input())\n A = [0] * N\n for i in range(N):\n A[i] = int(input())\n\n A.sort()\n d = deque(A)\n min_A = d.popleft()\n max_A = d.pop()\n ans = max_A - min_A\n v1 = min_A\n v2 = max_A\n while d:\n if len(d) == 1:\n v = d.pop()\n ans += max(abs(v1 - v), abs(v2 - v))\n else:\n v_min = d[0]\n v_max = d[-1]\n diff = 0\n is_popleft = None\n if diff < abs(v1 - v_min):\n diff = abs(v1 - v_min)\n next_v1 = v_min\n next_v2 = v2\n is_popleft = True\n if diff < abs(v2 - v_min):\n diff = abs(v2 - v_min)\n next_v1 = v_min\n next_v2 = v1\n is_popleft = True\n if diff < abs(v1 - v_max):\n diff = abs(v1 - v_max)\n next_v1 = v_max\n next_v2 = v2\n is_popleft = False\n if diff < abs(v2 - v_max):\n diff = abs(v2 - v_max)\n next_v1 = v_max\n next_v2 = v1\n is_popleft = False\n if is_popleft is None:\n next_v1 = v_min\n next_v2 = v2\n is_popleft = True\n ans += diff\n v1, v2 = next_v1, next_v2\n if is_popleft:\n d.popleft()\n else:\n d.pop()\n\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":27,"i2":46,"j1":27,"j2":52,"error":"0","stderr":null,"stdout":21.0} {"problem_id":"p03229","language":"Python","original_status":"Time Limit Exceeded","pass":"def main():\n N = int(input())\n A = [int(input()) for _ in range(N)]\n A.sort()\n ans = 0\n edge = [A.pop()] * 2\n while len(A):\n a = abs(edge[0] - A[0])\n b = abs(edge[0] - A[len(A) - 1])\n c = abs(edge[1] - A[0])\n d = abs(edge[1] - A[len(A) - 1])\n if max(a, b, c, d) == a:\n edge[0] = A.pop(0)\n ans += a\n elif max(a, b, c, d) == b:\n edge[0] = A.pop()\n ans += b\n elif max(a, b, c, d) == c:\n edge[1] = A.pop(0)\n ans += c\n else:\n edge[1] = A.pop()\n ans += d\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"from collections import deque\n\n\ndef main():\n N = int(input())\n A = [int(input()) for _ in range(N)]\n A.sort()\n ans = 0\n B = deque(A)\n edge = [B.popleft()] * 2\n while len(B):\n a = abs(edge[0] - B[0])\n b = abs(edge[0] - B[len(B) - 1])\n c = abs(edge[1] - B[0])\n d = abs(edge[1] - B[len(B) - 1])\n if max(a, b, c, d) == a:\n edge[0] = B.popleft()\n ans += a\n elif max(a, b, c, d) == b:\n edge[0] = B.pop()\n ans += b\n elif max(a, b, c, d) == c:\n edge[1] = B.popleft()\n ans += c\n else:\n edge[1] = B.pop()\n ans += d\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":0,"i2":22,"j1":0,"j2":26,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03231","language":"Python","original_status":"Runtime Error","pass":"from fractions import gcd\n\n\nN, M = map(int, input().split())\nS = input()\nT = input()\nLCM = N * M \/\/ gcd(N, M)\nS_dist = [\"\"] * LCM\nT_dist = [\"\"] * LCM\nfor i in range(N):\n S_dist[i * LCM \/\/ N] = S[i]\nfor i in range(M):\n T_dist[i * LCM \/\/ M] = T[i]\nfor s, t in zip(S_dist, T_dist):\n if s != \"\" and t != \"\" and s != t:\n print(-1)\n break\nelse:\n print(LCM)\n","fail":"from fractions import gcd\n\n\nN, M = map(int, input().split())\nS = input()\nT = input()\ng = gcd(N, M)\nN \/\/= g\nM \/\/= g\nfor i in range(g):\n if S[i * N] != T[i * M]:\n print(-1)\n break\nelse:\n print(N * M * g)\n","change":"replace","i1":6,"i2":19,"j1":6,"j2":15,"error":"ImportError: cannot import name 'gcd' from 'fractions' (\/usr\/lib\/python3.10\/fractions.py)","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03231\/Python\/s895495204.py\", line 1, in \n from fractions import gcd\nImportError: cannot import name 'gcd' from 'fractions' (\/usr\/lib\/python3.10\/fractions.py)\n","stdout":null} {"problem_id":"p03231","language":"Python","original_status":"Runtime Error","pass":"def g_c_d(x, y):\n if x == 0:\n return y\n elif y == 0:\n return x\n else:\n return g_c_d(y, x % y)\n\n\ndef l_c_m(x, y):\n return x * y \/\/ g_c_d(x, y)\n\n\na, b = map(int, input().split())\nc = input()\nd = input()\nf = l_c_m(a, b)\ne = [\"\"] * f\nfor i in range(0, f):\n if i * f \/\/ a > f - 1:\n break\n if e[i * f \/\/ a] == \"\":\n e[i * f \/\/ a] = c[i]\n elif e[i * f \/\/ a] != c[i]:\n print(-1)\n exit()\n if i * f \/\/ b > f - 1:\n break\n if e[i * f \/\/ b] == \"\":\n e[i * f \/\/ b] = d[i]\n elif e[i * f \/\/ b] != d[i]:\n print(-1)\n exit()\nprint(f)\n","fail":"def g_c_d(x, y):\n if x == 0:\n return y\n elif y == 0:\n return x\n else:\n return g_c_d(y, x % y)\n\n\ndef l_c_m(x, y):\n return x * y \/\/ g_c_d(x, y)\n\n\na, b = map(int, input().split())\nc = input()\nd = input()\nlcm = l_c_m(a, b)\ngcd = g_c_d(a, b)\nfor i in range(0, gcd):\n if c[i * a \/\/ gcd] != d[i * b \/\/ gcd]:\n print(-1)\n exit()\nprint(lcm)\n","change":"replace","i1":16,"i2":34,"j1":16,"j2":23,"error":"0","stderr":null,"stdout":6.0} {"problem_id":"p03231","language":"Python","original_status":"Runtime Error","pass":"import math\n\n\ndef lcm(x, y):\n return (x * y) \/\/ math.gcd(x, y)\n\n\nN, M = map(int, input().split())\nS = input()\nT = input()\n\n\ngcdNM = math.gcd(N, M)\nlcmNM = lcm(N, M)\n\nisGood = True\nfor i in range(gcdNM):\n if S[i * N \/\/ (gcdNM)] != T[i * M \/\/ (gcdNM)]:\n isGood = False\n break\n\nif isGood and T[0] == S[0]:\n print(lcmNM)\nelse:\n print(-1)\n","fail":"def lcm(x, y):\n return (x * y) \/\/ gcd(x, y)\n\n\ndef gcd(a, b):\n while b:\n a, b = b, a % b\n return a\n\n\nN, M = map(int, input().split())\nS = input()\nT = input()\n\ngcdNM = gcd(N, M)\nlcmNM = lcm(N, M)\n\nisGood = True\nfor i in range(gcdNM):\n if S[i * N \/\/ (gcdNM)] != T[i * M \/\/ (gcdNM)]:\n isGood = False\n break\n\nif isGood and T[0] == S[0]:\n print(lcmNM)\nelse:\n print(-1)\n","change":"replace","i1":0,"i2":13,"j1":0,"j2":15,"error":"0","stderr":null,"stdout":6.0} {"problem_id":"p03231","language":"Python","original_status":"Runtime Error","pass":"from math import gcd\n\nN, M = map(int, input().split())\nS = input()\nT = input()\n\nG = gcd(N, M)\nL = N * M \/\/ G\nn = N \/\/ G\nm = M \/\/ G\n\nans = True\nfor k in range(G):\n if S[k * n] != T[k * m]:\n ans = False\n break\nprint(L if ans else -1)\n","fail":"from fractions import gcd\n\nN, M = map(int, input().split())\nS = input()\nT = input()\n\nG = gcd(N, M)\nL = N * M \/\/ G\nn = N \/\/ G\nm = M \/\/ G\n\nans = True\nfor k in range(G):\n if S[k * n] != T[k * m]:\n ans = False\n break\nprint(L if ans else -1)\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"0","stderr":null,"stdout":6.0} {"problem_id":"p03231","language":"Python","original_status":"Runtime Error","pass":"from fractions import gcd\n\n\ndef lcm(x, y):\n return x \/\/ gcd(x, y) * y\n\n\nN, M = map(int, input().split())\nS = input()\nT = input()\n\nL = lcm(N, M)\nX = {}\n\nfor i in range(0, L, L \/\/ N):\n X[i] = S[i]\n\nfor i in range(0, L, L \/\/ M):\n if i not in X:\n continue\n if X[i] != T[i]:\n print(-1)\n exit()\nprint(L)\n","fail":"from fractions import gcd\n\n\ndef lcm(x, y):\n return x \/\/ gcd(x, y) * y\n\n\nN, M = map(int, input().split())\nS = input()\nT = input()\n\nL = lcm(N, M)\nX = {}\n\nfor i in range(N):\n X[(L \/\/ N) * i] = S[i]\n\nfor i in range(M):\n if (L \/\/ M) * i in X and X[(L \/\/ M) * i] != T[i]:\n print(-1)\n exit()\nprint(L)\n","change":"replace","i1":14,"i2":21,"j1":14,"j2":19,"error":"ImportError: cannot import name 'gcd' from 'fractions' (\/usr\/lib\/python3.10\/fractions.py)","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03231\/Python\/s558166314.py\", line 1, in \n from fractions import gcd\nImportError: cannot import name 'gcd' from 'fractions' (\/usr\/lib\/python3.10\/fractions.py)\n","stdout":null} {"problem_id":"p03231","language":"Python","original_status":"Runtime Error","pass":"import math\n\nN, M = map(int, input().split())\nS = input()\nT = input()\n\nif N == M:\n print(N if S == T else -1)\nelse:\n G = math.gcd(N, M)\n L = N * M \/\/ G\n n = N \/\/ G\n m = M \/\/ G\n ans = True\n for k in range(G):\n if S[k * n] != T[k * m]:\n ans = False\n break\n print(L if ans else -1)\n","fail":"import fractions\n\nN, M = map(int, input().split())\nS = input()\nT = input()\n\nif N == M:\n print(N if S == T else -1)\nelse:\n G = fractions.gcd(N, M)\n L = N * M \/\/ G\n n = N \/\/ G\n m = M \/\/ G\n ans = True\n for k in range(G):\n if S[k * n] != T[k * m]:\n ans = False\n break\n print(L if ans else -1)\n","change":"replace","i1":0,"i2":10,"j1":0,"j2":10,"error":"0","stderr":null,"stdout":6.0} {"problem_id":"p03231","language":"Python","original_status":"Runtime Error","pass":"# from math import gcd\nfrom fraction import gcd\nimport sys\n\nN, M = map(int, input().split())\nS = input()\nT = input()\n\nd = gcd(N, M)\nm = N * M \/\/ d\n\nfor i in range(d):\n if S[i * (N \/\/ d)] != T[i * (M \/\/ d)]:\n print(-1)\n sys.exit()\n\nprint(m)\n","fail":"# from math import gcd\nfrom fractions import gcd\nimport sys\n\nN, M = map(int, input().split())\nS = input()\nT = input()\n\nd = gcd(N, M)\nm = N * M \/\/ d\n\nfor i in range(d):\n if S[i * (N \/\/ d)] != T[i * (M \/\/ d)]:\n print(-1)\n sys.exit()\n\nprint(m)\n","change":"replace","i1":1,"i2":2,"j1":1,"j2":2,"error":"ModuleNotFoundError: No module named 'fraction'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03231\/Python\/s663695996.py\", line 2, in \n from fraction import gcd\nModuleNotFoundError: No module named 'fraction'\n","stdout":null} {"problem_id":"p03238","language":"Python","original_status":"Runtime Error","pass":"dat0 = input()\nif dat0 == 1:\n print(\"Hello World\")\nelse:\n dat1 = input()\n dat2 = input()\n ans = int(dat1) + int(dat2)\n print(ans)\n","fail":"dat0 = input()\nif dat0 == \"1\":\n print(\"Hello World\")\nelse:\n dat1 = input()\n dat2 = input()\n ans = int(dat1) + int(dat2)\n print(ans)\n","change":"replace","i1":1,"i2":2,"j1":1,"j2":2,"error":"EOFError: EOF when reading a line","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03238\/Python\/s913510472.py\", line 5, in \n dat1 = input()\nEOFError: EOF when reading a line\n","stdout":null} {"problem_id":"p03238","language":"Python","original_status":"Runtime Error","pass":"n = int(input())\nA = int(input())\nB = int(input())\n\nif n == 1:\n print(\"Hello World\")\nif n == 2:\n print(A + B)\n","fail":"n = int(input())\n\nif n == 1:\n print(\"Hello World\")\nif n == 2:\n a = int(input())\n b = int(input())\n print(a + b)\n","change":"replace","i1":1,"i2":8,"j1":1,"j2":8,"error":"EOFError: EOF when reading a line","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03238\/Python\/s095666082.py\", line 2, in \n A = int(input())\nEOFError: EOF when reading a line\n","stdout":null} {"problem_id":"p03238","language":"Python","original_status":"Runtime Error","pass":"def solve():\n age = int(input())\n if age == 1:\n return \"Hello World\"\n a, b = map(int, input().split())\n return a + b\n\n\nif __name__ == \"__main__\":\n print(solve())\n","fail":"def solve():\n age = int(input())\n if age == 1:\n return \"Hello World\"\n a, b = list(int(input()) for _ in range(2))\n return a + b\n\n\nif __name__ == \"__main__\":\n print(solve())\n","change":"replace","i1":4,"i2":5,"j1":4,"j2":5,"error":"0","stderr":null,"stdout":"Hello World\n"} {"problem_id":"p03238","language":"Python","original_status":"Runtime Error","pass":"n = input()\n\nif n == 1:\n print(\"Hello Workd\")\nelse:\n a = int(input())\n b = int(input())\n print(a + b)\n","fail":"N = input()\n\nif N == \"1\":\n print(\"Hello World\")\nelse:\n A = int(input())\n B = int(input())\n print(A + B)\n","change":"replace","i1":0,"i2":8,"j1":0,"j2":8,"error":"EOFError: EOF when reading a line","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03238\/Python\/s770594409.py\", line 6, in \n a = int(input())\nEOFError: EOF when reading a line\n","stdout":null} {"problem_id":"p03238","language":"Python","original_status":"Runtime Error","pass":"input_data = [int(i) for i in input().split(\" \")]\n\nif input_data[0] == 1:\n print(\"Hello World\")\n exit()\n\nprint(input_data[1] + input_data[2])\n","fail":"if int(input()) == 1:\n print(\"Hello World\")\nelse:\n print(int(input()) + int(input()))\n","change":"replace","i1":0,"i2":7,"j1":0,"j2":4,"error":"0","stderr":null,"stdout":"Hello World\n"} {"problem_id":"p03238","language":"Python","original_status":"Runtime Error","pass":"N = input()\nA = input()\nB = input()\n\nif N == \"1\":\n print(\"Hello World\")\nelse:\n print(str(int(A) + int(B)))\n","fail":"N = input()\n\nif N == \"1\":\n print(\"Hello World\")\nelse:\n A = input()\n B = input()\n print(str(int(A) + int(B)))\n","change":"replace","i1":1,"i2":7,"j1":1,"j2":7,"error":"EOFError: EOF when reading a line","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03238\/Python\/s676285942.py\", line 2, in \n A = input()\nEOFError: EOF when reading a line\n","stdout":null} {"problem_id":"p03238","language":"Python","original_status":"Runtime Error","pass":"N = int(input())\nif N == 1:\n print(\"Hello World\")\nelse:\n A, B = map(int, input().split())\n print(A + B)\n","fail":"N = int(input())\nif N == 1:\n print(\"Hello World\")\nelse:\n A = int(input())\n B = int(input())\n print(A + B)\n","change":"replace","i1":4,"i2":5,"j1":4,"j2":6,"error":"0","stderr":null,"stdout":"Hello World\n"} {"problem_id":"p03238","language":"Python","original_status":"Runtime Error","pass":"n = int(input())\na = int(input())\nb = int(input())\nif n == 1:\n print(\"Hello World\")\nelse:\n print(a + b)\n","fail":"n = int(input())\nif n == 1:\n print(\"Hello World\")\nelse:\n a = int(input())\n b = int(input())\n print(a + b)\n","change":"replace","i1":1,"i2":6,"j1":1,"j2":6,"error":"EOFError: EOF when reading a line","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03238\/Python\/s158910161.py\", line 2, in \n a = int(input())\nEOFError: EOF when reading a line\n","stdout":null} {"problem_id":"p03238","language":"Python","original_status":"Runtime Error","pass":"N = int(input())\n\nif N == 1:\n print(\"Hello World\")\nelse:\n A, B = map(int, input().split())\n print(A + B)\n","fail":"N = int(input())\n\nif N == 1:\n print(\"Hello World\")\nelse:\n A = int(input())\n B = int(input())\n print(A + B)\n","change":"replace","i1":5,"i2":6,"j1":5,"j2":7,"error":"0","stderr":null,"stdout":"Hello World\n"} {"problem_id":"p03238","language":"Python","original_status":"Runtime Error","pass":"N = int(input())\n\nif N == 1:\n print(\"Hello World\")\nelif N == 2:\n A, B = map(int, input().split())\n\n print(A + B)\n","fail":"N = int(input())\n\nif N == 1:\n print(\"Hello World\")\nelif N == 2:\n A = int(input())\n B = int(input())\n print(A + B)\n","change":"replace","i1":5,"i2":7,"j1":5,"j2":7,"error":"0","stderr":null,"stdout":"Hello World\n"} {"problem_id":"p03239","language":"Python","original_status":"Runtime Error","pass":"import sys\n\ninput = sys.stdin.readline\n\n\ndef main():\n n, t = map(int, input().split())\n routes = filter(\n lambda x: x[1] <= t, [list(map(int, input().split())) for _ in range(n)]\n )\n if routes:\n print(min(routes)[0])\n else:\n print(\"TLE\")\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"import sys\n\ninput = sys.stdin.readline\n\n\ndef main():\n n, t = map(int, input().split())\n routes = list(\n filter(lambda x: x[1] <= t, [list(map(int, input().split())) for _ in range(n)])\n )\n if routes:\n print(min(routes)[0])\n else:\n print(\"TLE\")\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":7,"i2":9,"j1":7,"j2":9,"error":0,"stderr":null,"stdout":4} {"problem_id":"p03239","language":"Python","original_status":"Runtime Error","pass":"N, T = map(int, input().split())\nr = [tuple(map(int, input().split())) for _ in range(N)]\nf = [(c, t) for c, t in r if t <= T]\nprint(min(f, key=lambda x: x[0])[0])\n","fail":"N, T = map(int, input().split())\nr = [tuple(map(int, input().split())) for _ in range(N)]\nf = [(c, t) for c, t in r if t <= T]\nif len(f) == 0:\n print(\"TLE\")\nelse:\n print(min(f, key=lambda x: x[0])[0])\n","change":"replace","i1":3,"i2":4,"j1":3,"j2":7,"error":0,"stderr":null,"stdout":4} {"problem_id":"p03240","language":"Python","original_status":"Runtime Error","pass":"import sys\n\ninput = sys.stdin.readline\n\n\ndef main():\n n = int(input())\n points = reversed(\n [[int(i) for i in input().split()] for _ in range(n)],\n key=lambda x: x[2],\n reverse=True,\n )\n print(points)\n hoge = 101\n for cx in range(hoge):\n for cy in range(hoge):\n x, y, z = points[0]\n h = max(z + abs(x - cx) + abs(y - cy), 0)\n # print(h, [max(z + abs(x - cx) + abs(y - cy), 0) for x, y, z in points])\n if h == 0:\n continue\n if all(\n [h == max(z + abs(x - cx) + abs(y - cy), 0) for x, y, z in points[1:]]\n ):\n print(cx, cy, h)\n break\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"import sys\n\ninput = sys.stdin.readline\n\n\ndef main():\n n = int(input())\n points = sorted(\n [[int(i) for i in input().split()] for _ in range(n)],\n key=lambda x: x[2],\n reverse=True,\n )\n hoge = 101\n for cx in range(hoge):\n for cy in range(hoge):\n x, y, z = points[0]\n h = z + abs(x - cx) + abs(y - cy)\n\n if h < 1:\n continue\n if all([z == max(h - abs(x - cx) - abs(y - cy), 0) for x, y, z in points]):\n print(cx, cy, h)\n return\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":7,"i2":26,"j1":7,"j2":23,"error":"TypeError: reversed() takes no keyword arguments","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03240\/Python\/s083980174.py\", line 30, in \n main()\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03240\/Python\/s083980174.py\", line 8, in main\n points = reversed(\nTypeError: reversed() takes no keyword arguments\n","stdout":null} {"problem_id":"p03240","language":"Python","original_status":"Runtime Error","pass":"N = int(input())\ndata = [tuple(map(int, input().split())) for _ in range(N)]\ndata.sort(key=lambda x: x[2])\nfor cx in range(101):\n for cy in range(101):\n h0 = None\n for x, y, h in data:\n if h:\n h_tmp = h + abs(cx - x) + abs(cy - y)\n if h_tmp != h0 and h0 is not None:\n break\n h0 = h_tmp\n else:\n if abs(cx - x) + abs(cy - y) < h0:\n break\n else:\n print(cx, cy, h0)\n exit()\n","fail":"N = int(input())\ndata = [tuple(map(int, input().split())) for _ in range(N)]\ndata.sort(key=lambda x: -x[2])\nfor cx in range(101):\n for cy in range(101):\n h0 = None\n for x, y, h in data:\n if h:\n h_tmp = h + abs(cx - x) + abs(cy - y)\n if h_tmp != h0 and h0 is not None:\n break\n h0 = h_tmp\n else:\n if abs(cx - x) + abs(cy - y) < h0:\n break\n else:\n print(cx, cy, h0)\n exit()\n","change":"replace","i1":2,"i2":3,"j1":2,"j2":3,"error":"0","stderr":null,"stdout":"2 2 6\n"} {"problem_id":"p03240","language":"Python","original_status":"Runtime Error","pass":"N = int(input())\nx = []\ny = []\nh = []\nfor _ in range(N):\n tmp = [int(i) for i in input().split()]\n if tmp[2] == 0:\n continue\n x.append(tmp[0])\n y.append(tmp[1])\n h.append(tmp[2])\n\nfor Cx in range(100 + 1):\n for Cy in range(100 + 1):\n correct_flag = True\n H = abs(x[0] - Cx) + abs(y[0] - Cy) + h[0]\n for i in range(1, N):\n if abs(x[i] - Cx) + abs(y[i] - Cy) + h[i] != H:\n correct_flag = False\n break\n if correct_flag:\n print(Cx, Cy, H)\n break\n","fail":"N = int(input())\nx = []\ny = []\nh = []\nkey = 0\nfor i in range(N):\n tmp = [int(i) for i in input().split()]\n if tmp[2] != 0:\n key = i\n x.append(tmp[0])\n y.append(tmp[1])\n h.append(tmp[2])\n\nfor Cx in range(100 + 1):\n for Cy in range(100 + 1):\n correct_flag = True\n H = abs(x[key] - Cx) + abs(y[key] - Cy) + h[key]\n for i in range(N):\n if h[i] == 0:\n if abs(x[i] - Cx) + abs(y[i] - Cy) < H:\n correct_flag = False\n break\n else:\n if abs(x[i] - Cx) + abs(y[i] - Cy) + h[i] != H:\n correct_flag = False\n break\n if correct_flag:\n print(Cx, Cy, H)\n break\n","change":"replace","i1":4,"i2":20,"j1":4,"j2":26,"error":"0","stderr":null,"stdout":"2 2 6\n"} {"problem_id":"p03240","language":"Python","original_status":"Time Limit Exceeded","pass":"N = int(input())\nP = [list(map(int, input().split())) for i in range(N)]\n\ni = 0\nwhile 1:\n if P[0][2] > 0:\n break\n i += 1\nx0, y0, h0 = P[i]\nfor cy in range(101):\n for cx in range(101):\n h = h0 + abs(cx - x0) + abs(cy - y0)\n for x, y, h1 in P:\n if h1 != max(h - abs(cx - x) - abs(cy - y), 0):\n break\n else:\n print(cx, cy, h)\n exit(0)\nexit(1)\n","fail":"N = int(input())\nP = [list(map(int, input().split())) for i in range(N)]\n\ni = 0\nwhile 1:\n if P[i][2] > 0:\n break\n i += 1\nx0, y0, h0 = P[i]\nfor cy in range(101):\n for cx in range(101):\n h = h0 + abs(cx - x0) + abs(cy - y0)\n for x, y, h1 in P:\n if h1 != max(h - abs(cx - x) - abs(cy - y), 0):\n break\n else:\n print(cx, cy, h)\n exit(0)\nexit(1)\n","change":"replace","i1":5,"i2":6,"j1":5,"j2":6,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03240","language":"Python","original_status":"Runtime Error","pass":"# -*- coding: utf-8 -*-\n\nN = int(input())\nX, Y, H = [], [], []\nfor _ in range(N):\n x, y, h = map(int, input().split())\n X.append(x)\n Y.append(y)\n H.append(h)\n\nfor x in range(101):\n for y in range(101):\n hc = {H[i] + abs(X[i] - x) + abs(Y[i] - y) for i in range(N) if H[i] > 0}\n h0 = {H[i] + abs(X[i] - x) + abs(Y[i] - y) for i in range(N) if H[i] == 0}\n if len(hc) == 1 and max(h0) <= max(hc):\n print(x, y, list(hc)[0])\n break\n","fail":"# -*- coding: utf-8 -*-\n\nN = int(input())\nX, Y, H = [], [], []\nfor _ in range(N):\n x, y, h = map(int, input().split())\n X.append(x)\n Y.append(y)\n H.append(h)\n\nfor x in range(101):\n for y in range(101):\n hc = {H[i] + abs(X[i] - x) + abs(Y[i] - y) for i in range(N) if H[i] > 0}\n h0 = {H[i] + abs(X[i] - x) + abs(Y[i] - y) for i in range(N) if H[i] == 0}\n if len(hc) == 1:\n if (len(h0) > 0 and min(h0) >= list(hc)[0]) or len(h0) == 0:\n print(x, y, list(hc)[0])\n break\n","change":"replace","i1":14,"i2":17,"j1":14,"j2":18,"error":"ValueError: max() arg is an empty sequence","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03240\/Python\/s122970234.py\", line 15, in \n if len(hc) == 1 and max(h0) <= max(hc):\nValueError: max() arg is an empty sequence\n","stdout":null} {"problem_id":"p03240","language":"Python","original_status":"Runtime Error","pass":"n = int(input())\ncan = [[0] * 101 for _ in range(101)]\n\n\ndef solve(n, can):\n for k in range(n):\n x, y, h = map(int, input().split())\n if k == 0:\n for i in range(101):\n for j in range(101):\n can[i][j] = h + abs(x - i) + abs(y - j)\n else:\n for i in range(101):\n for j in range(101):\n if can[i][j] is None:\n continue\n if h + abs(x - i) + abs(y - j) != can[i][j]:\n can[i][j] = None\n for i in range(101):\n for j in range(101):\n if can[i][j] is None:\n continue\n return i, j, can[i][j]\n\n\nprint(*solve(n, can))\n","fail":"def solve(n):\n can = [[[-1, float(\"inf\")] for _ in range(101)] for _ in range(101)]\n for k in range(n):\n x, y, h = map(int, input().split())\n for i in range(101):\n for j in range(101):\n if can[i][j] is None:\n continue\n hh = h + abs(x - i) + abs(y - j)\n hl = 1 if h == 0 else hh\n nl, nh = max(can[i][j][0], hl), min(can[i][j][1], hh)\n if nl > nh:\n can[i][j] = None\n else:\n can[i][j][0] = nl\n can[i][j][1] = nh\n\n for i in range(101):\n for j in range(101):\n if can[i][j] is None:\n continue\n return i, j, can[i][j][0]\n\n\nn = int(input())\nprint(*solve(n))\n","change":"replace","i1":0,"i2":26,"j1":0,"j2":26,"error":"0","stderr":null,"stdout":"2 2 6\n"} {"problem_id":"p03241","language":"Python","original_status":"Runtime Error","pass":"import math\n\nN, M = map(int, input().split())\n\nd = max(d for d in range(1, math.ceil(M \/ (N - 1))) if M % d == 0)\nprint(d)\n","fail":"import math\n\nN, M = map(int, input().split())\n\nif N == 1:\n print(M)\nelse:\n d = max(d for d in range(1, math.ceil(M \/ (N - 1))) if M % d == 0)\n print(d)\n","change":"replace","i1":4,"i2":6,"j1":4,"j2":9,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p03241","language":"Python","original_status":"Runtime Error","pass":"# coding: utf-8\nimport math\n\n(n, m) = [int(i) for i in input().rstrip().split(\" \")]\n\nfor i in range(n, math.sqrt(m) + 1):\n if m % i == 0:\n print(int(m \/ i))\n break\n","fail":"# coding: utf-8\nimport math\n\n(n, m) = [int(i) for i in input().rstrip().split(\" \")]\n\nans = 0\ndivList = []\nfor i in range(1, int(math.sqrt(m)) + 1):\n if m % i == 0:\n j = m \/ i\n divList.append(i)\n divList.append(j)\ndivList = sorted(divList)\nfor i in divList:\n if i < n:\n continue\n ans = m \/ i\n break\n\nprint(int(ans))\n","change":"replace","i1":5,"i2":9,"j1":5,"j2":20,"error":"TypeError: 'float' object cannot be interpreted as an integer","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03241\/Python\/s345710504.py\", line 6, in \n for i in range(n, math.sqrt(m) + 1):\nTypeError: 'float' object cannot be interpreted as an integer\n","stdout":null} {"problem_id":"p03241","language":"Python","original_status":"Time Limit Exceeded","pass":"n, m = map(int, input().split())\nmax_i = m \/\/ n\nfor i in range(max_i, 0, -1):\n if m % i == 0:\n print(i)\n break\n","fail":"import math\n\nn, m = map(int, input().split())\nmax_i = 1\nfor i in range(1, int(math.sqrt(m)) + 1):\n if m % i != 0:\n continue\n j = m \/\/ i\n if i * n <= m and i > max_i:\n max_i = i\n if j * n <= m and j > max_i:\n max_i = j\nprint(max_i)\n","change":"replace","i1":0,"i2":6,"j1":0,"j2":13,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03241","language":"Python","original_status":"Time Limit Exceeded","pass":"n, m = map(int, input().split())\nif m % n == 0:\n print(m \/\/ n)\nelse:\n gcd = m \/\/ n\n for i in range(gcd, 0, -1):\n if m % i == 0:\n j = m \/\/ gcd\n if j >= n:\n print(i)\n exit()\n","fail":"import math\n\nn, m = map(int, input().split())\nroot_m = int(math.sqrt(m))\nans = 1\nfor a in range(1, root_m):\n # print(a, ans)\n if m % a == 0:\n b = m \/\/ a\n if a * n <= m:\n ans = max(ans, a)\n if b * n <= m:\n ans = max(ans, b)\nprint(ans)\n","change":"replace","i1":0,"i2":11,"j1":0,"j2":14,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03241","language":"Python","original_status":"Runtime Error","pass":"N, M = map(int, input().split())\nans = 0\nfor i in range(1, (M + N - 2) \/\/ (N - 1)):\n if (M - i * (N - 1)) % i == 0:\n ans = i\nprint(ans)\n","fail":"def enum_divisors(n):\n res = []\n for i in range(1, int(n**0.5) + 1):\n if n % i == 0:\n res.append(i)\n if i != n \/\/ i:\n res.append(n \/\/ i)\n return res\n\n\nN, M = map(int, input().split())\ndivs = filter(lambda x: x <= M \/\/ N, enum_divisors(M))\nprint(max(divs))\n","change":"replace","i1":0,"i2":6,"j1":0,"j2":13,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p03241","language":"Python","original_status":"Time Limit Exceeded","pass":"import math\n\nN, M = map(int, input().split())\ni = math.floor(M \/ N)\n\nwhile i >= 1:\n if M % i == 0:\n break\n i = i - 1\n\nprint(i)\n","fail":"import math\n\nN, M = map(int, input().split())\n\n\ndef calculate(n, m):\n res = 1\n for i in range(1, int(math.pow(m, 0.5))):\n if m % i != 0:\n continue\n\n j = m \/\/ i\n\n if i <= m \/\/ n:\n res = max(res, i)\n\n if j <= m \/\/ n:\n res = max(res, j)\n\n print(res)\n\n\ncalculate(N, M)\n","change":"replace","i1":3,"i2":11,"j1":3,"j2":23,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03241","language":"Python","original_status":"Runtime Error","pass":"N, M = map(int, input().split()) # \u9805\u6570N, A\u306e\u548cM\n\nans = 1\n\nif N == 1:\n print(M)\n exit()\n\nfor i in range(1000000):\n if (M >= N * i) and (M % i == 0):\n ans = i\n\nprint(ans)\n","fail":"N, M = map(int, input().split()) # \u9805\u6570N, A\u306e\u548cM\n\nans = 1\nfor i in range(1, int(M ** (1 \/ 2)) + 1):\n if M % i != 0:\n continue\n j = M \/\/ i # j\u306f\u3069\u3093\u3069\u3093\u5c0f\u3055\u304f\u306a\u308b\n if j >= N:\n ans = max(ans, i)\n if i >= N:\n ans = max(ans, j)\n\nprint(ans)\n","change":"replace","i1":3,"i2":11,"j1":3,"j2":11,"error":"ZeroDivisionError: integer division or modulo by zero","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03241\/Python\/s190829031.py\", line 10, in \n if (M >= N * i) and (M % i == 0):\nZeroDivisionError: integer division or modulo by zero\n","stdout":null} {"problem_id":"p03241","language":"Python","original_status":"Time Limit Exceeded","pass":"N, M = map(int, input().split())\nd = [i for i in range(1, int(M \/ N) + 1) if M % i == 0]\nprint(max(d))\n","fail":"import math\n\nN, M = map(int, input().split())\nd = []\nfor i in range(1, int(math.sqrt(M)) + 1):\n if M % i == 0:\n d.append(i)\n d.append(int(M \/ i))\nd = list(filter(lambda x: x <= int(M \/ N), d))\nprint(max(d))\n","change":"replace","i1":0,"i2":2,"j1":0,"j2":9,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03241","language":"Python","original_status":"Runtime Error","pass":"# https:\/\/atcoder.jp\/contests\/abc112\/tasks\/abc112_d\n\n# \u7b54\u3048ans\u306e\u6e80\u305f\u3059\u6761\u4ef6\n# ans<=M\/\/N\u3067\u3042\u308b\n# M%ans==0\u3067\u3042\u308b\n\n\n# \u4eee\u8aac:M\/\/N\u304b\u3089ans\u3092--\u3057\u3066\u3001M%ans==0\u3068\u306a\u308bans\u304c\u7b54\u3048\n# \u3067\u3082\u3082\u3057N=2, M=10*9+7\u3068\u304b\u3060\u3063\u305f\u3089TLE\u3057\u305d\u3046 \u2192\u7d04\u6570\u306a\u3089\u3070\n\nfrom math import sqrt\n\nN, M = list(map(int, input().split()))\n\nans = M \/\/ N\nif M % N == 0:\n print(ans)\n exit()\n\ns = min(ans, sqrt(M) + 1)\nfor a in range(s, 0, -1):\n if M % a == 0:\n print(a)\n exit()\n","fail":"# https:\/\/atcoder.jp\/contests\/abc112\/tasks\/abc112_d\n\n# \u7b54\u3048ans\u306e\u6e80\u305f\u3059\u6761\u4ef6\n# ans<=M\/\/N\u3067\u3042\u308b\n# M%ans==0\u3067\u3042\u308b\n\n\n# \u4eee\u8aac:M\/\/N\u304b\u3089ans\u3092--\u3057\u3066\u3001M%ans==0\u3068\u306a\u308bans\u304c\u7b54\u3048\n# \u3067\u3082\u3082\u3057N=2, M=10*9+7\u3068\u304b\u3060\u3063\u305f\u3089TLE\u3057\u305d\u3046\u2192\u3057\u306a\u304b\u3063\u305f(\u30b3\u30fc\u30ca\u30fc\u30b1\u30fc\u30b9\u306b\u52a9\u3051\u3089\u308c\u305f\uff1f)\n# 2 999999937\u3067TLE\u3057\u3066\u3057\u307e\u3046\u306e\u3067\u3053\u308c\u306f\u5618\u89e3\u7b54\n\nN, M = list(map(int, input().split()))\n\n# \u4ee5\u4e0b\u5618\u89e3\u7b54\n# ans = M \/\/ N\n# for a in range(ans, 0, -1):\n# if M % a == 0:\n# print(a)\n# exit()\n\n# \u672c\u5f53\u306e\u89e3\u7b54\nans_temp = M \/\/ N\nif M % N == 0:\n print(ans_temp)\n exit()\n\n\ndef factorization(n):\n arr = []\n temp = n\n for i in range(2, int(-(-(n**0.5) \/\/ 1)) + 1):\n if temp % i == 0:\n cnt = 0\n while temp % i == 0:\n cnt += 1\n temp \/\/= i\n arr.append((i, cnt))\n\n if temp != 1:\n arr.append((temp, 1))\n\n if arr == []:\n arr.append((n, 1))\n\n return arr\n\n\ndef make_divisors(n, sort=False):\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 if sort:\n divisors.sort()\n return divisors\n\n\nprint(max(make_divisors(M), key=lambda x: 0 if x > ans_temp else x))\n","change":"replace","i1":8,"i2":24,"j1":8,"j2":60,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p03241","language":"Python","original_status":"Time Limit Exceeded","pass":"N, M = map(int, input().split())\nprint(max(d for d in range(1, M \/\/ N + 1) if M % d == 0))\n","fail":"N, M = map(int, input().split())\nprint(next(d for d in reversed(range(M \/\/ N + 1)) if M % d == 0))\n","change":"replace","i1":1,"i2":2,"j1":1,"j2":2,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03241","language":"Python","original_status":"Time Limit Exceeded","pass":"import sys\nfrom io import StringIO\nimport unittest\nimport os\n\n# \u518d\u5e30\u51e6\u7406\u4e0a\u9650(dfs\u4f5c\u6210\u6642\u306b\u8a2d\u5b9a\u3059\u308b\u306e\u304c\u9762\u5012\u306a\u306e\u3067\u9650\u5ea6\u8fd1\u3044\u5024\u3092\u7d44\u307f\u8fbc\u3080)\nsys.setrecursionlimit(999999999)\n\n\n# \u5b9f\u88c5\u3092\u884c\u3046\u95a2\u6570\ndef resolve(test_def_name=\"\"):\n n, m = map(int, input().split())\n\n ans = []\n\n for i in range(1, m \/\/ n + 1):\n if (m - i * n) % i == 0:\n ans.append(i)\n\n print(max(ans))\n\n\n# \u30c6\u30b9\u30c8\u30af\u30e9\u30b9\nclass TestClass(unittest.TestCase):\n def assertIO(self, assert_input, output):\n stdout, sat_in = sys.stdout, sys.stdin\n sys.stdout, sys.stdin = StringIO(), StringIO(assert_input)\n resolve(sys._getframe().f_back.f_code.co_name)\n sys.stdout.seek(0)\n out = sys.stdout.read()[:-1]\n sys.stdout, sys.stdin = stdout, sat_in\n self.assertEqual(out, output)\n\n def test_input_1(self):\n test_input = \"\"\"3 14\"\"\"\n output = \"\"\"2\"\"\"\n self.assertIO(test_input, output)\n\n def test_input_2(self):\n test_input = \"\"\"10 123\"\"\"\n output = \"\"\"3\"\"\"\n self.assertIO(test_input, output)\n\n def test_input_3(self):\n test_input = \"\"\"100000 1000000000\"\"\"\n output = \"\"\"10000\"\"\"\n self.assertIO(test_input, output)\n\n # \u81ea\u4f5c\u30c6\u30b9\u30c8\u30d1\u30bf\u30fc\u30f3\u306e\u3072\u306a\u5f62(\u5229\u7528\u6642\u306f\u300ctes_t\u300d\u306e\u30a2\u30f3\u30c0\u30fc\u30d0\u30fc\u3092\u524a\u9664\u3059\u308b\u3053\u3068\n def tes_t_1original_1(self):\n test_input = \"\"\"\u30c7\u30fc\u30bf\"\"\"\n output = \"\"\"\u30c7\u30fc\u30bf\"\"\"\n self.assertIO(test_input, output)\n\n\n# \u5b9f\u88c5or\u30c6\u30b9\u30c8\u306e\u547c\u3073\u51fa\u3057\nif __name__ == \"__main__\":\n if os.environ.get(\"USERNAME\") is None:\n # AtCoder\u63d0\u51fa\u6642\u306e\u5834\u5408\n resolve()\n\n else:\n # \u81eaPC\u306e\u5834\u5408\n unittest.main()\n","fail":"import sys\nfrom io import StringIO\nimport unittest\nimport os\n\n# \u518d\u5e30\u51e6\u7406\u4e0a\u9650(dfs\u4f5c\u6210\u6642\u306b\u8a2d\u5b9a\u3059\u308b\u306e\u304c\u9762\u5012\u306a\u306e\u3067\u9650\u5ea6\u8fd1\u3044\u5024\u3092\u7d44\u307f\u8fbc\u3080)\nsys.setrecursionlimit(999999999)\n\n\n# \u5b9f\u88c5\u3092\u884c\u3046\u95a2\u6570\ndef resolve(test_def_name=\"\"):\n n, m = map(int, input().split())\n\n for i in reversed(range(1, m \/\/ n + 1)):\n if (m - i * n) % i == 0:\n print(i)\n return\n\n\n# \u30c6\u30b9\u30c8\u30af\u30e9\u30b9\nclass TestClass(unittest.TestCase):\n def assertIO(self, assert_input, output):\n stdout, sat_in = sys.stdout, sys.stdin\n sys.stdout, sys.stdin = StringIO(), StringIO(assert_input)\n resolve(sys._getframe().f_back.f_code.co_name)\n sys.stdout.seek(0)\n out = sys.stdout.read()[:-1]\n sys.stdout, sys.stdin = stdout, sat_in\n self.assertEqual(out, output)\n\n def test_input_1(self):\n test_input = \"\"\"3 14\"\"\"\n output = \"\"\"2\"\"\"\n self.assertIO(test_input, output)\n\n def test_input_2(self):\n test_input = \"\"\"10 123\"\"\"\n output = \"\"\"3\"\"\"\n self.assertIO(test_input, output)\n\n def test_input_3(self):\n test_input = \"\"\"100000 1000000000\"\"\"\n output = \"\"\"10000\"\"\"\n self.assertIO(test_input, output)\n\n # \u81ea\u4f5c\u30c6\u30b9\u30c8\u30d1\u30bf\u30fc\u30f3\u306e\u3072\u306a\u5f62(\u5229\u7528\u6642\u306f\u300ctes_t\u300d\u306e\u30a2\u30f3\u30c0\u30fc\u30d0\u30fc\u3092\u524a\u9664\u3059\u308b\u3053\u3068\n def tes_t_1original_1(self):\n test_input = \"\"\"\u30c7\u30fc\u30bf\"\"\"\n output = \"\"\"\u30c7\u30fc\u30bf\"\"\"\n self.assertIO(test_input, output)\n\n\n# \u5b9f\u88c5or\u30c6\u30b9\u30c8\u306e\u547c\u3073\u51fa\u3057\nif __name__ == \"__main__\":\n if os.environ.get(\"USERNAME\") is None:\n # AtCoder\u63d0\u51fa\u6642\u306e\u5834\u5408\n resolve()\n\n else:\n # \u81eaPC\u306e\u5834\u5408\n unittest.main()\n","change":"replace","i1":13,"i2":20,"j1":13,"j2":17,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03241","language":"Python","original_status":"Time Limit Exceeded","pass":"N, M = [int(str) for str in input().strip().split()]\n\nfor i in range(N, M + 1):\n if M % i == 0:\n print(M \/\/ i)\n exit()\n\nprint(1)\n","fail":"N, M = [int(str) for str in input().strip().split()]\n\nfor i in range(M \/\/ N, 0, -1):\n if M % i == 0:\n print(i)\n exit()\n\nprint(1)\n","change":"replace","i1":2,"i2":5,"j1":2,"j2":5,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03241","language":"Python","original_status":"Time Limit Exceeded","pass":"n, m = map(int, input().split())\n\nif n == 1:\n print(m)\n exit()\na = []\nfor i in range(1, m \/\/ n + 1):\n if m % n == 0:\n print(m \/\/ n)\n exit()\n if m % i == 0:\n a.append(i)\n\nprint(max(a))\n","fail":"import math\n\nn, m = map(int, input().split())\n\nif n == 1:\n print(m)\n exit()\na = []\nb = []\nfor i in range(1, math.ceil(math.sqrt(m))):\n if m % n == 0:\n print(m \/\/ n)\n exit()\n if m % i == 0:\n b.append(i)\n b.append(m \/\/ i)\n\n# print(b)\n\nfor i in range(len(b)):\n if b[i] * n <= m:\n a.append(b[i])\n# print(a)\n\nif len(b) == 2:\n print(1)\nelse:\n print(max(a))\n","change":"replace","i1":0,"i2":14,"j1":0,"j2":28,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03241","language":"Python","original_status":"Time Limit Exceeded","pass":"N, M = map(int, input().split())\n\n\ndef factorize(n):\n if n == 1:\n return [1]\n\n i, factors = 2, []\n while i * i <= n:\n while n % i == 0:\n n \/\/= i\n factors.append(i)\n i += 1\n if n > 1:\n factors.append(n)\n return factors\n\n\nfactors = factorize(M)\nn_factors = len(factors)\n\nans = 0\nfor i in range(1 << n_factors):\n x = 1\n for j in range(n_factors):\n if i & (1 << j):\n x *= factors[j]\n y = M \/\/ x\n if N <= y:\n ans = max(ans, x)\nprint(ans)\n","fail":"from collections import Counter\n\nN, M = map(int, input().split())\n\n\ndef factorize(n):\n if n == 1:\n return [1]\n\n i, factors = 2, []\n while i * i <= n:\n while n % i == 0:\n n \/\/= i\n factors.append(i)\n i += 1\n if n > 1:\n factors.append(n)\n return factors\n\n\nc = Counter(factorize(M))\na = [1]\nfor k, v in c.items():\n tmp = []\n for x in a:\n for i in range(v + 1):\n tmp.append(x * (k**i))\n a = list(set(a) | set(tmp))\n\nans = 0\nfor x in a:\n y = M \/\/ x\n if N <= y:\n ans = max(ans, x)\nprint(ans)\n","change":"replace","i1":0,"i2":27,"j1":0,"j2":31,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03241","language":"Python","original_status":"Time Limit Exceeded","pass":"# -*- coding: utf-8 -*-\n\nN, M = map(int, input().split())\n\nfor i in range(1, M \/\/ 2 + 1):\n if M % i == 0 and i >= N:\n print(M \/\/ i)\n exit()\n\nprint(1)\n","fail":"# -*- coding: utf-8 -*-\n\nimport bisect\n\nN, M = map(int, input().split())\n\ny = [1, M]\nfor i in range(2, int(M**0.5) + 1):\n if M % i == 0:\n y.append(i)\n y.append(M \/\/ i)\n\ny.sort()\nprint(M \/\/ y[bisect.bisect_left(y, N)])\n","change":"replace","i1":1,"i2":10,"j1":1,"j2":14,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03241","language":"Python","original_status":"Time Limit Exceeded","pass":"N, M = map(int, input().split())\nceil = M \/ N\ntmp = 1\nmx = 0\nwhile ceil >= tmp:\n if (M - tmp * (N - 1)) % tmp == 0:\n mx = tmp\n tmp += 1\n\nprint(mx)\n","fail":"N, M = map(int, input().split())\nceil = M \/\/ N\nfor i in range(1, ceil + 1)[::-1]:\n tmp = M - i * (N - 1)\n if tmp > 0 and tmp % i == 0:\n print(i)\n break\n","change":"replace","i1":1,"i2":10,"j1":1,"j2":7,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03241","language":"Python","original_status":"Time Limit Exceeded","pass":"# a1 + a2 + a3 ... + an = M\n# ai \u306e \u6700\u5927\u516c\u7d04\u6570\u3092D\u3068\u3059\u308b\n# ai = xi * D\u3000\u306e\u306f\u305a\u3002 D * x0 + D * x1 ... + D * xn = M\n# \u307e\u3068\u3081\u3066 D(x1 + x2 + .... + xn) = M\n# \u5909\u5f62\u3057\u3001D = M \/ (x1 + x2 + .... + xn)\n# (x1 + ... xn) = K \u3068\u3059\u308b\u3068\u3001K\u3092\u6700\u5c0f\u5316\u3059\u308b\u3068D\u304c\u6700\u5927\u5316\u3059\u308b\n# M \/ K \u304c\u5272\u308a\u5207\u308c\u308b\u5fc5\u8981\u304c\u3042\u308b\u306e\u3067\u3001K\u306fM\u306e\u7d04\u6570\u306e\u3044\u305a\u308c\u304b\n# K >= N\u3002\u306a\u305c\u306a\u3089 xi >= 1 \u306a\u306e\u3067\u3001K\u306f\u6700\u4f4e\u3067\u3082\u6570\u5b57\u306e\u500b\u6570 N \u306b\u306a\u308b\n# \u3064\u307e\u308a\u3001\u7d04\u6570\u306e\u3046\u3061\u3067 N \u4ee5\u4e0a\u306e\u6700\u521d\u306e\u5024\u304c K \u306b\u306a\u308b\n# ex: 3 14\n# 14 \u306e\u7d04\u6570 {1, 2, 7}\n# K >= N \u306a\u306e\u3067\u3001\u3000K >= 3\n# K = 7 \u3067\u78ba\u5b9a\u3002\u3064\u307e\u308a D = M\/K = 2 \u3067Answer\n\nN, M = map(int, input().split())\nfor i in range(1, M + 1):\n if M % i == 0 and i >= N:\n print(M \/\/ i)\n break\n","fail":"# a1 + a2 + a3 ... + an = M\n# ai \u306e \u6700\u5927\u516c\u7d04\u6570\u3092D\u3068\u3059\u308b\n# ai = xi * D\u3000\u306e\u306f\u305a\u3002 D * x0 + D * x1 ... + D * xn = M\n# \u307e\u3068\u3081\u3066 D(x1 + x2 + .... + xn) = M\n# \u5909\u5f62\u3057\u3001D = M \/ (x1 + x2 + .... + xn)\n# (x1 + ... xn) = K \u3068\u3059\u308b\u3068\u3001K\u3092\u6700\u5c0f\u5316\u3059\u308b\u3068D\u304c\u6700\u5927\u5316\u3059\u308b\n# M \/ K \u304c\u5272\u308a\u5207\u308c\u308b\u5fc5\u8981\u304c\u3042\u308b\u306e\u3067\u3001K\u306fM\u306e\u7d04\u6570\u306e\u3044\u305a\u308c\u304b\n# K >= N\u3002\u306a\u305c\u306a\u3089 xi >= 1 \u306a\u306e\u3067\u3001K\u306f\u6700\u4f4e\u3067\u3082\u6570\u5b57\u306e\u500b\u6570 N \u306b\u306a\u308b\n# \u3064\u307e\u308a\u3001\u7d04\u6570\u306e\u3046\u3061\u3067 N \u4ee5\u4e0a\u306e\u6700\u521d\u306e\u5024\u304c K \u306b\u306a\u308b\n# ex: 3 14\n# 14 \u306e\u7d04\u6570 {1, 2, 7}\n# K >= N \u306a\u306e\u3067\u3001\u3000K >= 3\n# K = 7 \u3067\u78ba\u5b9a\u3002\u3064\u307e\u308a D = M\/K = 2 \u3067Answer\n\nN, M = map(int, input().split())\nM_ROOT = int(M**0.5)\nk = M\nfor i in range(1, M_ROOT + 1):\n if M % i == 0:\n if i >= N:\n print(M \/\/ i)\n exit()\n d = M \/\/ i\n if d < k and d >= N:\n k = d\nprint(M \/\/ k)\n","change":"replace","i1":15,"i2":19,"j1":15,"j2":26,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03241","language":"Python","original_status":"Time Limit Exceeded","pass":"N, M = map(int, input().split())\n\ni = M \/\/ N\nwhile M % i:\n i -= 1\n\nprint(i)\n","fail":"import math\n\nN, M = map(int, input().split())\n\ndiv = M\nfor i in range(1, int(math.sqrt(M)) + 1):\n if M % i:\n continue\n i2 = M \/\/ i\n if i >= N:\n div = min(div, i)\n if i2 >= N:\n div = min(div, i2)\n\nprint(M \/\/ div)\n","change":"replace","i1":0,"i2":7,"j1":0,"j2":15,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03242","language":"Python","original_status":"Runtime Error","pass":"n = int(input())\nfor i in n:\n if i == 1:\n i = 9\n elif i == 9:\n i = 1\nprint(n)\n","fail":"n = int(input())\nprint(1110 - n)\n","change":"replace","i1":1,"i2":7,"j1":1,"j2":2,"error":"TypeError: 'int' object is not iterable","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03242\/Python\/s049531454.py\", line 2, in \n for i in n:\nTypeError: 'int' object is not iterable\n","stdout":null} {"problem_id":"p03242","language":"Python","original_status":"Runtime Error","pass":"s = str(input())\nans = \"\"\nfor i in range(len(s)):\n if s[i] == 1:\n ans += 9\n else:\n ans += 1\nprint(ans)\n","fail":"s = list(str(input()))\nans = \"\"\nfor i in range(3):\n if s[i] == \"1\":\n ans = ans + \"9\"\n else:\n ans = ans + \"1\"\nprint(ans)\n","change":"replace","i1":0,"i2":7,"j1":0,"j2":7,"error":"TypeError: can only concatenate str (not \"int\") to str","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03242\/Python\/s740292612.py\", line 7, in \n ans += 1\nTypeError: can only concatenate str (not \"int\") to str\n","stdout":null} {"problem_id":"p03242","language":"Python","original_status":"Runtime Error","pass":"n = str(input())\nfor i in n:\n if i == 9:\n n[i] = 1\n else:\n n[i] = 9\nprint(int(n))\n","fail":"n = str(input())\nans = \"\"\nfor i in n:\n if i == \"9\":\n ans += \"1\"\n else:\n ans += \"9\"\nprint(ans)\n","change":"replace","i1":1,"i2":7,"j1":1,"j2":8,"error":"TypeError: 'str' object does not support item assignment","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03242\/Python\/s999144591.py\", line 6, in \n n[i] = 9\nTypeError: 'str' object does not support item assignment\n","stdout":null} {"problem_id":"p03242","language":"Python","original_status":"Runtime Error","pass":"n = int(input())\n\nn_letters = str(n)\n\nfor i in n_letters:\n if n_letters[i] == \"1\":\n n_letters[i] = \"9\"\n elif n_letters[i] == \"9\":\n n_letters[i] = \"1\"\n","fail":"n = input()\nans = []\nfor i in range(len(n)):\n if n[i] == \"1\":\n ans.append(\"9\")\n elif n[i] == \"9\":\n ans.append(\"1\")\n\nprint(\"\".join(ans))\n","change":"replace","i1":0,"i2":9,"j1":0,"j2":9,"error":"TypeError: string indices must be integers","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03242\/Python\/s208424458.py\", line 6, in \n if n_letters[i] == \"1\":\nTypeError: string indices must be integers\n","stdout":null} {"problem_id":"p03243","language":"Python","original_status":"Runtime Error","pass":"n = input()\nx = (n - 1) \/\/ 111 + 1\nprint(x * 111)\n","fail":"n = int(input())\nx = (n - 1) \/\/ 111 + 1\nprint(x * 111)\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"TypeError: unsupported operand type(s) for -: 'str' and 'int'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03243\/Python\/s109763902.py\", line 2, in \n x = (n - 1) \/\/ 111 + 1\nTypeError: unsupported operand type(s) for -: 'str' and 'int'\n","stdout":null} {"problem_id":"p03243","language":"Python","original_status":"Runtime Error","pass":"N = int(input())\nprint(min([x for x in [int(str(i) * 3) - N for i in range(1, 10)] if x > 0]) + N)\n","fail":"N = int(input())\nprint(min([x for x in [int(str(i) * 3) - N for i in range(1, 10)] if x >= 0]) + N)\n","change":"replace","i1":1,"i2":2,"j1":1,"j2":2,"error":"WA","stderr":null,"stdout":222.0} {"problem_id":"p03243","language":"Python","original_status":"Runtime Error","pass":"n = input()\nfor ans in range(111, 1000, 111):\n if n <= ans:\n break\nprint(ans)\n","fail":"n = input()\nfor ans in range(111, 1000, 111):\n if int(n) <= ans:\n break\nprint(ans)\n","change":"replace","i1":2,"i2":3,"j1":2,"j2":3,"error":"TypeError: '<=' not supported between instances of 'str' and 'int'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03243\/Python\/s479378402.py\", line 3, in \n if n <= ans:\nTypeError: '<=' not supported between instances of 'str' and 'int'\n","stdout":null} {"problem_id":"p03244","language":"Python","original_status":"Runtime Error","pass":"import collections\n\nn = int(input())\nv = list(map(int, input().split()))\na = v[::2]\nb = v[1::2]\nac = collections.Counter(a)\nbc = collections.Counter(b)\nac = sorted(ac.items(), key=lambda x: x[1], reverse=True)\nbc = sorted(bc.items(), key=lambda x: x[1], reverse=True)\nif ac[0][0] == bc[0][0]:\n if len(ac) == len(bc) and len(ac) == 1:\n print(ac[0][1])\n exit()\n i = 0\n while ac[i][1] == bc[i][1]:\n i += 1\n if ac[i][1] > bc[i][1]:\n ac.remove(ac[i])\n bc.remove(bc[0])\n elif ac[i][1] < bc[i][1]:\n ac.remove(ac[0])\n bc.remove(bc[i])\nelse:\n ac.remove(ac[0])\n bc.remove(bc[0])\nans = 0\nfor i in range(len(ac)):\n ans += ac[i][1]\nfor i in range(len(bc)):\n ans += bc[i][1]\nprint(ans)\n","fail":"import collections\n\nn = int(input())\nv = list(map(int, input().split()))\na = v[::2]\nb = v[1::2]\nac = collections.Counter(a)\nbc = collections.Counter(b)\nac = sorted(ac.items(), key=lambda x: x[1], reverse=True)\nbc = sorted(bc.items(), key=lambda x: x[1], reverse=True)\nif ac[0][0] == bc[0][0]:\n if len(ac) == len(bc) and len(ac) == 1:\n print(ac[0][1])\n exit()\n i = 0\n while ac[i][1] == bc[i][1]:\n i += 1\n if i == len(ac) - 1 or i == len(bc) - 1:\n break\n if ac[i][1] > bc[i][1]:\n ac.remove(ac[i])\n bc.remove(bc[0])\n elif ac[i][1] < bc[i][1]:\n ac.remove(ac[0])\n bc.remove(bc[i])\n else:\n ac.remove(ac[0])\n bc.remove(bc[1])\nelse:\n ac.remove(ac[0])\n bc.remove(bc[0])\nans = 0\nfor i in range(len(ac)):\n ans += ac[i][1]\nfor i in range(len(bc)):\n ans += bc[i][1]\nprint(ans)\n","change":"replace","i1":17,"i2":23,"j1":17,"j2":28,"error":"0","stderr":null,"stdout":1.0} {"problem_id":"p03244","language":"Python","original_status":"Runtime Error","pass":"from collections import Counter\n\nn = int(input())\nv = list(map(int, input().split()))\n\nif len(set(v)) == 1:\n print(n \/\/ 2)\nelse:\n v1 = [v[i] for i in range(0, n, 2)]\n v2 = [v[i + 1] for i in range(0, n, 2)]\n\n kw1 = Counter(v1)\n kw2 = Counter(v2)\n\n x1 = kw1.most_common()[0][0]\n x2 = kw2.most_common()[0][0]\n\n if x1 != x2:\n ans = 0\n for i in v1:\n if i != x1:\n ans += 1\n for i in v2:\n if i != x2:\n ans += 1\n else:\n y1 = kw1.most_common()[1][0]\n y2 = kw2.most_common()[1][0]\n\n ans1 = 0\n ans2 = 0\n\n for i in v1:\n if i != y1:\n ans1 += 1\n for i in v2:\n if i != x2:\n ans1 += 1\n\n for i in v1:\n if i != x1:\n ans2 += 1\n for i in v2:\n if i != y2:\n ans2 += 1\n\n ans = min(ans1, ans2)\n\nprint(ans)\n","fail":"from collections import Counter\n\nn = int(input())\nv = list(map(int, input().split()))\n\nif len(set(v)) == 1:\n print(n \/\/ 2)\nelse:\n v1 = [v[i] for i in range(0, n, 2)]\n v2 = [v[i + 1] for i in range(0, n, 2)]\n\n kw1 = Counter(v1)\n kw2 = Counter(v2)\n\n x1 = kw1.most_common()[0][0]\n x2 = kw2.most_common()[0][0]\n\n if x1 != x2:\n ans = 0\n for i in v1:\n if i != x1:\n ans += 1\n for i in v2:\n if i != x2:\n ans += 1\n else:\n y1 = kw1.most_common()[1][0]\n y2 = kw2.most_common()[1][0]\n\n ans1 = 0\n ans2 = 0\n\n for i in v1:\n if i != y1:\n ans1 += 1\n for i in v2:\n if i != x2:\n ans1 += 1\n\n for i in v1:\n if i != x1:\n ans2 += 1\n for i in v2:\n if i != y2:\n ans2 += 1\n\n ans = min(ans1, ans2)\n\n print(ans)\n","change":"replace","i1":48,"i2":49,"j1":48,"j2":49,"error":"0","stderr":null,"stdout":1.0} {"problem_id":"p03244","language":"Python","original_status":"Runtime Error","pass":"from collections import defaultdict\n\nN = int(input())\nV = list(map(int, input().split()))\n\nif N == 2:\n if V[0] == V[1]:\n print(0)\n else:\n print(1)\n exit()\n\nd_even = defaultdict(int)\nd_odd = defaultdict(int)\n\nfor i in range(N):\n v = V[i]\n if i % 2 == 0:\n d_even[v] += 1\n else:\n d_odd[v] += 1\n\nl_even = sorted(d_even.items(), key=lambda x: -x[1])\nl_odd = sorted(d_odd.items(), key=lambda x: -x[1])\n\nif l_even[0][0] != l_odd[0][0]:\n print(N - l_even[0][1] - l_odd[0][1])\nelse:\n ans1 = N - l_even[0][1] - l_odd[1][1]\n ans2 = N - l_even[1][1] - l_odd[0][1]\n print(min(ans1, ans2))\n","fail":"from collections import defaultdict\n\nN = int(input())\nV = list(map(int, input().split()))\n\n# \u30b3\u30fc\u30ca\u30fc\u30b1\u30fc\u30b9\u306f\u5148\u306b\u7d42\u308f\u3089\u305b\u308b\n# \u5168\u90e8\u540c\u3058\u6570\u306e\u5834\u5408\u306f\u3001N\/2\u304c\u7b54\u3048\nif len(set(V)) == 1:\n print(N \/\/ 2)\n exit()\n# 2\u3064\u3057\u304b\u306a\u3044\u5834\u5408\u306f1\u304c\u7b54\u3048\nif N == 2:\n print(1)\n exit()\n\n# \u65b9\u91dd: \u5076\u6570\u756a\u76ee\u3068\u5947\u6570\u756a\u76ee\u306f\u5206\u3051\u3066\u8003\u3048\u308b\n# \u5076\u6570\u756a\u76ee\u3001\u5947\u6570\u756a\u76ee\u306f\u305d\u308c\u305e\u308c\u306e\u6700\u983b\u5024\u306b\u5408\u308f\u305b\u308b\u306e\u304c\u4f4e\u30b3\u30b9\u30c8\n# \u6700\u983b\u5024\u304c\u540c\u3058\u5834\u5408\u306f\u300c\u6570\u5217\u306b\u73fe\u308c\u308b\u6570\u306f\u3061\u3087\u3046\u30692\u7a2e\u985e\u300d\u306e\u5236\u7d04\u3092\u5916\u308c\u308b\u306e\u3067\u30012\u756a\u76ee\u306b\u591a\u3044\u6570\u306b\u3042\u308f\u305b\u308b\nd_even = defaultdict(int)\nd_odd = defaultdict(int)\n\nfor i in range(N):\n v = V[i]\n if i % 2 == 0:\n d_even[v] += 1\n else:\n d_odd[v] += 1\n\nl_even = sorted(d_even.items(), key=lambda x: -x[1])\nl_odd = sorted(d_odd.items(), key=lambda x: -x[1])\n\nif l_even[0][0] != l_odd[0][0]:\n print(N - l_even[0][1] - l_odd[0][1])\nelse:\n # \u3069\u3061\u3089\u3082\u8a66\u3057\u3066\u30b3\u30b9\u30c8\u306e\u5c0f\u3055\u3044\u65b9\u3092\u63a1\u7528\u3059\u308b\n ans1 = N - l_even[0][1] - l_odd[1][1]\n ans2 = N - l_even[1][1] - l_odd[0][1]\n print(min(ans1, ans2))\n","change":"replace","i1":5,"i2":28,"j1":5,"j2":35,"error":"0","stderr":null,"stdout":1.0} {"problem_id":"p03244","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\nodd = []\neven = []\narr = list(map(int, input().split()))\nfor i, e in enumerate(arr):\n if i % 2 == 0:\n # odd\n res = False\n for x in odd:\n if x[0] == e:\n x[1] += 1\n res = True\n break\n if not res:\n odd.append([e, 1])\n else:\n # even\n res = False\n for x in even:\n if x[0] == e:\n x[1] += 1\n res = True\n break\n if not res:\n even.append([e, 1])\nodd.sort(key=lambda x: x[1])\neven.sort(key=lambda x: x[1])\nif odd[-1][0] == even[-1][0]:\n if len(odd) == 1:\n ans = n - even[-1][1]\n elif len(even) == 1:\n ans = n - odd[-1][1]\n elif odd[-2][1] > even[-2][1]:\n ans = n - even[-1][1] - odd[-2][1]\n else:\n ans = n - even[-2][1] - odd[-1][1]\nelse:\n ans = n - odd[-1][1] - even[-1][1]\nprint(ans)\n","fail":"n = int(input())\nodd = [[i, 0] for i in range(100000)]\neven = [[i, 0] for i in range(100000)]\narr = list(map(int, input().split()))\nodd_e = True\neven_e = True\nfor i, e in enumerate(arr):\n if i % 2 == 0:\n odd[e - 1][1] += 1\n if odd_e and arr[0] != e:\n odd_e = False\n else:\n even[e - 1][1] += 1\n if even_e and arr[1] != e:\n even_e = False\nodd.sort(key=lambda z: z[1])\neven.sort(key=lambda z: z[1])\nif odd[-1][0] == even[-1][0]:\n if odd_e or even_e:\n ans = n - even[-1][1]\n elif odd[-2][1] > even[-2][1]:\n ans = n - even[-1][1] - odd[-2][1]\n else:\n ans = n - even[-2][1] - odd[-1][1]\nelse:\n ans = n - odd[-1][1] - even[-1][1]\nprint(ans)\n","change":"replace","i1":1,"i2":32,"j1":1,"j2":20,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03244","language":"Python","original_status":"Runtime Error","pass":"from collections import Counter\n\nN = int(input())\n\nindex = 0\neven_numbers = []\nodd_numbers = []\n\nfor i in input().split():\n if index % 2 == 0:\n even_numbers.append(int(i))\n else:\n odd_numbers.append(int(i))\n index += 1\n\neven = Counter(even_numbers).most_common(2)\nodd = Counter(odd_numbers).most_common(2)\n\nif even[0][1] == odd[0][1]:\n print(min(N - even[0][1] - odd[1][1], N - even[1][1] - odd[0][1]))\nelse:\n print(N - even[0][1] - odd[0][1])\n","fail":"from collections import Counter\n\nN = int(input())\n\nindex = 0\neven_numbers = []\nodd_numbers = []\n\nfor i in input().split():\n if index % 2 == 0:\n even_numbers.append(int(i))\n else:\n odd_numbers.append(int(i))\n index += 1\n\neven = Counter(even_numbers).most_common(2)\nodd = Counter(odd_numbers).most_common(2)\n\nif even[0][0] == odd[0][0]:\n if len(even) == 1:\n print(N \/\/ 2)\n else:\n print(N - even[0][1] - max(even[1][1], odd[1][1]))\nelse:\n print(N - even[0][1] - odd[0][1])\n","change":"replace","i1":18,"i2":20,"j1":18,"j2":23,"error":"0","stderr":null,"stdout":1.0} {"problem_id":"p03244","language":"Python","original_status":"Runtime Error","pass":"from collections import defaultdict\n\nn = int(input())\nV = map(int, input().split())\n\nodd = defaultdict(int)\neven = defaultdict(int)\n\nmax_odd = 0\nmax_even = 0\nf_odd = 0\nf_even = 0\ns_odd = 0\ns_even = 0\n\nfor i, v in enumerate(V):\n i += 1\n if i % 2 == 0:\n even[v] += 1\n if even[v] > max_even:\n max_even = even[v]\n if f_even != 0 and v != f_even:\n s_even = f_even\n f_even = v\n elif f_even == 0:\n f_even = v\n\n elif i % 2 == 1:\n odd[v] += 1\n if odd[v] > max_odd:\n max_odd = odd[v]\n if f_odd != 0 and v != f_odd:\n s_odd = f_odd\n f_odd = v\n elif f_odd == 0:\n f_odd = v\n\nhalf = n \/ 2\ncnt = 0\n\n\nif f_odd != f_even:\n c1 = (half - max_odd) + (half - max_even)\n c2 = (half - max_even) + (half - max_odd)\n if c1 > c2:\n cnt = c2\n else:\n cnt = c1\n num1 = f_odd\n num2 = f_even\nelif f_odd == f_even:\n c1 = (half - max_odd) + (half - even[s_even])\n c2 = (half - max_even) + (half - odd[s_odd])\n if c1 > c2:\n cnt = c2\n num1 = s_odd\n num2 = f_even\n else:\n cnt = c1\n num1 = f_odd\n num2 = s_even\n\nlast_odd = V[-2]\nlast_even = V[-1]\nif last_odd != num1 and last_odd == num2:\n cnt -= 1\nif last_even != num2 and last_even == num1:\n cnt -= 1\n\nprint(int(cnt))\n","fail":"n = int(input())\nv = list(map(int, input().split()))\n\njudge_2n_1 = {}\njudge_2n = {}\n\nfor i in range(n):\n if i % 2 == 0:\n if v[i] not in judge_2n_1.keys():\n judge_2n_1[v[i]] = 1\n else:\n judge_2n_1[v[i]] += 1\n else:\n if v[i] not in judge_2n.keys():\n judge_2n[v[i]] = 1\n else:\n judge_2n[v[i]] += 1\n\njudge_2n = sorted(judge_2n.items(), key=lambda x: x[1], reverse=True)\njudge_2n_1 = sorted(judge_2n_1.items(), key=lambda x: x[1], reverse=True)\nanswer = n - 1\n\nfor i in judge_2n[:2]:\n for j in judge_2n_1[:2]:\n if i[0] != j[0]:\n answer = min(answer, n - i[1] - j[1])\n else:\n answer = min(answer, n - max(i[1], j[1]))\n\nprint(answer)\n","change":"replace","i1":0,"i2":70,"j1":0,"j2":30,"error":"TypeError: 'map' object is not subscriptable","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03244\/Python\/s492098689.py\", line 63, in \n last_odd = V[-2]\nTypeError: 'map' object is not subscriptable\n","stdout":null} {"problem_id":"p03244","language":"Python","original_status":"Runtime Error","pass":"from collections import Counter\n\n\nn = int(input())\nv = list(map(int, input().split()))\n\nv_odd = []\nv_even = []\nfor index in range(len(v)):\n i = index + 1\n if i % 2 == 0:\n v_even.append(v[index])\n else:\n v_odd.append(v[index])\n# print(v_odd)\n# print(v_even)\n# print(Counter(v_odd).most_common())\n# print(Counter(v_even).most_common())\n\nif Counter(v_odd).most_common()[0][1] != Counter(v_even).most_common()[0][1]:\n number_of_rewrites = len(v_odd) - Counter(v_odd).most_common()[0][1]\n number_of_rewrites += len(v_even) - Counter(v_even).most_common()[0][1]\nelse:\n if Counter(v_odd).most_common()[0][1] >= Counter(v_even).most_common()[0][1]:\n number_of_rewrites = len(v_odd) - Counter(v_odd).most_common()[0][1]\n number_of_rewrites += len(v_even) - Counter(v_even).most_common()[1][1]\n else:\n number_of_rewrites = len(v_odd) - Counter(v_odd).most_common()[1][1]\n number_of_rewrites += len(v_even) - Counter(v_even).most_common()[0][1]\n\n\nprint(number_of_rewrites)\n","fail":"from collections import Counter\n\n\nn = int(input())\nv = list(map(int, input().split()))\n\nv_odd = []\nv_even = []\nfor index in range(len(v)):\n i = index + 1\n if i % 2 == 0:\n v_even.append(v[index])\n else:\n v_odd.append(v[index])\n# print(v_odd)\n# print(v_even)\n# print(Counter(v_odd).most_common())\n# print(Counter(v_even).most_common())\n\nif Counter(v_odd).most_common()[0][0] != Counter(v_even).most_common()[0][0]:\n number_of_rewrites = len(v_odd) - Counter(v_odd).most_common()[0][1]\n number_of_rewrites += len(v_even) - Counter(v_even).most_common()[0][1]\nelse:\n odd_1st = Counter(v_odd).most_common()[0][1]\n even_1st = Counter(v_even).most_common()[0][1]\n odd_2nd = (\n Counter(v_odd).most_common()[1][1]\n if len(Counter(v_odd).most_common()) >= 2\n else 0\n )\n even_2nd = (\n Counter(v_even).most_common()[1][1]\n if len(Counter(v_even).most_common()) >= 2\n else 0\n )\n\n number_of_rewrites = min(\n len(v_odd) - odd_1st + len(v_even) - even_2nd,\n len(v_odd) - odd_2nd + len(v_even) - even_1st,\n )\n\nprint(number_of_rewrites)\n","change":"replace","i1":19,"i2":30,"j1":19,"j2":40,"error":"0","stderr":null,"stdout":1.0} {"problem_id":"p03244","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\nvs = input().split()\n\nvs1 = [vs[i] for i in range(0, len(vs), 2)]\nvs2 = [vs[i] for i in range(1, len(vs), 2)]\n\nm1 = 0\ni1 = -1\nm2 = 0\ni2 = -1\nccc = 0\nfor value in vs1:\n ccc += 1\n count = vs1.count(value)\n if count > m1:\n i2 = i1\n m2 = m1\n i1 = value\n m1 = count\n\nm3 = 0\ni3 = -1\nm4 = 0\ni4 = -1\nccc2 = 0\nfor value in vs2:\n ccc2 += 1\n count = vs2.count(value)\n if count > m3:\n i4 = i3\n m4 = m3\n i3 = value\n m3 = count\n\nif i1 != i3:\n print((ccc - m1) + (ccc2 - m3))\nelse:\n if m2 > m4:\n print((ccc - m2) + (ccc2 - m3))\n else:\n print((ccc - m1) + (ccc2 - m4))\n","fail":"from collections import Counter\n\nn = int(input())\nvs = input().split()\n\nxs = [v for v in vs[::2]]\nx = Counter(xs).most_common()\n\nys = [v for v in vs[1::2]]\ny = Counter(ys).most_common()\n\nif x[0][0] != y[0][0]:\n d = n - x[0][1] - y[0][1]\n print(d)\nelse:\n if len(x) == 1:\n print(n \/\/ 2)\n else:\n d1 = n - x[0][1] - y[1][1]\n d2 = n - x[1][1] - y[0][1]\n if d1 > d2:\n print(d2)\n else:\n print(d1)\n","change":"replace","i1":0,"i2":41,"j1":0,"j2":24,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03244","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\nv = input().split(\" \")\nif len(set(v)) == 1:\n print(n \/\/ 2)\nelse:\n ans = 0\n odds = v[1::2]\n evens = v[::2]\n ans += len(odds) - max([odds.count(_o) for _o in set(odds)])\n ans += len(evens) - max([evens.count(_o) for _o in set(evens)])\n print(ans)\n","fail":"import collections\n\nn = int(input())\nv = input().split(\" \")\n\"\"\"\nn = 10000\n# v = [_i % 10 for _i in range(n)]\nv = [_i for _i in range(n)]\nn = 10\nv = [1, 1, 1, 1, 1, 1, 1, 1, 1, 2]\n\"\"\"\nif len(set(v)) == 1:\n print(n \/\/ 2)\nelse:\n odds = v[1::2]\n _o = collections.Counter(odds)\n r_o = {str(v): k for k, v in _o.items()}\n evens = v[::2]\n _e = collections.Counter(evens)\n r_e = {str(v): k for k, v in _e.items()}\n ans1 = 0\n tmp = max(_o.values())\n ans1 += len(odds) - tmp\n key = r_o[str(tmp)]\n if key in _e.keys():\n _e[key] = 0\n ans1 += len(evens) - max(_e.values())\n\n ans2 = 0\n _o = collections.Counter(odds)\n r_o = {str(v): k for k, v in _o.items()}\n _e = collections.Counter(evens)\n r_e = {str(v): k for k, v in _e.items()}\n tmp = max(_e.values())\n ans2 += len(evens) - tmp\n key = r_e[str(tmp)]\n if key in _o.keys():\n _o[key] = 0\n ans2 += len(evens) - max(_o.values())\n\n print(min(ans1, ans2))\n","change":"replace","i1":0,"i2":11,"j1":0,"j2":41,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03244","language":"Python","original_status":"Runtime Error","pass":"from collections import defaultdict\n\n\ndef resolve():\n n = int(input())\n v = list(map(int, input().split()))\n d_o = defaultdict(int)\n d_e = defaultdict(int)\n for i in range(n):\n if i % 2:\n d_o[v[i]] += 1\n else:\n d_e[v[i]] += 1\n de = sorted(d_e.items(), key=lambda x: x[1])\n do = sorted(d_o.items(), key=lambda x: x[1])\n if de == do:\n p = max(de[0][1], do[0][1])\n print(n - p)\n if de[0] != do[0]:\n print(n - de[0][1] - do[0][1])\n else:\n p = max(de[0][1] + do[1][1], de[1][1] + do[0][1])\n print(n - p)\n\n\nif __name__ == \"__main__\":\n resolve()\n","fail":"from collections import defaultdict\n\n\ndef resolve():\n n = int(input())\n v = list(map(int, input().split()))\n d_o = defaultdict(int)\n d_e = defaultdict(int)\n for i in range(n):\n if i % 2:\n d_o[v[i]] += 1\n else:\n d_e[v[i]] += 1\n d_e[0] = 0\n d_o[0] = 0\n de = sorted(d_e.items(), key=lambda x: -x[1])\n do = sorted(d_o.items(), key=lambda x: -x[1])\n if de[0][0] != do[0][0]:\n print(n - de[0][1] - do[0][1])\n else:\n p01 = de[0][1] + do[1][1]\n p10 = de[1][1] + do[0][1]\n print(n - max(p01, p10))\n\n\nif __name__ == \"__main__\":\n resolve()\n","change":"replace","i1":13,"i2":23,"j1":13,"j2":23,"error":"0","stderr":null,"stdout":1.0} {"problem_id":"p03244","language":"Python","original_status":"Runtime Error","pass":"from sys import stdin\n\nn = int(stdin.readline().rstrip())\nv = [int(i) for i in stdin.readline().rstrip().split()]\n\nleft = [0] * 10**5 + 1\nright = [0] * 10**5 + 1\n\nfor i in range(len(v)):\n if i % 2 == 0:\n left[v[i]] += 1\n else:\n right[v[i]] += 1\n\nleft_max = 0\nleft_max_second = 0\nright_max = 0\nright_max_second = 0\nleft_flag = 0\nright_flag = 0\nfor i in range(len(left)):\n if left_max < left[i]:\n left_max_second = left_max\n left_max = left[i]\n left_flag = i\n\n if right_max < right[i]:\n right_max_second = right_max\n right_max = right[i]\n right_flag = i\n\nif left_flag == right_flag:\n tmp = min(left_max + right_max_second, right_max + left_max_second)\n # print(left_max, left_max_second, right_max, right_max_second)\n print(n - tmp)\nelse:\n print((n \/\/ 2 - left_max) + (n \/\/ 2 - right_max))\n","fail":"from collections import Counter\nfrom sys import stdin\n\nn = int(stdin.readline().rstrip())\na = [int(i) for i in stdin.readline().rstrip().split()]\n\neven = []\nodd = []\nfor i in range(n):\n if i % 2 == 0:\n even.append(a[i])\n else:\n odd.append(a[i])\n\neven_conter = Counter(even)\nodd_conter = Counter(odd)\n\neven_sorted = even_conter.most_common()\nodd_sorted = odd_conter.most_common()\n\neven_key1 = even_sorted[0][0]\neven_val1 = even_sorted[0][1]\nodd_key1 = odd_sorted[0][0]\nodd_val1 = odd_sorted[0][1]\n\nans = n\nif even_key1 == odd_key1:\n if len(even_sorted) >= 2:\n even_val2 = even_sorted[1][1]\n odd_val2 = odd_sorted[1][1]\n ans -= max((even_val1 + odd_val2), (odd_val1 + even_val2))\n else:\n ans -= max(even_val1, odd_val1)\nelse:\n ans -= even_val1 + odd_val1\n\nprint(ans)\n","change":"replace","i1":0,"i2":37,"j1":0,"j2":37,"error":"TypeError: can only concatenate list (not \"int\") to list","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03244\/Python\/s259366931.py\", line 6, in \n left = [0] * 10**5 + 1\nTypeError: can only concatenate list (not \"int\") to list\n","stdout":null} {"problem_id":"p03244","language":"Python","original_status":"Runtime Error","pass":"import collections\n\nn = int(input())\nv = list(map(int, input().split()))\n\ns = len(set(v))\nif s == 1:\n print(n \/\/ 2)\n exit()\n\nodd = v[::2]\neven = v[1::2]\nmo = collections.Counter(odd).most_common()[0]\nmo2 = collections.Counter(odd).most_common()[1]\nme = collections.Counter(even).most_common()[0]\nme2 = collections.Counter(even).most_common()[1]\n\nif mo[0] == me[0]:\n if me2[1] < mo2[1]:\n mo = mo2\n else:\n me = me2\nprint(abs((n \/\/ 2) - mo[1]) + abs((n \/\/ 2) - me[1]))\n","fail":"import collections\n\nn = int(input())\nv = list(map(int, input().split()))\n\ns = len(set(v))\nif s == 1:\n print(n \/\/ 2)\n exit()\n\nodd = v[::2]\neven = v[1::2]\nmo = collections.Counter(odd).most_common(2)\nme = collections.Counter(even).most_common(2)\n\nif mo[0][0] != me[0][0]:\n print(n - mo[0][1] - me[0][1])\nelif len(mo) == 1:\n print(n - mo[0][1] - me[1][1])\nelif len(me) == 1:\n print(n - mo[1][1] - me[0][1])\nelse:\n print(n - max(mo[0][1] + me[1][1], mo[1][1] + me[0][1]))\n","change":"replace","i1":12,"i2":23,"j1":12,"j2":23,"error":"IndexError: list index out of range","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03244\/Python\/s099535148.py\", line 14, in \n mo2 = collections.Counter(odd).most_common()[1]\nIndexError: list index out of range\n","stdout":null} {"problem_id":"p03244","language":"Python","original_status":"Runtime Error","pass":"from collections import Counter\n\nn = int(input())\nv = list(map(int, input().split()))\n\nva = v[::2]\nvb = v[1::2]\n\nva_ = Counter(va).most_common(2)\nvb_ = Counter(vb).most_common(2)\n\nif va_[0][0] == vb_[0][0]:\n if va_[0][1] + vb_[1][1] > va_[1][1] + vb_[0][1]:\n print(len(va) - va_[0][1] + len(vb) - vb_[1][1])\n else:\n print(len(va) - va_[1][1] + len(vb) - vb_[0][1])\nelse:\n print(len(va) - va_[0][1] + len(vb) - vb_[0][1])\n","fail":"from collections import Counter\n\nn = int(input())\nv = list(map(int, input().split()))\n\nva = v[::2]\nvb = v[1::2]\n\nva_ = Counter(va).most_common()\nvb_ = Counter(vb).most_common()\n\nif va_[0][0] == vb_[0][0]:\n if len(va_) == 1 or len(vb_) == 1:\n if len(va_) == 1 and len(vb_) == 1:\n print(len(v) \/\/ 2)\n elif len(va_) == 1:\n if va_[0][0] == vb_[0][0]:\n print(len(vb) - vb_[1][1])\n else:\n print(len(vb) - vb_[0][1])\n else:\n if va_[0][0] == vb_[0][0]:\n print(len(va) - va_[1][1])\n else:\n print(len(va) - va_[0][1])\n exit()\n if va_[0][1] + vb_[1][1] > va_[1][1] + vb_[0][1]:\n print(len(va) - va_[0][1] + len(vb) - vb_[1][1])\n else:\n print(len(va) - va_[1][1] + len(vb) - vb_[0][1])\nelse:\n print(len(va) - va_[0][1] + len(vb) - vb_[0][1])\n","change":"replace","i1":8,"i2":12,"j1":8,"j2":26,"error":"0","stderr":null,"stdout":1.0} {"problem_id":"p03244","language":"Python","original_status":"Runtime Error","pass":"from statistics import mode\n\nn = int(input())\nv = list(map(int, input.split()))\na = v[::1]\nb = v[1::1]\nslash = mode(a)\nback_slash = mode(b)\na = [i for i in a if i != slash]\nb = [j for j in b if j != back_slash]\nprint(len(a) + len(b))\n","fail":"from collections import Counter\n\nn = int(input())\nv = list(map(int, input().split()))\nv_odd = v[0::2]\nv_even = v[1::2]\nans = 0\nc_odd = Counter(v_odd)\nc_even = Counter(v_even)\nv_o, c_o = zip(*c_odd.most_common())\nv_e, c_e = zip(*c_even.most_common())\nif len(c_o) == 1:\n odd1 = 0\nelse:\n odd1 = c_o[1]\nif len(c_e) == 1:\n even1 = 0\nelse:\n even1 = c_e[1]\nif not v_o[0] == v_e[0]:\n print(sum(c_o) - c_o[0] + sum(c_e) - c_e[0])\nelse:\n ans = min(sum(c_o) - c_o[0] + sum(c_e) - even1, sum(c_o) - odd1 + sum(c_e) - c_e[0])\n print(ans)\n","change":"replace","i1":0,"i2":11,"j1":0,"j2":24,"error":"AttributeError: 'builtin_function_or_method' object has no attribute 'split'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03244\/Python\/s850974654.py\", line 4, in \n v = list(map(int, input.split()))\nAttributeError: 'builtin_function_or_method' object has no attribute 'split'\n","stdout":null} {"problem_id":"p03244","language":"Python","original_status":"Runtime Error","pass":"# coding:utf-8\nimport collections\n\n\ndef main():\n n = int(input())\n v = list(map(int, input().split()))\n\n va = []\n vb = []\n for i in range(0, n, 2):\n va.append(v[i])\n vb.append(v[i + 1])\n\n c1mc = collections.Counter(va).most_common()\n c2mc = collections.Counter(vb).most_common()\n\n if c1mc[0][0] != c2mc[0][0]:\n print(n - c1mc[0][1] - c2mc[0][1])\n return\n\n else:\n a = n - c1mc[1][1] - c2mc[0][1]\n b = n - c1mc[0][1] - c2mc[1][1]\n\n if a < b:\n print(a)\n else:\n print(b)\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"# coding:utf-8\nimport collections\n\n\ndef main():\n n = int(input())\n v = list(map(int, input().split()))\n\n va = []\n vb = []\n for i in range(0, n, 2):\n va.append(v[i])\n vb.append(v[i + 1])\n\n if va == vb and len(set(va)) == 1:\n print(len(va))\n return\n\n c1mc = collections.Counter(va).most_common()\n c2mc = collections.Counter(vb).most_common()\n\n if c1mc[0][0] != c2mc[0][0]:\n print(n - c1mc[0][1] - c2mc[0][1])\n return\n\n else:\n a = n - c1mc[1][1] - c2mc[0][1]\n b = n - c1mc[0][1] - c2mc[1][1]\n\n if a < b:\n print(a)\n else:\n print(b)\n\n\nif __name__ == \"__main__\":\n main()\n","change":"insert","i1":13,"i2":13,"j1":13,"j2":17,"error":"0","stderr":null,"stdout":1.0} {"problem_id":"p03244","language":"Python","original_status":"Runtime Error","pass":"import collections\n\nn = int(input())\nv = list(map(int, input().split()))\nv1 = []\nv2 = []\nans = 0\n\nfor i in range(n):\n if i % 2 == 0:\n v1.append(v[i])\n else:\n v2.append(v[i])\n\nc1 = collections.Counter(v1)\nmostChar1, mostCount1 = c1.most_common()[0]\nndChar1, ndCount1 = c1.most_common()[1]\n\nc2 = collections.Counter(v2)\nmostChar2, mostCount2 = c2.most_common()[0]\nndChar2, ndCount2 = c2.most_common()[1]\n\nif mostChar1 == mostChar2:\n temp1 = n - mostCount1 - ndCount2\n temp2 = n - mostCount2 - ndCount1\n ans = min(temp1, temp2)\nelse:\n ans = n - mostCount1 - mostCount2\n\nprint(ans)\n","fail":"import collections\n\nn = int(input())\nv = list(map(int, input().split()))\nv1 = []\nv2 = []\nans = 0\n\nfor i in range(n):\n if i % 2 == 0:\n v1.append(v[i])\n else:\n v2.append(v[i])\n\nc1 = collections.Counter(v1)\nmostChar1, mostCount1 = c1.most_common()[0]\n# ndChar1, ndCount1 = c1.most_common()[1]\n\nc2 = collections.Counter(v2)\nmostChar2, mostCount2 = c2.most_common()[0]\n# ndChar2, ndCount2 = c2.most_common()[1]\n\nif mostChar1 == mostChar2:\n if len(c1.most_common()) == 1 and len(c1.most_common()) == 1:\n ans = n \/\/ 2\n elif len(c1.most_common()) == 1:\n ndChar2, ndCount2 = c2.most_common()[1]\n ans = n - mostCount1 - ndCount2\n elif len(c2.most_common()) == 1:\n ndChar1, ndCount1 = c1.most_common()[1]\n ans = n - mostCount2 - ndCount1\n else:\n ndChar1, ndCount1 = c1.most_common()[1]\n ndChar2, ndCount2 = c2.most_common()[1]\n temp1 = n - mostCount1 - ndCount2\n temp2 = n - mostCount2 - ndCount1\n ans = min(temp1, temp2)\nelse:\n ans = n - mostCount1 - mostCount2\n\nprint(ans)\n","change":"replace","i1":16,"i2":26,"j1":16,"j2":37,"error":"IndexError: list index out of range","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03244\/Python\/s429102895.py\", line 17, in \n ndChar1, ndCount1 = c1.most_common()[1]\nIndexError: list index out of range\n","stdout":null} {"problem_id":"p03244","language":"Python","original_status":"Runtime Error","pass":"from collections import Counter\n\nn = int(input())\nv = input().split()\n\nv1 = v[::2]\nv2 = v[1::2]\nc1 = Counter(v1).most_common(2)\nc2 = Counter(v2).most_common(2)\n\nif c1[0][0] != c2[0][0]:\n print(n - c1[0][1] - c2[0][1])\nelse:\n print(min(n - c1[0][1] - c2[1][1], n - c1[1][1] - c2[0][1]))\n","fail":"from collections import Counter\n\nn = int(input())\nv = input().split()\n\nv1 = v[::2]\nv2 = v[1::2]\nc1 = Counter(v1).most_common(2)\nc2 = Counter(v2).most_common(2)\n\nif len(set(v)) == 1:\n print(len(v) \/\/ 2)\nelif c1[0][0] != c2[0][0]:\n print(n - c1[0][1] - c2[0][1])\nelse:\n print(min(n - c1[0][1] - c2[1][1], n - c1[1][1] - c2[0][1]))\n","change":"replace","i1":10,"i2":11,"j1":10,"j2":13,"error":"0","stderr":null,"stdout":1.0} {"problem_id":"p03244","language":"Python","original_status":"Time Limit Exceeded","pass":"from collections import Counter\nimport itertools\n\n\nn = int(input())\nv = [int(i) for i in input().split()]\n\nif len(set(v)) == 1:\n print(int(len(v) \/ 2))\n exit()\n\nmax_hit = 0\na_nums = [v[i] for i in range(0, len(v), 2)]\na_count = Counter(a_nums)\nb_nums = [v[i] for i in range(1, len(v), 2)]\nb_count = Counter(b_nums)\nvals = [None, None]\n\nfor i, j in itertools.product(set(a_nums), set(b_nums)):\n if i == j:\n continue\n\n if a_count[i] + b_count[j] > max_hit:\n max_hit = a_count[i] + b_count[j]\n vals[0] = i\n vals[1] = j\n\nfix = 0\nfor i, x in enumerate(v):\n if x != vals[i % 2]:\n fix += 1\nprint(fix)\n","fail":"from collections import Counter\n\nn = int(input())\nv = list(map(int, input().split()))\n\n\"\"\"\u6570\u5b57\u304c1\u7a2e\u985e\u306e\u5834\u5408\u306f\u534a\u5206\u3092\u66f8\u304d\u63db\u3048\u308b\u5fc5\u8981\u304c\u78ba\u5b9a\"\"\"\nif len(set(v)) == 1:\n print(len(v) \/\/ 2)\n exit()\n\n\"\"\"\u8981\u7d20\u51fa\u73fe\u6570\u3092\u96c6\u8a08\"\"\"\nodd_count = Counter(v[1::2])\neven_count = Counter(v[::2])\n\n\"\"\"\u4e00\u756a\u591a\u304f\u51fa\u73fe\u3059\u308b2\u3064\u306e\u6570\u5b57\u3092\u63a2\u3059\"\"\"\nmax_hit = 0\nodd = None\neven = None\nfor odd_val, odd_hit in odd_count.most_common(5):\n # if max_hit > odd_hit:\n # break # \u3082\u3046\u6700\u5927\u5024\u306f\u66f4\u65b0\u3055\u308c\u306a\u3044\u306e\u3067\u6253\u3061\u6b62\u3081\n for even_val, even_hit in even_count.most_common(5):\n # if max_hit > even_hit:\n # break # \u3082\u3046\u6700\u5927\u5024\u306f\u66f4\u65b0\u3055\u308c\u306a\u3044\u306e\u3067\u6253\u3061\u6b62\u3081\n if odd_val == even_val:\n continue # \u6570\u5b57\u306f2\u7a2e\u985e\u306a\u3044\u3068\u30c0\u30e1\n if odd_hit + even_hit > max_hit:\n max_hit = odd_hit + even_hit\n odd = odd_val\n even = even_val\n\n\"\"\"\u4e00\u81f4\u3057\u3066\u3044\u306a\u3044\u8981\u7d20\u304c\u66f8\u304d\u63db\u3048\u5fc5\u8981\u56de\u6570\"\"\"\nprint(len(v) - max_hit)\n","change":"replace","i1":1,"i2":32,"j1":1,"j2":33,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03245","language":"Python","original_status":"Time Limit Exceeded","pass":"n = int(input())\nxy = [tuple(map(int, input().split())) for _ in range(n)]\nd = []\ns = [\"\" for _ in xy]\nwhile True:\n p = [max(abs(x), abs(y)) for x, y in xy]\n q = [abs(x) + abs(y) for x, y in xy]\n if max(q) == 0:\n break\n elif max(q) == 1 and min(q) == 0:\n d = None\n break\n d.append((max(p) + min(p)) \/\/ 2)\n for i in range(len(xy)):\n x, y = xy[i]\n if p[i] == abs(x):\n if x > 0:\n s[i] += \"R\"\n xy[i] = (x - d[-1], y)\n else:\n s[i] += \"L\"\n xy[i] = (x + d[-1], y)\n else:\n if y > 0:\n s[i] += \"U\"\n xy[i] = (x, y - d[-1])\n else:\n s[i] += \"D\"\n xy[i] = (x, y + d[-1])\n\nif d is None or len(d) > 40:\n print(-1)\nelse:\n print(len(d))\n print(*d)\n for t in s:\n print(t)\n","fail":"n = int(input())\nxy = [tuple(map(int, input().split())) for _ in range(n)]\ns = set([(x + y) % 2 for x, y in xy])\nif len(s) > 1:\n print(-1)\n exit(0)\n\nd = []\nw = [\"\" for _ in xy]\nif s.pop() == 0:\n d = [1]\n w = [\"L\" for _ in xy]\n xy = [(x + 1, y) for x, y in xy]\n\nb = 1\nwhile True:\n if all(abs(x) + abs(y) == 1 for x, y in xy):\n d.append(b)\n for i in range(len(xy)):\n x, y = xy[i]\n if x > 0:\n w[i] += \"R\"\n elif x < 0:\n w[i] += \"L\"\n elif y > 0:\n w[i] += \"U\"\n else:\n w[i] += \"D\"\n break\n d.append(b)\n for i in range(len(xy)):\n x, y = xy[i]\n if x % 2 == 1:\n if y % 4 == 2 and (x - 1) % 4 == 0 or y % 4 == 0 and (x - 1) % 4 == 2:\n w[i] += \"R\"\n xy[i] = ((x - 1) \/\/ 2, y \/\/ 2)\n else:\n w[i] += \"L\"\n xy[i] = ((x + 1) \/\/ 2, y \/\/ 2)\n else:\n if x % 4 == 2 and (y - 1) % 4 == 0 or x % 4 == 0 and (y - 1) % 4 == 2:\n w[i] += \"U\"\n xy[i] = (x \/\/ 2, (y - 1) \/\/ 2)\n else:\n w[i] += \"D\"\n xy[i] = (x \/\/ 2, (y + 1) \/\/ 2)\n b *= 2\n\nprint(len(d))\nprint(*d)\nfor t in w:\n print(t)\n","change":"replace","i1":2,"i2":37,"j1":2,"j2":52,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03246","language":"Python","original_status":"Runtime Error","pass":"from collections import Counter\n\nN = int(input())\nV = tuple(map(int, input().split()))\nX, Y = Counter(), Counter()\nfor i in range(0, N):\n if i & 1:\n Y[V[i]] += 1\n else:\n X[V[i]] += 1\nx = sorted(X.items(), reverse=True, key=lambda x: x[1])[:2]\ny = sorted(Y.items(), reverse=True, key=lambda x: x[1])[:2]\nif x[0][0] == y[0][0]:\n ans = N\n tmp = 0\n for i in range(0, N):\n if i & 1:\n if V[i] != y[1][0]:\n tmp += 1\n else:\n if V[i] != x[0][0]:\n tmp += 1\n ans = min(ans, tmp)\n tmp = 0\n for i in range(0, N):\n if i & 1:\n if V[i] != y[0][0]:\n tmp += 1\n else:\n if V[i] != x[1][0]:\n tmp += 1\n ans = min(ans, tmp)\nelse:\n ans = 0\n for i in range(0, N):\n if i & 1:\n if V[i] != y[0][0]:\n ans += 1\n else:\n if V[i] != x[0][0]:\n ans += 1\nprint(ans)\n","fail":"from collections import Counter\n\nN = int(input())\nV = tuple(map(int, input().split()))\nX, Y = Counter(), Counter()\nfor i in range(0, N):\n if i & 1:\n Y[V[i]] += 1\n else:\n X[V[i]] += 1\nif len(X) != 1:\n x = sorted(X.items(), reverse=True, key=lambda x: x[1])[:2]\nelse:\n x = sorted(X.items(), reverse=True, key=lambda x: x[1])[:1]\nif len(Y) != 1:\n y = sorted(Y.items(), reverse=True, key=lambda x: x[1])[:2]\nelse:\n y = sorted(Y.items(), reverse=True, key=lambda x: x[1])[:1]\nif x[0][0] == y[0][0]:\n ans = N\n tmp = 0\n if len(y) == 1:\n for i in range(0, N):\n if i & 1:\n if V[i] != y[0][0] + 1:\n tmp += 1\n else:\n if V[i] != x[0][0]:\n tmp += 1\n else:\n for i in range(0, N):\n if i & 1:\n if V[i] != y[1][0]:\n tmp += 1\n else:\n if V[i] != x[0][0]:\n tmp += 1\n ans = min(ans, tmp)\n tmp = 0\n if len(x) == 1:\n for i in range(0, N):\n if i & 1:\n if V[i] != y[0][0]:\n tmp += 1\n else:\n if V[i] != x[0][0] + 1:\n tmp += 1\n else:\n for i in range(0, N):\n if i & 1:\n if V[i] != y[0][0]:\n tmp += 1\n else:\n if V[i] != x[1][0]:\n tmp += 1\n ans = min(ans, tmp)\nelse:\n ans = 0\n for i in range(0, N):\n if i & 1:\n if V[i] != y[0][0]:\n ans += 1\n else:\n if V[i] != x[0][0]:\n ans += 1\nprint(ans)\n","change":"replace","i1":10,"i2":31,"j1":10,"j2":55,"error":0,"stderr":null,"stdout":1} {"problem_id":"p03250","language":"Python","original_status":"Runtime Error","pass":"a, b, c = map(int, input().split())\nprint(max(a, b, c) * 9 + sum(a, b, c))\n","fail":"a, b, c = map(int, input().split())\nprint(max(a, b, c) * 9 + a + b + c)\n","change":"replace","i1":1,"i2":2,"j1":1,"j2":2,"error":"TypeError: sum() takes at most 2 arguments (3 given)","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03250\/Python\/s348388771.py\", line 2, in \n print(max(a, b, c) * 9 + sum(a, b, c))\nTypeError: sum() takes at most 2 arguments (3 given)\n","stdout":null} {"problem_id":"p03250","language":"Python","original_status":"Runtime Error","pass":"a, b, c = map(int, input().split())\nprint(max(a, b, c) * 9 + sum(a, b, c))\n","fail":"a, b, c = map(int, input().split())\nprint(max([a, b, c]) * 9 + sum([a, b, c]))\n","change":"replace","i1":1,"i2":2,"j1":1,"j2":2,"error":"TypeError: sum() takes at most 2 arguments (3 given)","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03250\/Python\/s838495112.py\", line 2, in \n print(max(a, b, c) * 9 + sum(a, b, c))\nTypeError: sum() takes at most 2 arguments (3 given)\n","stdout":null} {"problem_id":"p03250","language":"Python","original_status":"Runtime Error","pass":"input_data = [int(i) for i in input().split(\" \")]\n\nans = 0\nfor k1, v1 in enumerate(input_data):\n for k2, v2 in enumerate(input_data):\n for k3, v3 in enumerate(input_data):\n if k1 == k2 or k2 == k3 or k3 == k1:\n continue\n kou1 = int(f\"{v1}{v2}\")\n if ans < kou1 + v3:\n ans = kou1 + v3\nprint(ans)\n","fail":"input_data = [int(i) for i in input().split(\" \")]\n\nans = 0\nfor k1, v1 in enumerate(input_data):\n for k2, v2 in enumerate(input_data):\n for k3, v3 in enumerate(input_data):\n if k1 == k2 or k2 == k3 or k3 == k1:\n continue\n kou1 = int(str(v1) + str(v2))\n kou2 = v3\n if ans < kou1 + kou2:\n ans = kou1 + v3\nprint(ans)\n","change":"replace","i1":8,"i2":10,"j1":8,"j2":11,"error":"0","stderr":null,"stdout":53.0} {"problem_id":"p03251","language":"Python","original_status":"Runtime Error","pass":"# max min\nn, m, x, y = map(int, input().split())\nxs = max(list(map(int, input().split())))\nys = min(list(map(int, input().split())))\nprint(\"No War\" if xs + 1 < ys else \"War\")\n# max min\nn, m, x, y = map(int, input().split())\nxs = max(list(map(int, input().split())))\nys = min(list(map(int, input().split())))\nprint(\"No War\" if xs + 1 <= ys else \"War\")\n","fail":"# max min\nn, m, x, y = map(int, input().split())\nxs = max(list(map(int, input().split())))\nys = min(list(map(int, input().split())))\n\nprint(\"No War\" if xs < ys and x <= xs and ys <= y else \"War\")\n","change":"replace","i1":4,"i2":10,"j1":4,"j2":6,"error":"EOFError: EOF when reading a line","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03251\/Python\/s312526263.py\", line 7, in \n n, m, x, y = map(int, input().split())\nEOFError: EOF when reading a line\n","stdout":"War\n"} {"problem_id":"p03252","language":"Python","original_status":"Time Limit Exceeded","pass":"S = input()\nT = input()\nn = len(S)\nfor i in range(n):\n s = S[i]\n t = T[i]\n S = S.translate(str.maketrans({s: t, t: s}))\nif S == T:\n print(\"Yes\")\nelse:\n print(\"No\")\n","fail":"S = input()\nT = input()\nst = {}\nts = {}\nfor s, t in zip(S, T):\n if s in st and st[s] != t:\n print(\"No\")\n exit()\n if t in ts and ts[t] != s:\n print(\"No\")\n exit()\n st[s] = t\n ts[t] = s\nprint(\"Yes\")\n","change":"replace","i1":2,"i2":11,"j1":2,"j2":14,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03252","language":"Python","original_status":"Time Limit Exceeded","pass":"# -*- coding: utf-8 -*-\n\n\ndef answer(S, T, N):\n i = 0\n while i < N:\n c1 = S[i]\n c2 = T[i]\n # print(\"c1:\", str(c1))\n # print(\"c2:\", str(c2))\n if c1 != c2:\n for j in range(N):\n # print([S[j], c1])\n # print([T[j], c2])\n if S[j] == c1 and T[j] != c2:\n return False\n i += 1\n\n return True\n\n\nS = list(input())\nT = list(input())\n\nN = len(S)\n\nST = [None] * N\n\nfor i in range(N):\n ST[i] = [S[i], T[i]]\n\nST.sort(key=lambda a_i: a_i[0])\n\nfor i in range(N):\n S[i] = ST[i][0]\n T[i] = ST[i][1]\n\nans1 = answer(S, T, N)\n\nST.sort(key=lambda a_i: a_i[1])\n\nfor i in range(N):\n S[i] = ST[i][0]\n T[i] = ST[i][1]\n\n# print(S)\n# print(T)\n\nans2 = answer(T, S, N)\n\nif ans1 and ans2:\n print(\"Yes\")\nelse:\n print(\"No\")\n","fail":"# coding: utf-8\n\n# https:\/\/atcoder.jp\/contests\/abc110\n\n\ndef main():\n S = input()\n T = input()\n N = len(S)\n\n memo1 = {}\n memo2 = {}\n for i in range(N):\n if S[i] not in memo1:\n memo1[S[i]] = T[i]\n else:\n if memo1[S[i]] != T[i]:\n return \"No\"\n if T[i] not in memo2:\n memo2[T[i]] = S[i]\n else:\n if memo2[T[i]] != S[i]:\n return \"No\"\n\n return \"Yes\"\n\n\nprint(main())\n","change":"replace","i1":0,"i2":54,"j1":0,"j2":28,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03252","language":"Python","original_status":"Runtime Error","pass":"from collections import defaultdict\n\nS = input()\nT = input()\n\nd = defaultdict(str)\n\nno_flag = False\nfor i in range(len(S)):\n if S[i] != T[i]:\n if d[S[i]] == T[i]:\n S[i] = T[i]\n pass\n elif d[S[i]] == \"\" and d[T[i]] == \"\":\n d[S[i]] = T[i]\n d[T[i]] = S[i]\n else:\n pass\n\nS = sorted(S)\nT = sorted(T)\nif S == T:\n print(\"Yes\")\nelse:\n print(\"No\")\n","fail":"from collections import defaultdict, Counter\n\nS = input()\nT = input()\n\nd_s = defaultdict(int)\nd_t = defaultdict(int)\n\nno_flag = False\nfor s, t in zip(list(S), list(T)):\n d_s[s] += 1\n d_t[t] += 1\n\nif sorted(d_s.values()) == sorted(d_t.values()):\n print(\"Yes\")\nelse:\n print(\"No\")\n","change":"replace","i1":0,"i2":22,"j1":0,"j2":14,"error":"TypeError: 'str' object does not support item assignment","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03252\/Python\/s005280607.py\", line 12, in \n S[i] = T[i]\nTypeError: 'str' object does not support item assignment\n","stdout":null} {"problem_id":"p03252","language":"Python","original_status":"Time Limit Exceeded","pass":"S = input()\nT = input()\n\n# \u4f8babcdefg...\u306e\u3088\u3046\u306b\u6587\u5b57\u5217\u304c1\u5bfe1\u306e\u77e2\u5370\u95a2\u4fc2\u306e\u5834\u5408\u306f\u3001\n# \u3069\u306e\u3088\u3046\u306a\u5834\u5408\u3067\u3082\u7f6e\u304d\u63db\u3048\u3067\u304d\u308b\u3002\u554f\u984c\u306f\u540c\u3058\u6587\u5b57\u304c\u8907\u6570\u73fe\u308c\u308b\u5834\u5408\n\n# S\u4e0a\u306b\u540c\u3058\u6587\u5b57s\u306e\u3042\u308b\u5834\u6240\u306b\u306f\n# T\u4e0a\u306b\u3082\u540c\u3058\u6587\u5b57t\u304c\u306a\u304f\u3066\u306f\u306a\u3089\u306a\u3044\n# \u3064\u307e\u308a\u3001\u540c\u3058\u5024\u306b\u306a\u3063\u3066\u3044\u308b\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306e\u96c6\u5408\u3092\u53d6\u308c\u3070\n# \u5168\u90e8\u540c\u3058\u306b\u306a\u3063\u3066\u3044\u308b\u306f\u305a\n\n# \u6587\u5b57\u7a2e\u3054\u3068\u306b\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306e\u96c6\u5408\u3092\u6c42\u3081\u308b\nns = len(S)\nindexS = {}\nfor i in range(ns):\n s = S[i]\n if s in indexS:\n indexS[s].append(i)\n else:\n indexS[s] = [i]\nindexT = {}\nfor i in range(ns):\n t = T[i]\n if t in indexT:\n indexT[t].append(i)\n else:\n indexT[t] = [i]\n# \u5148\u982d\u306e\u6587\u5b57\u304b\u3089\u3001\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306e\u96c6\u5408\u304c\u7b49\u3057\u3044\u304b\u30c1\u30a7\u30c3\u30af\nfor s, t in zip(S, T):\n i_s = indexS[s]\n i_t = indexT[t]\n if i_s != i_t:\n print(\"No\")\n break\nelse:\n print(\"Yes\")\n","fail":"S = input()\nT = input()\n\n# \u4f8babcdefg...\u306e\u3088\u3046\u306b\u6587\u5b57\u5217\u304c1\u5bfe1\u306e\u77e2\u5370\u95a2\u4fc2\u306e\u5834\u5408\u306f\u3001\n# \u3069\u306e\u3088\u3046\u306a\u5834\u5408\u3067\u3082\u7f6e\u304d\u63db\u3048\u3067\u304d\u308b\u3002\u554f\u984c\u306f\u540c\u3058\u6587\u5b57\u304c\u8907\u6570\u73fe\u308c\u308b\u5834\u5408\n\n# S\u4e0a\u306b\u540c\u3058\u6587\u5b57s\u306e\u3042\u308b\u5834\u6240\u306b\u306f\n# T\u4e0a\u306b\u3082\u540c\u3058\u6587\u5b57t\u304c\u306a\u304f\u3066\u306f\u306a\u3089\u306a\u3044\n# \u3064\u307e\u308a\u3001\u540c\u3058\u5024\u306b\u306a\u3063\u3066\u3044\u308b\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306e\u96c6\u5408\u3092\u53d6\u308c\u3070\n# \u5168\u90e8\u540c\u3058\u306b\u306a\u3063\u3066\u3044\u308b\u306f\u305a\n\n# \u6587\u5b57\u7a2e\u3054\u3068\u306b\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306e\u96c6\u5408\u3092\u6c42\u3081\u308b\nns = len(S)\nindexS = {}\nfor i in range(ns):\n s = S[i]\n if s in indexS:\n indexS[s].append(i)\n else:\n indexS[s] = [i]\nindexT = {}\nfor i in range(ns):\n t = T[i]\n if t in indexT:\n indexT[t].append(i)\n else:\n indexT[t] = [i]\n# \u5148\u982d\u306e\u6587\u5b57\u304b\u3089\u3001\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306e\u96c6\u5408\u304c\u7b49\u3057\u3044\u304b\u30c1\u30a7\u30c3\u30af\nfor i in range(ns):\n s = S[i]\n t = T[i]\n i_s = len(indexS[s])\n i_t = len(indexT[t])\n if i_s != i_t:\n print(\"No\")\n break\nelse:\n print(\"Yes\")\n","change":"replace","i1":28,"i2":31,"j1":28,"j2":33,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03252","language":"Python","original_status":"Time Limit Exceeded","pass":"s, t = [input() for _ in range(2)]\n\nfor i in range(len(s)):\n if s[i] == t[i]:\n pass\n else:\n s_diff = s[i]\n t_diff = t[i]\n s = s.translate(str.maketrans({s_diff: t_diff, t_diff: s_diff}))\n\nif s == t:\n print(\"Yes\")\nelse:\n print(\"No\")\n","fail":"s = list(input())\nt = list(input())\nx = list(set(s))\ny = list(set(t))\na = []\nb = []\n\nfor i in range(len(set(s))):\n a.append(s.count(x[i]))\n\nfor j in range(len(set(t))):\n b.append(t.count(y[j]))\n\na.sort()\nb.sort()\n\nif a == b:\n print(\"Yes\")\nelse:\n print(\"No\")\n","change":"replace","i1":0,"i2":11,"j1":0,"j2":17,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03252","language":"Python","original_status":"Time Limit Exceeded","pass":"\"\"\" AtCoder \"\"\"\n\nS = input()\nT = input()\n\nfor i in range(len(S)):\n index = i\n tmp = T[i]\n while True:\n index = S.find(S[i], index + 1)\n if index == -1:\n break\n\n if tmp != T[index]:\n print(\"No\")\n exit()\n\nfor i in range(len(T)):\n index = i\n tmp = S[i]\n while True:\n index = T.find(T[i], index + 1)\n if index == -1:\n break\n if tmp != S[index]:\n print(\"No\")\n exit()\n\nprint(\"Yes\")\n","fail":"\"\"\" AtCoder \"\"\"\nimport collections\n\nS = input()\nT = input()\n\ns = {}\nt = {}\n\nfor i in range(len(S)):\n if S[i] in s and s[S[i]] != T[i] or T[i] in t and t[T[i]] != S[i]:\n print(\"No\")\n exit()\n s[S[i]] = T[i]\n t[T[i]] = S[i]\n\nprint(\"Yes\")\n","change":"replace","i1":1,"i2":27,"j1":1,"j2":15,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03252","language":"Python","original_status":"Time Limit Exceeded","pass":"S = input()\nT = input()\nN = len(S)\npos_S = {c: set() for c in \"abcdefghijklmnopqrstuvwxyz\"}\n[pos_S[S[i]].add(i) for i in range(N)]\npos_T = {c: set() for c in \"abcdefghijklmnopqrstuvwxyz\"}\n[pos_T[T[i]].add(i) for i in range(N)]\nif all(pos_S[S[i]] == pos_T[T[i]] for i in range(N)):\n print(\"Yes\")\nelse:\n print(\"No\")\n","fail":"S = input()\nT = input()\nS_cnt = sorted(S.count(c) for c in set(S))\nT_cnt = sorted(T.count(c) for c in set(T))\nprint(\"Yes\") if S_cnt == T_cnt else print(\"No\")\n","change":"replace","i1":2,"i2":11,"j1":2,"j2":5,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03253","language":"Python","original_status":"Time Limit Exceeded","pass":"mod = 1000000007\n\n\ndef calc(a, b):\n am = 1\n ad = 1\n for i in range(b):\n am *= (a - i) % mod\n ad *= (i + 1) % mod\n return am * modpow(ad, mod - 2) % mod\n\n\ndef modpow(a, p):\n if p == 0:\n return 1\n if p % 2 == 0:\n p \/\/= 2\n h = modpow(a, p)\n return h * h % mod\n else:\n return a * modpow(a, p - 1) % mod\n\n\ndef main():\n N, M = map(int, input().split())\n res = M\n ans = 1\n i = 2\n while res >= i * i:\n if res % i == 0:\n c = 0\n while res % i == 0:\n c += 1\n res \/\/= i\n ans *= calc(N + c - 1, N - 1) % mod\n i += 1\n if res != 1:\n ans *= calc(N, N - 1) % mod\n print(ans)\n\n\nmain()\n","fail":"mod = 1000000007\n\n\ndef modpow(a, p):\n if p == 0:\n return 1\n if p % 2 == 0:\n h = modpow(a, p \/\/ 2)\n return h * h % mod\n else:\n return a * modpow(a, p - 1) % mod\n\n\ndef calc(a, b):\n if b > a - b:\n return calc(a, a - b)\n am = 1\n ad = 1\n for i in range(b):\n am *= a - i\n ad *= i + 1\n am %= mod\n ad %= mod\n return am * modpow(ad, mod - 2) % mod\n\n\ndef main():\n N, M = map(int, input().split())\n res = M\n ans = 1\n i = 2\n while res >= i * i:\n if res % i == 0:\n c = 0\n while res % i == 0:\n c += 1\n res \/\/= i\n ans *= calc(N + c - 1, N - 1)\n ans %= mod\n i += 1\n if res != 1:\n ans *= calc(N, N - 1)\n ans %= mod\n print(ans)\n\n\nmain()\n","change":"replace","i1":1,"i2":38,"j1":1,"j2":43,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03254","language":"Python","original_status":"Time Limit Exceeded","pass":"import itertools\n\nN, x = map(int, input().split())\na = list(map(int, input().split()))\n\nif sum(a) == x:\n print(N)\n exit()\n\nfor i in range(N - 1, 0, -1):\n for element in itertools.combinations(a, i):\n if sum(element) <= x:\n print(i)\n exit()\n\nprint(0)\nexit()\n","fail":"N, x = [int(i) for i in input().split()]\na = [int(i) for i in input().split()]\na.sort()\n\nif sum(a) == x:\n print(N)\n exit()\n\nlow = 0\nhigh = N - 1\nmost_happy = 0\n\nwhile low <= high:\n i = int((low + high) \/ 2)\n if sum(a[0:i]) <= x:\n low = i + 1\n if i > most_happy:\n most_happy = i\n else:\n high = i - 1\n\nprint(most_happy)\nexit()\n","change":"replace","i1":0,"i2":16,"j1":0,"j2":22,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03254","language":"Python","original_status":"Runtime Error","pass":"n, x = map(int, input().split())\na = list(map(int, input().split()))\na.sort()\nans = 0\ni = 0\nwhile x > 0:\n if a[i] > x:\n break\n else:\n x -= a[i]\n ans += 1\n i += 1\n\n\nprint(ans)\n","fail":"n, x = map(int, input().split())\na = list(map(int, input().split()))\na.sort()\nans = 0\ni = 0\nwhile i != n:\n if a[i] > x:\n break\n else:\n x -= a[i]\n ans += 1\n i += 1\nif x > 0 and i == n:\n ans -= 1\nif ans < 0:\n ans = 0\nprint(ans)\n","change":"replace","i1":5,"i2":14,"j1":5,"j2":16,"error":"IndexError: list index out of range","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03254\/Python\/s458600204.py\", line 7, in \n if a[i] > x:\nIndexError: list index out of range\n","stdout":null} {"problem_id":"p03254","language":"Python","original_status":"Runtime Error","pass":"N, x = list(map(int, input().split()))\na = list(map(int, input().split()))\na.sort()\n\nfor i in range(len(a)):\n x -= a[i]\n if x >= 0:\n ans = i + 1\n\nprint(ans)\n","fail":"import numpy\n\nN, x = list(map(int, input().split()))\na = list(map(int, input().split()))\na.sort()\na_sum = numpy.cumsum(a)\nans = numpy.sum(a_sum <= x)\n\nif ans == N and x not in a_sum:\n ans -= 1\n\nprint(ans)\n","change":"replace","i1":0,"i2":8,"j1":0,"j2":10,"error":"WA","stderr":null,"stdout":3.0} {"problem_id":"p03261","language":"Python","original_status":"Runtime Error","pass":"N = int(input())\nW = []\nfor i in range(N):\n tmp = input()\n if tmp in W and i != 0:\n print(\"No\")\n exit()\n W.append(tmp)\n\nlast_word = W[0][-1]\nfor i in range(1, len(N)):\n if last_word != W[i][0]:\n print(\"No\")\n exit()\nprint(\"Yes\")\n","fail":"N = int(input())\nW = []\nans = True\nfor i in range(N):\n tmp = input()\n if tmp in W and i != 0:\n ans = False\n W.append(tmp)\n\nif ans:\n last_word = W[0][-1]\n for i in range(1, N):\n if last_word != W[i][0]:\n ans = False\n last_word = W[i][-1]\n\nprint(\"Yes\" if ans else \"No\")\n","change":"replace","i1":2,"i2":15,"j1":2,"j2":17,"error":"0","stderr":null,"stdout":"No\n"} {"problem_id":"p03261","language":"Python","original_status":"Runtime Error","pass":"# ABC109B\n\nn = int(input())\nw = [int(input()) for i in range(n)]\nok = \"Yes\"\ne = w[0][-1]\ndouble = [w[0]]\nfor i in range(1, n):\n if double.count(w[i]) != 0:\n ok = \"No\"\n break\n double.append(w[i])\n s = w[i][0]\n if s != e:\n ok = \"No\"\n break\n e = w[i][-1]\nprint(ok)\n","fail":"n = int(input())\nw = [input() for i in range(n)]\nok = \"Yes\"\ne = w[0][-1]\ndouble = [w[0]]\nfor i in range(1, n):\n if double.count(w[i]) != 0:\n ok = \"No\"\n break\n double.append(w[i])\n s = w[i][0]\n if s != e:\n ok = \"No\"\n break\n e = w[i][-1]\nprint(ok)\n","change":"replace","i1":0,"i2":4,"j1":0,"j2":2,"error":"ValueError: invalid literal for int() with base 10: 'hoge'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03261\/Python\/s660309777.py\", line 4, in \n w = [int(input()) for i in range(n)]\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03261\/Python\/s660309777.py\", line 4, in \n w = [int(input()) for i in range(n)]\nValueError: invalid literal for int() with base 10: 'hoge'\n","stdout":null} {"problem_id":"p03262","language":"Python","original_status":"Time Limit Exceeded","pass":"# import math\n\n\ndef make_divisor_list(num):\n if num <= 0:\n # return []\n return make_divisor_list(-num)\n elif num == 1:\n return [1]\n else:\n divisor_list = [1]\n for i in range(2, num \/\/ 2 + 1):\n if num % i == 0:\n divisor_list.append(i)\n divisor_list.append(num)\n return divisor_list\n\n\n# print(make_divisor_list(24))\n\nN, X = [int(x) for x in input().split()]\nxlist = [int(x) for x in input().split()]\n\n# print(xlist)\n\nshiftedX = [x - X for x in xlist]\n\n# print(shiftedX)\n\ndivisor_set_list = [set(make_divisor_list(x)) for x in shiftedX]\n# print(divisor_set_list)\n\ndiv_set = divisor_set_list[0]\n\nfor s in divisor_set_list:\n div_set = div_set & s\n\n# print(div_set)\n\nprint(max(div_set))\n","fail":"# import math\n\n\ndef gcd(a, b):\n a = abs(a)\n b = abs(b)\n if b > a:\n return gcd(b, a)\n if a % b == 0:\n return b\n else:\n return gcd(b, a % b)\n\n\n# print(make_divisor_list(24))\n\n\nN, X = [int(x) for x in input().split()]\nxlist = [int(x) for x in input().split()]\n\n# print(xlist)\n\nshiftedX = [x - X for x in xlist]\n\n# print(shiftedX)\n\nmaxDivisor = shiftedX[0]\nfor n in shiftedX:\n maxDivisor = gcd(maxDivisor, n)\n\nprint(maxDivisor)\n","change":"replace","i1":3,"i2":40,"j1":3,"j2":31,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03262","language":"Python","original_status":"Runtime Error","pass":"import math\nfrom functools import reduce\n\nn, x = map(int, input().split())\nxx = list(map(int, input().split()))\nxx.sort()\n\nif n == 1:\n ans = xx[0] - x\nelse:\n dist = [xx[i + 1] - xx[i] for i in range(n - 1)]\n ans = reduce(math.gcd, dist)\n\nprint(ans)\n","fail":"import fractions\nfrom functools import reduce\n\nn, x = map(int, input().split())\nxx = [abs(int(i) - x) for i in input().split()]\n\nif n == 1:\n ans = xx[0]\nelse:\n ans = reduce(fractions.gcd, xx)\n\nprint(ans)\n","change":"replace","i1":0,"i2":12,"j1":0,"j2":10,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p03262","language":"Python","original_status":"Time Limit Exceeded","pass":"n, x = map(int, input().split())\nli = list(map(int, input().split()))\nt = []\nfor i in li:\n t.append(abs(i - x))\nfor j in range(min(t)):\n if all(k % (min(t) - j) == 0 for k in t):\n print(min(t) - j)\n exit()\n","fail":"n, x = map(int, input().split())\nli = list(map(int, input().split()))\nt = []\nfor i in li:\n t.append(abs(i - x))\ndivisors = []\nfor i in range(1, int(min(t) ** 0.5) + 1):\n if min(t) % i == 0:\n divisors.append(i)\n if i != min(t) \/\/ i:\n divisors.append(min(t) \/\/ i)\ndivisors.sort()\ndivisors = divisors[::-1]\nfor j in divisors:\n if all(k % j == 0 for k in t):\n print(j)\n exit()\n","change":"replace","i1":5,"i2":8,"j1":5,"j2":16,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03262","language":"Python","original_status":"Runtime Error","pass":"#! \/usr\/bin\/env python3\n\nimport math\n\nn, x = map(int, input().split())\na = [abs(int(i) - x) for i in input().split()]\n\na.sort()\n\nres = 0\nfor val in a:\n if res == 0:\n res = val\n else:\n res = math.gcd(res, val)\n if res == 1:\n break\n\nprint(res)\n","fail":"#! \/usr\/bin\/env python3\n\nimport fractions\n\nn, x = map(int, input().split())\na = [abs(int(i) - x) for i in input().split()]\n\na.sort()\n\nres = 0\nfor val in a:\n if res == 0:\n res = val\n else:\n res = fractions.gcd(res, val)\n if res == 1:\n break\n\nprint(res)\n","change":"replace","i1":2,"i2":15,"j1":2,"j2":15,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p03262","language":"Python","original_status":"Runtime Error","pass":"import math\n\nN, X = map(int, input().split())\na = list(map(int, input().split()))\n\ngcd = 0\n\nfor x in range(N):\n gcd = math.gcd(abs(a[x] - X), gcd)\nprint(gcd)\n","fail":"import fractions\n\nN, X = map(int, input().split())\na = list(map(int, input().split()))\n\ngcd = 0\n\nfor x in range(N):\n gcd = fractions.gcd(abs(a[x] - X), gcd)\nprint(gcd)\n","change":"replace","i1":0,"i2":9,"j1":0,"j2":9,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p03262","language":"Python","original_status":"Runtime Error","pass":"import numpy as np\n\nn, x0 = map(int, input().split())\nX = list(map(int, input().split()))\n\nprint(np.gcd.reduce([x - x0 for x in X]))\n","fail":"from fractions import gcd\nfrom functools import reduce\n\nn, x0 = map(int, input().split())\nX = list(map(int, input().split()))\n\nprint(reduce(gcd, (abs(x - x0) for x in X)))\n","change":"replace","i1":0,"i2":6,"j1":0,"j2":7,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03262","language":"Python","original_status":"Runtime Error","pass":"from sys import stdin\nfrom functools import reduce\nimport math\n\ninput = stdin.readline\n\nN, X = map(int, input().split())\n\nxn = [abs(X - int(i)) for i in input().split()]\n\n\ndef main():\n print(reduce(math.gcd, xn))\n return\n\n\nmain()\n","fail":"from sys import stdin\nfrom functools import reduce\n\n# \u30d0\u30fc\u30b8\u30e7\u30f3 3.4.X \u4ee5\u524d\nimport fractions\n\n# \u30d0\u30fc\u30b8\u30e7\u30f3 3.4.X \u3088\u308a \u5f8c\n# import math\n\ninput = stdin.readline\n\nN, X = map(int, input().split())\n\nxn = [abs(X - int(i)) for i in input().split()]\n\n\ndef main():\n print(reduce(fractions.gcd, xn))\n return\n\n\nmain()\n","change":"replace","i1":2,"i2":13,"j1":2,"j2":18,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p03262","language":"Python","original_status":"Time Limit Exceeded","pass":"n, x = tuple(map(int, input().split()))\npoints = [int(x) for x in input().split()]\npoints.append(x)\npoints.sort()\n\nds = [points[i + 1] - points[i] for i in range(len(points) - 1)]\nfor m in range(min(ds), 0, -1):\n if all([x % m == 0 for x in ds]):\n print(m)\n break\n","fail":"from functools import reduce\n\n\ndef euclid(a, b):\n if a < b:\n a, b = (b, a)\n\n while True:\n r = a % b\n if r == 0:\n break\n a, b = (b, r)\n\n return b\n\n\nif __name__ == \"__main__\":\n n, x = tuple(map(int, input().split()))\n points = [int(x) for x in input().split()]\n\n buf = [abs(p - x) for p in points]\n print(reduce(lambda a, b: euclid(a, b), buf))\n","change":"replace","i1":0,"i2":10,"j1":0,"j2":22,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03262","language":"Python","original_status":"Runtime Error","pass":"from functools import reduce\nfrom math import gcd\n\nX = int(input().split()[1])\nx = [abs(int(x) - X) for x in input().split()]\n\nprint(reduce(gcd, x))\n","fail":"from functools import reduce\nfrom fractions import gcd\n\nX = int(input().split()[1])\nx = [abs(int(x) - X) for x in input().split()]\n\nprint(reduce(gcd, x))\n","change":"replace","i1":1,"i2":2,"j1":1,"j2":2,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p03262","language":"Python","original_status":"Runtime Error","pass":"import math\nfrom functools import reduce\n\n\ndef gcd_list(numbers):\n return reduce(math.gcd, numbers)\n\n\nn, x = [int(_) for _ in input().split()]\nx_list = [int(_) for _ in input().split()]\n\nlist = [abs(x_list[i] - x) for i in range(n)]\n\nanswer = gcd_list(list)\nprint(answer)\n","fail":"from fractions import gcd\nfrom functools import reduce\n\n\ndef gcd_list(numbers):\n return reduce(gcd, numbers)\n\n\nn, x = [int(_) for _ in input().split()]\nx_list = [int(_) for _ in input().split()]\n\nlist = [abs(x_list[i] - x) for i in range(n)]\n\nanswer = gcd_list(list)\nprint(answer)\n","change":"replace","i1":0,"i2":6,"j1":0,"j2":6,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p03262","language":"Python","original_status":"Time Limit Exceeded","pass":"N, X = map(int, input().split())\nL = list(map(int, input().split()))\n\nmin_dist = abs(X - min(L))\n\nans = 1\n\nfor d in range(min_dist, 0, -1):\n b = all((x - X) % d == 0 for x in L)\n if b:\n print(d)\n break\n","fail":"import math\nfrom functools import reduce\n\n\ndef gcd(ns):\n return reduce(math.gcd, ns)\n\n\nN, X = map(int, input().split())\nL = list(map(int, input().split()))\n\ndiff = [abs(x - X) for x in L]\n\nif len(diff) == 1:\n print(diff[0])\nelse:\n print(gcd(diff))\n","change":"replace","i1":0,"i2":12,"j1":0,"j2":17,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03262","language":"Python","original_status":"Runtime Error","pass":"(n, x) = list(map(int, input().split()))\nx_list = list(map(int, input().split()))\n\nx_list.append(x)\nx_list.sort()\n\nmin_diff = 999_999_999_999\nfor i in range(len(x_list) - 1):\n diff = x_list[i + 1] - x_list[i]\n if min_diff > diff:\n min_diff = diff\n\n# \u5dee\u5206\u306e\u6700\u5c0f\u3092\u7d04\u5206\u3057\u3066\u3044\u304f\nx_diff = [xx - x_list[0] for xx in x_list]\n\nfor i in range(1, min_diff):\n if min_diff % i != 0: # \u7d04\u5206\u3067\u304d\u306a\u3044\u5834\u5408\u306f\u6b21\u306e\u6570\u306b\u9032\u3080\n continue\n xx = min_diff \/\/ i\n is_divided = [j for j in x_diff if j % xx != 0]\n if len(is_divided) == 0:\n print(xx)\n exit()\n","fail":"(n, x) = list(map(int, input().split()))\nx_list = list(map(int, input().split()))\n\nif x in x_list:\n pass\nelse:\n x_list.append(x)\n x_list.sort()\n\nmin_diff = 99999999999\nfor i in range(len(x_list) - 1):\n diff = x_list[i + 1] - x_list[i]\n if min_diff > diff:\n min_diff = diff\n\n# \u5dee\u5206\u306e\u6700\u5c0f\u3092\u7d04\u5206\u3057\u3066\u3044\u304f\nx_diff = [xx - x_list[0] for xx in x_list]\n\nfor i in range(1, min_diff):\n if min_diff % i != 0: # \u7d04\u5206\u3067\u304d\u306a\u3044\u5834\u5408\u306f\u6b21\u306e\u6570\u306b\u9032\u3080\n continue\n xx = min_diff \/\/ i\n is_divided = [j for j in x_diff if j % xx != 0]\n if len(is_divided) == 0:\n print(xx)\n exit()\nprint(1)\n","change":"replace","i1":3,"i2":23,"j1":3,"j2":27,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p03262","language":"Python","original_status":"Runtime Error","pass":"n, s = map(int, input().split())\nxxx = [abs(s - y) for y in map(int, input().split())]\nd = 0\nwhile True:\n d = min(xxx)\n xxx = [x % d for x in xxx]\n if all(x == 0 for x in xxx):\n break\nprint(d)\n","fail":"n, s = map(int, input().split())\nxxx = [abs(s - y) for y in map(int, input().split())]\nd = 0\nwhile True:\n xxx = [x for x in xxx if x > 0]\n d = min(xxx)\n xxx = [x % d for x in xxx]\n if all(x == 0 for x in xxx):\n break\nprint(d)\n","change":"insert","i1":4,"i2":4,"j1":4,"j2":5,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p03262","language":"Python","original_status":"Runtime Error","pass":"import math\n\nN, X = map(int, input().split())\nx = map(int, input().split())\nx = [xi - X for xi in x]\n\nd = x[0]\nfor xi in x[1:]:\n d = math.gcd(d, xi)\nprint(d)\n","fail":"def gcd(a, b):\n big, small = max(a, b), min(a, b)\n if big % small == 0:\n return small\n div = None\n while big % small != 0:\n div = big % small\n big, small = small, div\n else:\n return div\n\n\nN, X = map(int, input().split())\nx = map(int, input().split())\nx = [xi - X for xi in x]\n\nd = x[0]\nfor xi in x[1:]:\n d = gcd(d, xi)\nprint(abs(d))\n","change":"replace","i1":0,"i2":10,"j1":0,"j2":20,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p03262","language":"Python","original_status":"Time Limit Exceeded","pass":"from functools import reduce\nfrom fractions import gcd\n\nn, x_ini = map(int, input().split())\nx = list(map(int, input().split()))\n\nx += [x_ini]\n\n# print(x)\n\nx2 = [x[i] - min(x) for i in range(n + 1)]\n\n# print(x2)\n\nx_ini -= min(x)\n\n# print(x_ini)\n\nans = reduce(gcd, x2)\n\nprint(ans)\n","fail":"from functools import reduce\nfrom fractions import gcd\n\nn, x_ini = map(int, input().split())\nx = [abs(x_ini - int(i)) for i in input().split()]\n\nans = reduce(gcd, x)\n\nprint(ans)\n","change":"replace","i1":4,"i2":19,"j1":4,"j2":7,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03262","language":"Python","original_status":"Runtime Error","pass":"import math\nfrom functools import reduce\n\nN, X = tuple(int(i) for i in input().split())\nx = [int(i) for i in input().split()]\n\nx.append(X)\nsx = sorted(x)\ndx = [j - i for i, j in zip(sx[:-1], sx[1:])]\n\nmdx = reduce(math.gcd, dx)\n\nprint(mdx)\n","fail":"from fractions import gcd\nfrom functools import reduce\n\nN, X = tuple(int(i) for i in input().split())\nx = [int(i) for i in input().split()]\n\nx.append(X)\nsx = sorted(x)\ndx = [j - i for i, j in zip(sx[:-1], sx[1:])]\n\nmdx = reduce(gcd, dx)\n\nprint(mdx)\n","change":"replace","i1":0,"i2":11,"j1":0,"j2":11,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p03262","language":"Python","original_status":"Runtime Error","pass":"from fractions import gcd\n\nN, X = map(int, input().split())\nX_list = list(map(int, input().split()))\n\ndX = [abs(X - x) for x in X_list]\nif len(dX) == 1:\n print(dX[0])\n exit(0)\n\nD = [abs(X_list[i] - X_list[i + 1]) for i in range(0, N - 1)]\nres = gcd(D[0], D[1])\nfor x in D[2:]:\n res = gcd(res, x)\n\nans = 0\nfor d in dX:\n ans = max(gcd(res, d), ans)\nprint(ans)\n","fail":"from fractions import gcd\n\nN, X = map(int, input().split())\nX_list = list(map(int, input().split()))\n\ndX = [abs(X - x) for x in X_list]\nif len(dX) == 1:\n print(dX[0])\n exit(0)\n\nD = [abs(X_list[i] - X_list[i + 1]) for i in range(0, N - 1)]\nres = D[0]\nfor x in D[1:]:\n res = gcd(res, x)\n\nans = 0\nfor d in dX:\n ans = max(gcd(res, d), ans)\nprint(ans)\n","change":"replace","i1":11,"i2":13,"j1":11,"j2":13,"error":"ImportError: cannot import name 'gcd' from 'fractions' (\/usr\/lib\/python3.10\/fractions.py)","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03262\/Python\/s082976387.py\", line 1, in \n from fractions import gcd\nImportError: cannot import name 'gcd' from 'fractions' (\/usr\/lib\/python3.10\/fractions.py)\n","stdout":null} {"problem_id":"p03262","language":"Python","original_status":"Runtime Error","pass":"from math import gcd\nfrom functools import reduce\n\n\ndef gcd_list(numbers):\n return reduce(gcd, numbers)\n\n\nn, x = map(int, input().split())\n\nx_arr = [0] * n\n\nx_arr = list(map(int, input().split()))\n\nfor i in range(len(x_arr)):\n x_arr[i] = abs(x_arr[i] - x)\nprint(gcd_list(x_arr))\n","fail":"from fractions import gcd\nfrom functools import reduce\n\n\ndef gcd_list(numbers):\n return reduce(gcd, numbers)\n\n\nn, x = map(int, input().split())\n\nx_arr = [0] * n\n\nx_arr = list(map(int, input().split()))\n\nfor i in range(len(x_arr)):\n x_arr[i] = abs(x_arr[i] - x)\nprint(gcd_list(x_arr))\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p03262","language":"Python","original_status":"Runtime Error","pass":"import fraction\n\nN, X = map(int, input().split())\n\nx = list(map(int, input().split()))\n\ndist_list = [abs(X - e) for e in x]\nans = dist_list[0]\nfor e in dist_list:\n ans = fraction.gcd(e, ans)\n\n\nprint(ans)\n","fail":"def gcd(x, y):\n while y != 0:\n temp = y\n y = x % y\n x = temp\n return x\n\n\nN, X = map(int, input().split())\n\nx = list(map(int, input().split()))\n\ndist_list = [abs(X - e) for e in x]\n\nans = dist_list[0]\nfor e in dist_list:\n ans = gcd(ans, e)\n\n\nprint(ans)\n","change":"replace","i1":0,"i2":10,"j1":0,"j2":17,"error":"ModuleNotFoundError: No module named 'fraction'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03262\/Python\/s329573155.py\", line 1, in \n import fraction\nModuleNotFoundError: No module named 'fraction'\n","stdout":null} {"problem_id":"p03262","language":"Python","original_status":"Runtime Error","pass":"import math\n\nN, X = map(int, input().split())\nx = list(map(int, input().split()))\n\ndx = [abs(X - v) for v in x]\nans = dx[0]\nfor b in dx[1:]:\n ans = math.gcd(ans, b)\nprint(ans)\n","fail":"def gcd(a, b):\n if b == 0:\n return a\n else:\n return gcd(b, a % b)\n\n\nN, X = map(int, input().split())\nx = list(map(int, input().split()))\n\ndx = [abs(X - v) for v in x]\nans = dx[0]\nfor b in dx[1:]:\n ans = gcd(ans, b)\nprint(ans)\n","change":"replace","i1":0,"i2":9,"j1":0,"j2":14,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p03262","language":"Python","original_status":"Runtime Error","pass":"from functools import reduce\nimport math\n\n\ndef solve():\n n, X = map(int, input().split())\n xs = list(map(int, input().split()))\n diffs = [abs(x - X) for x in xs]\n return reduce(math.gcd, diffs)\n\n\nif __name__ == \"__main__\":\n print(solve())\n","fail":"from functools import reduce\nimport fractions\n\n\ndef solve():\n n, X = map(int, input().split())\n xs = list(map(int, input().split()))\n diffs = [abs(x - X) for x in xs]\n return reduce(fractions.gcd, diffs)\n\n\nif __name__ == \"__main__\":\n print(solve())\n","change":"replace","i1":1,"i2":9,"j1":1,"j2":9,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p03262","language":"Python","original_status":"Runtime Error","pass":"import math\nfrom functools import reduce\n\n\ndef gcd(*numbers):\n return reduce(math.gcd, numbers)\n\n\ndef gcd_list(numbers):\n return reduce(math.gcd, numbers)\n\n\nN, X = map(int, input().split())\nx = list(map(int, input().split()))\ndif = [abs(X - x[0])]\n\nif N > 1:\n for i in range(N - 1):\n dif.append(x[i + 1] - x[i])\nprint(gcd_list(dif))\n","fail":"import math\nfrom functools import reduce\nimport fractions\n\n\ndef gcd(*numbers):\n return reduce(fractions.gcd, numbers)\n\n\ndef gcd_list(numbers):\n return reduce(fractions.gcd, numbers)\n\n\nN, X = map(int, input().split())\nx = list(map(int, input().split()))\ndif = [abs(X - x[0])]\n\nif N > 1:\n for i in range(N - 1):\n dif.append(x[i + 1] - x[i])\nprint(abs(gcd_list(dif)))\n","change":"replace","i1":2,"i2":20,"j1":2,"j2":21,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p03262","language":"Python","original_status":"Runtime Error","pass":"import numpy as np\nimport math\nfrom functools import reduce\n\n# K = int(input())\n# N, K = map(int, input().split())\n# A = list(map(int, input().split()))\n\nN, X = map(int, input().split())\nx = list(map(int, input().split()))\n\nd = np.zeros(N, dtype=int)\nfor n in range(N):\n d[n] = x[n] - X\n\ngcd = reduce(math.gcd, d)\n\n# print(d)\nprint(gcd)\n","fail":"import numpy as np\nimport math\nfrom functools import reduce\n\n# K = int(input())\n# N, K = map(int, input().split())\n# A = list(map(int, input().split()))\n\n\ndef gcd(a: int, b: int):\n return gcd(b, a % b) if b else a\n\n\nN, X = map(int, input().split())\nx = list(map(int, input().split()))\n\nd = np.zeros(N, dtype=int)\nfor n in range(N):\n d[n] = x[n] - X\n\nret = abs(reduce(gcd, d))\n\n# print(d)\nprint(ret)\n","change":"replace","i1":8,"i2":19,"j1":8,"j2":24,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03262","language":"Python","original_status":"Runtime Error","pass":"import math\n\n\nN, X = list(map(int, input().split()))\nx = list(map(int, input().split()))\n# print(N, X, x)\n\nminimum = x[0]\nfor i in range(len(x)):\n x[i] = x[i] - X\n minimum = min(x[i], minimum)\n# print(x, minimum)\n\ngcd_value = math.gcd(x[0], x[0])\nfor i in range(len(x)):\n gcd_value = math.gcd(gcd_value, x[i])\n # print(gcd)\nprint(gcd_value)\n","fail":"import fractions\n\nN, X = list(map(int, input().split()))\nx = list(map(int, input().split()))\n# print(N, X, x)\n\nminimum = x[0]\nfor i in range(len(x)):\n x[i] = x[i] - X\n minimum = min(x[i], minimum)\n# print(x, minimum)\n\ngcd_value = fractions.gcd(x[0], x[0])\nfor i in range(len(x)):\n gcd_value = abs(fractions.gcd(gcd_value, x[i]))\n # print(gcd)\nprint(gcd_value)\n","change":"replace","i1":0,"i2":16,"j1":0,"j2":15,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p03262","language":"Python","original_status":"Runtime Error","pass":"import math\n\nN, X = list(map(int, input().split()))\nxlist = list(map(int, input().split()))\nxlist.append(X)\nxlist.sort()\n\nm = xlist[1] - xlist[0]\nfor i in range(1, len(xlist) - 1):\n d = xlist[i + 1] - xlist[i]\n m = math.gcd(d, m)\nprint(m)\n","fail":"def gcd(a, b):\n if b > a:\n a, b = b, a\n c = a % b\n if c == 0:\n return b\n return gcd(b, c)\n\n\nN, X = list(map(int, input().split()))\nxlist = list(map(int, input().split()))\nxlist.append(X)\nxlist.sort()\n\nm = xlist[1] - xlist[0]\nfor i in range(1, len(xlist) - 1):\n d = xlist[i + 1] - xlist[i]\n m = gcd(d, m)\nprint(m)\n","change":"replace","i1":0,"i2":11,"j1":0,"j2":18,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p03262","language":"Python","original_status":"Runtime Error","pass":"def gcd(*args):\n a, *args = args\n if len(args) == 0:\n return a\n elif len(args) > 1:\n return gcd(a, gcd(*args))\n else:\n b = args[0]\n if a < b:\n a, b = b, a\n while b != 0:\n a, b = b, a % b\n return a\n\n\nn, x = map(int, input().split())\nc = [abs(x - xn) for xn in map(int, input().split())]\nprint(gcd(*c))\n","fail":"from functools import reduce\n\n\ndef gcd(a, b):\n if a < b:\n a, b = b, a\n while b != 0:\n a, b = b, a % b\n return a\n\n\ndef gcd_from_list(vals):\n return reduce(gcd, vals)\n\n\nn, x = map(int, input().split())\nc = [abs(x - xn) for xn in map(int, input().split())]\nprint(gcd_from_list(c))\n","change":"replace","i1":0,"i2":18,"j1":0,"j2":18,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p03262","language":"Python","original_status":"Runtime Error","pass":"import math\nfrom functools import reduce\n\nn, X = map(int, input().split())\nx = [int(i) - X for i in input().split()]\n\nprint(reduce(math.gcd, x))\n","fail":"from fractions import gcd\n\nn, X = map(int, input().split())\nx = list(map(int, input().split()))\n\nz = list(map(lambda i: abs(X - i), x))\nans = z[0]\nfor i in range(1, n):\n ans = gcd(ans, z[i])\nprint(ans)\n","change":"replace","i1":0,"i2":7,"j1":0,"j2":10,"error":"0","stderr":null,"stdout":2.0} {"problem_id":"p03263","language":"Python","original_status":"Runtime Error","pass":"import sys\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\nsys.setrecursionlimit(20000000)\n\n\ndef main():\n H, W = map(int, input().split())\n A = [list(map(int, input().split())) for _ in range(H)]\n answer = []\n for h in range(H):\n for w in range(W):\n if A[h][w] % 2 == 0:\n continue\n else:\n if h + 1 <= H - 1 and w + 1 <= W + 1:\n if A[h + 1][w] % 2 == 1:\n A[h + 1][w] += 1\n answer.append([h + 1, w + 1, h + 2, w + 1])\n else:\n A[h][w + 1] += 1\n answer.append([h + 1, w + 1, h + 1, w + 2])\n elif h + 1 <= H - 1:\n A[h + 1][w] += 1\n answer.append([h + 1, w + 1, h + 2, w + 1])\n elif w + 1 <= W - 1:\n A[h][w + 1] += 1\n answer.append([h + 1, w + 1, h + 1, w + 2])\n else:\n continue\n N = len(answer)\n print(N)\n for i in range(N):\n print(*answer[i], sep=\" \")\n\n\nif __name__ == \"__main__\":\n main()\n","fail":"import sys\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\nsys.setrecursionlimit(20000000)\n\n\ndef main():\n H, W = map(int, input().split())\n A = [list(map(int, input().split())) for _ in range(H)]\n answer = []\n for h in range(H):\n for w in range(W):\n if A[h][w] % 2 == 0:\n continue\n else:\n if h + 1 <= H - 1 and w + 1 <= W - 1:\n if A[h + 1][w] % 2 == 1:\n A[h + 1][w] += 1\n answer.append([h + 1, w + 1, h + 2, w + 1])\n else:\n A[h][w + 1] += 1\n answer.append([h + 1, w + 1, h + 1, w + 2])\n elif h + 1 <= H - 1:\n A[h + 1][w] += 1\n answer.append([h + 1, w + 1, h + 2, w + 1])\n elif w + 1 <= W - 1:\n A[h][w + 1] += 1\n answer.append([h + 1, w + 1, h + 1, w + 2])\n else:\n continue\n N = len(answer)\n print(N)\n for i in range(N):\n print(*answer[i], sep=\" \")\n\n\nif __name__ == \"__main__\":\n main()\n","change":"replace","i1":19,"i2":20,"j1":19,"j2":20,"error":"WA","stderr":null,"stdout":"3\n1 1 1 2\n1 2 2 2\n1 3 2 3\n"} {"problem_id":"p03263","language":"Python","original_status":"Runtime Error","pass":"h, w = map(int, input().split())\na = [list(map(int, input().split())) for i in range(h)]\nr, c, d = 0, 0, 3\nret = []\nfor y in range(h * w - 1):\n if y % w == 0 or y % w == w - 1:\n d = (d + 1) % 4\n dy, dx = [(0, 1), (1, 0), (0, -1), (1, 0)][d]\n if a[r][c] % 2 != 0:\n ret.append((r, c, r + dy, c + dx))\n a[r + dy][c + dx] += 1\n r, c = r + dy, c + dx\nprint(len(ret))\nfor r1, c1, r2, c2 in ret:\n print(r1 + 1, c1 + 1, r2 + 1, c2 + 1)\n","fail":"h, w = map(int, input().split())\na = [list(map(int, input().split())) for i in range(h)]\nr, c, d = 0, 0, 3\nret = []\nfor y in range(h * w - 1):\n if y % w == 0:\n d = (d + 1) % 4\n if y % w == w - 1:\n d = (d + 1) % 4\n dy, dx = [(0, 1), (1, 0), (0, -1), (1, 0)][d]\n if a[r][c] % 2 != 0:\n ret.append((r, c, r + dy, c + dx))\n a[r + dy][c + dx] += 1\n r, c = r + dy, c + dx\nprint(len(ret))\nfor r1, c1, r2, c2 in ret:\n print(r1 + 1, c1 + 1, r2 + 1, c2 + 1)\n","change":"replace","i1":5,"i2":6,"j1":5,"j2":8,"error":"WA","stderr":null,"stdout":"3\n1 1 1 2\n1 2 1 3\n2 3 2 2\n"} {"problem_id":"p03263","language":"Python","original_status":"Runtime Error","pass":"import sys\n\nH, W = map(int, input().split())\nA = [list(map(int, sys.stdin.readline().rsplit())) for _ in range(H)]\n\nres = []\nfor i in range(H):\n for j in range(W):\n if A[i][j] % 2 != 0 and i < W - 1:\n A[i][j] -= 1\n A[i][j + 1] += 1\n res.append([i + 1, j + 1, i + 2, j + 1])\n elif A[i][j] % 2 != 0 and i != H - 1 and j == W - 1:\n A[i][j] -= 1\n A[i + 1][j] += 1\n res.append([i + 1, j + 1, i + 1, j + 2])\nprint(len(res))\nfor i in range(len(res)):\n print(*res[i])\n","fail":"import sys\n\nH, W = map(int, input().split())\nA = [list(map(int, sys.stdin.readline().rsplit())) for _ in range(H)]\n\nres = []\nfor i in range(H):\n for j in range(W):\n if A[i][j] % 2 != 0 and j < W - 1:\n A[i][j] -= 1\n A[i][j + 1] += 1\n res.append([i + 1, j + 1, i + 1, j + 2])\n elif A[i][j] % 2 != 0 and i != H - 1 and j == W - 1:\n A[i][j] -= 1\n A[i + 1][j] += 1\n res.append([i + 1, j + 1, i + 2, j + 1])\nprint(len(res))\nfor i in range(len(res)):\n print(*res[i])\n","change":"replace","i1":8,"i2":16,"j1":8,"j2":16,"error":"WA","stderr":null,"stdout":"3\n1 1 2 1\n1 2 2 2\n2 2 3 2\n"} {"problem_id":"p03263","language":"Python","original_status":"Runtime Error","pass":"h, w = map(int, input().split())\nT = [[] for i in range(h)]\nS = [[0] * w for i in range(h)]\nfor i in range(h):\n a = list(map(int, input().split()))\n T[i] = a\n\nfor i in range(h):\n for j in range(w):\n T[i][j] = T[i][j] % 2\n\nrec = []\nfor i in range(h):\n for j in range(w):\n if T[i][j] == 1:\n rec.append((i, j))\n\nrec = sorted(rec)\nrec = sorted(rec, key=lambda s: s[1])\nmove = []\nfor i in range(0, len(rec), 2):\n if i + 1 == len(rec):\n break\n a, b = rec[i], rec[i + 1]\n sx = a[0]\n sy = a[1]\n tx = b[0]\n ty = b[1]\n while sx != tx and S[sx][sy] != 1:\n move.append((sx, sy, sx + 1, sy))\n S[sx][sy] = 1\n sx += 1\n if sy <= ty:\n while sy != ty and S[sx][sy] != 1:\n move.append((sx, sy, tx, sy + 1))\n S[sx][sy] = 1\n sy += 1\n else:\n while sy != ty and S[sx][sy] != 1:\n move.append((sx, sy, tx, sy - 1))\n S[sx][sy] = 1\n sy -= 1\n\nprint(len(move))\nfor i in range(len(move)):\n x, y, w, z = move[i][0] + 1, move[i][1] + 1, move[i][2] + 1, move[i][3] + 1\n print(x, y, w, z)\n","fail":"h, w = map(int, input().split())\nT = [[] for i in range(h)]\nS = [[0] * w for i in range(h)]\nfor i in range(h):\n a = list(map(int, input().split()))\n T[i] = a\n\nfor i in range(h):\n for j in range(w):\n T[i][j] = T[i][j] % 2\n\nmove = []\ni = 0\nj = 0\nk = 0\nflag = False\nwhile True:\n px, py = i, j\n if T[i][j] == 1:\n flag = True\n if i % 2 == 0:\n j += 1\n if j == w:\n j -= 1\n i += 1\n if i == h:\n break\n if flag:\n move.append((px, py, i, j))\n if flag and T[i][j] == 1:\n T[i][j] = 0\n flag = False\n k += 1\n else:\n j -= 1\n if j == -1:\n j += 1\n i += 1\n if i == h:\n break\n if flag:\n move.append((px, py, i, j))\n if flag and T[i][j] == 1:\n T[i][j] = 0\n flag = False\n\nprint(len(move))\nfor i in range(len(move)):\n x, y, w, z = move[i][0] + 1, move[i][1] + 1, move[i][2] + 1, move[i][3] + 1\n print(x, y, w, z)\n","change":"replace","i1":11,"i2":42,"j1":11,"j2":45,"error":"WA","stderr":null,"stdout":"3\n1 1 2 1\n2 1 2 2\n1 3 2 3\n"} {"problem_id":"p03263","language":"Python","original_status":"Runtime Error","pass":"H, W = map(int, input().split())\nG = [list(map(int, input().split())) for i in range(H)]\n\nN = 0\nans = []\nfor h in range(H):\n for w in range(W - 1):\n if G[h][w] % 2 == 1:\n N += 1\n ans.append((h, w, h, w + 1))\n G[h][w + 1] += 1\n G[h][w] -= 1\n\nfor h in range(H - 1):\n if G[h][W - 1] % 2 == 1:\n N += 1\n ans.append((h, w, h + 1, w))\n G[h + 1][W - 1] += 1\n G[h][W - 1] -= 1\n\nprint(N)\nfor y1, x1, y2, x2 in ans:\n print(y1 + 1, x1 + 1, y2 + 1, x2 + 1)\n","fail":"H, W = map(int, input().split())\nG = [list(map(int, input().split())) for i in range(H)]\n\nN = 0\nans = []\nfor h in range(H):\n for w in range(W - 1):\n if G[h][w] % 2 == 1:\n N += 1\n ans.append((h, w, h, w + 1))\n G[h][w + 1] += 1\n G[h][w] -= 1\n\nfor h in range(H - 1):\n if G[h][W - 1] % 2 == 1:\n N += 1\n ans.append((h, W - 1, h + 1, W - 1))\n G[h + 1][W - 1] += 1\n G[h][W - 1] -= 1\n\nprint(N)\nfor y1, x1, y2, x2 in ans:\n print(y1 + 1, x1 + 1, y2 + 1, x2 + 1)\n","change":"replace","i1":16,"i2":17,"j1":16,"j2":17,"error":"WA","stderr":null,"stdout":"3\n1 1 1 2\n1 2 1 3\n2 2 2 3\n"} {"problem_id":"p03265","language":"Python","original_status":"Runtime Error","pass":"import numpy as np\n\nx_1, y_1, x_2, y_2 = map(int, input().split())\n\nP_1 = np.array([x_1, y_1])\nP_2 = np.array([x_2, y_2])\nvec_12 = P_2 - P_1\nvec_13 = np.array([-vec_12[1], vec_12[0]])\nP_3 = P_1 + vec_13\nP_4 = P_2 + vec_13\nprint(P_3[0], P_3[1], P_4[1], P_4[2])\n","fail":"import numpy as np\n\nx_1, y_1, x_2, y_2 = map(int, input().split())\n\nP_1 = np.array([x_1, y_1])\nP_2 = np.array([x_2, y_2])\nvec_12 = P_2 - P_1\nvec_13 = np.array([-vec_12[1], vec_12[0]])\nP_3 = P_1 + vec_13\nP_4 = P_2 + vec_13\nprint(P_4[0], P_4[1], P_3[0], P_3[1])\n","change":"replace","i1":10,"i2":11,"j1":10,"j2":11,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03266","language":"Python","original_status":"Time Limit Exceeded","pass":"import itertools\n\na, b = map(int, input().split())\nc = []\nfor i in range(1, a + 1):\n if i % b == 0 or i % b == b \/ 2:\n c.append(i)\nd = 0\nfor i in itertools.product(c, repeat=3):\n if (i[0] + i[1]) % b == 0 and (i[0] + i[2]) % b == 0 and (i[1] + i[2]) % b == 0:\n d += 1\nprint(d)\n","fail":"a, b = map(int, input().split())\nc = []\nd = []\nfor i in range(1, a + 1):\n if i % b == 0:\n c.append(i)\n elif i % b == b \/ 2:\n d.append(i)\ne = 0\nprint(len(c) * len(c) * len(c) + len(d) * len(d) * len(d))\n","change":"replace","i1":0,"i2":12,"j1":0,"j2":10,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03266","language":"Python","original_status":"Time Limit Exceeded","pass":"N, K = list(map(int, input().split()))\nc = 0\nfor i in range(1, N + 1):\n a = 0\n if (i + i) % K == 0:\n for j in range(1, N + 1):\n if (i + j) % K == 0:\n a += 1\n c += a * a\nprint(c)\n","fail":"N, K = list(map(int, input().split()))\nc = N \/\/ K\nd = 0\nfor i in range(1, N + 1):\n if K % 2 == 0 and i % K == K \/\/ 2:\n d += 1\nprint(c**3 + d**3)\n","change":"replace","i1":1,"i2":10,"j1":1,"j2":7,"error":"TLE","stderr":null,"stdout":null} {"problem_id":"p03272","language":"Python","original_status":"Runtime Error","pass":"a = int(input())\nb = int(input())\n\nans = a - b + 1\nprint(ans)\n","fail":"l = [int(x) for x in input().split()]\n\nans = l[0] - l[1] + 1\nprint(ans)\n","change":"replace","i1":0,"i2":4,"j1":0,"j2":3,"error":"ValueError: invalid literal for int() with base 10: '4 2'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03272\/Python\/s331328096.py\", line 1, in \n a = int(input())\nValueError: invalid literal for int() with base 10: '4 2'\n","stdout":null} {"problem_id":"p03272","language":"Python","original_status":"Runtime Error","pass":"n, i = map(int, input())\nprint(n - i + 1)\n","fail":"n, i = map(int, input().split())\nprint(n - i + 1)\n","change":"replace","i1":0,"i2":1,"j1":0,"j2":1,"error":"ValueError: invalid literal for int() with base 10: ' '","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03272\/Python\/s890659369.py\", line 1, in \n n, i = map(int, input())\nValueError: invalid literal for int() with base 10: ' '\n","stdout":null} {"problem_id":"p03272","language":"Python","original_status":"Runtime Error","pass":"\"\"\"\nauthor : halo2halo\ndate : 23, Jan, 2020\n\"\"\"\n\nimport sys\n\n# import numpy as np\n\nread = sys.stdin.buffer.read\nreadline = sys.stdin.buffer.readline\nreadlines = sys.stdin.buffer.readlines\n\nN, i = map(int, readline())\nprint(N - i + 1)\n","fail":"\"\"\"\nauthor : halo2halo\ndate : 23, Jan, 2020\n\"\"\"\n\nimport sys\n\n# import numpy as np\n\nread = sys.stdin.buffer.read\nreadline = sys.stdin.buffer.readline\nreadlines = sys.stdin.buffer.readlines\n\nN, i = map(int, readline().split())\nprint(N - i + 1)\n","change":"replace","i1":13,"i2":14,"j1":13,"j2":14,"error":"ValueError: too many values to unpack (expected 2)","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03272\/Python\/s252613778.py\", line 14, in \n N, i = map(int, readline())\nValueError: too many values to unpack (expected 2)\n","stdout":null} {"problem_id":"p03272","language":"Python","original_status":"Runtime Error","pass":"x = int(input())\ny = int(input())\nif x == y:\n print(y)\nelse:\n print(y - x + 1)\n","fail":"a, b = map(int, input().split())\nprint(a + 1 - b)\n# Source code should be longer than 50 charactersSource code should be longer than 50 charactersSource code should be longer than 50 charactersSource code should be longer than 50 charactersSource code should be longer than 50 charactersSource code should be longer than 50 charactersSource code should be longer than 50 charactersSource code should be longer than 50 charactersSource code should be longer than 50 characters\n","change":"replace","i1":0,"i2":6,"j1":0,"j2":3,"error":"ValueError: invalid literal for int() with base 10: '4 2'","stderr":"Traceback (most recent call last):\n File \"\/home\/alex\/Documents\/bug-detection\/input\/Project_CodeNet\/data\/p03272\/Python\/s410442106.py\", line 1, in \n x = int(input())\nValueError: invalid literal for int() with base 10: '4 2'\n","stdout":null} {"problem_id":"p03273","language":"Python","original_status":"Runtime Error","pass":"h, w = map(int, input().split())\na = [input() for w in range(h)]\n\nfor i in range(h)[::-1]:\n if \"#\" not in a[i]:\n del a[i]\n h -= 1\nprint(a)\n\nn = []\nfor j in range(w):\n print(\"j=\" + str(j))\n m = [\"\".join(t[j] for t in a)]\n if \"#\" in m[0]:\n n += m\nprint(n)\n\nfor k in range(h):\n print(\"\".join(n[k]))\n","fail":"h, w = map(int, input().split())\na = [input() for w in range(h)]\n\nfor i in range(h)[::-1]:\n if \"#\" not in a[i]:\n del a[i]\n h -= 1\n\nn = []\nfor j in range(w):\n m = [\"\".join(t[j] for t in a)]\n if \"#\" in m[0]:\n n += m\n\nfor k in range(h):\n print(\"\".join(u[k] for u in n))\n","change":"replace","i1":7,"i2":19,"j1":7,"j2":16,"error":"WA","stderr":null,"stdout":"['##.#', '##.#', '.#.#']\nj=0\nj=1\nj=2\nj=3\n['##.', '###', '###']\n##.\n###\n###\n"}