problem_id stringlengths 6 6 | user_id stringlengths 10 10 | time_limit float64 1k 8k | memory_limit float64 262k 1.05M | problem_description stringlengths 48 1.55k | codes stringlengths 35 98.9k | status stringlengths 28 1.7k | submission_ids stringlengths 28 1.41k | memories stringlengths 13 808 | cpu_times stringlengths 11 610 | code_sizes stringlengths 7 505 |
|---|---|---|---|---|---|---|---|---|---|---|
p03137 | u852719059 | 2,000 | 1,048,576 | We will play a one-player game using a number line and N pieces. First, we place each of these pieces at some integer coordinate. Here, multiple pieces can be placed at the same coordinate. Our objective is to visit all of the M coordinates X_1, X_2, ..., X_M with these pieces, by repeating the following move: **Move** : Choose a piece and let x be its coordinate. Put that piece at coordinate x+1 or x-1. Note that the coordinates where we initially place the pieces are already regarded as visited. Find the minimum number of moves required to achieve the objective. | ["\nn,m = map(int,input().split())\nXs = list(map(int,input().split()))\n\nif n >= m:\n print('0')\n exit()\n\nXs.sort()\nXsDist = [b - a for a, b in zip(Xs, Xs[1:])]\n\nXsDist.sort()\nprint(sum(XsDist[:n]))", "\nn,m = map(int,input().split())\nXs = list(map(int,input().split()))\n\nif n >= m:\n print('0')\n exit()\n\nXs.sort()\nXsDist = [0]\n\nfor i in range(len(Xs)):\n if not i == 0:\n XsDist.append(Xs[i] - Xs[i-1])\n\nXsDist.sort()\nprint(sum(XsDist[:n+1]))", "\nn,m = map(int,input().split())\nXs = list(map(int,input().split()))\n\nif n >= m:\n print('0')\n exit()\n\nXs.sort()\nXsDist = [b - a for a, b in zip(Xs, Xs[1:])]\n\nXsDist.sort()\nprint(sum(XsDist[:m - n]))"] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s695106136', 's835260681', 's421086984'] | [13968.0, 13960.0, 13968.0] | [98.0, 119.0, 96.0] | [213, 267, 217] |
p03137 | u852798899 | 2,000 | 1,048,576 | We will play a one-player game using a number line and N pieces. First, we place each of these pieces at some integer coordinate. Here, multiple pieces can be placed at the same coordinate. Our objective is to visit all of the M coordinates X_1, X_2, ..., X_M with these pieces, by repeating the following move: **Move** : Choose a piece and let x be its coordinate. Put that piece at coordinate x+1 or x-1. Note that the coordinates where we initially place the pieces are already regarded as visited. Find the minimum number of moves required to achieve the objective. | ['n, m = map(int, input().split())\nx = list(map(int, input().split()))\nx.sort()\n\nans = [x[i+1] - x[i] for i in range(m-1)]\nans.sort()\n\nprint(sum([ans[i] for i in range(m-3)]))\n ', 'n, m = map(int, input().split())\nx = list(map(int, input().split()))\nx.sort()\n\nans = [abs(x[i+1] - x[i]) for i in range(m-1)]\nans.sort()\n\nprint(sum([ans[i] for i in range(m-n)]))\n '] | ['Wrong Answer', 'Accepted'] | ['s067156981', 's077662472'] | [13968.0, 13968.0] | [110.0, 108.0] | [178, 183] |
p03137 | u854093727 | 2,000 | 1,048,576 | We will play a one-player game using a number line and N pieces. First, we place each of these pieces at some integer coordinate. Here, multiple pieces can be placed at the same coordinate. Our objective is to visit all of the M coordinates X_1, X_2, ..., X_M with these pieces, by repeating the following move: **Move** : Choose a piece and let x be its coordinate. Put that piece at coordinate x+1 or x-1. Note that the coordinates where we initially place the pieces are already regarded as visited. Find the minimum number of moves required to achieve the objective. | ['N,M = map(int,input().split())\nX = list(map(int,input().split()))\nX.sort()\nif N >= M: \n print(0)\n exit()\ndiff = []\nfor i in range(1,len(X)): \n diff.append()(X[i]-X[i-1])\ndiff.sort(reverse=True) \ntotal = sum(diff)\nfor i in range(N-1): \n total -= diff[i]\nprint(total)', 'N,M = map(int,input().split())\nX = list(map(int,input().split()))\nX.sort()\nif N >= M: \n print(0)\n exit()\ndiff = []\nfor i in range(1,len(X)): \n diff.append(X[i]-X[i-1])\ndiff.sort(reverse=True)\ntotal = sum(diff)\nfor i in range(N-1): \n total -= diff[i]\nprint(total)\n'] | ['Runtime Error', 'Accepted'] | ['s619186145', 's668951532'] | [13968.0, 13968.0] | [77.0, 126.0] | [455, 441] |
p03137 | u854144714 | 2,000 | 1,048,576 | We will play a one-player game using a number line and N pieces. First, we place each of these pieces at some integer coordinate. Here, multiple pieces can be placed at the same coordinate. Our objective is to visit all of the M coordinates X_1, X_2, ..., X_M with these pieces, by repeating the following move: **Move** : Choose a piece and let x be its coordinate. Put that piece at coordinate x+1 or x-1. Note that the coordinates where we initially place the pieces are already regarded as visited. Find the minimum number of moves required to achieve the objective. | ['n,m=[int(i) for i in input().split()]\nx=[int(i) for i in input().split()]\nx.sort()\na=[]\nif m==1:\n print("0")\nelse:\n for i in range(m-1):\n a.append(x[i+1]-x[i])\n a.sort(reverse=True)\n result=0\n print("0")\n for i in range(n-1):\n result+=a[i]\n print(max(x)-min(x)-result)', 'n,m=[int(i) for i in input().split()]\nx=[int(i) for i in input().split()]\nx.sort()\na=[]\nif m==1 or n>=m:\n print("0")\nelse:\n for i in range(m-1):\n a.append(x[i+1]-x[i])\n a.sort(reverse=True)\n if n==1:\n print(max(x)-min(x))\n else:\n result=0\n for i in range(n-1):\n result+=a[i]\n print(max(x)-min(x)-result)'] | ['Runtime Error', 'Accepted'] | ['s277553462', 's564962266'] | [13832.0, 13840.0] | [136.0, 139.0] | [303, 364] |
p03137 | u856169020 | 2,000 | 1,048,576 | We will play a one-player game using a number line and N pieces. First, we place each of these pieces at some integer coordinate. Here, multiple pieces can be placed at the same coordinate. Our objective is to visit all of the M coordinates X_1, X_2, ..., X_M with these pieces, by repeating the following move: **Move** : Choose a piece and let x be its coordinate. Put that piece at coordinate x+1 or x-1. Note that the coordinates where we initially place the pieces are already regarded as visited. Find the minimum number of moves required to achieve the objective. | ['N, M = map(int, input().split())\nX = list(map(int, input().split()))\nX.sort()', 'N, M = map(int, input().split())\nX = list(map(int, input().split()))\nX.sort()\n\nif N >= M:\n print(0)\nelse:\n sub_X = []\n for i in range(0, M - 1):\n sub_X.append((i, abs(X[i+1] - X[i])))\n sub_X.sort(key=lambda x: x[1], reverse=True)\n\n division = set()\n if len(sub_X) != 0:\n for i in range(N-1):\n division.add(sub_X[i][0])\n ans = 0\n start = X[0]\n for i in range(M):\n if i in division:\n ans += X[i] - start\n start = X[i+1]\n if i == M-1:\n ans += X[i] - start\n\n print(ans)'] | ['Wrong Answer', 'Accepted'] | ['s288946423', 's096448599'] | [13960.0, 20432.0] | [76.0, 207.0] | [77, 567] |
p03137 | u857428111 | 2,000 | 1,048,576 | We will play a one-player game using a number line and N pieces. First, we place each of these pieces at some integer coordinate. Here, multiple pieces can be placed at the same coordinate. Our objective is to visit all of the M coordinates X_1, X_2, ..., X_M with these pieces, by repeating the following move: **Move** : Choose a piece and let x be its coordinate. Put that piece at coordinate x+1 or x-1. Note that the coordinates where we initially place the pieces are already regarded as visited. Find the minimum number of moves required to achieve the objective. | ['入力(後でいじる)\ndef pin(type=int):\n return map(type,input().split())\n\n\n#solution:\n\nN,M=pin()\nP=sorted(list(pin()))\n#print("*",P)\nPP=[abs(P[j+1]-P[j]) for j in range(M-1)]\n#print(PP)\nQ=sorted(PP)\n#print(Q)\nif N>=M:\n print(0)\nelse:\n for i in range(N-1):\n Q.pop()\n print(sum(Q))', '\ndef pin(type=int):\n return map(type,input().split())\n\n\n#solution:\n\nN,M=pin()\nP=sorted(list(pin()))\nprint("*",P)\nPP=[abs(P[j+1]-P[j]) for j in range(M-1)]\nprint(PP)\nQ=sorted(PP)\nprint(Q)\nif N>=M:\n print(0)\nelse:\n for i in range(N-1):\n Q.pop()\n print(sum(Q))\n ', '\ndef pin(type=int):\n return map(type,input().split())\n\n\n#solution:\n\nN,M=pin()\nP=sorted(list(pin()))\n#print("*",P)\nPP=[abs(P[j+1]-P[j]) for j in range(M-1)]\n#print(PP)\nQ=sorted(PP)\n#print(Q)\nif N>=M:\n print(0)\nelse:\n for i in range(N-1):\n Q.pop()\n print(sum(Q))\n '] | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s351842792', 's812946687', 's319192745'] | [2940.0, 13960.0, 13960.0] | [17.0, 139.0, 123.0] | [752, 755, 758] |
p03137 | u858428199 | 2,000 | 1,048,576 | We will play a one-player game using a number line and N pieces. First, we place each of these pieces at some integer coordinate. Here, multiple pieces can be placed at the same coordinate. Our objective is to visit all of the M coordinates X_1, X_2, ..., X_M with these pieces, by repeating the following move: **Move** : Choose a piece and let x be its coordinate. Put that piece at coordinate x+1 or x-1. Note that the coordinates where we initially place the pieces are already regarded as visited. Find the minimum number of moves required to achieve the objective. | ['import numpy as np\n\na1 = list(int(i) for i in input().split()) \nx = list(int(i) for i in input().split()) \nx = np.sort(x)\nn = a[0]\n\ndelta = []\nfor i in range(0,len(x) - 1):\n delta.append(x[i + 1] - x[i])\n\nif n == 1:\n print(np.sum(delta))\nelse:\n delta = np.sort(delta)\n print(np.sum(delta[0:delta.size - (n - 2)]))', 'import numpy as np\n\na1 = list(int(i) for i in input().split()) \nx = list(int(i) for i in input().split()) \nx = np.sort(x)\nn = a[0]\n\ndelta = []\nfor i in range(0,len(x) - 1):\n delta.append(x[i + 1] - x[i])\n\nif n == 1:\n print(np.sum(delta))\nelse:\n delta = np.sort(delta)\n f = delta.size - (n - 2)\n print(np.sum(delta[0:f:]))', 'import numpy as np\n\na1 = list(int(i) for i in input().split()) \nx = list(int(i) for i in input().split()) \nx = np.sort(x)\nn = a1[0]\n\ndelta = []\nif len(x) <= n:\n print(0)\nelse:\n for i in range(0,len(x) - 1):\n delta.append(x[i + 1] - x[i])\n\n if n == 1:\n print(np.sum(delta))\n else:\n delta = np.sort(delta)\n f = delta.size - (n - 2)\n print(np.sum(delta[0:-(n-1):]))'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s241001851', 's324903149', 's799121431'] | [23076.0, 23920.0, 22944.0] | [192.0, 194.0, 276.0] | [327, 338, 411] |
p03137 | u861077506 | 2,000 | 1,048,576 | We will play a one-player game using a number line and N pieces. First, we place each of these pieces at some integer coordinate. Here, multiple pieces can be placed at the same coordinate. Our objective is to visit all of the M coordinates X_1, X_2, ..., X_M with these pieces, by repeating the following move: **Move** : Choose a piece and let x be its coordinate. Put that piece at coordinate x+1 or x-1. Note that the coordinates where we initially place the pieces are already regarded as visited. Find the minimum number of moves required to achieve the objective. | ['N, M = map(int, input().split())\nX = list(map(int, input().split()))\nX.sort()\n\nMs = M -1\ndest = list()\n\nfor i in range(Ms):\n K = X[i+1] - X[i]\n dest = list.append(K)\n\ndest.sort()\nL = 0\nNM = N - M\nfor j in range(NM):\n L = L + dest(j)\n\nprint(L)', 'N, M = map(int, input().split( ))\ndatas = list(map(int, input().split( )))\ndatas.sort()\nMs = M - 1\n\ndest = list()\nK = 0\ni = 0\nfor i in range(Ms):\n K = datas[i+1] - datas[i]\n dest.append(K)\n\ndest.sort()\nL = 0\nMN = M - N\nfor j in range(MN):\n L = L + dest[j]\n\nprint(L)\n'] | ['Runtime Error', 'Accepted'] | ['s047208249', 's769542507'] | [13968.0, 13968.0] | [82.0, 121.0] | [245, 269] |
p03137 | u866769581 | 2,000 | 1,048,576 | We will play a one-player game using a number line and N pieces. First, we place each of these pieces at some integer coordinate. Here, multiple pieces can be placed at the same coordinate. Our objective is to visit all of the M coordinates X_1, X_2, ..., X_M with these pieces, by repeating the following move: **Move** : Choose a piece and let x be its coordinate. Put that piece at coordinate x+1 or x-1. Note that the coordinates where we initially place the pieces are already regarded as visited. Find the minimum number of moves required to achieve the objective. | ['N,M = map(int,input().split())\nX = list(map(int,input().split()))\nif N > M :\n print(0)\nelse:\n flag = [0 for fl in range(M)]\n X.sort()\n for _ in range(1,M):\n flag[_] += X[_] - X[_-1]\n for lp in range(N-1):\n flag.pop(flag.index(max(flag)))\n print(sum(flag))\n', 'N,M = map(int,input().split())\nX = list(map(int,input().split()))\nif N > M :\n print(0)\nelse:\n flag = [0 for fl in range(M)]\n X.sort()\n for _ in range(1,M+1):\n flag[_] += X[_] - X[_-1]\n for lp in range(len(flag)):\n \tff = flag.index(max(flag))\n flag.pop(ff)\n print(sum(flag))\n', 'N,M = map(int,input().split())\nX = list(map(int,input().split()))\nif N >= M :\n print(0)\n exit()\nX.sort()\nflag = [b-a for a,b in zip(X,X[1:])]\nflag.sort()\nprint(sum(flag[:M-N:]))'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s212635927', 's280296371', 's012763539'] | [2940.0, 2940.0, 13968.0] | [18.0, 17.0, 96.0] | [291, 315, 183] |
p03137 | u867848444 | 2,000 | 1,048,576 | We will play a one-player game using a number line and N pieces. First, we place each of these pieces at some integer coordinate. Here, multiple pieces can be placed at the same coordinate. Our objective is to visit all of the M coordinates X_1, X_2, ..., X_M with these pieces, by repeating the following move: **Move** : Choose a piece and let x be its coordinate. Put that piece at coordinate x+1 or x-1. Note that the coordinates where we initially place the pieces are already regarded as visited. Find the minimum number of moves required to achieve the objective. | ['n,m=map(int,input().split())\nx=list(map(int,input().split()))\nx=sorted(x)\n\nif n>=m:\n print(0)\n exit()\n\nl=[]\nfor i in range(m-1):\n l+=[x[i+1]-x[i]]\n\nl=sorted(l)\nprint(sum(l)-sum(l[:-(n-1)]))\n', 'n,m=map(int,input().split())\nx=list(map(int,input().split()))\nx=sorted(x)\n\nif n>=m:\n print(0)\n exit()\n\nl=[]\nfor i in range(m-1):\n l+=[x[i+1]-x[i]]\n\nl=sorted(l)\nprint(sum(l)-sum(l[-n+1:]) if n!=1 else sum(l))\n'] | ['Wrong Answer', 'Accepted'] | ['s496368525', 's084476080'] | [13968.0, 13960.0] | [119.0, 118.0] | [199, 217] |
p03137 | u868767877 | 2,000 | 1,048,576 | We will play a one-player game using a number line and N pieces. First, we place each of these pieces at some integer coordinate. Here, multiple pieces can be placed at the same coordinate. Our objective is to visit all of the M coordinates X_1, X_2, ..., X_M with these pieces, by repeating the following move: **Move** : Choose a piece and let x be its coordinate. Put that piece at coordinate x+1 or x-1. Note that the coordinates where we initially place the pieces are already regarded as visited. Find the minimum number of moves required to achieve the objective. | ['N, M = map(int, input().split(" "))\nX = list(map(int, input().split(" ")))\nX.sort()\ntotal = X[-1]-X[0]\ndif = [X[i+1] - X[i] for i in range(len(X)-1)]\ndif.sort()\nprint(dif)\nY = [0 for i in range(N-1)]\nfor i in range(N-1):\n\tY[i] = dif.pop()\nprint(total-sum(Y))', 'N, M = map(int, input().split(" "))\nX = list(map(int, input().split(" ")))\nX.sort()\ntotal = X[-1]-X[0]\ndif = [X[i+1] - X[i] for i in range(len(X)-1)]\ndif.sort()\nY = [0 for i in range(N-1)]\nfor i in range(N-1):\n try:\n Y[i] = dif.pop()\n except:\n Y[i]=0\nprint(total-sum(Y))'] | ['Runtime Error', 'Accepted'] | ['s372752641', 's484122634'] | [13968.0, 13960.0] | [127.0, 123.0] | [258, 278] |
p03137 | u871303155 | 2,000 | 1,048,576 | We will play a one-player game using a number line and N pieces. First, we place each of these pieces at some integer coordinate. Here, multiple pieces can be placed at the same coordinate. Our objective is to visit all of the M coordinates X_1, X_2, ..., X_M with these pieces, by repeating the following move: **Move** : Choose a piece and let x be its coordinate. Put that piece at coordinate x+1 or x-1. Note that the coordinates where we initially place the pieces are already regarded as visited. Find the minimum number of moves required to achieve the objective. | ['import math\nimport sys\nINF = 1000000\n\nN, M = map(int, input().split())\npoints = list(map(int, input().split()))\n\npoints.sort()\nprint(points)\n\nminLength = [INF for _ in range(M)]\narrays = []\n\nfor n in range(N):\n tmp_array = []\n index = minLength.index(max(minLength)) \n minLength[index] = 0\n tmp_array.append(points[index])\n for r in arrays:\n if points[index] in r:\n r.remove(points[index])\n for i in range(M):\n if minLength[i] > abs(points[i] - points[index]):\n for r in arrays:\n if points[i] in r:\n r.remove(points[i])\n tmp_array.append(points[i])\n minLength[i] = abs(points[i] - points[index])\n arrays.append(tmp_array)\n if all([True if i == 0 else False for i in minLength]):\n print(0)\n sys.exit()\n\n\nans = 0\nfor a in arrays:\n mi = min(a)\n ma = max(a)\n ans += abs(ma - mi)\nprint(ans)', 'import sys\nINF = 1000000\n\nN, M = map(int, input().split())\npoints = list(map(int, input().split()))\n\npoints.sort()\nprint(points)\n\nminLength = [INF for _ in range(M)]\narrays = []\n\nfor n in range(N):\n tmp_array = []\n index = minLength.index(max(minLength)) \n minLength[index] = 0\n tmp_array.append(points[index])\n for r in arrays:\n if points[index] in r:\n r.remove(points[index])\n for i in range(M):\n if minLength[i] > abs(points[i] - points[index]):\n for r in arrays:\n if points[i] in r:\n r.remove(points[i])\n tmp_array.append(points[i])\n minLength[i] = abs(points[i] - points[index])\n arrays.append(tmp_array)\n if all([True if i == 0 else False for i in minLength]):\n print(0)\n sys.exit()\n\n\nans = 0\nfor a in arrays:\n mi = min(a)\n ma = max(a)\n ans += abs(ma - mi)\nprint(ans)', 'n, m = map(int, input().split())\nx = list(map(int, input().split()))\nx.sort()\n\nans = [abs(x[i+1] - x[i]) for i in range(m-1)]\nans.sort()\n\nprint(sum([ans[i] for i in range(m-n)]))\n \n'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s018535259', 's665913113', 's656146401'] | [13968.0, 15300.0, 13968.0] | [2104.0, 2108.0, 106.0] | [883, 871, 184] |
p03137 | u875408597 | 2,000 | 1,048,576 | We will play a one-player game using a number line and N pieces. First, we place each of these pieces at some integer coordinate. Here, multiple pieces can be placed at the same coordinate. Our objective is to visit all of the M coordinates X_1, X_2, ..., X_M with these pieces, by repeating the following move: **Move** : Choose a piece and let x be its coordinate. Put that piece at coordinate x+1 or x-1. Note that the coordinates where we initially place the pieces are already regarded as visited. Find the minimum number of moves required to achieve the objective. | ["def iread():\n return int(input())\n\n\ndef sread():\n return input()\n\n\ndef aread_int():\n tmp = input().split()\n ret = [int(i) for i in tmp]\n return ret\n\n\ndef aread_str():\n return input().split()\n\nif __name__ == '__main__':\n n, m = map(int, input().split())\n \n x = aread_int()\n x = sorted(x)\n x_dist = [0] * (m - 1)\n for i in range(m - 1) :\n x_dist[i] += abs(x[i] - x[i + 1])\n \n if n > m :\n print(0)\n exit()\n \n x_dist = sorted(x_dist)\n print(x_dist)\n idx = len(x_dist) - 1\n cost = sum(x_dist)\n for i in range(n - 1) :\n cost -= x_dist[idx]\n x_dist[idx] = 0\n idx -= 1\n\n print(cost)", "def iread():\n return int(input())\n\n\ndef sread():\n return input()\n\n\ndef aread_int():\n tmp = input().split()\n ret = [int(i) for i in tmp]\n return ret\n\n\ndef aread_str():\n return input().split()\n\nif __name__ == '__main__':\n n, m = map(int, input().split())\n \n x = aread_int()\n x = sorted(x)\n x_dist = [0] * (m - 1)\n for i in range(m - 1) :\n x_dist[i] += abs(x[i] - x[i + 1])\n \n if n > m :\n print(0)\n exit()\n \n x_dist = sorted(x_dist)\n idx = len(x_dist) - 1\n cost = sum(x_dist)\n for i in range(n - 1) :\n cost -= x_dist[idx]\n x_dist[idx] = 0\n idx -= 1\n\n print(cost)"] | ['Wrong Answer', 'Accepted'] | ['s303111167', 's540963341'] | [13832.0, 13960.0] | [157.0, 151.0] | [679, 661] |
p03137 | u879674287 | 2,000 | 1,048,576 | We will play a one-player game using a number line and N pieces. First, we place each of these pieces at some integer coordinate. Here, multiple pieces can be placed at the same coordinate. Our objective is to visit all of the M coordinates X_1, X_2, ..., X_M with these pieces, by repeating the following move: **Move** : Choose a piece and let x be its coordinate. Put that piece at coordinate x+1 or x-1. Note that the coordinates where we initially place the pieces are already regarded as visited. Find the minimum number of moves required to achieve the objective. | ['import numpy as np\n\n# N = 3\n# M = 7\n\n\n(N, M) = list(map(int, input().split()))\nx_list = sorted(list(map(int, input().split())))\n\n\ndef rl_dist(x_point):\n\n p_num = len(x_point)\n d_list = []\n d_dict = {}\n for num, (a, b) in enumerate(zip(x_point, x_point[1:])):\n d = (b-a)\n if x_point[num] not in d_dict.keys():\n d_dict[x_point[num]] = [d]\n if num==0:\n d_dict[x_point[num]] = np.mean(d_dict[x_point[num]])\n else:\n d_dict[x_point[num]].append(d)\n \n if len(d_dict[x_point[num]])==2:\n d_dict[x_point[num]] = np.mean(d_dict[x_point[num]])\n \n \n if x_point[num+1] not in d_dict.keys():\n d_dict[x_point[num+1]] = [d]\n \n if num+1==p_num-1:\n d_dict[x_point[num+1]] = np.mean(d_dict[x_point[num+1]])\n \n return d_dict\n \n \nrl_dict = rl_dist(x_list)\n \nfirst_set = list(set([p[0] for p in sorted(rl_dict.items(), key=lambda x: x[1])[-1*N:] ]))\nprint(first_set)\n\nrem = list(set(x_list) - set(first_set))\nprint(rem)\n\ncost = 0\n\nwhile len(rem)>0:\n d_list = []\n best = 10**5\n best_list = []\n \n if cost==0:\n candidate = first_set\n else:\n candidate = [new_set]\n \n for fp in list(candidate):\n for r in rem:\n d = abs(fp-r)\n if d<best:\n best = d\n best_list = [fp, r]\n \n print(best, best_list)\n cost += best\n \n new_set = best_list[1]\n rem = set(rem) - set([new_set])\nprint(cost)', 'import numpy as np\n\n# N = 3\n# M = 7\n\n\n(N, M) = list(map(int, input().split()))\nx_list = list(map(int, input().split()))\n\n\ndef rl_dist(x_point):\n\n p_num = len(x_point)\n d_list = []\n d_dict = {}\n for num, (a, b) in enumerate(zip(x_point, x_point[1:])):\n d = (b-a)\n if x_point[num] not in d_dict.keys():\n d_dict[x_point[num]] = [d]\n if num==0:\n d_dict[x_point[num]] = np.mean(d_dict[x_point[num]])\n else:\n d_dict[x_point[num]].append(d)\n \n if len(d_dict[x_point[num]])==2:\n d_dict[x_point[num]] = np.mean(d_dict[x_point[num]])\n \n \n if x_point[num+1] not in d_dict.keys():\n d_dict[x_point[num+1]] = [d]\n \n if num+1==p_num-1:\n d_dict[x_point[num+1]] = np.mean(d_dict[x_point[num+1]])\n \n return d_dict\n \n \nrl_dict = rl_dist(x_list)\n \nfirst_set = list(set([p[0] for p in sorted(rl_dict.items(), key=lambda x: x[1])[-1*N:] ]))\nprint(first_set)\n\nrem = list(set(x_list) - set(first_set))\nprint(rem)\n\ncost = 0\n\nwhile len(rem)>0:\n d_list = []\n best = 10**5\n best_list = []\n \n if cost==0:\n candidate = first_set\n else:\n candidate = [new_set]\n \n for fp in list(candidate):\n for r in rem:\n d = abs(fp-r)\n if d<best:\n best = d\n best_list = [fp, r]\n \n print(best, best_list)\n cost += best\n \n new_set = best_list[1]\n rem = set(rem) - set([new_set])\nprint(cost)', 'import numpy as np\n\n# N = 3\n# M = 7\n\n\n(N, M) = list(map(int, input().split()))\nx_list = sorted(list(map(int, input().split())))\n\n\ndef rl_dist(x_point):\n\n p_num = len(x_point)\n d_list = []\n d_dict = {}\n for num, (a, b) in enumerate(zip(x_point, x_point[1:])):\n d = (b-a)\n if x_point[num] not in d_dict.keys():\n d_dict[x_point[num]] = [d]\n if num==0:\n d_dict[x_point[num]] = np.mean(d_dict[x_point[num]])\n else:\n d_dict[x_point[num]].append(d)\n \n if len(d_dict[x_point[num]])==2:\n d_dict[x_point[num]] = np.mean(d_dict[x_point[num]])\n \n \n if x_point[num+1] not in d_dict.keys():\n d_dict[x_point[num+1]] = [d]\n \n if num+1==p_num-1:\n d_dict[x_point[num+1]] = np.mean(d_dict[x_point[num+1]])\n \n return d_dict\n \n \nrl_dict = rl_dist(x_list)\n \nfirst_set = list(set([p[0] for p in sorted(rl_dict.items(), key=lambda x: x[1])[-1*N:] ]))\nprint(first_set)\n\nrem = list(set(x_list) - set(first_set))\nprint(rem)\n\ncost = 0\n\nwhile len(rem)>0:\n d_list = []\n best = 10**5\n best_list = []\n \n if cost==0:\n candidate = first_set\n else:\n candidate = [new_set]\n \n for fp in list(candidate):\n for r in rem:\n d = abs(fp-r)\n if d<best:\n best = d\n best_list = [fp, r]\n \n print(best, best_list)\n cost += best\n \n new_set = best_list[1]\n rem = set(rem) - set([new_set])\nprint(cost)', 'import numpy as np\n\n# N = 3\n# M = 7\n\n\n(N, M) = list(map(int, input().split()))\nx_list = sorted(list(map(int, input().split())))\n\n\ndef rl_dist(x_point):\n\n p_num = len(x_point)\n d_list = []\n d_dict = {}\n for num, (a, b) in enumerate(zip(x_point, x_point[1:])):\n d = (b-a)\n if x_point[num] not in d_dict.keys():\n d_dict[x_point[num]] = [d]\n if num==0:\n d_dict[x_point[num]] = np.mean(d_dict[x_point[num]])\n else:\n d_dict[x_point[num]].append(d)\n \n if len(d_dict[x_point[num]])==2:\n d_dict[x_point[num]] = np.mean(d_dict[x_point[num]])\n \n \n if x_point[num+1] not in d_dict.keys():\n d_dict[x_point[num+1]] = [d]\n \n if num+1==p_num-1:\n d_dict[x_point[num+1]] = np.mean(d_dict[x_point[num+1]])\n \n return d_dict\n \n \nrl_dict = rl_dist(x_list)\n \nfirst_set = list(set([p[0] for p in sorted(rl_dict.items(), key=lambda x: x[1])[-1*N:] ]))\nprint("First Set", first_set)\n\nrem = list(set(x_list) - set(first_set))\nprint("First Remain", rem)\n\ncost = 0\n\ncurrent_point = first_set\n\nwhile len(rem)>0:\n d_list = []\n best = 10**5\n best_list = []\n \n for fp in current_point:\n for r in rem:\n if fp==r:\n continue\n \n d = abs(fp-r)\n if d<best:\n best = d\n best_list = [fp, r]\n \n print("Next", best, best_list)\n cost += best\n \n bef_point = best_list[0]\n new_point = best_list[1]\n rem = set(rem) - set([new_point])\n \n idx = current_point.index(bef_point)\n current_point[idx] = new_point\n \nprint(cost)', 'debug = 0\n"""\nN: state num\nM: city num\n"""\n\n\nif debug:\n N = 2\n m = 10\nelse:\n (N, M) = list(map(int, input().split()))\n\nif debug:\n p_y_list = [\n [1, 30]\n ,[1, 20]\n ,[1, 10]\n ,[1, 3]\n ,[2, 63]\n ,[2, 33]\n ,[2, 23]\n ,[3, 21]\n ,[3, 7]\n ]\n\ncity_id_list = []\nfor num, z in enumerate(range(M)):\n# for num, (P, Y) in enumerate(p_y_list):\n \n if not debug:\n (P, Y) = list(map(int, input().split()))\n\n city_id_list.append([Y, P, num])\n \ncity_id_list = sorted( city_id_list, key= lambda x: x[0])\n\nstate_cnt = {}\ntmp_list = []\nfor (Y, P, num) in city_id_list:\n \n if P not in state_cnt.keys():\n state_cnt[P] = 1\n elif P in state_cnt.keys():\n state_cnt[P] += 1\n \n tmp_id = str(P).zfill(6) + str(state_cnt[P]).zfill(6)\n \n tmp_list.append([num, tmp_id])\n \nfor cid in sorted(tmp_list, key=lambda x: x[0]):\n print(cid[1])', 'N, M = map(int, input().split())\nX = sorted(list(map(int, input().split())))\n\nif N>=M:\n print(0)\nelse: \n dist = [b-a for a, b in zip(X, X[1:])]\n dist.sort()\n if (N-1)==0:\n print(sum(dist[:M-N]))\n else:\n print(sum(dist[:-(N-1)]))'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s109399123', 's184808379', 's192257243', 's568754084', 's836356920', 's328160338'] | [28056.0, 33016.0, 29036.0, 29096.0, 13964.0, 13960.0] | [2109.0, 2109.0, 2109.0, 2109.0, 41.0, 98.0] | [1650, 1642, 1650, 1804, 943, 258] |
p03137 | u879870653 | 2,000 | 1,048,576 | We will play a one-player game using a number line and N pieces. First, we place each of these pieces at some integer coordinate. Here, multiple pieces can be placed at the same coordinate. Our objective is to visit all of the M coordinates X_1, X_2, ..., X_M with these pieces, by repeating the following move: **Move** : Choose a piece and let x be its coordinate. Put that piece at coordinate x+1 or x-1. Note that the coordinates where we initially place the pieces are already regarded as visited. Find the minimum number of moves required to achieve the objective. | ['N,M = map(int,input().split())\nL = list(map(int,input().split()))\nif N >= M :\n ans = 0\nelse :\n L = sorted(L)\n A = []\n for i in range(M-1) :\n A.append(L[i+1]-L[i])\n A = sorted(A)\n ans = A[:M-N]\nprint(ans)\n', 'N,M = map(int,input().split())\nL = list(map(int,input().split()))\nif N >= M :\n ans = 0\nelse :\n L = sorted(L)\n A = []\n for i in range(M-1) :\n A.append(L[i+1]-L[i])\nA = sorted(A)\nans = A[:M-N]\nprint(ans)\n', 'N,M = map(int,input().split())\nL = list(map(int,input().split()))\nL = sorted(L)\nA = []\nfor i in range(M-1) :\n A.append(L[i+1] - L[i])\nA = sorted(A)\nif N >= M :\n ans = 0\nelse :\n ans = sum(A[:M-N])\nprint(ans)\n'] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s669578091', 's692219601', 's533440203'] | [13968.0, 13960.0, 13968.0] | [113.0, 115.0, 127.0] | [229, 221, 216] |
p03137 | u880480312 | 2,000 | 1,048,576 | We will play a one-player game using a number line and N pieces. First, we place each of these pieces at some integer coordinate. Here, multiple pieces can be placed at the same coordinate. Our objective is to visit all of the M coordinates X_1, X_2, ..., X_M with these pieces, by repeating the following move: **Move** : Choose a piece and let x be its coordinate. Put that piece at coordinate x+1 or x-1. Note that the coordinates where we initially place the pieces are already regarded as visited. Find the minimum number of moves required to achieve the objective. | ['N, M = map(int,input().split())\nX = list(map(int,input().split()))\n\nans = sorted([X[x+1] - X[x] for x in range(M-1)])\n\nif N >= M:\n print(0)\nelse:\n print(sum(ans[:M-N]))', 'N, M = map(int,input().split())\nX = sorted(list(map(int,input().split())))\n\nans = sorted([X[x+1] - X[x] for x in range(M-1)])\n\nif N >= M:\n print(0)\nelse:\n print(sum(ans[:M-N]))'] | ['Wrong Answer', 'Accepted'] | ['s798748149', 's860932796'] | [20716.0, 20668.0] | [88.0, 85.0] | [174, 182] |
p03137 | u883203948 | 2,000 | 1,048,576 | We will play a one-player game using a number line and N pieces. First, we place each of these pieces at some integer coordinate. Here, multiple pieces can be placed at the same coordinate. Our objective is to visit all of the M coordinates X_1, X_2, ..., X_M with these pieces, by repeating the following move: **Move** : Choose a piece and let x be its coordinate. Put that piece at coordinate x+1 or x-1. Note that the coordinates where we initially place the pieces are already regarded as visited. Find the minimum number of moves required to achieve the objective. | ['n,m = list(map(int,input().split()))\n\ndata = [int(s) for s in input().split()]\ndata.sort()\nl = []\nfor i in range(m-1):\n l.append(data[i+1]-data[i])\nl.sort(reverse = True)\n\nx = 0\nfor i in range(m-1):\n x += l[i]\nprint(data[m-1] - data[0] - x)\n', 'n,m = list(map(int,input().split()))\n\ndata = [int(s) for s in input().split()]\ndata.sort()\nl = []\nif n >= m:\n print(0)\nelse:\n for i in range(m-1):\n l.append(data[i+1]-data[i])\n l.sort(reverse = True)\n\n x = 0\n for i in range(n-1):\n x += l[i]\n print(data[m-1] - data[0] - x)\n'] | ['Wrong Answer', 'Accepted'] | ['s140444729', 's642873989'] | [13832.0, 13840.0] | [132.0, 125.0] | [247, 305] |
p03137 | u886112691 | 2,000 | 1,048,576 | We will play a one-player game using a number line and N pieces. First, we place each of these pieces at some integer coordinate. Here, multiple pieces can be placed at the same coordinate. Our objective is to visit all of the M coordinates X_1, X_2, ..., X_M with these pieces, by repeating the following move: **Move** : Choose a piece and let x be its coordinate. Put that piece at coordinate x+1 or x-1. Note that the coordinates where we initially place the pieces are already regarded as visited. Find the minimum number of moves required to achieve the objective. | ['n,m=map(int,input().split())\nx=[int(i) for i in input().split()]\nif m==1 or n>m\n print(0)\nelse:\n x=sorted(x)\n\n if n==1:\n print(x[-1]-x[0])\n else:\n\n xsa=[]\n for i in range(len(x)-1):\n xsa.append(x[i+1]-x[i])\n\n xsa=sorted(xsa)\n\n print(sum(xsa[0:(m-n)]))\n', 'n,m=map(int,input().split())\nx=[int(i) for i in input().split()]\nif m==1:\n print(0)\nelse:\n x=sorted(x)\n\n if n==1:\n print(x[-1]-x[0])\n else:\n\n xsa=[]\n for i in range(len(x)-1):\n xsa.append(x[i+1]-x[i])\n\n xsa=sorted(xsa)\n\n print(xsa)\n\n print(sum(xsa[0:(m-n)]))', 'n,m=map(int,input().split())\nx=[int(i) for i in input().split()]\nif m==1 or n>m:\n print(0)\nelse:\n x=sorted(x)\n\n if n==1:\n print(x[-1]-x[0])\n else:\n\n xsa=[]\n for i in range(len(x)-1):\n xsa.append(x[i+1]-x[i])\n\n xsa=sorted(xsa)\n\n\n\n print(sum(xsa[0:(m-n)]))\n'] | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s318583395', 's398143904', 's110676695'] | [2940.0, 13832.0, 13840.0] | [17.0, 122.0, 116.0] | [310, 323, 313] |
p03137 | u887207211 | 2,000 | 1,048,576 | We will play a one-player game using a number line and N pieces. First, we place each of these pieces at some integer coordinate. Here, multiple pieces can be placed at the same coordinate. Our objective is to visit all of the M coordinates X_1, X_2, ..., X_M with these pieces, by repeating the following move: **Move** : Choose a piece and let x be its coordinate. Put that piece at coordinate x+1 or x-1. Note that the coordinates where we initially place the pieces are already regarded as visited. Find the minimum number of moves required to achieve the objective. | ['N, M = map(int,input().split())\nX = sorted(list(map(int,input().split())))\n\ntmp = sorted([X[i+1] - X[i] for i in range(M-1)])\nif(M <= N):\n print(sum(tmp[:M-N]))\nelse:\n print(0)', 'N, M = map(int,input().split())\nX = sorted(list(map(int,input().split())))\n\ntmp = [abs(X[i+1] - X[i]) for i in range(M-1)]\nif(tmp != []):\n tmp.remove([max(tmp) for _ in range(N-1)]\n print(sum(tmp))\nelse:\n print(0)', 'N, M = map(int,input().split())\nX = sorted(map(int,input().split()))\n\nX = sorted([X[i+1]-X[i] for i in range(M-1)])\nans = sum(X[:M-N])\nif M <= N:\n ans = 0\nprint(ans)'] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s146899317', 's473041115', 's950353271'] | [13968.0, 2940.0, 13968.0] | [102.0, 17.0, 102.0] | [178, 216, 166] |
p03137 | u896451538 | 2,000 | 1,048,576 | We will play a one-player game using a number line and N pieces. First, we place each of these pieces at some integer coordinate. Here, multiple pieces can be placed at the same coordinate. Our objective is to visit all of the M coordinates X_1, X_2, ..., X_M with these pieces, by repeating the following move: **Move** : Choose a piece and let x be its coordinate. Put that piece at coordinate x+1 or x-1. Note that the coordinates where we initially place the pieces are already regarded as visited. Find the minimum number of moves required to achieve the objective. | ['def MAP(): return list(map(int,input().split()))\ndef INT(): return int(input())\nMOD = 10**9+7\n\nn,m = MAP()\nx = MAP()\nx.sort()\n\nif n>=m:\n print(0)\n exit(0)\n\ntmp = x[m-1] - x[0]\nif n==1:\n print(tmp)\n exit(0)\n\nll = []\nans = 0\nfor i in range(m-1):\n ll.append(x[i+1]-x[i])\nll.sort()\nprint(tmp-sum(ll[-(n-1):]))\nprint(ll)\nprint(ll[-(n-1):])', 'def MAP(): return list(map(int,input().split()))\ndef INT(): return int(input())\nMOD = 10**9+7\n\nn,m = MAP()\nx = MAP()\nx.sort()\n\nif n>=m:\n print(0)\n exit(0)\n\nll = []\nfor i in range(m-1):\n ll.append(x[i+1]-x[i])\nll.sort()\nprint(sum(ll[0:max(0, m - n)]))'] | ['Wrong Answer', 'Accepted'] | ['s417032658', 's040791231'] | [13968.0, 13968.0] | [129.0, 112.0] | [349, 259] |
p03137 | u903005414 | 2,000 | 1,048,576 | We will play a one-player game using a number line and N pieces. First, we place each of these pieces at some integer coordinate. Here, multiple pieces can be placed at the same coordinate. Our objective is to visit all of the M coordinates X_1, X_2, ..., X_M with these pieces, by repeating the following move: **Move** : Choose a piece and let x be its coordinate. Put that piece at coordinate x+1 or x-1. Note that the coordinates where we initially place the pieces are already regarded as visited. Find the minimum number of moves required to achieve the objective. | ["N, M = map(int, input().split())\nX = list(map(int, input().split()))\n\nif N >= M:\n print(0)\n exit()\n\nX = sorted(X)\nprint(X)\nd = [X[i + 1] - X[i] for i in range(len(X) - 1)]\nd = sorted(d)\nprint('d', d)\nif N == 1:\n print(sum(d))\nelse:\n print(sum(d[:-N + 1]))\n", "N, M = map(int, input().split())\nX = list(map(int, input().split()))\n\nif N >= M:\n print(0)\n exit()\n\nX = sorted(X)\n# print(X)\nd = [X[i + 1] - X[i] for i in range(len(X) - 1)]\nd = sorted(d)\n# print('d', d)\nif N == 1:\n print(sum(d))\nelse:\n print(sum(d[:-N + 1]))\n"] | ['Wrong Answer', 'Accepted'] | ['s728209953', 's516078481'] | [13968.0, 13960.0] | [120.0, 104.0] | [268, 272] |
p03137 | u909162870 | 2,000 | 1,048,576 | We will play a one-player game using a number line and N pieces. First, we place each of these pieces at some integer coordinate. Here, multiple pieces can be placed at the same coordinate. Our objective is to visit all of the M coordinates X_1, X_2, ..., X_M with these pieces, by repeating the following move: **Move** : Choose a piece and let x be its coordinate. Put that piece at coordinate x+1 or x-1. Note that the coordinates where we initially place the pieces are already regarded as visited. Find the minimum number of moves required to achieve the objective. | ['nm = list(map(int, input().split()))\nn = nm[0]\nm = nm[1]\nx = list(map(int, input().split()))\nx.sort()\nd = []\nfor i in range(m - 1):\n x_d = x[i + 1] - x[i]\n d.append(x_d)\nprint(d)\nd.sort()\nif n > m:\n n = m\nans = sum(d[:m - n])\nprint(ans)\n', 'nm = list(map(int, input().split()))\nn = nm[0]\nm = nm[1]\nx = list(map(int, input().split()))\nx.sort()\nd = []\nfor i in range(m - 1):\n x_d = x[i + 1] - x[i]\n d.append(x_d)\nd.sort()\nif n > m:\n n = m\nans = sum(d[:m - n])\nprint(ans)\n'] | ['Wrong Answer', 'Accepted'] | ['s291861466', 's923631155'] | [13968.0, 13968.0] | [119.0, 114.0] | [246, 237] |
p03137 | u917733926 | 2,000 | 1,048,576 | We will play a one-player game using a number line and N pieces. First, we place each of these pieces at some integer coordinate. Here, multiple pieces can be placed at the same coordinate. Our objective is to visit all of the M coordinates X_1, X_2, ..., X_M with these pieces, by repeating the following move: **Move** : Choose a piece and let x be its coordinate. Put that piece at coordinate x+1 or x-1. Note that the coordinates where we initially place the pieces are already regarded as visited. Find the minimum number of moves required to achieve the objective. | ['N, M= (int(i) for i in input().split())\nif (N<M):\n X = list(int(i) for i in input().split())\n X.sort()\n Y = [X[i] - X[i-1] for i in range(1, len(X))].sort()\n print(sum(Y[0:M-N]))\nelse:\n print(0)\n\n\n# -100 | -10 -3 0 2 9 | 17\n# 0 | 90 97 100 102 109 | 117\n# 90 7 3 2 7 6\n# 90 7 7 6 3 2\n\n\n\n\n', 'N, M= (int(i) for i in input().split())\nif (N<M)\n X = list(int(i) for i in input().split())\n X.sort()\n Y = [X[i] - X[i-1] for i in range(1, len(X))].sort()\n print(sum(Y[0:M-N]))\nelse:\n print(0)\n\n\n# -100 | -10 -3 0 2 9 | 17\n# 0 | 90 97 100 102 109 | 117\n# 90 7 3 2 7 6\n# 90 7 7 6 3 2\n\n\n\n\n', 'N, M= (int(i) for i in input().split())\nif (N<M):\n X = list(int(i) for i in input().split())\n X.sort()\n Y = [X[i] - X[i-1] for i in range(1, len(X))]\n Y.sort()\n print(sum(Y[0:M-N]))\nelse:\n print(0)\n\n\n\n\n'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s136688575', 's153124847', 's830134597'] | [13960.0, 2940.0, 13960.0] | [107.0, 18.0, 108.0] | [499, 498, 405] |
p03137 | u918601425 | 2,000 | 1,048,576 | We will play a one-player game using a number line and N pieces. First, we place each of these pieces at some integer coordinate. Here, multiple pieces can be placed at the same coordinate. Our objective is to visit all of the M coordinates X_1, X_2, ..., X_M with these pieces, by repeating the following move: **Move** : Choose a piece and let x be its coordinate. Put that piece at coordinate x+1 or x-1. Note that the coordinates where we initially place the pieces are already regarded as visited. Find the minimum number of moves required to achieve the objective. | ['N,M=[int(s) for s in input().split()]\nls=[int(s) for s in input().split()]\nls.sort()\nd=[ls[i+1]-ls[i] for i in range(M-1)]\nd.sort()\nfor _ in range(N):\n if len(d)==0:\n break\n del d[0]\nprint(sum(d))', 'N,M=[int(s) for s in input().split()]\nls=[int(s) for s in input().split()]\nls.sort()\nd=[ls[i+1]-ls[i] for i in range(M-1)]\nd.sort()\nfor _ in range(N-1):\n if len(d)==0:\n break\n del d[0]\nprint(sum(d))\n', 'N,M=[int(s) for s in input().split()]\nif N>=M:\n print(0)\nelse:\n ls=[int(s) for s in input().split()]\n ls.sort()\n d=[ls[i+1]-ls[i] for i in range(M-1)]\n d.sort()\n print(sum(d[:M-N]))'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s044963202', 's928449005', 's951275649'] | [13832.0, 13840.0, 13832.0] | [1577.0, 1585.0, 103.0] | [201, 204, 187] |
p03137 | u919127329 | 2,000 | 1,048,576 | We will play a one-player game using a number line and N pieces. First, we place each of these pieces at some integer coordinate. Here, multiple pieces can be placed at the same coordinate. Our objective is to visit all of the M coordinates X_1, X_2, ..., X_M with these pieces, by repeating the following move: **Move** : Choose a piece and let x be its coordinate. Put that piece at coordinate x+1 or x-1. Note that the coordinates where we initially place the pieces are already regarded as visited. Find the minimum number of moves required to achieve the objective. | ['#python3.4\ndef inpul(): return list(map(int, input().split()))\n\nN, M = inpul()\nX = inpul()\n\nif(N >= M):\n print(0)\n\nnew_list = sorted(X)\ndiff_list = [new_list[i+1] - new_list[i] for i in range(M-1)]\nnew_dif_list = sorted(diff_list, reverse = True)\nelse:\n if(N >= 2):\n for i in range(N-1):\n new_dif_list.pop(0)\n\n print(sum(new_dif_list))\n', '#python3.4\ndef inpul(): return list(map(int, input().split()))\n\nN, M = inpul()\nX = inpul()\n\nif(N >= M):\n print(0)\nelse:\n new_list = sorted(X)\n diff_list = [new_list[i+1] - new_list[i] for i in range(M-1)]\n new_dif_list = sorted(diff_list, reverse = True)\n\n if(N >= 2):\n for i in range(N-1):\n new_dif_list.pop(0)\n\n print(sum(new_dif_list))\n'] | ['Runtime Error', 'Accepted'] | ['s469282648', 's026853731'] | [2940.0, 13968.0] | [17.0, 1550.0] | [356, 358] |
p03137 | u919689206 | 2,000 | 1,048,576 | We will play a one-player game using a number line and N pieces. First, we place each of these pieces at some integer coordinate. Here, multiple pieces can be placed at the same coordinate. Our objective is to visit all of the M coordinates X_1, X_2, ..., X_M with these pieces, by repeating the following move: **Move** : Choose a piece and let x be its coordinate. Put that piece at coordinate x+1 or x-1. Note that the coordinates where we initially place the pieces are already regarded as visited. Find the minimum number of moves required to achieve the objective. | ['# -*- coding: utf-8 -*-\n\n\nimport copy\n\nn, m = map(int, input().split())\nary = [int(s) for s in input().split()]\n\nif n < m :\n ary.sort()\n sa = []\n \n for i in range(0, m - 1):\n sa.append(ary[i + 1] - ary[i])\n \n print(sa)\n \n sa.sort()\n \n for i in range(0, n - 1):\n sa.pop(-1)\n \n print(sum(sa))\nelse :\n print(0)', '# -*- coding: utf-8 -*-\n\n\nimport copy\n\nn, m = map(int, input().split())\nary = [int(s) for s in input().split()]\n\nif n < m :\n ary.sort()\n sa = []\n \n for i in range(0, m - 1):\n sa.append(ary[i + 1] - ary[i])\n \n #print(sa)\n \n sa.sort()\n \n for i in range(0, n - 1):\n sa.pop(-1)\n \n print(sum(sa))\nelse :\n print(0)'] | ['Wrong Answer', 'Accepted'] | ['s221143149', 's419157948'] | [14600.0, 14088.0] | [144.0, 130.0] | [401, 402] |
p03137 | u922487073 | 2,000 | 1,048,576 | We will play a one-player game using a number line and N pieces. First, we place each of these pieces at some integer coordinate. Here, multiple pieces can be placed at the same coordinate. Our objective is to visit all of the M coordinates X_1, X_2, ..., X_M with these pieces, by repeating the following move: **Move** : Choose a piece and let x be its coordinate. Put that piece at coordinate x+1 or x-1. Note that the coordinates where we initially place the pieces are already regarded as visited. Find the minimum number of moves required to achieve the objective. | ['N,M = list(map(int, input().split(" ")))\nXs = sorted(list(map(int, input().split(" "))))\n\nif N >= M :\n\tprint(0)\n\texit()\n\t\ndarr = [Xs[i+1] - Xs[i]for i in range(M-1)]\n\nprint(darr)\n\n# ??\nfor i in range(N-1):\n\tdarr.pop(darr.index(max(darr)))\n\t\nprint(sum(darr))', 'import heapq\nN,M = list(map(int, input().split(" ")))\nXs = sorted(list(map(int, input().split(" "))))\n\nif N >= M :\n\tprint(0)\n\texit()\n\t\ndarr = [Xs[i+1] - Xs[i]for i in range(M-1)]\n\n# print(darr)\nheapq.heapify(darr)\nres = 0\n\nfor _ in range(M - N):\n\tres += heapq.heappop(darr)\n\t\nprint(res)'] | ['Wrong Answer', 'Accepted'] | ['s838615801', 's620777046'] | [13968.0, 13960.0] | [2104.0, 126.0] | [257, 286] |
p03137 | u932868243 | 2,000 | 1,048,576 | We will play a one-player game using a number line and N pieces. First, we place each of these pieces at some integer coordinate. Here, multiple pieces can be placed at the same coordinate. Our objective is to visit all of the M coordinates X_1, X_2, ..., X_M with these pieces, by repeating the following move: **Move** : Choose a piece and let x be its coordinate. Put that piece at coordinate x+1 or x-1. Note that the coordinates where we initially place the pieces are already regarded as visited. Find the minimum number of moves required to achieve the objective. | ['n,m=map(int,input().split())\nx=list(map(int,input().split()))\nl=[]\nfor i in range(n-1):\n l.append(x[i+1]-x[i])\nl.sort(reverse=True)\ncnt=sum(l[:m-1])\nprint(x[m-1]-x[0]-cnt)', 'n,m=map(int,input().split())\nx=list(map(int,input().split()))\nx.sort()\nl=[]\nfor i in range(m-1):\n l.append(x[i+1]-x[i])\nl.sort(reverse=True)\ncnt=sum(l[:n-1])\nprint(sum(l)-cnt)\n'] | ['Runtime Error', 'Accepted'] | ['s351923940', 's957577622'] | [13968.0, 13960.0] | [105.0, 113.0] | [172, 177] |
p03137 | u934868410 | 2,000 | 1,048,576 | We will play a one-player game using a number line and N pieces. First, we place each of these pieces at some integer coordinate. Here, multiple pieces can be placed at the same coordinate. Our objective is to visit all of the M coordinates X_1, X_2, ..., X_M with these pieces, by repeating the following move: **Move** : Choose a piece and let x be its coordinate. Put that piece at coordinate x+1 or x-1. Note that the coordinates where we initially place the pieces are already regarded as visited. Find the minimum number of moves required to achieve the objective. | ['n,m = map(int, input().split())\na = sorted(list(map(int ,input().split())), reverse=True)\nd = []\nfor i in range(m-1):\n d += [a[i+1] - a[i]]\nd.sort(reverse=True)\nprint(sum(d[n-1:]))', 'n,m = map(int, input().split())\na = sorted(list(map(int ,input().split())))\nd = []\nfor i in range(m-1):\n d += [a[i+1] - a[i]]\nd.sort(reverse=True)\nprint(sum(d[n-1:]))'] | ['Wrong Answer', 'Accepted'] | ['s476525398', 's248061945'] | [13960.0, 13960.0] | [123.0, 125.0] | [181, 167] |
p03137 | u937706062 | 2,000 | 1,048,576 | We will play a one-player game using a number line and N pieces. First, we place each of these pieces at some integer coordinate. Here, multiple pieces can be placed at the same coordinate. Our objective is to visit all of the M coordinates X_1, X_2, ..., X_M with these pieces, by repeating the following move: **Move** : Choose a piece and let x be its coordinate. Put that piece at coordinate x+1 or x-1. Note that the coordinates where we initially place the pieces are already regarded as visited. Find the minimum number of moves required to achieve the objective. | ['from collections import deque\nN, M = map(int, input().split())\nX = deque(map(int, input().split()))\nif N >= M:\n\tprint(0)\nelse:\n\tX.sort()\n\tx = 0\n\ty = deque([0] * (N - 1))\n\tfor i in range(M - 1):\n\t\ta = X[i+1] - X[i]\n\t\tb = min(y)\n\t\tif a > b:\n\t\t\ty.remove(b)\n\t\t\ty.append(a)\n\t\t\tx += b\n\t\telse:\n\t\t\tx += a\n\tprint(x)', 'N, M = map(int, input().split())\nX = list(map(int, input().split()))\nif N >= M:\n\tprint(0)\nelse:\n\tX.sort()\n\tY = [0] * (M - 1)\n\tfor i in range(M - 1):\n\t\tY[i] = X[i+1] - X[i]\n\tY.sort(reverse = True)\n\tprint(max(X) - min(X) - sum(Y[:N - 1]))'] | ['Runtime Error', 'Accepted'] | ['s990164824', 's885394595'] | [13576.0, 13968.0] | [44.0, 139.0] | [306, 236] |
p03137 | u939702463 | 2,000 | 1,048,576 | We will play a one-player game using a number line and N pieces. First, we place each of these pieces at some integer coordinate. Here, multiple pieces can be placed at the same coordinate. Our objective is to visit all of the M coordinates X_1, X_2, ..., X_M with these pieces, by repeating the following move: **Move** : Choose a piece and let x be its coordinate. Put that piece at coordinate x+1 or x-1. Note that the coordinates where we initially place the pieces are already regarded as visited. Find the minimum number of moves required to achieve the objective. | ['n, m = map(int, input().split())\nif n >= m:\n ans = 0\nelse:\n x = list(map(int, input().split()))\n x.sort()\n print(x)\n d = [x[i] - x[i-1] for i in range(1,m)]\n d.sort()\n print(d)\n ans = sum(d[:m-n])\nprint(ans)', 'n, m = map(int, input().split())\nif n >= m:\n ans = 0\nelse:\n x = list(map(int, input().split()))\n x.sort()\n d = [x[i] - x[i-1] for i in range(1,m)]\n d.sort()\n ans = sum(d[:m-n])\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s528260110', 's333721342'] | [13968.0, 13960.0] | [122.0, 101.0] | [215, 193] |
p03137 | u943470534 | 2,000 | 1,048,576 | We will play a one-player game using a number line and N pieces. First, we place each of these pieces at some integer coordinate. Here, multiple pieces can be placed at the same coordinate. Our objective is to visit all of the M coordinates X_1, X_2, ..., X_M with these pieces, by repeating the following move: **Move** : Choose a piece and let x be its coordinate. Put that piece at coordinate x+1 or x-1. Note that the coordinates where we initially place the pieces are already regarded as visited. Find the minimum number of moves required to achieve the objective. | ['n,m = list(map(int, input().split()))\nx = list(map(int, input().split()))\n\nif n >= m:\n print(0)\n exit()\nelse:\n difference = []\n x.sort()\n \n for i in range(m-1):\n difference.append(x[i+1]-x[i])\n \n difference.sort()\n \n print(sum(difference[:n-1]))\n', 'n,m = input().split()\nn = int(n)\nm = int(m)\n\nrow_x = input().split()\n\nif n >= m:\n print(0)\nelse:\n difference = []\n x = sorted(row_x)\n\n for i in range(m-1):\n difference.append(x[i+1]-x[i])\n\n for i in range(n-1):\n difference.remove(max(difference))\n\n print(sum(difference))', 'n,m = list(map(int, input().split()))\nx = list(map(int, input().split()))\n\nif n >= m:\n print(0)\n exit()\nelse:\n difference = []\n x.sort()\n \n for i in range(m-1):\n difference.append(x[i+1]-x[i])\n \n difference.sort()\n \n print(sum(difference[:m-n]))\n'] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s082077776', 's923641266', 's139527760'] | [13960.0, 10512.0, 13968.0] | [112.0, 83.0, 116.0] | [274, 303, 274] |
p03137 | u944643608 | 2,000 | 1,048,576 | We will play a one-player game using a number line and N pieces. First, we place each of these pieces at some integer coordinate. Here, multiple pieces can be placed at the same coordinate. Our objective is to visit all of the M coordinates X_1, X_2, ..., X_M with these pieces, by repeating the following move: **Move** : Choose a piece and let x be its coordinate. Put that piece at coordinate x+1 or x-1. Note that the coordinates where we initially place the pieces are already regarded as visited. Find the minimum number of moves required to achieve the objective. | ['N, M = map(int, input().split())\nX = list(map(int, input().split()))\nif N >= M :\n print(0)\nelse:\n length = [0] * (M-1)\n for i in range(M-1):\n length[i](X[i+1]-X[i])\n length.sort()\n print(sum(length[:(M-N)]))', 'N, M = map(int, input().split())\nX = list(map(int, input().split()))\nif N >= M :\n print(0)\nelse:\n length = [0] * (M-1)\n for i in range(M-1):\n length[i](X[i+1]-X[i])\n length.sort()\n print(sum(length[:M-N]))', 'N, M = map(int, input().split())\nX = sorted(list(map(int, input().split())))\nif N >= M :\n print(0)\nelse:\n length = [0] * (M-1)\n for i in range(M-1):\n length[i](X[i+1]-X[i])\n length.sort()\n print(sum(length[:(M-N)]))', 'N, M = map(int, input().split())\nX = sorted(list(map(int, input().split())))\nif N >= M :\n print(0)\nelse:\n length = [0] * (M-1)\n for i in range(M-1):\n length[i] = (X[i+1]-X[i])\n length.sort()\n print(sum(length[:(M-N)]))'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s098841543', 's264127296', 's656196020', 's939414700'] | [13968.0, 13960.0, 13960.0, 13968.0] | [42.0, 42.0, 78.0, 109.0] | [215, 213, 223, 226] |
p03137 | u946996108 | 2,000 | 1,048,576 | We will play a one-player game using a number line and N pieces. First, we place each of these pieces at some integer coordinate. Here, multiple pieces can be placed at the same coordinate. Our objective is to visit all of the M coordinates X_1, X_2, ..., X_M with these pieces, by repeating the following move: **Move** : Choose a piece and let x be its coordinate. Put that piece at coordinate x+1 or x-1. Note that the coordinates where we initially place the pieces are already regarded as visited. Find the minimum number of moves required to achieve the objective. | ['mod = 10 ** 9 + 7\nmod2 = 2 ** 61 + 1\nfrom collections import deque\nimport heapq\nfrom bisect import bisect_left, insort_left, bisect_right\n\n_NUMINT_ALL = list(range(10))\n\n\ndef main():\n ans = solve()\n if ans is not None:\n print(ans)\n\n\ndef solve():\n N, M = iip(False)\n X = iip()\n X.sort()\n\n if N >= M:\n return 0\n\n A = [X[i+1] - X[i] for i in range(len(X)-1)]\n A.sort()\n\n return sum(A[:max(0, -N+1)])\n\n\n\n\ndef iip(listed=True, num_only=True): \n if num_only:\n ret = [int(i) for i in input().split()]\n else:\n ret = [int(i) if i in _NUMINT_ALL else i for i in input().split()]\n\n if len(ret) == 1 and not listed:\n return ret[0]\n return ret\n\n\ndef saidai_kouyakusuu(A): \n l = len(A)\n while True:\n m = min(A)\n mx = max(A)\n if m == mx:\n return m\n\n for i in range(l):\n if A[i] % m == 0:\n A[i] = m\n else:\n A[i] %= m\n\n\ndef sort_tuples(l, index): \n if isinstance(l, list):\n l.sort(key=lambda x: x[index])\n return l\n else:\n l = list(l)\n return sorted(l, key=lambda x: x[index])\n\n\ndef count_elements(l): \n d = {}\n for i in l:\n if i in d:\n d[i] += 1\n else:\n d[i] = 1\n return d\n\n\ndef safeget(l, index, default="exception"): \n if index >= len(l): \n if default == "exception":\n raise Exception("".join(["safegetに不正な値 ", index, "が渡されました。配列の長さは", len(l), "です"]))\n else:\n return default\n elif index < 0:\n if default == "exception":\n raise Exception("".join(["safegetに不正な値 ", index, "が渡されました。負の値は許可されていません"]))\n else:\n return default\n else:\n return l[index]\n\n\ndef iipt(l, listed=False, num_only=True): \n ret = []\n for i in range(l):\n ret.append(iip(listed=listed, num_only=num_only))\n return ret\n\n\ndef sortstr(s): \n return "".join(sorted(s))\n\n\ndef iip_ord(startcode="a"): \n if isinstance(startcode, str):\n startcode = ord(startcode)\n return [ord(i) - startcode for i in input()]\n\n\ndef YesNo(s): \n if s:\n print("Yes")\n else:\n print("No")\n\n\ndef fprint(s): \n for i in s:\n print(i)\n\n\ndef bitall(N): \n ret = []\n for i in range(2 ** N):\n a = []\n for j in range(N):\n a.append(i % 2)\n i //= 2\n ret.append(a)\n return ret\n\ndef split_print_space(s): \n print(" ".join([str(i) for i in s]))\n\n\ndef split_print_enter(s): \n print("\\n".join([str(i) for i in s]))\n\n\ndef soinsuu_bunkai(n): \n ret = []\n for i in range(2, int(n ** 0.5) + 1):\n while n % i == 0:\n n //= i\n ret.append(i)\n if i > n:\n break\n if n != 1:\n ret.append(n)\n return ret\n\n\ndef conbination(n, r, mod, test=False): \n if n <= 0:\n return 0\n if r == 0:\n return 1\n if r < 0:\n return 0\n if r == 1:\n return n\n ret = 1\n for i in range(n - r + 1, n + 1):\n ret *= i\n ret = ret % mod\n\n bunbo = 1\n for i in range(1, r + 1):\n bunbo *= i\n bunbo = bunbo % mod\n\n ret = (ret * inv(bunbo, mod)) % mod\n if test:\n # print(f"{n}C{r} = {ret}")\n pass\n return ret\n\n\ndef inv(n, mod): \n return power(n, mod - 2)\n\n\ndef power(n, p, mod_=mod): \n if p == 0:\n return 1\n if p % 2 == 0:\n return (power(n, p // 2, mod_) ** 2) % mod_\n if p % 2 == 1:\n return (n * power(n, p - 1, mod_)) % mod_\n\n\nif __name__ == "__main__":\n main()\n', 'mod = 10 ** 9 + 7\nmod2 = 2 ** 61 + 1\nfrom collections import deque\nimport heapq\nfrom bisect import bisect_left, insort_left, bisect_right\n\n_NUMINT_ALL = list(range(10))\n\n\ndef main():\n ans = solve()\n if ans is not None:\n print(ans)\n\n\ndef solve():\n N, M = iip(False)\n X = iip()\n X.sort()\n\n A = [X[i+1] - X[i] for i in range(len(X)-1)]\n A.sort()\n\n return sum(A[0:max(0, M-N)])\n\n\n\n\ndef iip(listed=True, num_only=True): \n if num_only:\n ret = [int(i) for i in input().split()]\n else:\n ret = [int(i) if i in _NUMINT_ALL else i for i in input().split()]\n\n if len(ret) == 1 and not listed:\n return ret[0]\n return ret\n\n\ndef saidai_kouyakusuu(A): \n l = len(A)\n while True:\n m = min(A)\n mx = max(A)\n if m == mx:\n return m\n\n for i in range(l):\n if A[i] % m == 0:\n A[i] = m\n else:\n A[i] %= m\n\n\ndef sort_tuples(l, index): \n if isinstance(l, list):\n l.sort(key=lambda x: x[index])\n return l\n else:\n l = list(l)\n return sorted(l, key=lambda x: x[index])\n\n\ndef count_elements(l): \n d = {}\n for i in l:\n if i in d:\n d[i] += 1\n else:\n d[i] = 1\n return d\n\n\ndef safeget(l, index, default="exception"): \n if index >= len(l): \n if default == "exception":\n raise Exception("".join(["safegetに不正な値 ", index, "が渡されました。配列の長さは", len(l), "です"]))\n else:\n return default\n elif index < 0:\n if default == "exception":\n raise Exception("".join(["safegetに不正な値 ", index, "が渡されました。負の値は許可されていません"]))\n else:\n return default\n else:\n return l[index]\n\n\ndef iipt(l, listed=False, num_only=True): \n ret = []\n for i in range(l):\n ret.append(iip(listed=listed, num_only=num_only))\n return ret\n\n\ndef sortstr(s): \n return "".join(sorted(s))\n\n\ndef iip_ord(startcode="a"): \n if isinstance(startcode, str):\n startcode = ord(startcode)\n return [ord(i) - startcode for i in input()]\n\n\ndef YesNo(s): \n if s:\n print("Yes")\n else:\n print("No")\n\n\ndef fprint(s): \n for i in s:\n print(i)\n\n\ndef bitall(N): \n ret = []\n for i in range(2 ** N):\n a = []\n for j in range(N):\n a.append(i % 2)\n i //= 2\n ret.append(a)\n return ret\n\ndef split_print_space(s): \n print(" ".join([str(i) for i in s]))\n\n\ndef split_print_enter(s): \n print("\\n".join([str(i) for i in s]))\n\n\ndef soinsuu_bunkai(n): \n ret = []\n for i in range(2, int(n ** 0.5) + 1):\n while n % i == 0:\n n //= i\n ret.append(i)\n if i > n:\n break\n if n != 1:\n ret.append(n)\n return ret\n\n\ndef conbination(n, r, mod, test=False): \n if n <= 0:\n return 0\n if r == 0:\n return 1\n if r < 0:\n return 0\n if r == 1:\n return n\n ret = 1\n for i in range(n - r + 1, n + 1):\n ret *= i\n ret = ret % mod\n\n bunbo = 1\n for i in range(1, r + 1):\n bunbo *= i\n bunbo = bunbo % mod\n\n ret = (ret * inv(bunbo, mod)) % mod\n if test:\n # print(f"{n}C{r} = {ret}")\n pass\n return ret\n\n\ndef inv(n, mod): \n return power(n, mod - 2)\n\n\ndef power(n, p, mod_=mod): \n if p == 0:\n return 1\n if p % 2 == 0:\n return (power(n, p // 2, mod_) ** 2) % mod_\n if p % 2 == 1:\n return (n * power(n, p - 1, mod_)) % mod_\n\n\nif __name__ == "__main__":\n main()\n'] | ['Wrong Answer', 'Accepted'] | ['s639390367', 's362133533'] | [14088.0, 14344.0] | [106.0, 107.0] | [4716, 4683] |
p03137 | u951601135 | 2,000 | 1,048,576 | We will play a one-player game using a number line and N pieces. First, we place each of these pieces at some integer coordinate. Here, multiple pieces can be placed at the same coordinate. Our objective is to visit all of the M coordinates X_1, X_2, ..., X_M with these pieces, by repeating the following move: **Move** : Choose a piece and let x be its coordinate. Put that piece at coordinate x+1 or x-1. Note that the coordinates where we initially place the pieces are already regarded as visited. Find the minimum number of moves required to achieve the objective. | ['N,M=map(int,input().split())\nX=list(map(int,input().split()))\nif(len(X)<=N):\n print(0)\nelse:\n #print(N,M,X)\n sort_X=sorted(X)\n #print(sort_X)\n #print(sort_X[1:],sort_X[0:len(sort_X)-1])\n X_sa=[x - y for (x, y) in zip(sort_X[1:], sort_X[0:len(X)-1])]\n #print(X_sa)\n sort_X_sa=sorted(X_sa)\n print(sort_X_sa)\n print(sort_X_sa[:M-N])\n print(sum(sort_X_sa[:M-N]))', 'N,M=map(int,input().split())\nX=list(map(int,input().split()))\nif(len(X)<=N):\n print(0)\nelse:\n #print(N,M,X)\n sort_X=sorted(X)\n #print(sort_X)\n #print(sort_X[1:],sort_X[0:len(sort_X)-1])\n X_sa=[x - y for (x, y) in zip(sort_X[1:], sort_X[0:len(X)-1])]\n #print(X_sa)\n sort_X_sa=sorted(X_sa)\n #print(sort_X_sa)\n #print(sort_X_sa[:M-N])\n print(sum(sort_X_sa[:M-N]))'] | ['Wrong Answer', 'Accepted'] | ['s300573525', 's725371414'] | [13968.0, 13968.0] | [109.0, 98.0] | [369, 371] |
p03137 | u958612488 | 2,000 | 1,048,576 | We will play a one-player game using a number line and N pieces. First, we place each of these pieces at some integer coordinate. Here, multiple pieces can be placed at the same coordinate. Our objective is to visit all of the M coordinates X_1, X_2, ..., X_M with these pieces, by repeating the following move: **Move** : Choose a piece and let x be its coordinate. Put that piece at coordinate x+1 or x-1. Note that the coordinates where we initially place the pieces are already regarded as visited. Find the minimum number of moves required to achieve the objective. | ['n,m=list(map(int,input().split(" ")))\nlist_x=list(map(int,input().split(" ")))\n\nlist_x.sort()\nlist_d=[]\n\nif m<=n:\n print(0)\nelse:\n i=0\n while i<=m-2:\n list_d.append(list_x[i+1]-list_x[i])\n i+=1\n list_d.sort()\n print(sum(list_d[0:n-1:1]))\n ', 'n,m=list(map(int,input().split(" ")))\nlist_x=list(map(int,input().split(" ")))\n\nlist_x.sort()\nlist_d=[]\n\nif m<=n:\n print(0)\nelse:\n i=0\n while i<=m-2:\n list_d.append(list_x[i+1]-list_x[i])\n i+=1\n list_d.sort()\n print(sum(list_d[0:m-n:1]))\n print(list_d)', 'n,m=list(map(int,input().split(" ")))\nlist_x=list(map(int,input().split(" ")))\n\nlist_x.sort()\nlist_d=[]\n\nif m<=n:\n print(0)\nelse:\n i=0\n while i<=m-2:\n list_d.append(list_x[i+1]-list_x[i])\n i+=1\n list_d.sort()\n print(sum(list_d[0:m-n:1]))'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s535733448', 's831384451', 's247220736'] | [13960.0, 13960.0, 13968.0] | [132.0, 128.0, 122.0] | [271, 284, 266] |
p03137 | u960171798 | 2,000 | 1,048,576 | We will play a one-player game using a number line and N pieces. First, we place each of these pieces at some integer coordinate. Here, multiple pieces can be placed at the same coordinate. Our objective is to visit all of the M coordinates X_1, X_2, ..., X_M with these pieces, by repeating the following move: **Move** : Choose a piece and let x be its coordinate. Put that piece at coordinate x+1 or x-1. Note that the coordinates where we initially place the pieces are already regarded as visited. Find the minimum number of moves required to achieve the objective. | ['B = [0]\n\nN,M = map(int, input().split())\nX = list(map(int, input().split()))\nX = sorted(X)\nprint(X)\nfor i in range(1,M):\n x = X[i]-X[i-1]\n B.append(x)\nB = sorted(B)\nB = B[::-1]\nprint(B)\nprint(X[-1]-X[0]-sum(B[:N-1]))', 'B = [0]\n\nN,M = map(int, input().split())\nX = list(map(int, input().split()))\nX = sorted(X)\nfor i in range(1,M):\n x = X[i]-X[i-1]\n B.append(x)\nB = sorted(B)\nB = B[::-1]\nprint(X[-1]-X[0]-sum(B[:N-1]))'] | ['Wrong Answer', 'Accepted'] | ['s833202801', 's624568682'] | [13968.0, 13968.0] | [132.0, 123.0] | [222, 204] |
p03137 | u963903527 | 2,000 | 1,048,576 | We will play a one-player game using a number line and N pieces. First, we place each of these pieces at some integer coordinate. Here, multiple pieces can be placed at the same coordinate. Our objective is to visit all of the M coordinates X_1, X_2, ..., X_M with these pieces, by repeating the following move: **Move** : Choose a piece and let x be its coordinate. Put that piece at coordinate x+1 or x-1. Note that the coordinates where we initially place the pieces are already regarded as visited. Find the minimum number of moves required to achieve the objective. | ['N, M = map(int, input().split(" "))\nX = [int(n) for n in input().split(" ")]\n\nX = sorted(X)\n\nif len(X) <= N:\n\tprint(0)\n\nelse:\n\tl = []\n\tfor n in range(len(X)):\n\t\tif n != 0:\n\t\t\tl.append(abs(X[n - 1] - X[n]))\n\n\tans = 0\n\tl = sorted(l, reverse=False)\n\tprint(l)\n\tfor i in range(M - N):\n\t\tans += l[0]\n\t\tl.pop(0)\n\n\tprint(ans)', 'N, M = map(int, input().split(" "))\nX = [int(n) for n in input().split(" ")]\n\nX = sorted(X)\n\nif len(X) <= N:\n\tprint(0)\n\nelse:\n\tl = []\n\tfor n in range(len(X)):\n\t\tif n != 0:\n\t\t\tl.append(abs(X[n - 1] - X[n]))\n\n\tans = 0\n\tl = sorted(l, reverse=False)\n\tfor i in range(M - N):\n\t\tans += l.pop(0)\n\n\tprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s195739464', 's199220292'] | [13832.0, 13840.0] | [1334.0, 1323.0] | [317, 300] |
p03137 | u965602776 | 2,000 | 1,048,576 | We will play a one-player game using a number line and N pieces. First, we place each of these pieces at some integer coordinate. Here, multiple pieces can be placed at the same coordinate. Our objective is to visit all of the M coordinates X_1, X_2, ..., X_M with these pieces, by repeating the following move: **Move** : Choose a piece and let x be its coordinate. Put that piece at coordinate x+1 or x-1. Note that the coordinates where we initially place the pieces are already regarded as visited. Find the minimum number of moves required to achieve the objective. | ['n, m, *x = map(int, open(0).read().split())\nx.sort()', 'n, m, *x = map(int, open(0).read().split())\nx.sort()\nd = [i-j for i, j in zip(x[1:], x)]\nd.sort()\nprint(sum(d[:m-n]) if n < m else 0)'] | ['Wrong Answer', 'Accepted'] | ['s002876968', 's098631702'] | [13964.0, 13964.0] | [77.0, 97.0] | [52, 133] |
p03137 | u966408025 | 2,000 | 1,048,576 | We will play a one-player game using a number line and N pieces. First, we place each of these pieces at some integer coordinate. Here, multiple pieces can be placed at the same coordinate. Our objective is to visit all of the M coordinates X_1, X_2, ..., X_M with these pieces, by repeating the following move: **Move** : Choose a piece and let x be its coordinate. Put that piece at coordinate x+1 or x-1. Note that the coordinates where we initially place the pieces are already regarded as visited. Find the minimum number of moves required to achieve the objective. | ['n, m = [int(x) for x in input().split()]\nx = [int(x) for x in input().split()]\n\nx.sort()\nprint(x)\n\ndist = [0] * (m-1)\nfor i in range(m-1):\n dist[i] = x[i+1] - x[i]\ndist.sort(reverse=True)\n\nlength = x[m-1]-x[0]\nfor i in range(n-1):\n length -= dist[i]\n\nprint(length)\n', 'n, m = [int(x) for x in input().split()]\nx = [int(x) for x in input().split()]\n\nx.sort()\n\ndist = [0] * (m-1)\nfor i in range(m-1):\n dist[i] = x[i+1] - x[i]\ndist.sort(reverse=True)\n\nif m <= n:\n print(0)\nelse:\n length = x[m-1]-x[0]\n for i in range(n-1):\n length -= dist[i]\n print(length)'] | ['Runtime Error', 'Accepted'] | ['s314403258', 's359791537'] | [13832.0, 13840.0] | [139.0, 124.0] | [271, 306] |
p03137 | u973840923 | 2,000 | 1,048,576 | We will play a one-player game using a number line and N pieces. First, we place each of these pieces at some integer coordinate. Here, multiple pieces can be placed at the same coordinate. Our objective is to visit all of the M coordinates X_1, X_2, ..., X_M with these pieces, by repeating the following move: **Move** : Choose a piece and let x be its coordinate. Put that piece at coordinate x+1 or x-1. Note that the coordinates where we initially place the pieces are already regarded as visited. Find the minimum number of moves required to achieve the objective. | ['N,M = map(int,input().split())\nlist = list(map(int,input().split()))\n\nlist.sort()\n\ndif = [b-a for a,b in zip(list,list[1:])]\ndif.sort()\nprint(sum(dif[:M-N]) if N - M > 0 else 0)', 'N,M = map(int,input().split())\nlist = list(map(int,input().split()))\nlist.sort()\n\ndiff = [b-a for a,b in zip(list,list[1::])]\ndiff.sort(reverse=True)\nprint(sum(diff[N-1:]) if M-N >0 else 0)'] | ['Wrong Answer', 'Accepted'] | ['s298232852', 's551705201'] | [13960.0, 13968.0] | [96.0, 96.0] | [177, 189] |
p03137 | u978313283 | 2,000 | 1,048,576 | We will play a one-player game using a number line and N pieces. First, we place each of these pieces at some integer coordinate. Here, multiple pieces can be placed at the same coordinate. Our objective is to visit all of the M coordinates X_1, X_2, ..., X_M with these pieces, by repeating the following move: **Move** : Choose a piece and let x be its coordinate. Put that piece at coordinate x+1 or x-1. Note that the coordinates where we initially place the pieces are already regarded as visited. Find the minimum number of moves required to achieve the objective. | ['N,M=map(int,input().split())\nX=list(map(int,input().split()))\ns=[]\nsum=0\nif M!=1:\n X.sort()\n for i in range(M-1):\n s.append(X[i+1]-X[i])\n t=[]\n for i in range(M-1):\n t.append(s[i])\n s.sort(reverse=True)\n buf=[[],[]]\n for i in range(N-1):\n buf[0].append(s[i])\n buf[1].append(t.index(s[i]))\n print(buf)\n buf[1].sort()\n for i in range(len(buf[1])):\n if i==0:\n sum+=X[buf[1][i]]-X[0]\n else:\n sum+=X[buf[1][i]]-X[buf[1][i-1]+1]\n sum+=X[M-1]-X[buf[1][-1]+1]\nelse:\n sum=0\n print(sum)\n\n', 'N,M=map(int,input().split())\nX=list(map(int,input().split()))\nX.sort()\na=[0 for i in range(M-1)]\nfor i in range(M-1):\n a[i]=X[i+1]-X[i]\na.sort(reverse=True)\na=a[N-1:]\nprint(sum(a))\n\n'] | ['Runtime Error', 'Accepted'] | ['s023515061', 's087392688'] | [13960.0, 14088.0] | [254.0, 117.0] | [581, 185] |
p03137 | u978494963 | 2,000 | 1,048,576 | We will play a one-player game using a number line and N pieces. First, we place each of these pieces at some integer coordinate. Here, multiple pieces can be placed at the same coordinate. Our objective is to visit all of the M coordinates X_1, X_2, ..., X_M with these pieces, by repeating the following move: **Move** : Choose a piece and let x be its coordinate. Put that piece at coordinate x+1 or x-1. Note that the coordinates where we initially place the pieces are already regarded as visited. Find the minimum number of moves required to achieve the objective. | ["import math\n\ndef solve(N,M,Xs):\n if N >= M:\n return 0\n\n Ds = [abs(Xs[i]-Xs[i+1]) for i in range(len(Xs)-1)] # Ds[j] := distance between j and j+1\n\n Ds.sort()\n print(Ds)\n \n\n if N == 1:\n return sum(Ds)\n\n return sum(Ds[0:len(Ds)-(math.ceil(N/2))])\n\ndef main():\n N, M = map(int, input().split())\n Xs = list(map(int, input().split()))\n Xs.sort()\n print(solve(N,M,Xs))\n\n\nif __name__ == '__main__':\n main()", "import math\n\ndef solve(N,M,Xs):\n if N >= M:\n return 0\n\n Ds = [abs(Xs[i]-Xs[i+1]) for i in range(len(Xs)-1)] # Ds[j] := distance between j and j+1\n\n Ds.sort()\n print(Ds)\n \n\n return sum(Ds[0:len(Ds)-(math.ceil(N/2))])\n\ndef main():\n N, M = map(int, input().split())\n Xs = list(map(int, input().split()))\n Xs.sort()\n print(solve(N,M,Xs))\n\n\nif __name__ == '__main__':\n main()", "import math\n\ndef solve(N,M,Xs):\n if N >= M:\n return 0\n\n Ds = [abs(Xs[i]-Xs[i+1]) for i in range(len(Xs)-1)] # Ds[j] := distance between j and j+1\n\n Ds.sort()\n #print(Ds)\n \n\n #ntake = math.ceil(N/2)\n ntake = N-1\n\n return sum(Ds[0:len(Ds)-ntake])\n\ndef main():\n N, M = map(int, input().split())\n Xs = list(map(int, input().split()))\n Xs.sort()\n print(solve(N,M,Xs))\n\n\nif __name__ == '__main__':\n main()"] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s836670737', 's992406276', 's680918483'] | [15824.0, 13576.0, 13576.0] | [107.0, 106.0, 100.0] | [471, 432, 467] |
p03137 | u999503965 | 2,000 | 1,048,576 | We will play a one-player game using a number line and N pieces. First, we place each of these pieces at some integer coordinate. Here, multiple pieces can be placed at the same coordinate. Our objective is to visit all of the M coordinates X_1, X_2, ..., X_M with these pieces, by repeating the following move: **Move** : Choose a piece and let x be its coordinate. Put that piece at coordinate x+1 or x-1. Note that the coordinates where we initially place the pieces are already regarded as visited. Find the minimum number of moves required to achieve the objective. | ['n,m=map(int,input().split())\nl=list(map(int,input().split()))\n\nnum=n-1\nsl=sorted(l)\n\ndsl=[sl[i+1]-sl[i] for i in range(m-1)]\npriny(dsl)', 'n,m=map(int,input().split())\nl=list(map(int,input().split()))\n\nif n>=m:\n print(0)\nelse:\n num=n-1\n sl=sorted(l)\n\n dsl=[abs(sl[i+1]-sl[i]) for i in range(m-1)]\n\n dsl=sorted(dsl)\n print(sum(dsl[0:len(dsl)-num]))\n'] | ['Runtime Error', 'Accepted'] | ['s327203553', 's013021032'] | [20320.0, 20500.0] | [75.0, 83.0] | [135, 215] |
p03145 | u000623733 | 2,000 | 1,048,576 | There is a right triangle ABC with ∠ABC=90°. Given the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC. It is guaranteed that the area of the triangle ABC is an integer. | ['l = map(int, raw_input().split())\nprint(int(l[0] * l[1] / 2)', 'l = list(map(int, input().split()))\nprint(int(l[0] * l[1] / 2))\n'] | ['Runtime Error', 'Accepted'] | ['s398971561', 's249483978'] | [2940.0, 3060.0] | [18.0, 18.0] | [60, 64] |
p03145 | u003501233 | 2,000 | 1,048,576 | There is a right triangle ABC with ∠ABC=90°. Given the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC. It is guaranteed that the area of the triangle ABC is an integer. | ['a,b,c=map(int,input().split())\nprint((a*b)/2)', 'a,b,c=map(int,input().split())\nans=a*b/2\nprint(ans)', 'a=list(map(int,input().split()))\nprint(a[0]*a[1]/2)', 'a,b,c=map(int,input().split())\nprint(a*b/2)', 'a,b,c=map(int,input().split())\nprint(a*b/2)', 'a,b,c=map(int,input().split())\nprint(a*b/2)', 'a,b,c=map(int,input().split())\nprint(a*b//2)'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s020167326', 's070725293', 's132460216', 's193945013', 's324029820', 's901488922', 's776233342'] | [2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0] | [17.0, 19.0, 17.0, 17.0, 17.0, 17.0, 17.0] | [45, 51, 51, 43, 43, 43, 44] |
p03145 | u004025573 | 2,000 | 1,048,576 | There is a right triangle ABC with ∠ABC=90°. Given the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC. It is guaranteed that the area of the triangle ABC is an integer. | ['a, b, c = map(int, input().splitr())\n\nprint(a*b//2)', 'a, b, c = map(int, input().split())\n\nprint(a*b//2)'] | ['Runtime Error', 'Accepted'] | ['s825589957', 's782224692'] | [2940.0, 2940.0] | [18.0, 18.0] | [51, 50] |
p03145 | u004208081 | 2,000 | 1,048,576 | There is a right triangle ABC with ∠ABC=90°. Given the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC. It is guaranteed that the area of the triangle ABC is an integer. | ['ab, bc, ca = list(map(int, input().split()))\n\nprint(int(ab * bc / 2)', 'ab, bc, ca = list(map(int, input().split()))\n \nprint(int(ab * bc / 2))'] | ['Runtime Error', 'Accepted'] | ['s614961305', 's851265784'] | [2940.0, 2940.0] | [17.0, 18.0] | [68, 70] |
p03145 | u006721330 | 2,000 | 1,048,576 | There is a right triangle ABC with ∠ABC=90°. Given the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC. It is guaranteed that the area of the triangle ABC is an integer. | ['a, b, c = map(int, input().split())\nans = a * b / 2\nprint(ans)', 'a, b, c = map(int, input().split())\nans = a * b / 2\nprint(int(ans))'] | ['Wrong Answer', 'Accepted'] | ['s692715652', 's842588769'] | [2940.0, 2940.0] | [17.0, 17.0] | [62, 67] |
p03145 | u008992227 | 2,000 | 1,048,576 | There is a right triangle ABC with ∠ABC=90°. Given the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC. It is guaranteed that the area of the triangle ABC is an integer. | ['a,b,c=map(int, input().split())\nprint(a*b/2)', 'a,b,c=map(int, input().split())\nprint(a*b//2)'] | ['Wrong Answer', 'Accepted'] | ['s368903049', 's159639172'] | [2940.0, 2940.0] | [17.0, 17.0] | [44, 45] |
p03145 | u009348313 | 2,000 | 1,048,576 | There is a right triangle ABC with ∠ABC=90°. Given the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC. It is guaranteed that the area of the triangle ABC is an integer. | ['AB, BC, CA = map(int, input().split())\nprint(AB * BC / 2)', 'AB, BC, CA = map(int, input().split())\nprint(AB * BC // 2)'] | ['Wrong Answer', 'Accepted'] | ['s557536056', 's637650165'] | [2940.0, 2940.0] | [18.0, 18.0] | [57, 58] |
p03145 | u013605408 | 2,000 | 1,048,576 | There is a right triangle ABC with ∠ABC=90°. Given the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC. It is guaranteed that the area of the triangle ABC is an integer. | ['a,b,c = input().split(" ")\na,b,c = int(a),int(b),int(c)\narea = a*b*c/(2*max(a,b,c))', 'a,b,c = input().split(" ")\na,b,c = int(a),int(b),int(c)\narea = int(a*b*c/(max(a,b,c)*2))\nprint(area)'] | ['Wrong Answer', 'Accepted'] | ['s946562692', 's255097928'] | [2940.0, 3060.0] | [18.0, 17.0] | [83, 100] |
p03145 | u013629972 | 2,000 | 1,048,576 | There is a right triangle ABC with ∠ABC=90°. Given the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC. It is guaranteed that the area of the triangle ABC is an integer. | [" import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, copy, functools\nfrom operator import itemgetter\n\n\nsys.setrecursionlimit(10**7)\ninf = 10 ** 20\neps = 1.0 / 10**10\nmod = 10**9+7\ndd = [(-1, 0), (0, 1), (1, 0), (0, -1)]\nddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]\n\n\ndef LI(): return [int(x) for x in sys.stdin.readline().split()]\ndef LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]\ndef LF(): return [float(x) for x in sys.stdin.readline().split()]\ndef LS(): return sys.stdin.readline().split()\ndef I(): return int(sys.stdin.readline())\ndef F(): return float(sys.stdin.readline())\ndef S(): return input()\ndef pf(s): return print(s, flush=True)\n\ndef main():\n \n N, K = LI()\n T = []\n D = []\n TD = []\n for i in range(N):\n TD.append(LI())\n # print(T, '\\n', D)\n TD = sorted(TD, key=itemgetter(1), reverse=True)\n # print('TD', TD)\n\n max_value_per_type = [[t, max([td[1] for td in TD if td[0] == t])]for t in set([i[0] for i in TD])]\n # print('max_value_per_type', max_value_per_type)\n content_per_type = [[t, [i[1] for i in TD if i[0] == t]] for t in set(i[0] for i in TD)]\n # print(content_per_type)\n max_idx_per_type = [i[1].index([mvpt[1] for mvpt in max_value_per_type if mvpt[0] == i[0]][0]) for i in content_per_type]\n # print('max_idx_per_type', max_idx_per_type)\n for idx, i in enumerate(max_idx_per_type):\n del content_per_type[idx][1][i]\n # remaining_values_per_type = [[c[0], [i[0] for i in content_per_type if ]] for c in content_per_type]\n \n results = [0]\n for i in range(1, K+1):\n \n \n \n \n \n # print(i)\n if len(set([i[0] for i in TD])) < i:\n break \n combinations = list(itertools.combinations(set([i[0] for i in TD]), i))\n # print('combi', combinations)\n type_bonus = i * i\n for combination in combinations:\n # print('\\n')\n \n current_options = [i for i in TD if i[0] in combination]\n \n print(max(results))\n\n\nmain()\n", 'AB, BC, CA = map(int, input().split())\n\nresult = AB * BC / 2\n\nprint(result)\n', 'AB, BC, CA = map(int, input().split())\n\nresult = int(AB * BC / 2)\n\nprint(result)\n'] | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s387425711', 's563488811', 's526877828'] | [2940.0, 2940.0, 2940.0] | [18.0, 17.0, 17.0] | [2453, 76, 81] |
p03145 | u013756322 | 2,000 | 1,048,576 | There is a right triangle ABC with ∠ABC=90°. Given the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC. It is guaranteed that the area of the triangle ABC is an integer. | ['n = list(map(int, input().split()))\nprint(n[0]*n[1]*0.5)', 'n = list(map(int, input().split()))\nprint(int(n[0]*n[1]/2))\n'] | ['Wrong Answer', 'Accepted'] | ['s692462742', 's151502598'] | [2940.0, 2940.0] | [18.0, 18.0] | [56, 60] |
p03145 | u020373088 | 2,000 | 1,048,576 | There is a right triangle ABC with ∠ABC=90°. Given the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC. It is guaranteed that the area of the triangle ABC is an integer. | ['ab, bc, ca = map(int, input().split())\nprint(ab * bc / 2)', 'ab, bc, ca = map(int, input().split())\nprint(int(ab * bc / 2))'] | ['Wrong Answer', 'Accepted'] | ['s771985675', 's749007655'] | [3060.0, 2940.0] | [20.0, 18.0] | [57, 62] |
p03145 | u020604402 | 2,000 | 1,048,576 | There is a right triangle ABC with ∠ABC=90°. Given the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC. It is guaranteed that the area of the triangle ABC is an integer. | ['N,M,L = map(int, input().split())\nprint(N*M/2)', 'N,M,L = map(int, input().split())\nprint(int(N*M/2))'] | ['Wrong Answer', 'Accepted'] | ['s581004830', 's905531622'] | [2940.0, 2940.0] | [17.0, 18.0] | [46, 51] |
p03145 | u021548497 | 2,000 | 1,048,576 | There is a right triangle ABC with ∠ABC=90°. Given the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC. It is guaranteed that the area of the triangle ABC is an integer. | ['a, b, c = map(int, input().split())\nprint(a*b/2)', 'a, b, c = map(int, input().split())\nprint(a*b//2)'] | ['Wrong Answer', 'Accepted'] | ['s090074575', 's534937864'] | [3064.0, 2940.0] | [17.0, 17.0] | [48, 49] |
p03145 | u023229441 | 2,000 | 1,048,576 | There is a right triangle ABC with ∠ABC=90°. Given the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC. It is guaranteed that the area of the triangle ABC is an integer. | ['A=list(map(int,input().split()))\nA.sort()\nprint(A[0]*A[1]/2)', 'A=list(map(int,input().split()))\nA.sort()\nprint(int(A[0]*A[1]/2))\n'] | ['Wrong Answer', 'Accepted'] | ['s388093175', 's561995929'] | [2940.0, 2940.0] | [17.0, 18.0] | [60, 66] |
p03145 | u026155812 | 2,000 | 1,048,576 | There is a right triangle ABC with ∠ABC=90°. Given the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC. It is guaranteed that the area of the triangle ABC is an integer. | ['a = list(map(int, input().split()))\na.sort()\nprint(a[0]*a[1]/2)', 'a = list(map(int, input().split()))\na.sort()\nprint(a[0]*a[1]//2)'] | ['Wrong Answer', 'Accepted'] | ['s395378032', 's445300404'] | [2940.0, 2940.0] | [17.0, 17.0] | [63, 64] |
p03145 | u027165539 | 2,000 | 1,048,576 | There is a right triangle ABC with ∠ABC=90°. Given the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC. It is guaranteed that the area of the triangle ABC is an integer. | ['a, b, c = map(int, input().split())\nprint((a * b) / 2)', 'a, b, c = map(int, input().split())\nprint(int((a * b) / 2))\n'] | ['Wrong Answer', 'Accepted'] | ['s735206704', 's592675559'] | [2940.0, 2940.0] | [19.0, 17.0] | [54, 60] |
p03145 | u027403702 | 2,000 | 1,048,576 | There is a right triangle ABC with ∠ABC=90°. Given the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC. It is guaranteed that the area of the triangle ABC is an integer. | ['X,Y,Z = map(int, input().split())\nprint((X * Y)/2)', 'X,Y,Z = map(int, input().split())\nprint((X * Y)//2)'] | ['Wrong Answer', 'Accepted'] | ['s923131959', 's751635972'] | [2940.0, 2940.0] | [17.0, 17.0] | [50, 51] |
p03145 | u027675217 | 2,000 | 1,048,576 | There is a right triangle ABC with ∠ABC=90°. Given the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC. It is guaranteed that the area of the triangle ABC is an integer. | ['a,b,c = map(int, input().split())\nprint(a*b*c//2)\n', 'a,b,c = map(int, input().split())\nprint(a*b//2)\n'] | ['Wrong Answer', 'Accepted'] | ['s655616977', 's530285445'] | [2940.0, 2940.0] | [17.0, 18.0] | [50, 48] |
p03145 | u029169777 | 2,000 | 1,048,576 | There is a right triangle ABC with ∠ABC=90°. Given the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC. It is guaranteed that the area of the triangle ABC is an integer. | ['a,b,c=map(int,input().split())\n\nprint(1/2*a*b)', 'a,b,c=map(int,input().split())\n\nprint(int(1/2*a*b))'] | ['Wrong Answer', 'Accepted'] | ['s248871053', 's230280110'] | [2940.0, 2940.0] | [21.0, 18.0] | [46, 51] |
p03145 | u031324264 | 2,000 | 1,048,576 | There is a right triangle ABC with ∠ABC=90°. Given the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC. It is guaranteed that the area of the triangle ABC is an integer. | ['#a,b,c = map(int, input().split())\n\nif (a >= b) and (a >= c):\n print(b*c/2)\nif (b >= a) and (b >= c):\n print(a*c/2)\nif (c >= a) and (c >= b):\n print(a*b/2)', 'a,b,c = map(int, input().split())\n\nif (a >= b) and (a <= c):\n print(b*c)\nif b >= a and b >= c:\n print(a*c)\nprint(a*b)\n', 'a,b,c = map(int, input().split())\n\nif (a >= b) and (a <= c):\n print(b*c/2)\nif b >= a and b >= c:\n print(a*c/2)\nprint(a*b/2)\n', 'a,b,c = map(int, input().split())\n\nif (a >= b) and (a >= c):\n print(b*c/2)\nif (b >= a) and (b >= c):\n print(a*c/2)\nif (c >= a) and (c >= b):\n print(a*b/2)', 'a,b,c = map(int, input().split())\n\nif (a >= b) and (a <= c):\n print(b*c/2)\nif (b >= a) and (b >= c):\n print(a*c/2)\nif (c >= a) and (c <= b):\n print(a*b/2)\n', 'a,b,c = map(int, input().split())\n\nif (a >= b) and (a >= c):\n print(int(b*c/2))\nif (b >= a) and (b >= c):\n print(int(a*c/2))\nif (c >= a) and (c >= b):\n print(int(a*b/2))'] | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s477616224', 's557820384', 's569606722', 's670375963', 's948017784', 's347962043'] | [2940.0, 2940.0, 2940.0, 3060.0, 2940.0, 3060.0] | [17.0, 17.0, 18.0, 17.0, 18.0, 17.0] | [164, 124, 130, 163, 162, 178] |
p03145 | u033272694 | 2,000 | 1,048,576 | There is a right triangle ABC with ∠ABC=90°. Given the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC. It is guaranteed that the area of the triangle ABC is an integer. | ['ary1 = list(map(int,input().split()))\nary2 = sorted(ary1)\nprint((ary2[0]*ary2[1])/2)\n', 'ary1 = list(map(int,input().split()))\nary2 = sorted(ary1)\nprint(ary2[0]*ary2[1])', 'ary1 = list(map(int,input().split()))\nary2 = sorted(ary1)\nprint((ary2[0]*ary2[1])//2)\n'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s262731217', 's603992650', 's952399318'] | [2940.0, 2940.0, 2940.0] | [18.0, 17.0, 17.0] | [85, 80, 86] |
p03145 | u036340997 | 2,000 | 1,048,576 | There is a right triangle ABC with ∠ABC=90°. Given the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC. It is guaranteed that the area of the triangle ABC is an integer. | ['a=sorted(list(map(int,input().split())))\nprint(a*b//2)', 'a=sorted(list(map(int,input().split())))\nprint(a[0]*a[1]//2)\n'] | ['Runtime Error', 'Accepted'] | ['s221442200', 's679016852'] | [3064.0, 2940.0] | [19.0, 17.0] | [54, 61] |
p03145 | u037221289 | 2,000 | 1,048,576 | There is a right triangle ABC with ∠ABC=90°. Given the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC. It is guaranteed that the area of the triangle ABC is an integer. | ["A,B,C = map(int,input().split(' '))\nprint(A*B/2)", "A,B,C = map(int,input().split(' '))\nprint(int(A*B/2))"] | ['Wrong Answer', 'Accepted'] | ['s867791631', 's612745890'] | [2940.0, 2940.0] | [17.0, 17.0] | [48, 53] |
p03145 | u039189422 | 2,000 | 1,048,576 | There is a right triangle ABC with ∠ABC=90°. Given the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC. It is guaranteed that the area of the triangle ABC is an integer. | ['c,a,b=map(int,input().split())\nprint(c*a/2)', 'a,b,c=map(int,input().split())\t!map(int\u3000でinputの中身をint性質にしている\nprint(b*a//2)\t\t\t\t\t!//はint表示、/はreal表示。多分', 'c,a,b=map(int,input().split())\nprint(c*a//2)'] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s414361621', 's468246959', 's895374608'] | [2940.0, 2940.0, 2940.0] | [17.0, 17.0, 18.0] | [43, 146, 44] |
p03145 | u039192119 | 2,000 | 1,048,576 | There is a right triangle ABC with ∠ABC=90°. Given the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC. It is guaranteed that the area of the triangle ABC is an integer. | ['a,b,c=map(int,input().split())\nprint(a*b/2)', 'a,b,c=map(int,input().split())\nprint(a*b//2)'] | ['Wrong Answer', 'Accepted'] | ['s980922652', 's181950414'] | [2940.0, 2940.0] | [17.0, 17.0] | [43, 44] |
p03145 | u039360403 | 2,000 | 1,048,576 | There is a right triangle ABC with ∠ABC=90°. Given the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC. It is guaranteed that the area of the triangle ABC is an integer. | ['a,b,c=map(int,input().split())\nprint(a*b/2)\n', 'a,b,c=map(int,input().split())\nprint(int(a*b/2))\n'] | ['Wrong Answer', 'Accepted'] | ['s195711345', 's892983033'] | [2940.0, 2940.0] | [17.0, 17.0] | [44, 49] |
p03145 | u042644898 | 2,000 | 1,048,576 | There is a right triangle ABC with ∠ABC=90°. Given the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC. It is guaranteed that the area of the triangle ABC is an integer. | ['import math\nimport copy\n\n\n\n\ndef nCast(number):\n if type(number)==str:\n return int(number)\n for idx in range(0,len(number)):\n if type(number[idx])==str:\n\n number[idx]=int(number[idx])\n else:\n nCast(number[idx])\n return number\n \ndef inputArr(w):\n l=list()\n for idx in range(0,w):\n l.append(input())\n return l\ndef inputArr1(w):\n l=list()\n for idx in range(0,w):\n l.append(input())\n return l\n\na=nCast(input().split())\n\n\ndef func():\n a.sort()\n\n return a[0]*a[1]*0.5\nprint(func()) \n\n\n\n\n\n', 'import math\nimport copy\n\n\n\n\ndef nCast(number):\n if type(number)==str:\n return int(number)\n for idx in range(0,len(number)):\n if type(number[idx])==str:\n\n number[idx]=int(number[idx])\n else:\n nCast(number[idx])\n return number\n \ndef inputArr(w):\n l=list()\n for idx in range(0,w):\n l.append(input())\n return l\ndef inputArr1(w):\n l=list()\n for idx in range(0,w):\n l.append(input())\n return l\n\na=nCast(input().split())\n\n\ndef func():\n a.sort()\n return int(a[0]*a[1]*0.5)\nprint(func()) \n\n\n\n\n\n'] | ['Wrong Answer', 'Accepted'] | ['s478699107', 's918402693'] | [3572.0, 3696.0] | [29.0, 107.0] | [574, 578] |
p03145 | u049182844 | 2,000 | 1,048,576 | There is a right triangle ABC with ∠ABC=90°. Given the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC. It is guaranteed that the area of the triangle ABC is an integer. | ['a,b,c = map(int,input().split())\n\nprint(a * b * 0.5)', 'a,b,c = map(int,input().split())\n\nprint(int(a * b * 0.5))'] | ['Wrong Answer', 'Accepted'] | ['s112693823', 's771257428'] | [9156.0, 9064.0] | [32.0, 24.0] | [52, 57] |
p03145 | u050698451 | 2,000 | 1,048,576 | There is a right triangle ABC with ∠ABC=90°. Given the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC. It is guaranteed that the area of the triangle ABC is an integer. | ['L = map(int, input().split())\nprint(L[0]*L[1]/2)', 'L = list(map(int,input().split()))\nprint(L[0]*L[1]/2)\n', 'L = list(map(int,input().split()))\nprint(int(L[0]*L[1]/2))\n'] | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s804593014', 's863961325', 's477710702'] | [2940.0, 2940.0, 2940.0] | [17.0, 17.0, 18.0] | [48, 54, 59] |
p03145 | u050708958 | 2,000 | 1,048,576 | There is a right triangle ABC with ∠ABC=90°. Given the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC. It is guaranteed that the area of the triangle ABC is an integer. | ['a,b,c = sorted(int, input().split())\nprint(int(a*b/2))', 'a,b,c = sorted(map(int, input().split()))\nprint(int(a*b/2))'] | ['Runtime Error', 'Accepted'] | ['s342794930', 's815079385'] | [2940.0, 3060.0] | [18.0, 19.0] | [54, 59] |
p03145 | u051393148 | 2,000 | 1,048,576 | There is a right triangle ABC with ∠ABC=90°. Given the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC. It is guaranteed that the area of the triangle ABC is an integer. | ['a, b, c = map(int, input().split())\nsum = a * b / 2\nprint(sum)', 'a,b,c = map(int, input().split())\nreturn a*b/2', 'a, b, c = map(int, input().split())\nsum_ = a * b / 2\nprint(int(sum_))'] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s039802830', 's363266070', 's240438205'] | [2940.0, 2940.0, 2940.0] | [18.0, 17.0, 18.0] | [62, 46, 69] |
p03145 | u052347048 | 2,000 | 1,048,576 | There is a right triangle ABC with ∠ABC=90°. Given the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC. It is guaranteed that the area of the triangle ABC is an integer. | ['a,b,c=map(int,input().split();print(a*b//2)', 'a,b,c=map(int,input());print(a*b//2)', 'a,b,c=map(int,input().split());print(a*b//2)'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s317860020', 's937115732', 's534270427'] | [2940.0, 2940.0, 2940.0] | [17.0, 18.0, 18.0] | [43, 36, 44] |
p03145 | u054106284 | 2,000 | 1,048,576 | There is a right triangle ABC with ∠ABC=90°. Given the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC. It is guaranteed that the area of the triangle ABC is an integer. | ['A, B, C = (int(i) for i in input().split())\nprint(A*B)', 'A, B, C = (int(i) for i in input().split())\nprint(A*B//2)'] | ['Wrong Answer', 'Accepted'] | ['s682935276', 's996722358'] | [2940.0, 2940.0] | [17.0, 17.0] | [54, 57] |
p03145 | u057964173 | 2,000 | 1,048,576 | There is a right triangle ABC with ∠ABC=90°. Given the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC. It is guaranteed that the area of the triangle ABC is an integer. | ['def resolve():\n s=int(input())\n l=[s]\n for i in range(10**6):\n if l[i]%2==0:\n if l[i]//2 in l:\n print(i+2)\n break\n else:\n l.append(l[i]//2)\n else:\n if 3*l[i]+1 in l:\n print(i+2)\n break\n else:\n l.append(3 * l[i] + 1)\nresolve()\n', 'import sys\ndef input(): return sys.stdin.readline().strip()\n\ndef resolve():\n a,b,c=map(int, input().split())\n print(a*b//2)\nresolve()'] | ['Runtime Error', 'Accepted'] | ['s656117913', 's647815225'] | [3056.0, 2940.0] | [17.0, 17.0] | [383, 139] |
p03145 | u058861899 | 2,000 | 1,048,576 | There is a right triangle ABC with ∠ABC=90°. Given the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC. It is guaranteed that the area of the triangle ABC is an integer. | ['n,k=map(int,input().split())\nli=[[0,0] for i in range(n)]\nfor i in range(n):\n li[i][0],li[i][1]=map(int,input().split())\n\nli.sort(reverse=True,key=lambda x:x[1])\n\ndef find_num_neta(choice,li):\n k=[]\n for i in choice:\n k.append(li[i][0])\n return len(set(k))\n\n#-----------------------------------------\nbest_list=[]\nbest_list_neta=[]\nnot_best_list=[]\n\nfor i in li:\n if i[0] in best_list_neta:\n not_best_list.append(i[1])\n else:\n best_list.append(i[1])\n best_list_neta.append(i[0])\n\n\ns2=min(len(best_list_neta),k)\ns1=find_num_neta(list(range(k)),li)\n\n\nscore=-1\nfor i in range(s1,s2+1):\n oishisa=0\n for j in range(i):\n oishisa+=best_list[j]\n for j in range(k-i):\n oishisa+=not_best_list[j]\n \n new_score=i**2+oishisa\n\n if score<new_score:\n score=new_score\n \n \nprint(score)', 'a,b,c=map(int,input().split())\nprint(a*b/2)', 'a,b,c=map(int,input().split())\nprint(int(a*b/2))'] | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s053142013', 's444083119', 's717796061'] | [3064.0, 2940.0, 2940.0] | [18.0, 17.0, 17.0] | [862, 43, 48] |
p03145 | u060569392 | 2,000 | 1,048,576 | There is a right triangle ABC with ∠ABC=90°. Given the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC. It is guaranteed that the area of the triangle ABC is an integer. | ['AB,BC,CA=list(map(int,input().split()))\n\nanswer=AB*BC/2\n\nprint(answer)', 'AB,BC,CA=list(map(int,input().split()))\n\nanswer=AB*BC//2\n\nprint(answer)'] | ['Wrong Answer', 'Accepted'] | ['s426979965', 's797115856'] | [2940.0, 2940.0] | [17.0, 17.0] | [70, 71] |
p03145 | u062604519 | 2,000 | 1,048,576 | There is a right triangle ABC with ∠ABC=90°. Given the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC. It is guaranteed that the area of the triangle ABC is an integer. | ['a,b,c=map(int,input().split())\nprint(a*b/2)', 'a,b,c=map(int,input().split())\nprint(int(a*b/2))'] | ['Wrong Answer', 'Accepted'] | ['s969308848', 's651363959'] | [2940.0, 2940.0] | [17.0, 17.0] | [43, 48] |
p03145 | u062847046 | 2,000 | 1,048,576 | There is a right triangle ABC with ∠ABC=90°. Given the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC. It is guaranteed that the area of the triangle ABC is an integer. | ['ab,bc,ca = map(int,input().split())\nprint(ab*bc/2)', 'ab,bc,ca = map(int,input().split())\nprint(int(ab*bc/2))'] | ['Wrong Answer', 'Accepted'] | ['s507334514', 's291665701'] | [2940.0, 3064.0] | [17.0, 17.0] | [50, 55] |
p03145 | u063073794 | 2,000 | 1,048,576 | There is a right triangle ABC with ∠ABC=90°. Given the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC. It is guaranteed that the area of the triangle ABC is an integer. | ['a=list(map(int,input().split()))\na.sort()\nprint(a[0]*a[1]/2)', 'a=list(map(int,input().split()))\na.sort()\nprint(a[0]*a[1]//2)'] | ['Wrong Answer', 'Accepted'] | ['s550197627', 's434477232'] | [2940.0, 2940.0] | [17.0, 17.0] | [60, 61] |
p03145 | u063346608 | 2,000 | 1,048,576 | There is a right triangle ABC with ∠ABC=90°. Given the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC. It is guaranteed that the area of the triangle ABC is an integer. | ['AB,BC,CA = map(int,input().split())\n\nanswer = (|BC| * |AB|) /2\n\nprint(int(answer))', 'AB,BC,CA = map(int,input().split())\n\nanswer = (BC * AB) /2\n\nprint(int(answer))'] | ['Runtime Error', 'Accepted'] | ['s268093783', 's061137200'] | [2940.0, 2940.0] | [17.0, 18.0] | [82, 78] |
p03145 | u064408584 | 2,000 | 1,048,576 | There is a right triangle ABC with ∠ABC=90°. Given the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC. It is guaranteed that the area of the triangle ABC is an integer. | ['a,b,c=sorted(map(int, input().split()))\nprint(a*b/2)', 'a,b,c=sorted(map(int, input().split()))\nprint(a*b//2)'] | ['Wrong Answer', 'Accepted'] | ['s068411262', 's413878348'] | [2940.0, 2940.0] | [17.0, 17.0] | [52, 53] |
p03145 | u067694718 | 2,000 | 1,048,576 | There is a right triangle ABC with ∠ABC=90°. Given the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC. It is guaranteed that the area of the triangle ABC is an integer. | ['a,b,c = [int(i) for i in input().split()]\nprint(a * b / 2)', 'a, b, c = [int(i) for i in input().split()]\nprint(int(a * b / 2))'] | ['Wrong Answer', 'Accepted'] | ['s872024817', 's381419930'] | [2940.0, 2940.0] | [17.0, 18.0] | [58, 65] |
p03145 | u067763075 | 2,000 | 1,048,576 | There is a right triangle ABC with ∠ABC=90°. Given the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC. It is guaranteed that the area of the triangle ABC is an integer. | ['def odd(a):\n return a/2\n\ndef even(b):\n return 3*b+1\n\nnum = int(input())\nbox = [num]\ncnt = 0\nanswer = 0\nwhile(True):\n if(num%2 == 0):\n num = odd(num)\n else:\n num = even(num)\n box.append(num)\n for i in range(len(box)-1):\n if(box[i] == num):\n answer = i\n if(answer != 0):\n print(str(i+2))\n break', 'x = input()\nbox= x.split(" ")\n\nadd = int(box[0]) * int(box[1])/ 2\nprint(int(add))'] | ['Runtime Error', 'Accepted'] | ['s163150590', 's312305221'] | [3064.0, 2940.0] | [17.0, 18.0] | [359, 81] |
p03145 | u069129582 | 2,000 | 1,048,576 | There is a right triangle ABC with ∠ABC=90°. Given the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC. It is guaranteed that the area of the triangle ABC is an integer. | ['a,b,c=map(int,input().split())\nprint(a*b/2)', 'a,b,c=map(int,input().split())\nprint(a*b//2)'] | ['Wrong Answer', 'Accepted'] | ['s978457138', 's128700081'] | [2940.0, 2940.0] | [25.0, 17.0] | [43, 44] |
p03145 | u069172538 | 2,000 | 1,048,576 | There is a right triangle ABC with ∠ABC=90°. Given the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC. It is guaranteed that the area of the triangle ABC is an integer. | ['a,b,c=(int(i) for i in input().split())\n\ns=(a+b+c)/2\n\nprint((s*(s-a)*(s-b)*(s-c))**(1/2))', 'a,b,c=(int(i) for i in input().split())\n \ns=(a+b+c)/2\n \nprint(int((s*(s-a)*(s-b)*(s-c))**(1/2)))'] | ['Wrong Answer', 'Accepted'] | ['s388238051', 's384438757'] | [3060.0, 3060.0] | [17.0, 17.0] | [89, 96] |
p03145 | u069602573 | 2,000 | 1,048,576 | There is a right triangle ABC with ∠ABC=90°. Given the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC. It is guaranteed that the area of the triangle ABC is an integer. | ['a, b, c = map(int, input().split()) \nprint(a*b/2)\n', 'a, b, c = map(int, input().split()) \nprint(int(a*b/2))\n'] | ['Wrong Answer', 'Accepted'] | ['s107194421', 's868063357'] | [2940.0, 2940.0] | [17.0, 18.0] | [71, 76] |
p03145 | u070449185 | 2,000 | 1,048,576 | There is a right triangle ABC with ∠ABC=90°. Given the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC. It is guaranteed that the area of the triangle ABC is an integer. | ['ab,bc,ca = map(int,input().split())\nprint(ab*bc/2)', 'ab,bc,ca = map(int,input().split())\nprint(int(ab*bc/2))'] | ['Wrong Answer', 'Accepted'] | ['s038432594', 's640710104'] | [2940.0, 2940.0] | [17.0, 17.0] | [50, 55] |
p03145 | u071468217 | 2,000 | 1,048,576 | There is a right triangle ABC with ∠ABC=90°. Given the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC. It is guaranteed that the area of the triangle ABC is an integer. | ['AB, BC, _ = map(int, input().split())\nans = AB * BC / 2\nprint(ans)\n', 'AB, BC, _ = map(int, input().split())\nans = AB * BC / 2\nprint(int(ans))\n'] | ['Wrong Answer', 'Accepted'] | ['s041791208', 's685607055'] | [2940.0, 2940.0] | [17.0, 17.0] | [67, 72] |
p03145 | u073396193 | 2,000 | 1,048,576 | There is a right triangle ABC with ∠ABC=90°. Given the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC. It is guaranteed that the area of the triangle ABC is an integer. | ['a, b, c= map(int, input().split())\n\nif a > b and a > c:\n print(b*c/2)\nelif b > a and b > c:\n print(a*c/2)\nelse:\n print(a*b/2)', 'a, b, c= map(int, input().split())\n\nif a > b and a > c:\n print(int(b*c/2))\nelif b > a and b > c:\n print(int(a*c/2))\nelse:\n print(int(a*b/2))'] | ['Wrong Answer', 'Accepted'] | ['s986147473', 's481656115'] | [9096.0, 8980.0] | [27.0, 28.0] | [134, 149] |
p03145 | u076306174 | 2,000 | 1,048,576 | There is a right triangle ABC with ∠ABC=90°. Given the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC. It is guaranteed that the area of the triangle ABC is an integer. | ['A,B,C=map(int, input().split()) \n\nprint(A*B/2)\n', '\nA,B,C=map(int, input().split()) \n\nprint(int(A*B/2))'] | ['Wrong Answer', 'Accepted'] | ['s810472201', 's796419086'] | [2940.0, 2940.0] | [21.0, 17.0] | [127, 132] |
p03145 | u076512055 | 2,000 | 1,048,576 | There is a right triangle ABC with ∠ABC=90°. Given the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC. It is guaranteed that the area of the triangle ABC is an integer. | ['c, a, b = map(int, input().split())\n\nprint(c*a/2)', 'c, a, b = map(int, input().split())\n\nprint(int(c*a/2))'] | ['Wrong Answer', 'Accepted'] | ['s345993526', 's521697490'] | [2940.0, 2940.0] | [17.0, 18.0] | [49, 54] |
p03145 | u076996519 | 2,000 | 1,048,576 | There is a right triangle ABC with ∠ABC=90°. Given the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC. It is guaranteed that the area of the triangle ABC is an integer. | ['l = map(int, input().split())\nprint(l[0]*l[1]/2)', 'l = list(map(int, input().split()))\nprint(l[0]*l[1]/2)', 'l = list(map(int, input().split()))\nprint(int(l[0]*l[1]/2))'] | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s391148434', 's626909231', 's456529798'] | [2940.0, 2940.0, 2940.0] | [18.0, 17.0, 17.0] | [48, 54, 59] |
p03145 | u077019541 | 2,000 | 1,048,576 | There is a right triangle ABC with ∠ABC=90°. Given the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC. It is guaranteed that the area of the triangle ABC is an integer. | ['ab,bc,ca = map(int,input().split())\nprint(ab*bc/2)', 'ab,bc,ca = map(int,input().split())\nprint(int(ab*bc/2))'] | ['Wrong Answer', 'Accepted'] | ['s340691262', 's434013953'] | [2940.0, 2940.0] | [18.0, 18.0] | [50, 55] |
p03145 | u077075933 | 2,000 | 1,048,576 | There is a right triangle ABC with ∠ABC=90°. Given the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC. It is guaranteed that the area of the triangle ABC is an integer. | ['A, B, C = map(int, input().split())\nprint(A*B/2)', 'A, B, C = map(int, input().split())\nprint(A*B//2)\n'] | ['Wrong Answer', 'Accepted'] | ['s932193310', 's664545461'] | [2940.0, 2940.0] | [20.0, 17.0] | [48, 50] |
p03145 | u077291787 | 2,000 | 1,048,576 | There is a right triangle ABC with ∠ABC=90°. Given the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC. It is guaranteed that the area of the triangle ABC is an integer. | ['# ABC116A - Right Triangle\nsides = sorted(list(map(int, input().split())))\n\nprint(sides[0] * sides[1] * 0.5)', '# ABC116A - Right Triangle\na, b, c = list(map(int, input().split()))\n\nprint(int(a * b / 2))'] | ['Wrong Answer', 'Accepted'] | ['s890864078', 's658967452'] | [2940.0, 2940.0] | [17.0, 17.0] | [108, 91] |
p03145 | u078276601 | 2,000 | 1,048,576 | There is a right triangle ABC with ∠ABC=90°. Given the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC. It is guaranteed that the area of the triangle ABC is an integer. | ['AB, BC, CA = map(int, input().split())\nS = AB*BC/2\n\nprint(S)', 'AB, BC, CA = map(int, input().split())\nS = AB*BC//2\n\nprint(S)'] | ['Wrong Answer', 'Accepted'] | ['s983259035', 's936590728'] | [8812.0, 9108.0] | [28.0, 28.0] | [60, 61] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.