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
p03136
u777394984
2,000
1,048,576
Determine if an N-sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane. You can use the following theorem: **Theorem** : an N-sided polygon satisfying the condition can be drawn if and only if the longest side is strictly shorter than the sum of the lengths of the other N-1 sides.
['n = int(input())\nl = map(int,input().split())\nif max(l) < sum(l-[max(l)]):\n print("Yes")\nelse:\n print("No")', 'n = input()\nl = map(int,input().split())\nld = sorted(l, reverse=True)\nm = ld[0]\nh = sum(ld[1:])\nif m < h:\n print("Yes")\nelse:\n print("No")']
['Runtime Error', 'Accepted']
['s661315360', 's701990225']
[2940.0, 2940.0]
[17.0, 17.0]
[109, 140]
p03136
u782930273
2,000
1,048,576
Determine if an N-sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane. You can use the following theorem: **Theorem** : an N-sided polygon satisfying the condition can be drawn if and only if the longest side is strictly shorter than the sum of the lengths of the other N-1 sides.
['input()\nlength = map(int, input().split(" "))\nlm = max(length)\nprint("Yes" if lm < sum(length)-lm else "No")', 'input()\nlength = list(map(int, input().split(" ")))\nlm = max(length)\nprint("Yes" if lm < sum(length) - lm else "No")']
['Wrong Answer', 'Accepted']
['s126193960', 's954383636']
[2940.0, 2940.0]
[17.0, 17.0]
[108, 116]
p03136
u789840108
2,000
1,048,576
Determine if an N-sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane. You can use the following theorem: **Theorem** : an N-sided polygon satisfying the condition can be drawn if and only if the longest side is strictly shorter than the sum of the lengths of the other N-1 sides.
["n = int(input())\npolys = []\nfor i in range(n):\n polys.append(int(input()))\n\nif sum(polys) - max(polys) > max(polys):\n print('Yes')\nelse:\n print('No')", "n = int(input())\npolys = list(map(int, input().split(' ')))\n\nif sum(polys) - max(polys) > max(polys):\n print('True')\nelse:\n print('False')", "n = int(input())\npolys = list(map(int, input().split(' ')))\n\nif sum(polys) - max(polys) > max(polys):\n print('Yes')\nelse:\n print('No')"]
['Runtime Error', 'Wrong Answer', 'Accepted']
['s559080335', 's676067205', 's689689772']
[2940.0, 2940.0, 2940.0]
[17.0, 18.0, 21.0]
[170, 152, 148]
p03136
u795323188
2,000
1,048,576
Determine if an N-sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane. You can use the following theorem: **Theorem** : an N-sided polygon satisfying the condition can be drawn if and only if the longest side is strictly shorter than the sum of the lengths of the other N-1 sides.
['n = int(input())\nlists = list(map(int,input().split()))\n\nma = max(lists)\nif sum(lists) - ma >ma:\n print("YES")\nelse:\n print("NO")\n\n', 'n = int(input())\nlists = list(map(int,input().split())\n\nma = max(lists)\nif sum(lists) - ma >ma:\n print("YES")\nelse:\n print("NO")\n', 'n = int(input())\nlists = list(map(int,input().split()))\n\nma = max(lists)\nif sum(lists) - ma >ma:\n print("Yes")\nelse:\n print("No")\n']
['Wrong Answer', 'Runtime Error', 'Accepted']
['s196879904', 's518841348', 's628626258']
[2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0]
[137, 135, 136]
p03136
u798316285
2,000
1,048,576
Determine if an N-sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane. You can use the following theorem: **Theorem** : an N-sided polygon satisfying the condition can be drawn if and only if the longest side is strictly shorter than the sum of the lengths of the other N-1 sides.
['input()\nL=list(map(int,input().split()))\nprint("Yes" if sum(L)<max(L)*2 else "No")', 'input()\nL=list(map(int,input().split()))\nprint("Yes" if sum(L)>max(L)*2 else "No")']
['Wrong Answer', 'Accepted']
['s325135294', 's229722925']
[2940.0, 2940.0]
[18.0, 17.0]
[82, 82]
p03136
u800780376
2,000
1,048,576
Determine if an N-sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane. You can use the following theorem: **Theorem** : an N-sided polygon satisfying the condition can be drawn if and only if the longest side is strictly shorter than the sum of the lengths of the other N-1 sides.
['N = int(input())\nLin = input().split(" ")\n\nLls = []\n\nfor i in range(0,N):\n Lls.append(Lin[i])\n\nLls.sort(reverse = True)\n\nmaxSide = Lls[0]\notherSide = 0\nfor i in range(1,N):\n otherSide = otherSide + Lls[i]\n\nif maxSide < otherSide:\n print("Yes")\nother:\n print("No")', 'N = int(input())\nLin = input().split(" ")\n\nLls = []\n\nfor i in range(0,N):\n Lls.append(Lin[i])\n\nLls.sort(reverse = True)\n\nmaxSide = Lls[0]\notherSide = 0\nfor i in range(1,N):\n otherSide = otherSide + Lls[i]\n\nif maxSide < otherSide:\n print("Yes")\nelse:\n print("No")\n', 'N = int(input())\nLin = input().split(" ")\n\nLls = []\n\nfor i in range(0,N):\n Lls.append(int(Lin[i]))\n\nLls.sort(reverse = True)\n\nmaxSide = Lls[0]\notherSide = 0\nfor i in range(1,N):\n otherSide = otherSide + Lls[i]\n\nif maxSide < otherSide:\n print("Yes")\nelse:\n print("No")\n']
['Runtime Error', 'Runtime Error', 'Accepted']
['s211788526', 's649705293', 's932436265']
[2940.0, 3060.0, 3060.0]
[17.0, 17.0, 17.0]
[275, 275, 280]
p03136
u803481017
2,000
1,048,576
Determine if an N-sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane. You can use the following theorem: **Theorem** : an N-sided polygon satisfying the condition can be drawn if and only if the longest side is strictly shorter than the sum of the lengths of the other N-1 sides.
["N = int(input())\nL = []\nfor i in range(N):\n L.append(int(input())\n\n \nmaxL = max(L)\nsumL = sum(L) - maxL\n \nif maxL >= sumL :\n return 'No'\nelse:\n return 'Yes'", 'n = int(input())\nl = list(map(int,input().split()))\nm = max(l)\ns = sum(l) - m\nif m < s:\n print("Yes")\nelse:\n print("No")']
['Runtime Error', 'Accepted']
['s645300790', 's755077377']
[2940.0, 2940.0]
[18.0, 19.0]
[187, 122]
p03136
u806855121
2,000
1,048,576
Determine if an N-sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane. You can use the following theorem: **Theorem** : an N-sided polygon satisfying the condition can be drawn if and only if the longest side is strictly shorter than the sum of the lengths of the other N-1 sides.
["N = int(input())\nL_list = list(map(int, input().split()))\n\nL_list.sort()\n\nprint(sum(L_list[0:-1]))\nif sum(L_list[0:-1]) > L_list[-1]:\n print('Yes')\nelse:\n print('No')", "N = int(input())\nL_list = list(map(int, input().split()))\n\nL_list.sort()\n\nif sum(L_list[0:-1]) > L_list[-1]:\n print('Yes')\nelse:\n print('No')\n"]
['Wrong Answer', 'Accepted']
['s487723673', 's413615561']
[3060.0, 2940.0]
[17.0, 17.0]
[172, 148]
p03136
u811000506
2,000
1,048,576
Determine if an N-sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane. You can use the following theorem: **Theorem** : an N-sided polygon satisfying the condition can be drawn if and only if the longest side is strictly shorter than the sum of the lengths of the other N-1 sides.
['N = int(input())\nL = list(map(int,input().split()))\nL.sort(reverse=True)\nsum = 0\nfor i in range(1,N,1):\n sum += L[i]\nprint(sum, L[0])\nif sum > L[0]:\n print("Yes")\nelse:\n print("No")', 'N = int(input())\nL = list(map(int,input().split()))\nL.sort(reverse=True)\nsum = 0\nfor i in range(1,N,1):\n sum += L[i]\nif sum > L[0]:\n print("Yes")\nelse:\n print("No")']
['Wrong Answer', 'Accepted']
['s933434793', 's207745850']
[3060.0, 3060.0]
[17.0, 20.0]
[184, 167]
p03136
u811436126
2,000
1,048,576
Determine if an N-sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane. You can use the following theorem: **Theorem** : an N-sided polygon satisfying the condition can be drawn if and only if the longest side is strictly shorter than the sum of the lengths of the other N-1 sides.
["n = int(input())\nl = sorted(list(map(int, input().split())))\n\nif l[-1] < sum(l[:-2]):\n print('Yes')\nelse:\n print('No')\n", "n = int(input())\nl = sorted(list(map(int, input().split())))\n\nif l[-1] < sum(l[:-1]):\n print('Yes')\nelse:\n print('No')\n"]
['Wrong Answer', 'Accepted']
['s705787993', 's310395473']
[2940.0, 2940.0]
[17.0, 17.0]
[125, 125]
p03136
u814663076
2,000
1,048,576
Determine if an N-sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane. You can use the following theorem: **Theorem** : an N-sided polygon satisfying the condition can be drawn if and only if the longest side is strictly shorter than the sum of the lengths of the other N-1 sides.
["\n# import heapq\n# import math\n# import random\n# from collections import Counter, defaultdict, deque\n# from decimal import Decimal\n# from functools import lru_cache, reduce\n# from itertools import combinations, combinations_with_replacement, product, permutations\n# from operator import add, mul, sub, itemgetter\n# import numpy as np\n\nimport sys\nsys.setrecursionlimit(10000)\n\ndef error_print(*args):\n\tprint(*args, file=sys.stderr)\n\ndef mt(f):\n\timport time\n\tdef wrap(*args, **kwargs):\n\t\ts = time.time()\n\t\tret = f(*args, **kwargs)\n\t\te = time.time()\n\t\terror_print(e - s, 'sec')\n\t\treturn ret\n\treturn wrap\n\ndef read_int(input):\n\tif input == None:\n\t\tinput = sys.stdin.readline().strip()\n\tret = [int(x) for x in input.split()]\n\tif len(ret) == 1:\n\t\tret = ret[0]\n\treturn ret\n\ndef read_float(input):\n\tif input == None:\n\t\tinput = sys.stdin.readline().strip()\n\tret = [float(x) for x in input.split()]\n\tif len(ret) == 1:\n\t\tret = ret[0]\n\treturn ret\n\t\ndef read_str(input):\n\tif input == None:\n\t\tinput = sys.stdin.readline().strip()\n\tret = [x for x in input.split()]\n\tif len(ret) == 1:\n\t\tret = ret[0]\n\treturn ret\n\t\t\n@mt\ndef slv(*args): \n\t\n\t\n\t\n\tif max(L) < sum(L) - max(L):\n\t\tans = 'Yes'\n\telse:\n\t\tans = 'No'\n\t\n\t\n\treturn ans\n\nif __name__ == '__main__':\n\t\n\t\n\tt = '''4\n3 8 5 1'''.splitlines()\n\t\n\t\n\t\n\t\n\tN = read_int()\n\tL = read_int()\n\t\n\t\n\t\t\n\t\n\t\n\t\n\tprint(slv(N, L))\n\t\n\t", "\n# import heapq\n# import math\n# import random\n# from collections import Counter, defaultdict, deque\n# from decimal import Decimal\n# from functools import lru_cache, reduce\n# from itertools import combinations, combinations_with_replacement, product, permutations\n# from operator import add, mul, sub, itemgetter\n# import numpy as np\n\nimport sys\nsys.setrecursionlimit(10000)\n\ndef error_print(*args):\n\tprint(*args, file=sys.stderr)\n\ndef mt(f):\n\timport time\n\tdef wrap(*args, **kwargs):\n\t\ts = time.time()\n\t\tret = f(*args, **kwargs)\n\t\te = time.time()\n\t\terror_print(e - s, 'sec')\n\t\treturn ret\n\treturn wrap\n\ndef read_int(input=None):\n\tif input == None:\n\t\tinput = sys.stdin.readline().strip()\n\tret = [int(x) for x in input.split()]\n\tif len(ret) == 1:\n\t\tret = ret[0]\n\treturn ret\n\ndef read_float(input):\n\tif input == None:\n\t\tinput = sys.stdin.readline().strip()\n\tret = [float(x) for x in input.split()]\n\tif len(ret) == 1:\n\t\tret = ret[0]\n\treturn ret\n\t\ndef read_str(input):\n\tif input == None:\n\t\tinput = sys.stdin.readline().strip()\n\tret = [x for x in input.split()]\n\tif len(ret) == 1:\n\t\tret = ret[0]\n\treturn ret\n\t\t\n@mt\ndef slv(*args): \n\t\n\t\n\t\n\tif max(L) < sum(L) - max(L):\n\t\tans = 'Yes'\n\telse:\n\t\tans = 'No'\n\t\n\t\n\treturn ans\n\nif __name__ == '__main__':\n\t\n\t\n\tt = '''4\n3 8 5 1'''.splitlines()\n\t\n\t\n\t\n\t\n\tN = read_int()\n\tL = read_int()\n\t\n\t\n\t\t\n\t\n\t\n\t\n\tprint(slv(N, L))\n\t\n\t"]
['Runtime Error', 'Accepted']
['s665123362', 's289898477']
[3064.0, 3064.0]
[18.0, 18.0]
[1521, 1526]
p03136
u819529201
2,000
1,048,576
Determine if an N-sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane. You can use the following theorem: **Theorem** : an N-sided polygon satisfying the condition can be drawn if and only if the longest side is strictly shorter than the sum of the lengths of the other N-1 sides.
["N = int(input())\nL = [int(input()) for L in range(N)]\nif max(L) < sum(L) - max(L):\n print('Yes')\nelse:\n print('No')", "N = int(input())\nL = [int(input()) for i in range(N)]\nif max(i) < sum(i) - max(i):\n print('Yes')\nelse:\n print('No')", "N = int(input())\nL = [int(input()) for i in range(N)]\nif max(L) < sum(L) - max(L):\n print('Yes')\nelse:\n print('No')", "N = int(input())\nL = [int(input()) for L in range(N)]\nif max(L) < (sum(L) - max(L)):\n print('Yes')\nelse:\n print('No')", "N = int(input())\nL = [int(input()) for L in range(N-1)]\nif max(L) < (sum(L) - max(L)):\n print('Yes')\nelse:\n print('No')", "N = int(input())\nL = [for i in range(N-1)]\nif max(i) < sum(i) - max(i):\n print('Yes')\nelse:\n print('No')", "N = int(input())\nL = [int(input()) for i in range(N-1)]\nif max(L) < sum(L) - max(L):\n print('Yes')\nelse:\n print('No')", "N = int(input())\nL = list(map(int,input().split()))\nif max(L) < (sum(L) - max(L)):\n print('Yes')\nelse:\n print('No')"]
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s014873824', 's029052515', 's128860032', 's163842784', 's271195938', 's424178676', 's844696736', 's850600740']
[3056.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0]
[17.0, 18.0, 17.0, 18.0, 20.0, 18.0, 17.0, 19.0]
[121, 121, 121, 123, 125, 110, 123, 121]
p03136
u819593641
2,000
1,048,576
Determine if an N-sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane. You can use the following theorem: **Theorem** : an N-sided polygon satisfying the condition can be drawn if and only if the longest side is strictly shorter than the sum of the lengths of the other N-1 sides.
["N = int(input())\nL = list(map(int, input().split()))\nmaxL = max(L)\nL.pop(maxL)\nif maxL > sum(L):\n print('Yes')\nelse:\n print('No')", "import numpy as np\n\n\nN = int(input())\nL = list(map(int, input().split()))\nmaxL = max(L)\nargmaxL = np.argmax(L)\nL.pop(argmaxL)\nif maxL < sum(L):\n print('Yes')\nelse:\n print('No')"]
['Runtime Error', 'Accepted']
['s537411588', 's323682410']
[3068.0, 18640.0]
[18.0, 274.0]
[131, 178]
p03136
u821084099
2,000
1,048,576
Determine if an N-sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane. You can use the following theorem: **Theorem** : an N-sided polygon satisfying the condition can be drawn if and only if the longest side is strictly shorter than the sum of the lengths of the other N-1 sides.
['N = input()\na = list(map(int, input().split()))\namax = max(a)\na.pop(amax)\nsum = 0\nfor i in a:\n sum += i\nif amax < sum:\n print("Yes")\nelse:\n print("No")', 'N = input()\na = list(map(int, input().split()))\namax = max(a)\na.remove(amax)\nsum = 0\nfor i in a:\n sum += i\nif amax < sum:\n print("Yes")\nelse:\n print("No")\n']
['Runtime Error', 'Accepted']
['s921325444', 's898801264']
[3060.0, 2940.0]
[18.0, 18.0]
[154, 158]
p03136
u821432765
2,000
1,048,576
Determine if an N-sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane. You can use the following theorem: **Theorem** : an N-sided polygon satisfying the condition can be drawn if and only if the longest side is strictly shorter than the sum of the lengths of the other N-1 sides.
['n=int(input())\nl=list(map(int, input().split()))\nm=pop(max(l))\nprint("Yes" if m < sum(l) else "No")', 'N = int(input())\nL = list(map(int, input().split()))\nprint("Yes" if pop(index(max(L))) < sum(L) else "No")', 'n=int(input())\nl=list(map(int, input().split()))\nprint("Yes" if max(l) < sum(l)-max(l) else "No")']
['Runtime Error', 'Runtime Error', 'Accepted']
['s677180768', 's715685093', 's443764359']
[2940.0, 2940.0, 2940.0]
[17.0, 19.0, 17.0]
[99, 106, 97]
p03136
u825027400
2,000
1,048,576
Determine if an N-sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane. You can use the following theorem: **Theorem** : an N-sided polygon satisfying the condition can be drawn if and only if the longest side is strictly shorter than the sum of the lengths of the other N-1 sides.
['N = int(input())\nl_list = list(map(int, input().split()))\n\nmax_len = max(l_list)\nother_total = sum(l_list) - max_len\n\nif max_len < other_total:\n print("YES")\nelse:\n print("NO")\n', 'N = int(input())\nl_list = list(map(int, input().split()))\n\nmax_len = max(l_list)\nother_total = sum(l_list) - max_len\n\nif max_len < other_total:\n print("Yes")\nelse:\n print("No")\n']
['Wrong Answer', 'Accepted']
['s655084356', 's574468987']
[2940.0, 2940.0]
[17.0, 18.0]
[183, 183]
p03136
u827141374
2,000
1,048,576
Determine if an N-sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane. You can use the following theorem: **Theorem** : an N-sided polygon satisfying the condition can be drawn if and only if the longest side is strictly shorter than the sum of the lengths of the other N-1 sides.
['N = int(input())\nL = (int(x) for x in input().split())\n\nlongest = max(L)\nothers = sum(L) - longest\nif longest < others:\n print("Yes")\nelse:\n print("No")\n', 'def test():\n N = int(input())\n L = list(int(x) for x in input().split())\n longest = max(L)\n others = sum(L) - longest\n if longest < others:\n print("Yes")\n else:\n print("No")\ntest()\n\n']
['Wrong Answer', 'Accepted']
['s081385749', 's213600466']
[2940.0, 2940.0]
[17.0, 17.0]
[155, 214]
p03136
u829369995
2,000
1,048,576
Determine if an N-sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane. You can use the following theorem: **Theorem** : an N-sided polygon satisfying the condition can be drawn if and only if the longest side is strictly shorter than the sum of the lengths of the other N-1 sides.
['a = input()\nb = input().split()\nb = [int(n) for n in b]\nb = sorted(b)\nm = b.pop(-1)\nif m < sum(b):\n print("YES")\nelse:\n print("NO")', 'a = input()\nb = input().split()\nb = [int(n) for n in b]\nb = sorted(b)\nm = b.pop(-1)\nif m < sum(b):\n print("Yes")\nelse:\n print("No")']
['Wrong Answer', 'Accepted']
['s981025694', 's536967118']
[2940.0, 3060.0]
[17.0, 17.0]
[133, 133]
p03136
u829411282
2,000
1,048,576
Determine if an N-sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane. You can use the following theorem: **Theorem** : an N-sided polygon satisfying the condition can be drawn if and only if the longest side is strictly shorter than the sum of the lengths of the other N-1 sides.
['a= int(input())\nb=list(map(int,input().split()))\nc=max(b)\nif sum(b)-c<c:\n print("YES")\nelse:\n print("NO")', 'a= int(input())\nb=list(map(int,input().split()))\nc=max(b)\nif sum(b)-c>c:\n print("YES")\nelse:\n print("NO")', 'a= int(input())\nb=list(map(int,input().split()))\nc=max(b)\nif c<sum(b)-c:\n print("Yes")\nelse:\n print("No")']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s886371250', 's951568392', 's773501814']
[2940.0, 2940.0, 2940.0]
[17.0, 18.0, 18.0]
[117, 117, 117]
p03136
u834153484
2,000
1,048,576
Determine if an N-sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane. You can use the following theorem: **Theorem** : an N-sided polygon satisfying the condition can be drawn if and only if the longest side is strictly shorter than the sum of the lengths of the other N-1 sides.
["n = int(input())\nL = list(map(int, input().split()))\nnagai = int(max(L))\nwa = int(sum(L))\nif nagai > wa - nagai:\n print('Yes')\nelif nagai <= wa - nagai:\n print('No')\n", "n = int(input())\nL = list(map(int, input().split()))\nnagai = max(L)\nif nagai > sum(L)\n print('Yes')\n else\n print('No')", "n = int(input())\nL = list(map(int, input().split()))\nnagai = int(max(L))\nwa = int(sum(L))\nif nagai > wa - nagai:\n print('Yes')\nelse:\n print('No')\n", "n = int(input())\nL = list(map(int, input().split()))\nnagai = int(max(L))\nwa = int(sum(L))\nif nagai < wa - nagai:\n print('Yes')\nelse:\n print('No')\n"]
['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s096364768', 's117425632', 's303648717', 's469925339']
[2940.0, 2940.0, 2940.0, 2940.0]
[17.0, 19.0, 17.0, 17.0]
[170, 122, 150, 150]
p03136
u841568901
2,000
1,048,576
Determine if an N-sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane. You can use the following theorem: **Theorem** : an N-sided polygon satisfying the condition can be drawn if and only if the longest side is strictly shorter than the sum of the lengths of the other N-1 sides.
['input()\nL = map(int, input().split())\nprint("Yes" if sum(L)>2*max(L) else "No")', 'N = int(input())\nL = sorted(map(int, input().split()))\nprint("Yes" if sum(L[:-1])>L[-1] else "No")']
['Runtime Error', 'Accepted']
['s543575771', 's073938969']
[2940.0, 9096.0]
[18.0, 31.0]
[79, 98]
p03136
u850200768
2,000
1,048,576
Determine if an N-sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane. You can use the following theorem: **Theorem** : an N-sided polygon satisfying the condition can be drawn if and only if the longest side is strictly shorter than the sum of the lengths of the other N-1 sides.
["_ = input()\n\nnums = [int(x) for x in input().split()]\n\nmax_ = max(nums)\n\npop(nums.index(max_))\n\nrest = sum(nums)\n\nif rest > max_:\n print('Yes')\nelse:\n print('No')", "_ = input()\n\nnums = [int(x) for x in input().split()]\n\nmax_ = max(nums)\n\nnums.pop(nums.index(max_))\n\nrest = sum(nums)\n\nif rest > max_:\n print('Yes')\nelse:\n print('No')"]
['Runtime Error', 'Accepted']
['s732025340', 's953674703']
[3060.0, 2940.0]
[17.0, 17.0]
[168, 173]
p03136
u852038767
2,000
1,048,576
Determine if an N-sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane. You can use the following theorem: **Theorem** : an N-sided polygon satisfying the condition can be drawn if and only if the longest side is strictly shorter than the sum of the lengths of the other N-1 sides.
['n = int(input())\nli = list(map(int,input().split()))\n\nfor i in range(n):\n sum += li[i]\n\njudge = sum - max(li) -max(li)\n\nif judge > 0:\n print("Yes")\nelse:\n print("No")', 'n = int(input())\nli = list(map(int,input().split()))\nmaxli = max(li)\njudge = np.sum(li) - maxli - maxli\nif judge > 0:\n print("Yes")\nelse:\n print("No")', 'n = int(input())\nlis = [input() for _ in range(n)]\n\nfor i in range(n):\n sum += lis[i]\n\njudge = sum - max(lis) - max(lis)\n\nif judge > 0:\n print("Yes")\nelse:\n print("No")', 'n = int(input())\nlis = list(map(int, input().split()))\n\nsum = 0\n\nfor i in range(n):\n sum = sum + lis[i]\n\njudge = sum - max(lis) - max(lis)\n\nif judge > 0:\n print("Yes")\nelse:\n print("No")']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s069632114', 's513440734', 's907353102', 's582958901']
[2940.0, 3060.0, 3060.0, 3060.0]
[18.0, 17.0, 17.0, 17.0]
[175, 156, 177, 195]
p03136
u858428199
2,000
1,048,576
Determine if an N-sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane. You can use the following theorem: **Theorem** : an N-sided polygon satisfying the condition can be drawn if and only if the longest side is strictly shorter than the sum of the lengths of the other N-1 sides.
['import numpy as np\n\n\nn = input()\na = list(int(i) for i in input().split()) \narg = np.argmax(a)\nmax_a = a[arg]\na = np.delete(a,arg)\nif np.sum(a) < max_a:\n print("Yes")\nelse:\n print("No")', 'import numpy as np\n\n\nn = input()\na = list(int(i) for i in input().split()) \narg = np.argmax(a)\nmax_a = a[arg]\na = np.delete(a,arg)\nif np.sum(a) >max_a:\n print("Yes")\nelse:\n print("No")']
['Wrong Answer', 'Accepted']
['s203062610', 's917779463']
[12388.0, 21648.0]
[153.0, 349.0]
[192, 191]
p03136
u859897687
2,000
1,048,576
Determine if an N-sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane. You can use the following theorem: **Theorem** : an N-sided polygon satisfying the condition can be drawn if and only if the longest side is strictly shorter than the sum of the lengths of the other N-1 sides.
["n=int(input())\nl=[int(input()) for i in range(n)]\na=sun(l)\nans='Yes'\nfor i in l:\n if a-i<i:\n ans='No'\nprint(ans)", "n=int(input())\nl=list(map(int,input().split()))\na=sum(l)\nans='Yes'\nfor i in l:\n if a-i<=i:\n ans='No'\nprint(ans)"]
['Runtime Error', 'Accepted']
['s646301322', 's144299783']
[3060.0, 3060.0]
[18.0, 17.0]
[116, 115]
p03136
u860726004
2,000
1,048,576
Determine if an N-sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane. You can use the following theorem: **Theorem** : an N-sided polygon satisfying the condition can be drawn if and only if the longest side is strictly shorter than the sum of the lengths of the other N-1 sides.
['./ABC/117/abc117B.py', 'N = int(input())\nL = list(map(int, input().split()))\n\nx = max(L)\nL.remove(x)\nif x < sum(L):\n\tprint("Yes")\nelse:\n\tprint("No")\n']
['Runtime Error', 'Accepted']
['s265037403', 's489565192']
[2940.0, 2940.0]
[18.0, 17.0]
[20, 125]
p03136
u863397945
2,000
1,048,576
Determine if an N-sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane. You can use the following theorem: **Theorem** : an N-sided polygon satisfying the condition can be drawn if and only if the longest side is strictly shorter than the sum of the lengths of the other N-1 sides.
['n = int(input())\nl = list(map(int, input().split()))\n\nnl = sorted(l)\n\nfor i in range(n-1):\n\tother = 0 + n1[i]\n\nif other < nl[n-1]:\n print("Yes")\nelse:\n print("No")', 'N = int(input())\nL = sorted(list(map(int,input().split())))\n\nif L[-1] < sum(L[0:N-1]):\n print("Yes")\nelse:\n print("No")']
['Runtime Error', 'Accepted']
['s836372068', 's314969757']
[9112.0, 9148.0]
[27.0, 30.0]
[165, 125]
p03136
u865413330
2,000
1,048,576
Determine if an N-sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane. You can use the following theorem: **Theorem** : an N-sided polygon satisfying the condition can be drawn if and only if the longest side is strictly shorter than the sum of the lengths of the other N-1 sides.
['n = int(input())\nl = list(map(int, input().split()))\nl.sort()\nprint("Yes") if sum(l[:n]) < l[n] else print("No")', 'n = int(input())\nl = list(map(int, input().split()))\nl.sort()\nprint("Yes") if sum(l[:n-1]) > l[n-1] else print("No")']
['Runtime Error', 'Accepted']
['s011375405', 's208434168']
[2940.0, 2940.0]
[17.0, 17.0]
[112, 116]
p03136
u866369660
2,000
1,048,576
Determine if an N-sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane. You can use the following theorem: **Theorem** : an N-sided polygon satisfying the condition can be drawn if and only if the longest side is strictly shorter than the sum of the lengths of the other N-1 sides.
['N = int(input())\nL = list(map(int, input().split()))\n\nL.sort(reverse=True)\nmax_num = L.pop(0)\n\nif max_num < total(L):\n print("Yes")\nelse:\n print("No")\n', 'N = int(input())\nL = map(int, input().split())\n\nL.sort(reverse=True)\nmax_num = L.pop(0)\n\nif max_num < total(L):\n print("Yes")\nelse:\n print("No")', 'N = int(input())\nL = list(map(int, input().split()))\n\nL.sort(reverse=True)\nmax_num = L.pop(0)\n\nif max_num < sum(L):\n print("Yes")\nelse:\n print("No")']
['Runtime Error', 'Runtime Error', 'Accepted']
['s054452118', 's104316735', 's099004977']
[2940.0, 2940.0, 3060.0]
[17.0, 17.0, 17.0]
[153, 146, 150]
p03136
u868237899
2,000
1,048,576
Determine if an N-sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane. You can use the following theorem: **Theorem** : an N-sided polygon satisfying the condition can be drawn if and only if the longest side is strictly shorter than the sum of the lengths of the other N-1 sides.
['N = int(input())\nL = sorted(list(map(int, input().split())))\n\nif L[-N] > sum(L[0:N-1]):\n print("Yes")\nelse:\n print("No")\n', 'N = int(input())\nL = sorted(list(map(int, input().split())))\n\nif L[-1] < sum(L[0:N-1]):\n print("Yes")\nelse:\n print("No")\n']
['Wrong Answer', 'Accepted']
['s140908473', 's416765730']
[2940.0, 2940.0]
[17.0, 17.0]
[127, 127]
p03136
u868628468
2,000
1,048,576
Determine if an N-sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane. You can use the following theorem: **Theorem** : an N-sided polygon satisfying the condition can be drawn if and only if the longest side is strictly shorter than the sum of the lengths of the other N-1 sides.
["N = int(input())\nL = [int() for i in input().split()]\nbig = max(L)\nbig_index = L.index(big)\nL[big_index] = 0\na = sum(L)\nif a > big:\n print('Yes')\nelse:\n print('No')", "N = int(input())\nL = [int() for i in input().split()]\nif 2*max(L) < sum(L):\n print('Yes')\nelse:\n print('No')", "N = int(input())\nL = [int() for i in input().split()]\nbig = max(L)\nbig_index = L.index(big)\nL[big_index] = 0\nsum = sum(L)\nif sum > big:\n print('Yes')\nelse:\n print('No')", "N = int(input())\nL = [int() for i in input().split()]\nbig = max(L)\nbig_index = L.index(big)\nL[big_index] = 0\na = sum(L)\nif a > big:\n print('Yes')\nelse:\n print('No')", "N = int(input())\nL = [int(i) for i in input().split()]\nif 2*max(L) < sum(L):\n print('Yes')\nelse:\n print('No')"]
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s044645975', 's136106022', 's600780907', 's627735799', 's641993572']
[3060.0, 2940.0, 3060.0, 3060.0, 2940.0]
[18.0, 17.0, 17.0, 17.0, 17.0]
[170, 114, 174, 170, 115]
p03136
u870518235
2,000
1,048,576
Determine if an N-sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane. You can use the following theorem: **Theorem** : an N-sided polygon satisfying the condition can be drawn if and only if the longest side is strictly shorter than the sum of the lengths of the other N-1 sides.
['N = int(input())\nLs = map(int, input().split())\n\nsum = 0\n\nfor i in range(N):\n sum += Ls[i]\n\nif max(Ls)*2 < sum:\n print("Yes")\nelse:\n print("No")\n ', 'N = int(input())\nLs = list(map(int, input().split()))\n\nsum = 0\n\nfor i in range(N):\n sum += Ls[i]\n\nif max(Ls)*2 < sum:\n print("Yes")\nelse:\n print("No")\n \n']
['Runtime Error', 'Accepted']
['s346574044', 's298895110']
[2940.0, 2940.0]
[18.0, 17.0]
[158, 165]
p03136
u870575557
2,000
1,048,576
Determine if an N-sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane. You can use the following theorem: **Theorem** : an N-sided polygon satisfying the condition can be drawn if and only if the longest side is strictly shorter than the sum of the lengths of the other N-1 sides.
["n = int(input())\nl = list(map(int, input().split()))\nif sum(l)-max(l) > max(l):\n print('yes')\nelse:\n print('no')", "n = int(input())\nl = list(map(int, input().split()))\nif sum(l)-max(l) > max(l):\n print('Yes')\nelse:\n print('No')"]
['Wrong Answer', 'Accepted']
['s058513155', 's614104082']
[2940.0, 2940.0]
[17.0, 24.0]
[118, 118]
p03136
u877415670
2,000
1,048,576
Determine if an N-sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane. You can use the following theorem: **Theorem** : an N-sided polygon satisfying the condition can be drawn if and only if the longest side is strictly shorter than the sum of the lengths of the other N-1 sides.
['n=int(input())\na=list(map(int,input().split()))\na.sort(reverse=True)\nif a[0]<sum(a[1:]):\n print("Yes")\nelse:\n print("No")', 'n=int(input())\na=list(map(int,input().split()))\na.sort(reverse=True)\nif a[0]<sum(a[1:]):\n print("Yes")\nelse:\n print("No")\n']
['Runtime Error', 'Accepted']
['s947384430', 's901706157']
[3188.0, 3064.0]
[18.0, 17.0]
[125, 124]
p03136
u885899351
2,000
1,048,576
Determine if an N-sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane. You can use the following theorem: **Theorem** : an N-sided polygon satisfying the condition can be drawn if and only if the longest side is strictly shorter than the sum of the lengths of the other N-1 sides.
['n=input()\nl=list(map(int,input().split()))\nl.sort()\nx=l.pop(-1)\nprint("YES" if sum(l)>x else "NO")', 'n=input()\nl=list(map(int,input().split()))\nl.sort()\nx=l.pop(-1)\nprint("Yes" if sum(l)>x else "No")']
['Wrong Answer', 'Accepted']
['s542939633', 's132333917']
[2940.0, 2940.0]
[17.0, 17.0]
[98, 98]
p03136
u894265012
2,000
1,048,576
Determine if an N-sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane. You can use the following theorem: **Theorem** : an N-sided polygon satisfying the condition can be drawn if and only if the longest side is strictly shorter than the sum of the lengths of the other N-1 sides.
["N = int(input())\nL = list(map(int, input()))\nL_max = max(L)\nif sum(L) > 2*L_max:\n print('Yes')\nelse:\n print('No')", "N = int(input())\nL = list(map(int, input().split()))\nL_max = max(L)\nif sum(L) > 2*L_max:\n print('Yes')\nelse:\n print('No')\n\n"]
['Runtime Error', 'Accepted']
['s040280113', 's569814963']
[2940.0, 2940.0]
[18.0, 18.0]
[115, 125]
p03136
u902024288
2,000
1,048,576
Determine if an N-sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane. You can use the following theorem: **Theorem** : an N-sided polygon satisfying the condition can be drawn if and only if the longest side is strictly shorter than the sum of the lengths of the other N-1 sides.
["N = input()\nL = list(map(int,input().split()))\nMa1 = max(L)\nSu1 = sum(L)\nif Ma1 >= Su1 - Ma1:\n print('Yes')\nelse:\n print('No')", "N = input()\nL = list(map(int,input().split()))\nMa1 = max(L)\n\nSu1 = sum(L)\n\nhikaku = Su1 - Ma1\n\nif hikaku > ma1:\n print('Yes')\nelse:\n print('No')", "N = input()\nL = list(map(int,input().split()))\nMa1 = max(L)\n \nSu1 = sum(L)\n \nhikaku = Su1 - Ma1\n \nif hikaku > Ma1:\n print('Yes')\nelse:\n print('No')"]
['Wrong Answer', 'Runtime Error', 'Accepted']
['s105316502', 's605166924', 's620312395']
[2940.0, 2940.0, 3060.0]
[17.0, 17.0, 17.0]
[128, 146, 149]
p03136
u903596281
2,000
1,048,576
Determine if an N-sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane. You can use the following theorem: **Theorem** : an N-sided polygon satisfying the condition can be drawn if and only if the longest side is strictly shorter than the sum of the lengths of the other N-1 sides.
['N=int(input())\nl=list(map(int,input().split()))\nl.sort()\nif sum(l[:N-1])>l[-1]:\n print("YES")\nelse:\n print("NO")', 'N=int(input())\nl=list(map(int,input().split()))\nl.sort()\nif sum(l[:N-1])>l[-1]:\n print("Yes")\nelse:\n print("No")']
['Wrong Answer', 'Accepted']
['s942185364', 's158461917']
[2940.0, 2940.0]
[17.0, 17.0]
[114, 114]
p03136
u904804404
2,000
1,048,576
Determine if an N-sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane. You can use the following theorem: **Theorem** : an N-sided polygon satisfying the condition can be drawn if and only if the longest side is strictly shorter than the sum of the lengths of the other N-1 sides.
['input()\nL = list(map(int,input().split()))\nif max(L) > sum(L)-max(L):\n print("Yes")\nelse:\n print("No")', 'input()\nL = list(map(int,input().split()))\nif max(L) < sum(L)-max(L):\n print("Yes")\nelse:\n print("No")\n']
['Wrong Answer', 'Accepted']
['s854526849', 's026282407']
[2940.0, 2940.0]
[18.0, 18.0]
[104, 105]
p03136
u904995051
2,000
1,048,576
Determine if an N-sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane. You can use the following theorem: **Theorem** : an N-sided polygon satisfying the condition can be drawn if and only if the longest side is strictly shorter than the sum of the lengths of the other N-1 sides.
['#ABC117B\nn = int(input())\nl = [int(input()) for i in range(n)]\nprint("Yes" if max(l) >= (sum(l)-max(l)) else "No")', '#ABC117B\nn = int(input())\nl = [int(input()) for i in range(n)]\nprint("Yes" if max(l) >= sum(l)-max(l) else "No")', '#ABC117B\nn = int(input())\nl = list(map(int,input().split()))\nprint("Yes" if max(l) < (sum(l)-max(l)) else "No")']
['Runtime Error', 'Runtime Error', 'Accepted']
['s614014320', 's655485260', 's690206747']
[9152.0, 9100.0, 9144.0]
[25.0, 24.0, 27.0]
[114, 112, 111]
p03136
u905582793
2,000
1,048,576
Determine if an N-sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane. You can use the following theorem: **Theorem** : an N-sided polygon satisfying the condition can be drawn if and only if the longest side is strictly shorter than the sum of the lengths of the other N-1 sides.
['n = int(input())\na = list(map(int,input().split()))\na.sort()\nif a>2*a[-1]:\n print("Yes")\nelse:\n print("No")', 'n = int(input())\na = list(map(int,input().split()))\na.sort()\nif sum(a)>2*a[-1]:\n print("Yes")\nelse:\n print("No")']
['Runtime Error', 'Accepted']
['s124713175', 's287908508']
[2940.0, 2940.0]
[17.0, 18.0]
[109, 114]
p03136
u909102981
2,000
1,048,576
Determine if an N-sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane. You can use the following theorem: **Theorem** : an N-sided polygon satisfying the condition can be drawn if and only if the longest side is strictly shorter than the sum of the lengths of the other N-1 sides.
['i=input;i();l=i().split();print(max(l)*2<sum(l)and"Yes"or"No")', 'i=input;i();l=map(int,i().split());print(["No","Yes"][max(l)*2<sum(l)])', 'i=input;i();l=list(map(int,i().split()));print(["No","Yes"][max(l)*2<sum(l)])']
['Runtime Error', 'Wrong Answer', 'Accepted']
['s956760520', 's964074065', 's104275401']
[2940.0, 3064.0, 2940.0]
[17.0, 18.0, 17.0]
[62, 71, 77]
p03136
u909162870
2,000
1,048,576
Determine if an N-sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane. You can use the following theorem: **Theorem** : an N-sided polygon satisfying the condition can be drawn if and only if the longest side is strictly shorter than the sum of the lengths of the other N-1 sides.
['n = int(input())\nt = list(map(int, input().split()))\nif max(t) * 2 > sum(t):\n\tprint("Yes")\nelse:\n\tprint("No")', 'n = int(input())\nt = list(map(int, input().split()))\nif max(t) * 2 < sum(t):\n print("Yes")\nelse:\n print("No")']
['Wrong Answer', 'Accepted']
['s842088314', 's609254381']
[2940.0, 2940.0]
[18.0, 17.0]
[109, 115]
p03136
u909716307
2,000
1,048,576
Determine if an N-sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane. You can use the following theorem: **Theorem** : an N-sided polygon satisfying the condition can be drawn if and only if the longest side is strictly shorter than the sum of the lengths of the other N-1 sides.
['N=int(input())\nL = list(map(int,input().split()))\nif(max(L) < sum(L)-max(L)):\n print("YES")\nelse:\n print("NO")\n', "n=int(input())\nl=list(map(int,input().split()))\nprint('Yes'if max(l)<sum(l)-max(l) else 'No')\n"]
['Wrong Answer', 'Accepted']
['s461308418', 's892330630']
[2940.0, 2940.0]
[18.0, 17.0]
[117, 94]
p03136
u918123058
2,000
1,048,576
Determine if an N-sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane. You can use the following theorem: **Theorem** : an N-sided polygon satisfying the condition can be drawn if and only if the longest side is strictly shorter than the sum of the lengths of the other N-1 sides.
["n=int(input())\ns=list(input())\nk=int(input())\nans=''\nfor i in range(n):\n if s[i]==s[k]:\n ans+=s[i]\n else:\n ans+='*'\nprint(ans)", "n=int(input())\nli=list(map(int,input().split()))\nm=max(li)\nsum=0\nfor i in range(n):\n sum+=li[i]\nif m<sum-m:\n print('Yes')\nelse:\n print('No')"]
['Runtime Error', 'Accepted']
['s505509755', 's894381800']
[2940.0, 2940.0]
[17.0, 17.0]
[146, 149]
p03136
u923341003
2,000
1,048,576
Determine if an N-sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane. You can use the following theorem: **Theorem** : an N-sided polygon satisfying the condition can be drawn if and only if the longest side is strictly shorter than the sum of the lengths of the other N-1 sides.
["N=int(input())\nLs=list(map(int, input().split()))\nLs = sorted(Ls, reverse=True)\nLmax=Ls[0]\nLsum=0\nfor i in range(1,N):\n Lsum+=Ls[i]\nif Lmax < Lsum:\n print('YES')\nelse:\n print('NO')", "N=int(input())\nLs=list(map(int, input().split()))\nLs = sorted(Ls, reverse=True)\nLmax=Ls[0]\nLsum=0\nfor i in range(1,N):\n Lsum+=Ls[i]\nif Lmax < Lsum:\n print('Yes')\nelse:\n print('No')"]
['Wrong Answer', 'Accepted']
['s270859495', 's130931364']
[3060.0, 3060.0]
[17.0, 17.0]
[189, 189]
p03136
u929582923
2,000
1,048,576
Determine if an N-sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane. You can use the following theorem: **Theorem** : an N-sided polygon satisfying the condition can be drawn if and only if the longest side is strictly shorter than the sum of the lengths of the other N-1 sides.
['n = int(input())\nl = [int(input()) for i in range(n)]\nprint("Yes" if (sum(l) - max(l)) > max(l) else "No")', 'n = int(input())\nl = map(int,input().split())\nprint("Yes" if sum(l) - max(l) > max(l) else "No")', '\nn = int(input())\nl = [int(input()) for i in range(n)]\nprint("Yes" if sum(l) - max(l) > max(l) else "No")', 'n = int(input())\nl = list(map(int,input().split()))\nprint("Yes" if max(l) < sum(l) - max(l) else "No")']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s092245364', 's299902596', 's836783430', 's422146997']
[2940.0, 2940.0, 2940.0, 2940.0]
[18.0, 17.0, 17.0, 17.0]
[106, 96, 105, 102]
p03136
u932868243
2,000
1,048,576
Determine if an N-sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane. You can use the following theorem: **Theorem** : an N-sided polygon satisfying the condition can be drawn if and only if the longest side is strictly shorter than the sum of the lengths of the other N-1 sides.
["n=int(input())\nl=list(map(int,input().split()))\nm=max(list)\nlist.remove(m)\nprint('Yes' if m<sum(list) else 'No')", "n=int(input())\nl=list(map(int,input().split()))\nm=max(l)\nl.remove(m)\nprint('Yes' if m<sum(l) else 'No')"]
['Runtime Error', 'Accepted']
['s092206583', 's150097505']
[2940.0, 2940.0]
[18.0, 18.0]
[112, 103]
p03136
u935450383
2,000
1,048,576
Determine if an N-sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane. You can use the following theorem: **Theorem** : an N-sided polygon satisfying the condition can be drawn if and only if the longest side is strictly shorter than the sum of the lengths of the other N-1 sides.
['numN = int(input())\nargs = input()\n \nlines = list()\n \n \nfor i in range(numN):\n if i == numN - 1 :\n lines.append(int(args))\n break\n\n lines.append(int(args[0:args.find(" ")]))\n args = args[args.find(" ") + 1 :]\n \nlist_sorted = sorted(lines)\nmax_line = list_sorted[0]\n \nfor m in range(numN - 1):\n max_line = max_line - list_sorted[m+1]\n \nif max_line < 0 :\n print(\'yes\')\nelse:\n print(\'no\')\n', 'numN = int(input())\nargs = input()\n \nlines = list()\n \n \nfor i in range(numN):\n if i == numN - 1 :\n lines.append(int(args))\n break\n\n lines.append(int(args[0:args.find(" ")]))\n args = args[args.find(" ") + 1 :]\n \nlist_sorted = sorted(lines, reverse = True)\nmax_line = list_sorted[0]\n \nfor m in range(numN - 1):\n max_line = max_line - list_sorted[m+1]\n\nif max_line < 0 :\n print(\'yes\')\nelse:\n print(\'no\')', 'numN = int(input())\nargs = input()\n \nlines = list()\n \n \nfor i in range(numN):\n if i == numN - 1 :\n lines.append(int(args))\n break\n\n lines.append(int(args[0:args.find(" ")]))\n args = args[args.find(" ") + 1 :]\n \nlist_sorted = sorted(lines, reverse = True)\nmax_line = list_sorted[0]\n \nfor m in range(numN - 1):\n max_line = max_line - list_sorted[m+1]\n\nprint(max_line) \nif max_line < 0 :\n print(\'yes\')\nelse:\n print(\'no\')', 'numN = int(input())\nargs = input()\n \nlines = list()\n \n \nfor i in range(numN):\n if i == numN - 1 :\n lines.append(int(args))\n break\n\n lines.append(int(args[0:args.find(" ")]))\n args = args[args.find(" ") + 1 :]\n \nlist_sorted = sorted(lines, reverse = True)\nmax_line = list_sorted[0]\n \nfor m in range(numN - 1):\n max_line = max_line - list_sorted[m+1]\n\nprint(max_line) \nif max_line < 0 :\n print(\'yes\')\nelse:\n print(\'no\')', 'numN = int(input())\nargs = input()\n \nlines = list()\n \n \nfor i in range(numN):\n if i == numN - 1 :\n lines.append(int(args))\n break\n\n lines.append(int(args[0:args.find(" ")]))\n args = args[args.find(" ") + 1 :]\n \nlist_sorted = sorted(lines, reverse = True)\nmax_line = list_sorted[0]\n \nfor m in range(numN - 1):\n max_line = max_line - list_sorted[m+1]\n\nif max_line < 0 :\n print(\'yes\')\nelse:\n print(\'no\')\n', 'numN = int(input())\nargs = input()\n\nlines = list()\n\n\nfor i in range(numN):\n list.append(int(args[0:args.find(" ")]))\n\nlist_sorted = list.sorted\nmax_line = list_sorted[0]\n\nfor m in range(numN - 1)\n max_line = max_line - list_sorted[m+1]\n\nif max_line < 0 :\n print(yes)\nelse\n print(no)', 'numN = int(input())\nargs = input()\n \nlines = list()\n \n \nfor i in range(numN):\n if i == numN - 1 :\n lines.append(int(args))\n break\n\n lines.append(int(args[0:args.find(" ")]))\n args = args[args.find(" ") + 1 :]\n \nlist_sorted = sorted(lines, reverse = True)\nmax_line = list_sorted[0]\n \nfor m in range(numN - 1):\n max_line = max_line - list_sorted[m+1]\n\nif max_line < 0 :\n print(\'Yes\')\nelse:\n print(\'No\')']
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s054020134', 's143178411', 's336189178', 's541515274', 's777854892', 's905102003', 's368873507']
[3064.0, 3064.0, 3064.0, 3064.0, 3064.0, 2940.0, 3188.0]
[17.0, 17.0, 17.0, 17.0, 17.0, 17.0, 21.0]
[418, 432, 449, 449, 433, 294, 432]
p03136
u937529125
2,000
1,048,576
Determine if an N-sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane. You can use the following theorem: **Theorem** : an N-sided polygon satisfying the condition can be drawn if and only if the longest side is strictly shorter than the sum of the lengths of the other N-1 sides.
['n = int(input())\nnums = list(map(int, input().split()))\nnums.sort()\nif nums[n] < sum(nums[:n]):\n print("Yes")\nelse:\n print("No")', 'n = int(input())\nnums = list(map(int, input().split()))\nnums.sort()\nif nums[n-1] < sum(nums[:n-1]):\n print("Yes")\nelse:\n print("No")']
['Runtime Error', 'Accepted']
['s177084904', 's607583077']
[2940.0, 2940.0]
[17.0, 17.0]
[134, 138]
p03136
u939585142
2,000
1,048,576
Determine if an N-sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane. You can use the following theorem: **Theorem** : an N-sided polygon satisfying the condition can be drawn if and only if the longest side is strictly shorter than the sum of the lengths of the other N-1 sides.
['N = int(input())\nL = list(map(int,input().split()))\nL_copy = L.copy()\nmax = max(L)\nL_copy.pop(L.index(max))\n\nif max > sum(L_copy):\n print("Yes")\nelse:\n print("No")', 'N = int(input())\nL = list(map(int,input().split()))\nL_copy = L.copy()\nmax = max(L)\nL_copy.pop(L.index(min))\n\nif max > sum(L_copy):\n print("Yes")\nelse:\n print("No")\n', 'N = int(input())\nL = list(map(int,input().split()))\nL_copy = L.copy()\nMAX = max(L)\nL_copy.pop(L.index(MAX))\n\n\nif MAX < sum(L_copy):\n print("Yes")\nelse:\n print("No")']
['Wrong Answer', 'Runtime Error', 'Accepted']
['s731221368', 's993817203', 's393993340']
[2940.0, 2940.0, 3060.0]
[17.0, 17.0, 17.0]
[165, 166, 166]
p03136
u945460548
2,000
1,048,576
Determine if an N-sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane. You can use the following theorem: **Theorem** : an N-sided polygon satisfying the condition can be drawn if and only if the longest side is strictly shorter than the sum of the lengths of the other N-1 sides.
["N = int(input())\nL = input().split()\nL = [int(i) for i in L]\nL = sorted(L, reverse=True)\nhen = 0\n\nfor i in range(1, N):\n hen += L[i]\nif L[0] < hen:\n print('YES')\nelse:\n print('NO')", "N = int(input())\nL = input().split()\nL = [int(i) for i in L]\nL = sorted(L, reverse=True)\nhen = 0\n\nfor i in range(1, N):\n hen += L[i]\nif L[0] < hen:\n print('Yes')\nelse:\n print('No')"]
['Wrong Answer', 'Accepted']
['s123904451', 's587921312']
[3060.0, 3064.0]
[17.0, 17.0]
[189, 189]
p03136
u945945701
2,000
1,048,576
Determine if an N-sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane. You can use the following theorem: **Theorem** : an N-sided polygon satisfying the condition can be drawn if and only if the longest side is strictly shorter than the sum of the lengths of the other N-1 sides.
['size = int(input())\nsides = []\nfor _ in range(len):\n sides.append(int(input()))\nbig = max(sides)\ntogether = sum(sides)\nif(big < together):\n print("Yes")\nelse:\n print("No")', 'size = int(input())\nsides = input().split()\nss = []\nfor x in sides:\n ss.append(int(x))\nbig = max(ss)\ntogether = sum(ss)\nif(big < together-big):\n\tprint("Yes")\nelse:\n\tprint("No")\n']
['Runtime Error', 'Accepted']
['s676913475', 's969791238']
[3064.0, 2940.0]
[18.0, 18.0]
[174, 178]
p03136
u946424121
2,000
1,048,576
Determine if an N-sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane. You can use the following theorem: **Theorem** : an N-sided polygon satisfying the condition can be drawn if and only if the longest side is strictly shorter than the sum of the lengths of the other N-1 sides.
['N = int(input())\nl = list[]\n\nfor i in N:\n n = int(input())\n l.append(n)\n\nm = l.max()\nSUM = l.sum() - m\n\nif m > SUM:\n print("YES")\nelse:\n print("NO")\n', 'N = int(input())\nl = list()\n\nfor i in range(N):\n n = int(input())\n l.append(n)\n \nm = max(l)\nSUM = sum(l) - m\n \nif m > SUM:\n print("YES")\nelse:\n print("NO")', 'N = int(input())\nl = list()\n\nfor i in range(N):\n n = int(input())\n l.append(n)\n \nm = max(l)\nSUM = sum(l) - m\n \nif m > SUM:\n print("Yes")\nelse:\n print("No")', "N = int(input())\nl = list()\n\nfor i in range(N):\n n = int(input())\n l.append(n)\n \nm = max(l)\nSUM = sum(l) - m\n \nif m < SUM:\n print('Yes')\nelse:\n print('No')", 'N = int(input())\nl = list()\n\nfor i in range(N):\n n = int(input())\n l.append(n)\n \nm = max(l)\nSUM = sum(l) - m\n \nif m < SUM:\n print("Yes")\nelse:\n print("No")', "N = int(input())\nl = list(map(int, input().split()))\n\nm = max(l)\nSUM = sum(l) - m\n\nif m < SUM:\n print('Yes')\nelse:\n print('No')"]
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s226193550', 's479649894', 's550666222', 's830714289', 's878572182', 's456424823']
[2940.0, 2940.0, 2940.0, 3064.0, 2940.0, 2940.0]
[17.0, 18.0, 17.0, 18.0, 17.0, 18.0]
[153, 159, 159, 160, 159, 129]
p03136
u948524308
2,000
1,048,576
Determine if an N-sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane. You can use the following theorem: **Theorem** : an N-sided polygon satisfying the condition can be drawn if and only if the longest side is strictly shorter than the sum of the lengths of the other N-1 sides.
['N = int(input())\nL = list(map(int,input().split()))\n\ns = 0\nmaxL = 0\nmaxi = -1\n\nfor i in range(N):\n if L[i] > maxL:\n maxL = L[i]\n maxi = i\n \n else:\n s = s+L[i]\n\nif s > L[maxi]:\n print("Yes")\nelse:\n print("No")', 'N = int(input())\nL = list(map(int,input().split()))\n\ns = 0\nmaxL = 0\n\nfor i in range(N):\n if L[i] > maxL:\n maxL = L[i]\n \n \n s = s+L[i]\n\n\nif s-maxL > maxL:\n print("Yes")\nelse:\n print("No")']
['Wrong Answer', 'Accepted']
['s233765206', 's957863621']
[3064.0, 3060.0]
[17.0, 17.0]
[245, 215]
p03136
u952708174
2,000
1,048,576
Determine if an N-sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane. You can use the following theorem: **Theorem** : an N-sided polygon satisfying the condition can be drawn if and only if the longest side is strictly shorter than the sum of the lengths of the other N-1 sides.
["N = int(input())\nL = [int(i) for i in input().split()]\n\nL.sort()\nans = 'YES' if sum(L[:N - 1]) > L[N - 1] else 'NO'\nprint(ans)", "N = int(input())\nL = [int(i) for i in input().split()]\n\nL.sort()\nans = 'Yes' if sum(L[:N - 1]) > L[N - 1] else 'No'\nprint(ans)\n"]
['Wrong Answer', 'Accepted']
['s586976957', 's131037182']
[2940.0, 2940.0]
[18.0, 18.0]
[126, 127]
p03136
u958612488
2,000
1,048,576
Determine if an N-sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane. You can use the following theorem: **Theorem** : an N-sided polygon satisfying the condition can be drawn if and only if the longest side is strictly shorter than the sum of the lengths of the other N-1 sides.
['n=int(input())\nt=list(map(int,input().split(" ")))\n\nt_max=max(t)\n\nj=0\nt_sum=0\nwhile j<=n-1:\n t_sum+=t[j]\n j+=1\n \nif t_sum>2*t_max:\n print("YES")\nelse:\n print("NO")', 'n=int(input())\nt=list(map(int,input().split(" ")))\n\nt_max=max(t)\n\nj=0\nt_sum=0\nwhile j<=n-1:\n t_sum+=t[j]\n j+=1\n \nif t_sum>2*t_max:\n print("Yes")\nelse:\n print("No")']
['Wrong Answer', 'Accepted']
['s953441523', 's616850782']
[3060.0, 3060.0]
[18.0, 18.0]
[182, 182]
p03136
u959651981
2,000
1,048,576
Determine if an N-sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane. You can use the following theorem: **Theorem** : an N-sided polygon satisfying the condition can be drawn if and only if the longest side is strictly shorter than the sum of the lengths of the other N-1 sides.
['n = int(input())\nl = list(int,input().split())\n\nl_max = max(l)\nif sum(l) - l_max > l_max:\n print("Yes")\nelse:\n print("No")', "N =int(input())\nL =[int(j) for j in input().split()]\nif max(L) < sum(L)-max(L):\n print('Yes')\nelse:\n print('No')\n"]
['Runtime Error', 'Accepted']
['s625809850', 's854013471']
[2940.0, 2940.0]
[18.0, 17.0]
[128, 119]
p03136
u961916328
2,000
1,048,576
Determine if an N-sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane. You can use the following theorem: **Theorem** : an N-sided polygon satisfying the condition can be drawn if and only if the longest side is strictly shorter than the sum of the lengths of the other N-1 sides.
['n = int(input())\na = input().split()\ni = 0\nwhile i < n:\n a[i] = int(a[i])\n i = i + 1 \n \ni = 0\nwhile i < n:\n j = i + 1\n while j < n:\n if a[i] < a[j]:\n temp = a[i]\n a[i] = a[j]\n a[j] = temp\n j = j + 1\n i = i + 1\n \nsums = sum(a)\nprint(a[0])\nif(sums - a[0] > a[0]):\n print("Yes")\nelse:\n print("No")', 'n = int(input())\na = input().split()\ni = 0\nwhile i < n:\n a[i] = int(a[i])\n i = i + 1 \n\ni = 0\nwhile i < n:\n j = i + 1\n while j < n:\n if a[i] < a[j]:\n temp = a[i]\n a[j] = a[i]\n a[j] = temp\n j = j + 1\n i = i + 1\n\nsum = sum(a)\nprint(a[0])\nif(sum-a[0] > a[0]):\n print("Yes")\nelse:\n print("No")', 'n = int(input())\na = input().split()\ni = 0\nwhile i < n:\n a[i] = int(a[i])\n i = i + 1 \n\ni = 0\nwhile i < n:\n j = i + 1\n while j < n:\n if a[i] < a[j]:\n temp = a[i]\n a[j] = a[i]\n a[i] = temp\n j = j + 1\n i = i + 1\n\nsum = sum(a)\nprint(a[0])\nif(sum-a[0] > a[0]):\n print("Yes")\nelse:\n print("No")', 'n = int(input())\na = input().split()\ni = 0\nwhile i < n:\n a[i] = int(a[i])\n i = i + 1 \n \ni = 0\nwhile i < n:\n j = i + 1\n while j < n:\n if a[i] < a[j]:\n temp = a[i]\n a[i] = a[j]\n a[j] = temp\n j = j + 1\n i = i + 1\n \nsums = sum(a)\n\nif(sums - a[0] > a[0]):\n print("Yes")\nelse:\n print("No")\nsum = sum(a)']
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s101210472', 's151174444', 's690607569', 's240497950']
[3064.0, 3064.0, 3064.0, 3064.0]
[19.0, 18.0, 18.0, 18.0]
[322, 316, 316, 324]
p03136
u977349332
2,000
1,048,576
Determine if an N-sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane. You can use the following theorem: **Theorem** : an N-sided polygon satisfying the condition can be drawn if and only if the longest side is strictly shorter than the sum of the lengths of the other N-1 sides.
["import numpy as np\nimport sys\n\nN = int(input())\nL = list(map(int, input().split()))\n\nif max(L) > sum(L) - max(L):\n\tprint('Yes')\nelse:\n\tprint('No')\n", "import numpy as np\nimport sys\n\nN = int(input())\nL = list(map(int, input().split()))\n\nif max(L) < sum(L) - max(L):\n\tprint('Yes')\nelse:\n\tprint('No')\n"]
['Wrong Answer', 'Accepted']
['s833563991', 's242790104']
[12508.0, 14552.0]
[151.0, 151.0]
[147, 147]
p03136
u979362546
2,000
1,048,576
Determine if an N-sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane. You can use the following theorem: **Theorem** : an N-sided polygon satisfying the condition can be drawn if and only if the longest side is strictly shorter than the sum of the lengths of the other N-1 sides.
['n = int(input)\nl = list(map(int, input().split()))\nx = max(l)\ns = sum(l)\nif x < (s-x):\n print("Yes")', 'n = int(input)\nl = list(map(int, input().split()))\nx = max(l)\ns = sum(l)\nif x < (s-x):\n print("Yes")\nelse:\n print("No")', 'n = int(input)\nl = list(map(int, input().split()))\nx = max(l)\ns = sum(l)\nif x < (s-x):\n print("Yes")\nelse:\n print("No")', 'n = int(input)\nl = list(map(int, input().split()))\n', 'n = int(input())\nl = list(map(int, input().split()))\nx = max(l)\ns = sum(l)\nif x < (s-x):\n print("Yes")\nelse:\n print("No")']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s114726706', 's299076268', 's730874969', 's804183385', 's247132573']
[2940.0, 2940.0, 2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0, 18.0, 17.0]
[103, 125, 125, 51, 127]
p03136
u982594421
2,000
1,048,576
Determine if an N-sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane. You can use the following theorem: **Theorem** : an N-sided polygon satisfying the condition can be drawn if and only if the longest side is strictly shorter than the sum of the lengths of the other N-1 sides.
["n = int(input())\ne = list(map(int, input().split))\nif max(e) < sum(e) - max(e):\n print('Yes')\nelse:\n print('No')\n", "n = int(input())\ne = list(map(int, input().split()))\nif max(e) < sum(e) - max(e):\n print('Yes')\nelse:\n print('No')\n"]
['Runtime Error', 'Accepted']
['s774931245', 's043432305']
[2940.0, 2940.0]
[17.0, 17.0]
[115, 117]
p03136
u987164499
2,000
1,048,576
Determine if an N-sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane. You can use the following theorem: **Theorem** : an N-sided polygon satisfying the condition can be drawn if and only if the longest side is strictly shorter than the sum of the lengths of the other N-1 sides.
['n = int(input())\nli = list(map(int,input().split()))\n\nli.sort()\n\nif sum(li[:-1]) > li[i]:\n print("Yes")\nelse:\n print("No")', 'n = int(input())\nli = list(map(int,input().split()))\n\nli.sort()\n\nif sum(li[:-1]) > li[-1]:\n print("Yes")\nelse:\n print("No")']
['Runtime Error', 'Accepted']
['s152888228', 's467564199']
[2940.0, 2940.0]
[17.0, 18.0]
[128, 129]
p03136
u987637902
2,000
1,048,576
Determine if an N-sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane. You can use the following theorem: **Theorem** : an N-sided polygon satisfying the condition can be drawn if and only if the longest side is strictly shorter than the sum of the lengths of the other N-1 sides.
['# B Polygon\nN = int(input())\nL = list(map(int, input().split()))\nmx = L.pop(L.index(max(L)))\nif mx > sum(L):\n print("Yes")\nelse:\n print("No")\npass\n', '# B Polygon\nN = int(input())\nL = list(map(int, input().split()))\nmx = L.pop(L.index(max(L)))\nif mx < sum(L):\n print("Yes")\nelse:\n print("No")\npass\n']
['Wrong Answer', 'Accepted']
['s410228982', 's300235047']
[9060.0, 8968.0]
[32.0, 29.0]
[153, 153]
p03136
u989348352
2,000
1,048,576
Determine if an N-sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane. You can use the following theorem: **Theorem** : an N-sided polygon satisfying the condition can be drawn if and only if the longest side is strictly shorter than the sum of the lengths of the other N-1 sides.
["# a,b=map(float,input().split())\n# print(a/b)\n\nN = int(input())\n# L = []\n#L = map(int, input().split())\nL = [int(i) for i in input().split()]\n#L.append(int(input()))\n\n# print(a/b)\nprint(L)\ns = sum(L)\nm = max(L)\n#f = 0\n#for x in L:\n\n# f = 1\n\nif (m < s - m):\n print('Yes')\nelse:\n print('No')\n ", "N = int(input())\n# L = []\n#L = map(int, input().split())\nL = [int(i) for i in input().split()]\n#L.append(int(input()))\n\n# print(a/b)\nprint(L)\ns = sum(L)\nm = max(L)\nprint(s)\nprint(m)\n#f = 0\n#for x in L:\n\n# f = 1\n\nif (m < s - m):\n print('Yes')\nelse:\n print('No')\n ", "N = int(input())\n# L = []\n#L = map(int, input().split())\nL = [int(i) for i in input().split()]\n#L.append(int(input()))\n\n# print(a/b)\nprint(L)\ns = sum(L)\nm = max(L)\n#f = 0\n#for x in L:\n\n# f = 1\n\nif (m < s):\n print('Yes')\nelse:\n print('No')", "N = int(input())\n# L = []\n\n# L = map(int, input().split())\n# = list(map(int, input().split()))\nL = [int(i) for i in input().split()]\n#L.append(int(input()))\n#s = 0\n#for x in L:\n \n#print(s)\n\n# print(a/b)\n#print(L)\ns = sum(L)\nm = max(L)\n#print(s)\n#print(m)\n#f = 0\n#for x in L:\n\n# f = 1\n\nif (m < s - m):\n print('Yes')\nelse:\n print('No')"]
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s240404112', 's439537694', 's624140770', 's020432858']
[2940.0, 3060.0, 2940.0, 2940.0]
[21.0, 17.0, 17.0, 20.0]
[326, 297, 270, 378]
p03136
u990670021
2,000
1,048,576
Determine if an N-sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane. You can use the following theorem: **Theorem** : an N-sided polygon satisfying the condition can be drawn if and only if the longest side is strictly shorter than the sum of the lengths of the other N-1 sides.
['s = [input() for i in range(2)]\nsides = [int(i) for i in s[1].split()]\nsides = sorted(sides,reverse=True)\nlong_side= sides.pop(0)\n\ntotal = 0\nfor side in sides:\n total += side\n \nif long_side < total:\n print("YES")\nelse:\n print("NO")', 's = [input() for i in range(2)]\nsides = [int(i) for i in s[1].split()]\nsides = sorted(sides,reverse=True)\nlong = sides.pop(0)\n\ntotal = 0\nfor side in sides:\n total += side\n \nif long < total:\n print("YES")\nelse:\n print("NO")', 's = [input() for i in range(2)]\nsides = [int(i) for i in s[1].split()]\nsides = sorted(sides,reverse=True)\nlong_side= sides.pop(0)\n\ntotal = 0\nfor side in sides:\n total += side\n \nif long_side < total:\n print("Yes")\nelse:\n print("No")']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s192621522', 's875833542', 's322403760']
[3060.0, 3064.0, 3060.0]
[17.0, 17.0, 17.0]
[235, 226, 235]
p03136
u992910889
2,000
1,048,576
Determine if an N-sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane. You can use the following theorem: **Theorem** : an N-sided polygon satisfying the condition can be drawn if and only if the longest side is strictly shorter than the sum of the lengths of the other N-1 sides.
["N=int(input())\nL=list(map(int,input().split()))\n\nfor i in range(N):\n if max(L)<sum(L)-max(L):\n print('Yes')\n else:\n print('No')", "N=int(input())\nL=list(map(int,input().split()))\n\nif max(L)<sum(L)-max(L):\n print('Yes')\nelse:\n print('No')"]
['Wrong Answer', 'Accepted']
['s278856307', 's901448582']
[2940.0, 2940.0]
[17.0, 18.0]
[147, 112]
p03136
u993090205
2,000
1,048,576
Determine if an N-sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane. You can use the following theorem: **Theorem** : an N-sided polygon satisfying the condition can be drawn if and only if the longest side is strictly shorter than the sum of the lengths of the other N-1 sides.
["n = int(input())\na = [int(e) for e in input().split()]\n\nprint('Yes' if max(a)>= sum([e for e in a]-max(a)) else 'No')", "n = int(input())\na = [int(e) for e in input().split()]\n\nans ='Yes' if max(a)>= sum([e for e in a]-max(a)) else 'No'\nprint(ans)", "n = int(input())\na = [int(e) for e in input().split()]\n\nans ='No' if max(a)>= sum([e for e in a])-max(a) else 'Yes'\nprint(ans)"]
['Runtime Error', 'Runtime Error', 'Accepted']
['s298654963', 's627975989', 's783940575']
[2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0]
[117, 126, 126]
p03136
u998262711
2,000
1,048,576
Determine if an N-sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane. You can use the following theorem: **Theorem** : an N-sided polygon satisfying the condition can be drawn if and only if the longest side is strictly shorter than the sum of the lengths of the other N-1 sides.
['N=int(input())\nli=list(map(int,input().split()))\nli.sort()\nif li.pop()>sum(li):\n print("Yes")\nelse:\n print("No")', 'N=int(input())\nli=list(map(int,input().split()))\nif 2*max(li)<sum(li):\n print("Yes")\nelse:\n print("No")']
['Wrong Answer', 'Accepted']
['s277329186', 's660483911']
[2940.0, 2940.0]
[18.0, 17.0]
[118, 109]
p03136
u998618379
2,000
1,048,576
Determine if an N-sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane. You can use the following theorem: **Theorem** : an N-sided polygon satisfying the condition can be drawn if and only if the longest side is strictly shorter than the sum of the lengths of the other N-1 sides.
['N = int(input())\nLs = input().split()\nfor i in range(N):\n Ls[i] = int(Ls[i])\nprint(Ls)\nmax_L = max(Ls)\nsum_others = sum(Ls) - max_L\nif max_L < sum_others:\n print("Yes")\nelse:\n print("No")', 'N = int(input())\nLs = input().split()\nfor i in range(N):\n Ls[i] = int(Ls[i])\nmax_L = max(Ls)\nsum_others = sum(Ls) - max_L\nif max_L < sum_others:\n print("Yes")\nelse:\n print("No")']
['Wrong Answer', 'Accepted']
['s405986691', 's775881611']
[3060.0, 2940.0]
[17.0, 17.0]
[196, 186]
p03136
u998733244
2,000
1,048,576
Determine if an N-sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane. You can use the following theorem: **Theorem** : an N-sided polygon satisfying the condition can be drawn if and only if the longest side is strictly shorter than the sum of the lengths of the other N-1 sides.
["N = int(input())\nL = [int(i) for i in input().split()]\n\nL = sorted(L)\n\nif L[len(L)-1] < sum(L[0:len(L)-1]):\n print('yes')\nelse:\n print('No')\n", "N = int(input())\nL = [int(i) for i in input().split()]\n\nL.sort()\nif L[N-1] < sum(L[0:N-1]):\n print('yes')\nelse:\n print('No')\n", "N = int(input())\nL = [int(i) for i in input().split()]\n\nif max(L) < sum(L)-max(L):\n print('yes')\nelse:\n print('No')\n", "N = int(input())\nL = [int(i) for i in input().split()]\n\nL.sort()\nif L[N-1] < sum(L[0:N-1]):\n print('Yes')\nelse:\n print('No')\n"]
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s114090338', 's153828000', 's411558223', 's897028220']
[2940.0, 2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0, 18.0]
[147, 131, 122, 131]
p03137
u006425112
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 \nn,m = map(int, input().split())\n\nX = np.array(list(map(int, input().split())))\n\nprint(X)\nX.sort()\nX = np.diff(X)\nX.sort()\nif n >= m:\n print(0)\nelse:\n print(X[:m-n].sum())', 'import numpy as np \nn,m = map(int, input().split())\n\nX = np.array(list(map(int, input().split())))\n\nX.sort()\nX = np.diff(X)\nX.sort()\nif n >= m:\n print(0)\nelse:\n print(X[:m-n].sum())']
['Wrong Answer', 'Accepted']
['s856773776', 's536238029']
[22948.0, 23056.0]
[189.0, 190.0]
[196, 187]
p03137
u013408661
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())\nline=list(map(int,input().split()))\nif n >= m:\n print(0)\nline.sort()\nstock=0\ndistance=[]\nfor i in line:\n stock=i\n distance.append(i-stock)\ndistance.pop(0)\nfor i in range(n-1):\n distance.pop(distance.index(max(distance)))\nans=0\nfor i in distance:\n ans+= i\nprint(ans)\n', 'n,m=map(int,input().split())\nline=list(map(int,input().split()))\nif n >= m:\n print(0)\nelse:\n line.sort()\n stock=0\n distance=[]\n for i in line:\n distance.append(i-stock)\n stock=i\n distance.pop(0)\n distance.sort()\n ans=0\n for i in range(m-n):\n ans+= distance[i]\n print(ans)']
['Runtime Error', 'Accepted']
['s680915627', 's173414149']
[13960.0, 13968.0]
[2104.0, 108.0]
[300, 290]
p03137
u013629972
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, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, copy, functools\nimport numpy as np\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\n\ndef main():\n N, M = LI()\n X = LI()\n # print(N, M, X)\n\n X.sort()\n # print(X)\n\n if N >= M:\n print(0)\n return\n if N == 1:\n \n print(X[-1] - X[0])\n return\n\n N_position_list = []\n \n X_diff = [X[i+1] - X[i] for i in range(len(X)-1)]\n order_idx = np.argsort(X_diff)\n # print(X_diff)\n \n \n count = 0\n torn_point = []\n \n while count < N - 1:\n max_idx = max(order_idx)\n order_idx = [i for i in order_idx if i != max_idx]\n torn_point.append(max_idx)\n X_diff[max_idx] = -10**5-1\n count += 1\n\n \n \n \n \n torn_list = []\n for i in range(len(torn_point)):\n if i == 0:\n torn_list.append(X[0:torn_point[i]+1])\n else:\n torn_list.append(X[torn_point[i-1]+1:torn_point[i]+1])\n else:\n torn_list.append(X[torn_point[-1]+1:])\n\n \n\n move_count = 0\n for l in torn_list:\n if len(l) >= 2:\n \n move_count += l[-1] - l[0]\n\n print(move_count)\n\n\nmain()\n', 'import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, copy, functools\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)]\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\nN, M = LI()\nX = LI()\nX = sorted(X)\nX_dist = []\nfor i in range(M-1):\n X_dist.append(abs(X[i] - X[i+1]))\n# print(X_dist)\nX_dist = sorted(X_dist, reverse=True)\nprint(sum(X_dist[N-1:]))\n']
['Wrong Answer', 'Accepted']
['s158482728', 's807232706']
[24248.0, 15668.0]
[2109.0, 148.0]
[2074, 891]
p03137
u015597249
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 sys\n\nfor line in sys.stdin:\n print(line)', "import sys\n\ninput = sys.stdin.readlines()\nN, M = map(int, input[0].strip().split(' '))\nXs = list(map(int, input[1].strip().split(' ')))\ns = sorted(Xs)\ngaps = [s[i+1]-s[i] for i in range(len(s)-1)]\nsgaps = sorted(gaps)\nif N>=M:\n print(0)\nelse:\n print(sum(sgaps[:(M-N)]))\n\n"]
['Wrong Answer', 'Accepted']
['s215032187', 's360260529']
[5108.0, 13828.0]
[19.0, 102.0]
[50, 277]
p03137
u016572066
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()))\na=list(map(int, input().split()))\na.sorted()\nd=[a[i+1]-a[i] for i in range(n-1)]\nd.sorted()\nprint(sum(d[:m-n]) if m>n else 0)', 'n,m = list(map(int, input().split()))\na=list(map(int, input().split()))\na.sorted()\nd=[a[i+1]-a[i] for i in range(n)]\nd.sorted()\nprint(sum(d[:m-n]) if m>n else 0)', 'n,m = list(map(int, input().split()))\na=list(map(int, input().split()))\na.sorted()\nd=[a[i+1]-a[i] for i in range(m-1)]\nd.sorted()\nprint(sum(d[:m-n]) if m>n else 0)', 'n,m = list(map(int, input().split()))\na=list(map(int, input().split()))\na.sort()\nd=[a[i+1]-a[i] for i in range(m-1)]\nd.sort()\nprint(sum(d[:m-n]) if m>n else 0)']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s074774875', 's156227326', 's813808856', 's047680130']
[13960.0, 13968.0, 13968.0, 13968.0]
[45.0, 40.0, 40.0, 100.0]
[163, 161, 163, 159]
p03137
u017063101
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()\nc=0\nl=[]\nif m==1 and x.length()==1:\n print("0")\nelse:\n for i in range(m-1):\n l.append(abs(x[i]-x[i+1]))\n l.sort()\n if range(len(l)-n+1)<=0:\n print("0")\n else:\n for i in range(len(l)-n+1):\n c+=l[i]\n print(c)', 'n,m=map(int,input().split())\nx=list(map(int,input().split()))\nx.sort()\nc=0\nfor i in range(n+1):\n c+=x[i]\nprint(c)', 'n,m=map(int,input().split())\nx=list(map(int,input().split()))\nx.sort()\nc=0\nl=[]\nfor i in range(m-1):\n l.append(abs(x[i]-x[i+1]))\nl.sort()\nif len(l)-n+1<=0:\n print("0")\nelse:\n for i in range(len(l)-n+1):\n c+=l[i]\n print(c)']
['Runtime Error', 'Runtime Error', 'Accepted']
['s019040196', 's409454000', 's061374488']
[13960.0, 13968.0, 13960.0]
[119.0, 93.0, 119.0]
[331, 116, 240]
p03137
u020390084
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 sys\nn, m = map(int,input().split())\n\nif n >= m:\n print(0)\n sys.exit()\n \nx = sorted(list(map(int,input().split())))\nprint(sum([x[i+1]-x[i] for i in range(len(x)-1)].sort(reverse = True)[n-1:]))\n', '#!/usr/bin/env python3\nimport sys\n\n\ndef solve(N: int, M: int, X: "List[int]"):\n x = sorted(X)\n x_dif = []\n for i in range(M-1):\n x_dif.append(x[i+1]-x[i])\n x_dif.sort(reverse=True)\n print(sum(x_dif[N-1:]))\n\n\n return\n\n\ndef main():\n def iterate_tokens():\n for line in sys.stdin:\n for word in line.split():\n yield word\n tokens = iterate_tokens()\n N = int(next(tokens)) # type: int\n M = int(next(tokens)) # type: int\n X = [int(next(tokens)) for _ in range(M)] # type: "List[int]"\n solve(N, M, X)\n\nif __name__ == \'__main__\':\n main()\n']
['Runtime Error', 'Accepted']
['s069193756', 's313481886']
[13968.0, 15796.0]
[100.0, 116.0]
[203, 610]
p03137
u020604402
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.
['diN, M = map(int,input().split())\nL = sorted(list(map(int,input().split())))\ndistance = []\nfor i in range(len(L)-1):\n distance.append(abs(L[i]-L[i+1]))\ndistance = sorted(distance)\nfor _ in range(N-1):\n if len(distance) > 0:\n del distance[-1]\n else:\n print(0)\n quit()\nprint(sum(distance))\n', 'N, M = map(int,input().split())\nL = sorted(list(map(int,input().split())))\ndistance = []\nfor i in range(len(L)-1):\n distance.append(abs(L[i]-L[i+1]))\ndistance = sorted(distance)\nfor _ in range(N-1):\n if len(distance) > 0:\n del distance[-1]\n else:\n print(0)\n quit()\nprint(sum(distance))\n']
['Runtime Error', 'Accepted']
['s357326595', 's053950336']
[13968.0, 13960.0]
[121.0, 133.0]
[318, 316]
p03137
u023229441
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=list(map(int,input().split()))\n\nB=[]\nfor i in range(m-1):\n B.append(abs(A[i+1]-A[i]))\nB.sort()\nprint(sum(B[:-n+1:]))\n', 'n,m=map(int,input().split())\nA=list(map(int,input().split()))\nA.sort()\nB=[]\nfor i in range(m-1):\n B.append(abs(A[i+1]-A[i]))\nB.sort()\nif n==1:\n print(sum(B))\n\nelse:\n print(sum(B[:-n+1:]))\n']
['Wrong Answer', 'Accepted']
['s870286969', 's985801694']
[13968.0, 13968.0]
[107.0, 116.0]
[149, 191]
p03137
u029785897
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())\n\nif (M <= N):\n print(0)\nelse:\n Xs = list(map(int, input().split()))\n Xs.sort()\n W = Xs[-1] - Xs[0]\n Ds = [Xs[i+1]-Xs[i] for i in range(M-1)]\n Ds.sort(reverse=True)\n\n gaps = 0\n print(Ds)\n for i in range(N-1):\n gaps += Ds[i]\n\n print(W-gaps)\n', 'N, M = map(int, input().split())\n\nif (M <= N):\n print(0)\nelse:\n Xs = list(map(int, input().split()))\n Xs.sort()\n W = Xs[-1] - Xs[0]\n Ds = [Xs[i+1]-Xs[i] for i in range(M-1)]\n Ds.sort(reverse=True)\n\n gaps = 0\n for i in range(N-1):\n gaps += Ds[i]\n\n print(W-gaps)']
['Wrong Answer', 'Accepted']
['s256378807', 's677992582']
[13968.0, 13968.0]
[121.0, 109.0]
[309, 294]
p03137
u033272694
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 itertools\nN,M = map(int,input().split())\nary1 = map(int,input().split())\nary2 = sorted(list(ary1))\n#print(list(itertools.combinations(range(1,M),N)))\nif N>=M:\n print(0)\nelif N==1:\n print(ary2[-1]-ary2[0])\nelse :\n iter1 = itertools.combinations(range(1,M),N)\n ans = 2*10**5+1\n dist = [2*10**5+1]*N\n for nlist1 in itertools.combinations(range(1,M),N-1):\n nlist2 = [0] + list(nlist1) +[M]\n print(nlist2)\n for i in range(N):\n dist[i] = ary2[nlist2[i+1]-1] - ary2[nlist2[i]]\n dist_sum = sum(dist)\n if dist_sum < ans:\n ans = dist_sum\n print(ans)\n', 'import itertools\nN,M = map(int,input().split())\nary1 = map(int,input().split())\nif N>=M:\n print(0)\nelse:\n ary2 = sorted(list(ary1))\n ary3 = ary2[1:]\n ary4 = ary2[:-1]\n d1 = ary2[M-1]-ary2[0]\n dist1 = sorted([i-j for i,j in zip(ary3,ary4)])[M-N:M]\n d2 = sum(dist1)\n print(d1-d2)']
['Wrong Answer', 'Accepted']
['s820093429', 's737879878']
[53020.0, 14336.0]
[2105.0, 103.0]
[580, 287]
p03137
u036340997
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 print(0)\nelse:\n x = sorted(list(map(int, input().split())))\n\n y = []\n for i in range(m-1):\n y.append(h[i+1] - h[i])\n\n y_sorted = sorted(y, reverse=True)\n\n ans = 0\n for _y in y[n:]:\n ans += _y\n print(ans)', 'n, m = map(int, input().split())\nx = sorted(list(map(int, input().split())))\n\nd = []\nfor i in range(m - 1):\n d.append(x[i+1] - x[i])\nd.sort()\n\nans = 0\nfor i in range(m - n):\n ans += d[i]\n \nprint(ans)']
['Runtime Error', 'Accepted']
['s080619298', 's775863040']
[13968.0, 13960.0]
[78.0, 115.0]
[262, 202]
p03137
u044459372
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)\nprint(x)\nsub=[]\nfor i in range(len(x)-1):\n\tsub.append(x[i+1]-x[i])\nsub=sorted(sub)\nprint(sub)\nprint(sum(sub[:-(n-1)]))', 'n,m=map(int,input().split())\nx=list(map(int,input().split()))\nx=sorted(x)\nsub=[]\nfor i in range(len(x)-1):\n\tsub.append(x[i+1]-x[i])\nsub=sorted(sub)\nif n==1:\n\tprint(sum(sub))\nelse:\n\tprint(sum(sub[:-(n-1)]))']
['Wrong Answer', 'Accepted']
['s990903841', 's876409353']
[13968.0, 13964.0]
[133.0, 112.0]
[192, 205]
p03137
u047023156
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 sys\nfrom collections import deque\n\n\ndiff = deque()\n\nN, M = map(int, input().split())\nX = list(map(int, input().split()))\n\nif N >= M:\n print(0)\n exit()\n\nX.sort()\n\nfor i in range(len(X)-1):\n diff.append(X[i+1]-X[i])\n\ndiff = list(diff)\ndiff.sort()\n\nprint(diff)\n\nfor i in range(N-1):\n diff.pop()\n\nprint(sum(diff))\n', 'import sys\n\ndiff = deque()\n\nN, M = map(int, input().split())\nX = list(map(int, input().split()))\ndiff = []\n\nif N >= M:\n print(0)\n exit()\n\nX.sort()\n\nfor i in range(len(X)-1):\n diff.append(X[i+1]-X[i])\n\ndiff.sort()\n\nfor i in range(N-1):\n diff.pop()\n\nprint(sum(diff))\n', 'import sys\n\ndiff = deque()\n\nN, M = map(int, input().split())\nX = list(map(int, input().split()))\n\nif N >= M:\n print(0)\n exit()\n\nX.sort()\n\nfor i in range(len(X)-1):\n diff.append(X[i+1]-X[i])\n\ndiff.sort()\n\nfor i in range(N-1):\n diff.pop()\n\nprint(sum(diff))\n', 'import sys\n\ndiff = []\n\nN, M = map(int, input().split())\nX = list(map(int, input().split()))\n\nif N >= M:\n print(0)\n exit()\n\nX.sort()\n\nfor i in range(len(X)-1):\n diff.append(X[i+1]-X[i])\n\ndiff.sort()\n\nfor i in range(N-1):\n diff.pop()\n\nprint(sum(diff))\n']
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted']
['s737669236', 's789818073', 's934119161', 's808591552']
[14216.0, 3060.0, 3064.0, 13968.0]
[131.0, 17.0, 17.0, 122.0]
[329, 277, 267, 262]
p03137
u047197186
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 \nn, m = input().split()\nxs_str = input().split()\nxs = list(map(int, xs_str))\nxs.sort()\n \nys = []\nfor x1, x2 in zip(xs[0:-1], xs[1:]):\n ys.append(abs(x2 - x1))\nys.sort()\n \nif len(ys) > n:\n out = sum(ys[0:-(n-1)])\nelse:\n out = 0\nprint(out)', '# - coding : utf-8 -*-\n \nn, m = input().split()\nxs_str = input().split()\nxs = [int(i) for i in input().split()]\nxs.sort()\n \nys = []\nfor x1, x2 in zip(xs[0:-1], xs[1:]):\n ys.append(abs(x2 - x1))\nys.sort()\n \nout = sum(ys[0:-(int(n)-1)])\nprint(out)', '# - coding : utf-8 -*-\n \nn, m = input().split()\nxs_str = input().split()\nxs = list(map(int, xs_str))\nxs.sort()\n \nys = []\nfor x1, x2 in zip(xs[0:-1], xs[1:]):\n ys.append(abs(x2 - x1))\nys.sort()\n \nif len(ys) >= n:\n out = sum(ys[0:-(n-1)])\nelse:\n out = 0\nprint(out)\n', '# - coding : utf-8 -*-\n \nn, m = input().split()\nxs_str = input().split()\nxs = list(map(int, xs_str))\nxs.sort()\n \nys = []\nfor i in range(int(m) - 1):\n ys.append(abs(xs[i+1] - xs[i])\nys.sort()\n \nout = sum(ys[0:-(int(n)-1)])\nprint(out)', '# - coding : utf-8 -*-\n \nn, m = input().split()\nxs_str = input().split()\nxs = list(map(int, xs_str))\nsortted(xs)\n \nys = []\nfor i in range(int(m) - 1):\n ys.append(abs(xs[i+1] - xs[i]))\nsorted(ys)\n \nout = sum(ys[0:-(int(n)-1)])\nprint(out)', '# - coding : utf-8 -*-\n \nn, m = map(int, input().split())\nxs = list(map(int, input().split()))\nsorted(xs)\n \nys = []\nfor i in range(m - 1):\n ys.append(xs[i+1] - xs[i])\nsorted(ys)\n\nout = sum(ys[0:-(n-1)])\nprint(out)', '# - coding : utf-8 -*-\n \nn, m = map(int, input().split())\nxs = list(map(int, input().split()))\nsorted(xs)\n \nys = []\nfor i in range(m - 1):\n ys.append(xs[i+1] - xs[i])\nsorted(ys)\n\nif len(ys) >= n:\n out = sum(ys[0:-(n-1)])\nelse:\n out = 0\nprint(out)', '# - coding : utf-8 -*-\n \nn, m = input().split()\nxs_str = input().split()\nxs = list(map(int, xs_str))\nsorted(xs)\n \nys = []\nfor i in range(int(m) - 1):\n ys.append(abs(xs[i+1] - xs[i]))\nsorted(ys)\n \nout = sum(ys[0:-(int(n)-1)])\nprint(out)', '# - coding : utf-8 -*-\n \nn, m = input().split()\nxs_str = input().split()\nxs = list(map(int, xs_str))\nsorted(xs)\n \nys = []\nfor i in range(int(m) - 1):\n ys.append(xs[i+1] - xs[i])\nsorted(ys)\n\nout = sum(ys[0:-(int(n)-1)])\nprint(out)', '# - coding : utf-8 -*-\n \nn, m = list(map(int, input().split()))\nxs_str = input().split()\nxs = list(map(int, xs_str))\nxs.sort()\n \nys = []\nfor x1, x2 in zip(xs[0:-1], xs[1:]):\n ys.append(abs(x2 - x1))\nys.sort()\n\nfor i in range(n - 1):\n if ys == []:\n break\n else:\n ys.pop()\nprint(sum(ys))']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s124747472', 's169675557', 's204104979', 's253531739', 's264990500', 's304762142', 's314989778', 's715945945', 's733941195', 's940586361']
[16272.0, 9988.0, 16272.0, 2940.0, 13960.0, 13968.0, 13968.0, 18424.0, 18432.0, 16272.0]
[112.0, 26.0, 111.0, 17.0, 46.0, 139.0, 137.0, 151.0, 138.0, 128.0]
[270, 248, 272, 235, 239, 216, 255, 238, 232, 308]
p03137
u048176319
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 print(0)\n exit()\n\nlx = sorted(list(map(int, input().split())))\n\nld = sorted([lx[i+1]-lx[i] for i in range(m-1)])\nif n == 1:\n print(sum(ld))\nelse:\n print(sum(ld[:-(n-1)]))\nprint(lx, ld)', 'n, m = map(int, input().split())\nif n >= m:\n print(0)\n exit()\n\nlx = sorted(list(map(int, input().split())))\n\nld = sorted([lx[i+1]-lx[i] for i in range(m-1)])\nif n == 1:\n print(sum(ld))\nelse:\n print(sum(ld[:-(n-1)]))']
['Wrong Answer', 'Accepted']
['s070754143', 's983666077']
[13968.0, 13960.0]
[119.0, 104.0]
[241, 227]
p03137
u055529891
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 = [0] * M\nX[0:M] = map(int, input().split())\nif N >= M:\n print(0)\nelse:\n Li = sorted(X)\n dff = [abs(X[i] - X[i - 1]) for i in range(1, M)]\n d = sorted(dff)\n out = sum(d[:M-N])\n print(out)', 'N, M = map(int, input().split())\nX = [0] * M\nX[0:M] = map(int, input().split())\nif N >= M:\n print(0)\nelse:\n Li = sorted(X)\n dff = [abs(Li[i] - Li[i - 1]) for i in range(1, M)]\n d = sorted(dff)\n print(sum(d[:M - N]))']
['Wrong Answer', 'Accepted']
['s851218753', 's539045510']
[14856.0, 14736.0]
[130.0, 106.0]
[240, 230]
p03137
u057109575
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())\n\ny = sorted([X[i + 1] - X[i] for i in range(len(X) - 1)])\nprint(sum(y[:-(N - 1)]))', 'N, M, *X = map(int, open(0).read().split())\nX.sort()\n\ny = sorted([X[i + 1] - X[i] for i in range(len(X) - 1)], reverse=True)\nprint(sum(y[N - 1:]))']
['Wrong Answer', 'Accepted']
['s627120802', 's436513551']
[13964.0, 13964.0]
[91.0, 99.0]
[126, 146]
p03137
u058861899
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())\n\nif n>=m:\n print(0)\n \nelse:\n li = sorted(list(map(int,input().split())),reverse=True)\n\n long=max(li)-min(li)\n dis=[li[i]-li[i+1] for i in range(m-1)]\n dis_sort=sorted(dis,reverse=True)\n print(sum(dis_sort[n:]))', 'n,m=map(int,input().split())\n\nli = sorted(list(map(int,input().split())),reverse=True)\nif n>=m:\n print(0)\n \nelse:\n long=max(li)-min(li)\n dis=[li[i]-li[i+1] for i in range(m-1)]\n dis_sort=sorted(dis,reverse=True)\n print(sum(dis_sort[n-1:]))']
['Wrong Answer', 'Accepted']
['s048733476', 's464619544']
[13968.0, 13968.0]
[108.0, 111.0]
[260, 257]
p03137
u072606168
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()]\ny = []\nfor i in range(len(x)-1):\n y.append(x[i]-x[i-1])\ny.sort()\nprint(sum(y[:n-1]))', 'n , m =map(int,input().split ())\nx = [int(i ) for i in input().split()]\ny = []\nfor i in range(m-1):\n y.append(x[i]-x[i-1])\ny.sort()\nprint(sum(y[:m-n+1]))', "n,m = map(int, input().split())\nx = [int(i) for i in input().split()]\nx.sort()\nx2 = []\nfor i in range(len(x)-1):\n x2.append(x[i+1] - x[i])\nx2.sort()\nif n < m:\n print(sum(x2[:len(x2) - n + 1]))\nelse:\n print('0')"]
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s948165485', 's997906389', 's987965687']
[13840.0, 13840.0, 13832.0]
[111.0, 108.0, 115.0]
[157, 154, 213]
p03137
u076512055
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()))\nans = 0\nif M-1-N < 0:\n pass\nelse:\n X.sort()\n dist = [X[i+1]-X[i] for i in range(M-1)]\n dist.sort()\n for i in range(M-1-N):\n ans += dist[i]\nprint(ans)', 'N, M = map(int, input().split())\nX = list(map(int, input().split()))\nans = 0\nif M-1-N <= 0:\n pass\nelse:\n X.sort()\n dist = [X[i+1]-X[i] for i in range(M-1)]\n dist.sort()\n for i in range(M-1-N):\n ans += dist[i]\nprint(ans)', 'N, M = map(int, input().split())\nX = list(map(int, input().split()))\nans = 0\nif (M-1)-(N-1) <= 0:\n pass\nelse:\n X.sort()\n dist = [X[i+1]-X[i] for i in range(M-1)]\n dist.sort()\n for i in range((M-1)-(N-1)):\n ans += dist[i]\nprint(ans)']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s312356602', 's737619535', 's945016650']
[13960.0, 13960.0, 13968.0]
[104.0, 105.0, 105.0]
[240, 241, 253]
p03137
u076917070
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 sys\ninput=sys.stdin.readline\nimport math\n\ndef main():\n N,_ = map(int, input().split())\n X = list(map(int, input().split()))\n X.sort()\n D = []\n for i in range(len(X)-1):\n D.append([i+1] - X[i])\n D.sort(reverse=True)\n D = D[math.ceil(N/2):]\n n = 0\n for d in D:\n n += d[1]\n print(n)\n\nif __name__ == '__main__':\n main()", "import sys\ninput=sys.stdin.readline\nimport math\n\ndef main():\n N,M = map(int, input().split())\n X = sorted(list(map(int, input().split())))\n D = sorted([X[i+1]-X[i] for i in range(M-1)], reverse=True)\n print(sum(D[N-1:]))\n\nif __name__ == '__main__':\n main()"]
['Runtime Error', 'Accepted']
['s928277224', 's773802486']
[13564.0, 13564.0]
[80.0, 101.0]
[369, 271]
p03137
u081688405
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 itertools import combinations\nn, m = map(int, input().split(" "))\nif n >= m:\n print(0)\nelse:\n ls = list(sorted(map(int, input().split(" "))))\n idxes = set( i for i in range(m-1) )\n routes = []\n for v in combinations(idxes, n-1):\n print(v)\n c = 0\n tmp = 0\n for i in v:\n tg = ls[tmp:i+1]\n c += tg[-1] - tg[0]\n tmp = i+1\n c += ls[-1] - ls[tmp]\n routes.append(c)\n print(min(routes))\n ', 'from itertools import combinations\nn, m = map(int, input().split(" "))\nif n >= m:\n print(0)\nelse:\n ls = list(sorted(map(int, input().split(" "))))\n total = ls[-1] - ls[0]\n sections = sorted([ls[i+1]-ls[i] for i in range(m-1)], reverse=True)\n print(total-sum(sections[:n-1]))\n \n']
['Wrong Answer', 'Accepted']
['s782555563', 's332926241']
[44284.0, 13696.0]
[2104.0, 106.0]
[425, 283]
p03137
u095756391
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()))\nans = 0\ndiff = []\n\nX.sort()\n\nfor i in range(M-1):\n dif = X[i+1] -X[i]\n diff.append(dif)\n \ndiff.sort()\n\nfor n in range(N):\n diff.pop(-1)\n\nfor i in range(len(diff)):\n ans += diff[i]\n', 'N, M = map(int, input().split())\nX = list(map(int, input().split()))\nans = 0\ndiff = []\n \nX.sort()\n \nfor i in range(M-1):\n dif = X[i+1] -X[i]\n diff.append(dif)\n \ndiff.sort()\n \nfor n in range(N):\n diff.pop(-1)\n \nfor i in range(len(diff)):\n ans += diff[i]\n\nprint(ans)', 'N, M = map(int, input().split())\nX = list(map(int, input().split()))\nans = 0\ndiff = []\n \nX.sort()\n \nfor i in range(M-1):\n dif = X[i+1] -X[i]\n diff.append(dif)\n \ndiff.sort()\n \nfor n in range(N):\n diff.pop(-1)\n \nfor i in range(len(diff)):\n ans += diff[i]\n\nprint(ans)', 'N, M = map(int, input().split())\nX = list(map(int, input().split()))\nans = 0\ndiff = []\n \nX.sort()\n\nif (N < M): \n for i in range(M-1):\n dif = X[i+1] -X[i]\n diff.append(dif)\n \n diff.sort()\n \n for n in range(N):\n diff.pop(-1)\n \n for i in range(len(diff)):\n ans += diff[i]\n\nprint(ans)', 'N, M = map(int, input().split())\nX = list(map(int, input().split()))\nans = 0\ndiff = []\n \nX.sort()\n \nfor i in range(M-1):\n dif = X[i+1] -X[i]\n diff.append(dif)\n \ndiff.sort()\n\nif (N < M):\n for n in range(N):\n diff.pop(-1)\n \n for i in range(len(diff)):\n ans += diff[i]\n\n print(ans)\nelse:\n print(ans)', 'N, M = map(int, input().split())\nX = list(map(int, input().split()))\nans = 0\ndiff = []\n \nX.sort()\n \nif (N < M): \n for i in range(M-1):\n dif = X[i+1] - X[i]\n diff.append(dif)\n \n diff.sort()\n \n for i in range(M-N):\n ans += diff[i]\n # for n in range(N):\n # diff.pop(-1)\n \n \n # ans += diff[i]\nprint(ans)']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s213115276', 's333185309', 's355295034', 's752808775', 's785205850', 's994044362']
[13968.0, 13960.0, 13968.0, 13964.0, 13968.0, 13960.0]
[130.0, 127.0, 128.0, 128.0, 130.0, 120.0]
[254, 269, 269, 297, 309, 385]
p03137
u104889915
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)\nelse:\n L=[X[i+1]-X[i] for i in range(M-1)]\n L.sort(reverse=True)\n s=sum([L[i] for i in range(N-1)])\n print(L)\n print(max(X)-min(X)-s)\n', 'N, M=map(int,input().split())\nX=list(map(int,input().split()))\nX.sort()\nif N>=M:\n print(0)\nelse:\n L=[X[i+1]-X[i] for i in range(M-1)]\n L.sort(reverse=True)\n s=sum([L[i] for i in range(N-1)])\n print(L)\n print(max(X)-min(X)-s)\n', 'N, M=map(int,input().split())\nX=list(map(int,input().split()))\nX.sort()\nif N>=M:\n print(0)\nelse:\n L=[X[i+1]-X[i] for i in range(M-1)]\n L.sort(reverse=True)\n s=sum([L[i] for i in range(N-1)])\n print(max(X)-min(X)-s)']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s411973702', 's861085643', 's449688331']
[13960.0, 13960.0, 13968.0]
[120.0, 123.0, 114.0]
[243, 243, 229]
p03137
u107269063
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 >= len(x):\n print(0)\n exit()\n\nl = []\nx.sort()\n \nfor i in range(m-1):\n diff = x[i+1] - x[i]\n ls.append(diff)\n\nl.sort(reverse=True)\nans = sum(ls)\n \nfor i in range(n-1):\n ans -= ls[i]\nprint(ans)', 'n, m = map(int, input().split())\nx = list(map(int, input().split()))\n \nif n >= len(x):\n print(0)\n exit()\nl = []\nx.sort()\n \nfor i in range(m-1):\n diff = x[i+1] - x[i]\n ls.append(diff)\nl.sort(reverse=True)\nans = sum(ls)\n \nfor i in range(n-1):\n ans -= ls[i]\nprint(ans)', 'n, m = map(int, input().split())\nx = list(map(int, input().split()))\n\nif n >= len(x):\n print(0)\n exit()\n\nls = []\nx.sort()\n\nfor i in range(m-1):\n diff = x[i+1] - x[i]\n ls.append(diff)\n\nls.sort(reverse=True)\nans = sum(ls)\n\nfor i in range(n-1):\n ans -= ls[i]\n\nprint(ans)']
['Runtime Error', 'Runtime Error', 'Accepted']
['s662680453', 's695777505', 's447489377']
[13960.0, 13964.0, 13960.0]
[78.0, 79.0, 126.0]
[282, 280, 282]
p03137
u113750443
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 nyu():\n N, M = map(int, input().split())\n X = list(map(int,input().split()))\n X.sort()\n return N,M,X\n\n\ndef kansu(N,M,X):\n\n x_abs = [X[m+1] -X[m] for m in range(M-1)] \n# print(x_abs)\n cnt_n = N\n \n while cnt_n-1 > 0:\n x_abs[x_abs.index(max(x_abs))] = -1\n cnt_n -= 1\n\n koma_max = 0\n sum = 0\n for m in range(M-1):\n if x_abs[m] == -1:\n sum =0\n continue\n else:\n sum += x_abs[m]\n if koma_max < sum:\n koma_max =sum\n print(koma_max)\n\n\n\n \n \n\n \n\n\nN,M,X = nyu()\n#print(X)\n\nif M == 1:\n print(0)\nelse:\n kansu(N,M,X)\n\n#print(S)\n\n', 'def nyu():\n N, M = map(int, input().split())\n X = list(map(int,input().split()))\n X.sort()\n return N,M,X\n\n\ndef kansu(N,M,X):\n\n x_abs = [X[m+1] -X[m] for m in range(M-1)] \n# print(x_abs)\n\n \n x_abs.sort()\n\n koma_max = 0\n for m in range(M-N):\n koma_max += x_abs[m]\n\n print(koma_max)\n\n\nN,M,X = nyu()\n#print(X)\n\nif M == 1:\n print(0)\nelse:\n kansu(N,M,X)\n\n#print(S)\n\n']
['Wrong Answer', 'Accepted']
['s820283296', 's892704540']
[14336.0, 13968.0]
[2104.0, 101.0]
[655, 409]
p03137
u113991073
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()))\ns=list(map(int,input().split()))\n\na.sort()\nterm=[]\nif n-m>=0:\n print(0)\nelse:\n for i in range(m-1):\n term.append(s[i+1]-s[i])\n \n term.sort()\n\n for i in range(n-1):\n del term[-1]\n \n print(sum(term))', 'n,m=list(map(int,input().split()))\ns=list(map(int,input().split()))\n\ns.sort()\nterm=[]\nif n-m>=0:\n print(0)\nelse:\n for i in range(m-1):\n term.append(s[i+1]-s[i])\n \n term.sort()\n\n for i in range(n-1):\n del term[-1]\n \n print(sum(term))']
['Runtime Error', 'Accepted']
['s978259266', 's740863328']
[13960.0, 13968.0]
[41.0, 117.0]
[267, 267]
p03137
u125205981
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 sys import stdin\n\ndef main():\n N, M = map(int, input().split())\n X = list(map(int, input().split()))\n\n if N >= M:\n print(0)\n return\n\n X.sort()\n n = [(i + 1, X[i+1] - X[i]) for i in range(M - 1)]\n n.sort(reverse=1, key=lambda x: x[1])\n ans, s1 = 0, 0\n for i in range(N - 1):\n s2 = n[i][0]\n ans += X[s1:s2][-1] - X[s1:s2][0]\n s1 = s2\n ans += X[s1:][-1] - X[s1:][0]\n print(ans)\n\ninput = lambda: stdin.readline()\nmain()\n', 'from sys import stdin\n\ndef main():\n N, M = map(int, input().split())\n X = list(map(int, input().split()))\n\n if N >= M:\n print(0)\n return\n\n X.sort()\n n1 = [(i + 1, X[i+1] - X[i]) for i in range(M - 1)]\n n1.sort(reverse=1, key=lambda x: x[1])\n n2 = n1[:N-1]\n n2.sort()\n\n ans, i = 0, 0\n for j, _ in n2:\n ans += X[i:j][-1] - X[i:j][0]\n i = j\n ans += X[i:][-1] - X[i:][0]\n print(ans)\n\ninput = lambda: stdin.readline()\nmain()\n']
['Wrong Answer', 'Accepted']
['s337442578', 's081551530']
[13308.0, 18752.0]
[42.0, 163.0]
[482, 484]