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 |
|---|---|---|---|---|---|---|---|---|---|---|
p03208 | u103208639 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['import sys\ninput=sys.stdin.readline\nn,k=map(int,input().split())\nh=[0]*n\nfor i in range(n):\n h[i]=int(input())\n\nans=10**9\nfor i in range(n-k):\n ans= min(h[i+k]-h[i], ans)\nprint(ans)\n', 'n,k =map(int,input().split())\nh=[0]*n\nfor i in range(n):\n h[i]=int(input())\nh.sort()\nans=10**9\nfor i in ra... | ['Wrong Answer', 'Accepted'] | ['s703845406', 's731966076'] | [6900.0, 7472.0] | [101.0, 257.0] | [188, 165] |
p03208 | u103902792 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ["n,k = map(int,input().split())\nH = [int(input()) for _ in range(n)]\nH.sort()\nans = float('inf')\n\nfor i in range(n-k+1):\n ans = min(H[i+k-1]-H[i])\nprint(ans)", "n,k = map(int,input().split())\nH = [int(input()) for _ in range(n)]\nH.sort()\nans = float('inf')\n\nfor i in range(n-k+1):\n ans = min(H[i+k-1]-H[i... | ['Runtime Error', 'Accepted'] | ['s965131612', 's717907034'] | [7384.0, 7384.0] | [206.0, 241.0] | [157, 164] |
p03208 | u106181248 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['n, k = map(int,input().split())\nh =[int(input()) for i in range(n)]\nh.sort()\nans = 100000000\n\nfor i in range(len(h)-k+1):\n if h[i+k-1] - h[i] < ans:\n ans = h[i+k-1] - h[i]\n if ans = 0:\n break\n\nprint(ans)', 'n, k = map(int,input().split())\nh =[int(input()) for i in range(n)]\nh.... | ['Runtime Error', 'Accepted'] | ['s621840313', 's955771325'] | [2940.0, 7384.0] | [17.0, 232.0] | [231, 236] |
p03208 | u112247039 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['n,k = map(int,input().split())\nh = sorted([int(input()) for _ in range(n)])\nprint(min(ans[j+k-1]-ans[j] for j in range(n-k+1)))', 'n,k = map(int,input().split())\nh = sorted([int(input()) for _ in range(n)])\nprint(min(h[j+k-1]-h[j] for j in range(n-k+1)))'] | ['Runtime Error', 'Accepted'] | ['s283040907', 's477117527'] | [14032.0, 14000.0] | [158.0, 173.0] | [127, 123] |
p03208 | u114366889 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['from collections import deque\n\nN,K = map(int,input().split())\nH_input = list()\nH = deque(maxlen=K)\ncount = 0\n\nfor i in range(N):\n H_input.append(int(input()))\nH_input.sort()\n\nfor h in H_input:\n if count <= K:\n H.append(h)\n else:\n if abs(H[0]-H[K]) >= abs(H[1]-h):\n H.a... | ['Wrong Answer', 'Accepted'] | ['s482083726', 's863801444'] | [8032.0, 7384.0] | [235.0, 249.0] | [347, 363] |
p03208 | u121879791 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['n,k=map(int,input().split())\nh=[]\nfor i in range(n):\n h.append(int(input()))\nh_sort=sorted(h)\nprint(min(h_sort[j+k-1]-h[j] for j in range(n-k+1)))', 'n,k=map(int,input().split())\nh=[]\nfor i in range(n):\n h.append(int(input()))\nh_sort=sorted(h)\nprint(min(h[j+k-1]-h[j] for j in range(n-k+1)))', 'n,k=map... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s057514809', 's227337216', 's191853196'] | [8280.0, 8280.0, 8280.0] | [242.0, 238.0, 234.0] | [149, 144, 154] |
p03208 | u123745130 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['n,k=map(int,input().split())\nlst=[int(input()) for _ in range(n)]\nlst=sorted(lst)\nab=lst[k-1]-lst[0]\ncd=lst[-1]-lst[-k]\nprint(ans=min(ab,cd))', 'n,k=map(int,input().split())\nlst=[int(input()) for _ in range(n)]\nlst=sorted(lst)\nans=float("inf")\nfor i in range(n+1-k):\n ans=min(ans,lst[k-1+i]-lst[i])\nprint(a... | ['Runtime Error', 'Accepted'] | ['s857012940', 's815817560'] | [8280.0, 8280.0] | [209.0, 248.0] | [141, 165] |
p03208 | u129836004 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['import collections\ndef c():\n n, k = map(int, input().split())\n h = []\n for i in range(n):\n h.append(int(input()))\n h.sort()\n d = collections.deque(maxlen = k)\n mins = []\n while len(d) < k:\n d.append(h.pop())\n while h:\n mins.append(d[k-1] - d[0])\n d.appe... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s278865548', 's502686305', 's380460785'] | [7984.0, 7988.0, 7988.0] | [234.0, 2104.0, 248.0] | [374, 280, 374] |
p03208 | u130900604 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['n,k=map(int,(input().split()))\nh=[int(input()) for i in range(n)]\n\nq=sorted(h)\nansList=[]\nfor c,d in zip(q,q[k-1:]):\n print(c,d)\n ansList.append(d-c)\n\nprint(min(ansList))', 'n,k=map(int,(input().split()))\nh=[int(input()) for i in range(n)]\n\nq=sorted(h)\nansList=[]\nfor c,d in zip(q,q[k-1:]):\n ansList.... | ['Wrong Answer', 'Accepted'] | ['s974328326', 's676592753'] | [14580.0, 12800.0] | [357.0, 237.0] | [172, 159] |
p03208 | u133936772 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['import sys\ninput = sys.stdin.readline\nn,k = map(int,input().split())\nl = sorted([int(input()) for _ in range(n)])\nprint(min(l[i+k]-l[i] for i in range(n-k+1))) ', 'n,k=map(int,input().split())\nl=sorted(int(input()) for _ in range(n))\na=10**9\nfor i in range(n-k+1):\n a=min(a,l[i+k-1]-l[i])\nprint(a)'] | ['Runtime Error', 'Accepted'] | ['s927277434', 's624889992'] | [8280.0, 13340.0] | [108.0, 187.0] | [160, 134] |
p03208 | u135116520 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['N,K=map(int,input().split())\nh=[int(input()) for i in range(N)]\nh=sorted(h)\nt=[]\nfor i in range(N-K+1):\n s=h[i+k-1]-h[i]\n t.append(s)\nprint(min(t))\n ', 'N,K=map(int,input().split())\nh=list(int(input()) for i in range(N))\nh=sorted(h)\nt=[]\nfor i in range(N-K+1):\n s=h[i+K-1]-h[i]\n t.append(s)\nprint(m... | ['Runtime Error', 'Accepted'] | ['s938553700', 's716839200'] | [8280.0, 10904.0] | [205.0, 251.0] | [152, 156] |
p03208 | u135197221 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['def main():\n n, k = Input()\n data = sorted(int(input()) for _ in range(n))\n print(min([data[i+k-1] - data[i] for i in range(n-k+1)]))\nmain()', 'def main():\n n, k = map(int, input().split(" "))\n data = sorted(int(input()) for _ in range(n))\n print(min([data[i+k-1] - data[i] for i in range(n-k+... | ['Runtime Error', 'Accepted'] | ['s802111509', 's926466388'] | [9036.0, 17116.0] | [24.0, 177.0] | [149, 170] |
p03208 | u136090046 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['n, k = input().split()\nprint(n, k)\nN = int(n)\nK = int(k)\n\nh_array = []\nfor i in range(N):\n tree = int(input())\n h_array.append(tree)\n\nh_array.sort()\n\n\nresult = float("inf")\n\nfor i in range(k - 1, N):\n result = min(result, h_array[i] - h_array[i - k + 1])\n\nprint(result)\n', 'n, k = input().s... | ['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s346062316', 's836162742', 's915584931', 's583559658'] | [7384.0, 7384.0, 7384.0, 7384.0] | [225.0, 262.0, 227.0, 259.0] | [379, 379, 366, 366] |
p03208 | u136395536 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['N,K = (int(i) for i in input().split())\n\nh = []\nfor i in range(N):\n H = int(input())\n h.append(H)\n\n\nh.sort()\nprint(h)\nsmallest = 10**9\n\nfor i in range(N-K+1):\n print(h[i+K-1],h[i])\n diff = h[i+K-1] - h[i]\n if diff < smallest:\n smallest = diff\n\nprint(smallest)', 'N,K = (int(i) f... | ['Wrong Answer', 'Accepted'] | ['s325331560', 's254715682'] | [10520.0, 11212.0] | [380.0, 251.0] | [281, 253] |
p03208 | u140191608 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['N , M = (map(int , input().split()))\ntree = []\nfor i in range(N):\n tree.append(int(input()))\nsort_tree = sorted(tree , reverse = True)\nprint(max(sort_tree[:M]) - min(sort_tree[:M]))', 'N , M = (map(int , input().split()))\ntree = []\nfor i in range(N):\n tree.append(int(input()))\nsort_tree = sorted(tree)\... | ['Wrong Answer', 'Accepted'] | ['s117071396', 's008158706'] | [8604.0, 12060.0] | [235.0, 245.0] | [184, 188] |
p03208 | u145600939 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ["h,n = map(int,input().split())\nh = [0]*n\nfor i in range(n):\n h[i] = int(input())\nh.sort()\nans = float('inf')\nfor i in range(n-k):\n ans = min(ans,abs(h[i+k-1]-h[i])\nprint(ans)\n", "n,k = map(int,input().split())\nh = [int(input()) for _ in range(n)]\nh.sort()\nans = float('inf')\nfor i in range(n-k+1):\n... | ['Runtime Error', 'Accepted'] | ['s001799920', 's580220042'] | [2940.0, 7384.0] | [17.0, 250.0] | [181, 162] |
p03208 | u153064216 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ["N, k = [int(s) for s in input().split(' ')]\n \nh = []\nwhile len(h) != N:\n heapq.heappush(h, int(input()))\n \nmin_height = 1000000000\nh.sort()\nfor start in range(0, N - k + 1):\n end = start + k - 1\n diff = h[end] - h[start]\n if diff < min_height:\n min_height = diff\nprint(min_height)", "i... | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s324047265', 's456214550', 's456473160', 's819559248', 's793938510'] | [3064.0, 18456.0, 18472.0, 3188.0, 7484.0] | [18.0, 329.0, 326.0, 19.0, 262.0] | [300, 222, 222, 210, 291] |
p03208 | u156931988 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['tree_num,choice_num = map(int,input().split())\ntree_list = sorted([int(input()) for _ in range(tree_num)])\nmi = 99999\nfor idx in range(tree_num-choice_num):\n cand = tree_list[idx+choice_num-1] - tree_list[idx]\n if cand < mi:\n mi = cand\nprint(cand)', 'tree_num,choice_num = map(int,input().split())\... | ['Wrong Answer', 'Accepted'] | ['s358198767', 's070051850'] | [8280.0, 8280.0] | [232.0, 230.0] | [260, 279] |
p03208 | u159335277 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['n, k = list(map(int, input().split()))\n\ntrees = []\nfor _ in range(0, n):\n trees.append(int(input()))\ntrees.sort()\ntrees.reverse()\nans = 100000000000\nfor i in range(0, n-k):\n ans = min(ans, trees[i] - trees[i+k-1])\nprint(ans)', 'n, k = list(map(int, input().split()))\n\ntrees = []\nfor _ in range(0, n):\n ... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s428952777', 's571188652', 's494755010'] | [7384.0, 7384.0, 7384.0] | [251.0, 225.0, 252.0] | [226, 159, 228] |
p03208 | u159994501 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['N, K = map(int,input().split())\na = 1000000000\nh = list(map(int, [input() for i in range(N)]))\nh.sort()\nprint(h)\nfor i in range(N-K+1):\n a = min(a, h[i+K-1]-h[i])\nprint(a)\n', 'N, K = map(int, input().split())\nh = sorted([int(input()) for _ in range(N)])\nans = float("inf")\nfor i in range(N - K + 1):\n ... | ['Wrong Answer', 'Accepted'] | ['s626952451', 's772513225'] | [14236.0, 8280.0] | [237.0, 246.0] | [175, 174] |
p03208 | u160244242 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['start = list(map(int, input().split()))\nn,k = start[0], start[1]\n\nlst = [int(input()) for i in range(n)]\n\nlst.sort()\nlst.reverse()\n\ndiff_lst = list()\nfor i in range(n-k+1):\n diff_lst.append(lst[i] - lst[i+k-1])\nmin(diff_lst)', 'start = list(map(int, input().split()))\nn,k = start[0], start[1]\n\nlst = [... | ['Wrong Answer', 'Accepted'] | ['s316374229', 's596789081'] | [11272.0, 11292.0] | [253.0, 242.0] | [227, 234] |
p03208 | u161442663 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['NK=int(input())\nListNK=NK.split() #ListNK[0]=N,[1]=K\nN=ListNK[0]\nK=ListNK[1]\nListh=[]\nListQ=[]\nfor i in range(0,N,1):\n hi=int(input())\n Listh.append(hi)\n\nListh.sort() \nfor i in range(0,N-K+1,1):\n Q=int(Listh[K+i-1]-Listh[i]) \n ListQ.append(Q)\nListQ.sort()\nprint(ListQ[0])\n', 'NK=int(input())\nListN... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s435585265', 's648919869', 's940583821'] | [3060.0, 3064.0, 11224.0] | [17.0, 17.0, 294.0] | [363, 371, 368] |
p03208 | u163320134 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['n,k=map(int,input().split())\narr=[int(input()) for _ in range(n)]\narr=sorted(arr)\nans=10**10\nfor i in range(n-k):\n ans=min(ans,arr[i+k]-arr[i])\nprint(ans)', 'n,k=map(int,input().split())\narr=[int(input()) for _ in range(n)]\narr=sorted(arr)\nans=10**10\nfor i in range(n-k):\n ans=min(ans,sum(arr[i:i+k]))\npr... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s392066337', 's733233039', 's666931868'] | [8280.0, 8280.0, 8280.0] | [249.0, 2104.0, 241.0] | [155, 155, 159] |
p03208 | u163421511 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['n, k = map(int, input().split())\nh = list(map(int, input().split()))\nh.sort()\n\nfor i in range(n-k+1):\n a = h[i+k-1]-h[i]\n ans = a if i == 0 else min(ans, a)\n\nprint(ans)\n', 'n, k = map(int, input().split())\nh = [int(i) for i in range(n)]\nh.sort()\n\nfor i in range(n-k+1):\n a = h[i+k-1]-h[i-1]\n ... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s533610169', 's700694143', 's774596518'] | [9072.0, 12916.0, 13216.0] | [27.0, 78.0, 191.0] | [175, 172, 176] |
p03208 | u163501259 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ["import sys\ninput = sys.stdin.readline\ndef main():\n N, K = map(int, input().split())\n h = [int(input()) for i in range(N)]\n H = sorted(h)\n ans = H[N-1] - H[N-K]\n print(ans)\n\nif __name__ == '__main__':\n main()", "import sys\ninput = sys.stdin.readline\ndef main():\n N, K = map(int, input(... | ['Wrong Answer', 'Accepted'] | ['s063553324', 's127047605'] | [8280.0, 8280.0] | [92.0, 112.0] | [225, 307] |
p03208 | u166621202 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['import random\n\nN,K = map(int,input().split())\nH = [int(input()) for _ in range(N) ]\n\ntmp = random.sample(H,K)\nscr = max(tmp) - min(tmp)\nprint(scr)\n', 'N,K = map(int,input().split())\nH = [int(input()) for _ in range(N) ]\nH.sort()\n\ntmp = [H[i+K-1]-H[i] for i in range(N-K+1)]\n\nprint(min(tmp))\n'] | ['Wrong Answer', 'Accepted'] | ['s454137570', 's283383131'] | [9108.0, 11216.0] | [250.0, 232.0] | [147, 140] |
p03208 | u167523937 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['N,K=map(int,input().split())\nh=[int(input()) for i in range(N)]\nh=sorted(h)\n\ndef_list = [h[i+K-1]-h[i] for i in range(N-K+1)]\nprint(def_list)\nprint(min(def_list))', 'N,K=map(int,input().split())\nh=[int(input()) for i in range(N)]\nh=sorted(h)\n\ndef_list = [h[i+K-1]-h[i] for i in range(N-K+1)]\nprint(min(def_l... | ['Wrong Answer', 'Accepted'] | ['s680028720', 's970526019'] | [13560.0, 10872.0] | [251.0, 240.0] | [208, 196] |
p03208 | u167908302 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['# coding:utf-8\nn, k = map(int, input().split())\nh = [int(input()) for _ in range(n)]\nh.sort()\nans = h[0]\n\nprint(min(h[i + k - 1] - h[i] for i in range(n - k + 1))\n', '# coding:utf-8\nn, k = map(int, input().split())\nh = [int(input()) for _ in range(n)]\nh.sort()\nans = h[0]\n\nprint(min(h[i + k - 1] - h[i] fo... | ['Runtime Error', 'Accepted'] | ['s849953157', 's102710368'] | [8896.0, 13312.0] | [25.0, 172.0] | [163, 164] |
p03208 | u172569352 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['import itertools\n\ndef q49(n, k, h):\n h.sort()\n a = [h[i+k-1]-h[i] for i in range(n-1)]\n return min(a)\n \nN, K = [int(i) for i in input().split()]\nh = []\nfor _ in range(N):\n h.append(int(input()))\nprint(q49(N, K, h))', 'import itertools\n\ndef q49(n, k, h):\n h.sort()\n a = [h[i+... | ['Runtime Error', 'Accepted'] | ['s036398163', 's218257186'] | [11316.0, 11316.0] | [240.0, 230.0] | [237, 239] |
p03208 | u177040005 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['N,K = map(int,input().split())\n\nH = []\nfor i in range(N):\n h = 100000#int(input())\n H.append(h)\n\nH = sorted(H)\n\ntmp = 0\nans = H[-1]\nfor i in range(N-K+1):\n tmp = H[i+K-1] - H[i]\n# print(H[i:i+K])\n\n ans = min(ans, tmp)\n\nprint(ans)\n', 'N,K = map(int,input().split())\n\nH = []\nfor i in ... | ['Wrong Answer', 'Accepted'] | ['s684969887', 's656397084'] | [4656.0, 8280.0] | [73.0, 266.0] | [245, 238] |
p03208 | u185249212 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['from __future__ import print_function\nimport numpy as np\nimport sys\nimport math,string,itertools,fractions,heapq,collections,re,array,bisect,copy,functools\n# from itertools import accumulate\n# from collections import deque\nimport random\n\ndef eprint(*args, **kwargs):\n print(*args, file=sys.stderr, **kwargs... | ['Wrong Answer', 'Accepted'] | ['s563655988', 's896212939'] | [14944.0, 14940.0] | [443.0, 433.0] | [619, 622] |
p03208 | u185325486 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['import itertools\nmin_all = 1000000\n \nN,K = [int(i) for i in input().split(" ")]\nH = [int(input()) for _ in range(N)]\nH.sort()\nprint(H)\n \nfor i in range(N+1-K):\n min_now = H[K-1+i] - H[i]\n if min_all > min_now:\n min_all = min_now\nprint(min_all)\n ', 'import itertools\nmin_all = 1000000000... | ['Wrong Answer', 'Accepted'] | ['s109373270', 's128463134'] | [10548.0, 7540.0] | [244.0, 233.0] | [263, 263] |
p03208 | u185802209 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['n, k = map(int,(input().split()))\nh = []\nfor i in range(n):\n h.append(int(input()))\nh.sort()\nmin=h[-1]-h[0]\nfor i in range(n-k+1):\n if h[i+k-1]-h[i] < min:\n min = h[i+k-1]-h[i]', 'n, k = map(int,(input().split()))\nh = []\nfor i in range(n):\n h.append(int(input()))\nh.sort()\nmin=h[-1]-h[0]\n... | ['Wrong Answer', 'Accepted'] | ['s155520324', 's951355621'] | [7384.0, 7384.0] | [234.0, 238.0] | [189, 200] |
p03208 | u186206732 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['\n\n\nN,K = map(int,input().split())\n\ntrees = []\n\nfor i in range(N):\n trees.append(int(input()))\n\n\ntrees.sort(reverse=True)\n\ndiff_list =[]\n\nfor i in range(N-1):\n diff_list.append(trees[i]-trees[i+1])\n\ndiff_list.sort()\n\n\nprint(min(diff_list[:K]))\n', '\nN,K = map(int,input().split())\n\ntrees = [... | ['Wrong Answer', 'Accepted'] | ['s841664403', 's996920284'] | [11852.0, 7384.0] | [280.0, 244.0] | [265, 228] |
p03208 | u189188797 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['n,m=map(int,input().split())\ntree=[]\nfor i in range(n):\n tree.append(int(input()))\nheikin=int(sum(tree)/len(tree))\nfor i in range(n):\n tree[i]=tree[i]-heikin\ntree.sort()\ntree.reverse()\nprint(tree)\nprint(abs(tree[1]-tree[m-1]))', 'n,k=map(int,input().split())\nanswer=0\ntree=[]\ndef tree_keisan(x,y): \... | ['Wrong Answer', 'Accepted'] | ['s806207976', 's200279551'] | [10572.0, 7388.0] | [253.0, 245.0] | [232, 337] |
p03208 | u189487046 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['import sys\nsys.setrecursionlimit(10 ** 6)\n\n\ndef input():\n return sys.stdin.readline()[:-1]\n\n\nN, K = map(int, input().split())\nH = [0]*N\nfor i in range(N):\n H[i] = int(input())\n\nH.sort()\nprint(H)\nans = 10**10\nfor i in range(N-K):\n ans = min(ans, H[i+(K-1)]-H[i])\nprint(ans)\n', 'import sys\ns... | ['Wrong Answer', 'Accepted'] | ['s088558066', 's984997429'] | [10532.0, 7472.0] | [166.0, 159.0] | [282, 277] |
p03208 | u191635495 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['n, k = map(int, input().split())\nh = [int(input()) for _ in range(n)]\nh.sort()\nres = [h[i+k-1]-h[i] for i in range(n-k+1) ]\nprint(res)\n', 'n, k = map(int, input().split())\nh = [int(input()) for _ in range(n)]\nh.sort()\nres = [h[i+k-1]-h[i] for i in range(n-k+1) ]\nprint(min(res))'] | ['Wrong Answer', 'Accepted'] | ['s043433714', 's493958895'] | [13204.0, 11216.0] | [229.0, 233.0] | [135, 139] |
p03208 | u197968862 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['n, k = map(int,input().split())\nh = [int(input()) for i in range(n)]\nans = max(h) - min(h)\nh.sort(reverse=True)\n\nprint(h)\nh_n = []\nfor i in range(0,n):\n l = h[i:i+k]\n if len(l) == k:\n h_n.append(l)\n\nseed = max(h)\nfor i in range(0,len(h_n)):\n high = max(h_n[i]) - min(h_n[i])\n if seed ... | ['Wrong Answer', 'Accepted'] | ['s176659062', 's140124428'] | [882552.0, 7384.0] | [2157.0, 250.0] | [343, 193] |
p03208 | u201856486 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['n, k = list(map(int, input().split()))\n\na = [int(input()) for _ in range(n)]\na.sort()\nb = 0\nans = []\nprint(a)\nfor i in range(n - k + 1):\n b = a[i + k - 1] - a[i]\n ans.append(b)\nans.sort()\nprint(ans[0])', 'n,k=list(map(int, input().split()))\na=[int(input()) for _ in range(n)]\na.sort()\nc=[a[i+k-1]-a... | ['Wrong Answer', 'Accepted'] | ['s403419737', 's726394887'] | [12268.0, 11292.0] | [280.0, 233.0] | [207, 133] |
p03208 | u209620426 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['n, k = map(int, input().split())\nh_li = [int(input()) for i in range(n)]\ndp = [[-1]*1000000010]*100010\n\ndef dfs(i, choosed):\n if i == n:\n if len(choosed) != k:\n dif = 10000000010\n else:\n dif = max(choosed) - min(choosed)\n\n elif len(choosed) >= 2 and dp[len(choosed)... | ['Runtime Error', 'Accepted'] | ['s053627127', 's861973725'] | [7072.0, 8280.0] | [168.0, 223.0] | [630, 191] |
p03208 | u210827208 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['n,k=map(int,input().split())\n\nx=[]\nfor i in range(n):\n x.append(int(input()))\n\nx.sort(reverse=True)\n\nprint(x[0]-x[k])', 'n,k=map(int,input().split())\n\nx=[]\nfor i in range(n):\n x.append(int(input()))\n\nx.sort()\n\ny=[]\n\nfor j in range(n):\n p=x[j+k-1]-x[j]\n y.append(p)\n\ny.sort()\n\nprint(y[0]... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s041409403', 's867425409', 's501969125'] | [7384.0, 11292.0, 11292.0] | [228.0, 252.0, 284.0] | [120, 171, 175] |
p03208 | u215743476 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['n, k = map(int, input().split())\nh = [int(input()) for _ in range(n)]\nh.sort()\n\nans = max(h) - min(h)\nfor i in range(n-k+1):\n ans = min(ans, h[i+k-1] - h[i])\n', 'n, k = map(int, input().split())\nh = [int(input()) for _ in range(n)]\nh.sort()\n\nans = max(h) - min(h)\nfor i in range(n-k+1):\n ans = min(a... | ['Wrong Answer', 'Accepted'] | ['s717151267', 's036017025'] | [7384.0, 7488.0] | [242.0, 252.0] | [161, 172] |
p03208 | u217086212 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['N,K = list(map(int, input().split()))\nh = [int(input()) for i in range(N)]\ncandidate = None\nh.sort()\nfor i in range(N-K+1):\n tmp = h[i+K+1] - h[i]\n if candidate == None or tmp < candidate:\n candidate = tmp\nprint(candidate)', 'N,K = list(map(int, input().split()))\nh = [int(input()) for i in range... | ['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s549038970', 's722462284', 's759868490', 's420467379'] | [7384.0, 7384.0, 12472.0, 7384.0] | [240.0, 247.0, 148.0, 236.0] | [235, 235, 559, 235] |
p03208 | u222207357 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['N,K = map(int,input().split())\nh = []\nfor i in range(N):\n h.append(int(input()))\n\nh.sort()\nans = 1e9\n\nprint(h)\nfor i in range(0,N-K+1):\n ans = min(ans,h[i+K-1]-h[i])\n print(i,ans)\nprint(ans)', 'N,K = map(int,input().split())\nh = []\nfor i in range(N):\n h.append(int(input()))\n\nh.sort()\nans... | ['Wrong Answer', 'Accepted'] | ['s616782011', 's540553651'] | [10520.0, 7384.0] | [384.0, 262.0] | [199, 175] |
p03208 | u223133214 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['n_k=list(map(int,input().split()))\nn,k=n_k[0],n_k[1]\nh_list=[]\nfor i in range(n):\n h_list.append(int(input()))\nh_list.sort()\nmax = 99999999\nfor i in range(n-k+1):\n if max>h_list[n-1]-h_list[n-k]:\n max=h_list[n-1]-h_list[n-k]\nprint(max)', 'n_k=list(map(int,input().split()))\nn,k=n_k[0],n_k[1]\nh... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s656215383', 's734367177', 's595470519'] | [7384.0, 7384.0, 7384.0] | [240.0, 230.0, 245.0] | [248, 261, 292] |
p03208 | u223904637 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['n,k = map(int,input().split())\nli=range(n)\nfor i in range(n):\n li[i]=int(input())\nli.sort()\nans=100000000000\nfor i in range(n-k+1):\n if ans>(li[i+k-1]-li[i]):\n ans=li[i+k-1]-li[i]\nprint(ans)\n \n ', 'n,k = map(int,input().split())\nli=list(range(n))\nfor i in range(n):\n li[i]=int(i... | ['Runtime Error', 'Accepted'] | ['s715703999', 's661374807'] | [3060.0, 7472.0] | [17.0, 243.0] | [217, 224] |
p03208 | u233288243 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['l = input().split(" ")\nalltrees = int(l[0])\nlighttrees = int(l[1])\ntl = []\nfor i in range(alltrees):\n tl.append(int(input()))\ntl= sorted(tl,reverse=True)\nh=0\ni = 0\nwhile(i<alltrees-lighttrees-1):\n h = min(tl[i]-tl[i+lighttrees-1], tl[i+1]-tl[i+lighttrees])\n i+=1\nprint(h)', '\n\nl = input().split(... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s029272924', 's041455759', 's312849696', 's841171001'] | [8280.0, 8280.0, 8280.0, 8280.0] | [306.0, 225.0, 215.0, 272.0] | [280, 266, 313, 323] |
p03208 | u240630407 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['N, K = map(int, input().split())\nH = []\nfor i in range(N):\n h = int(input())\n H.append(h)\nH = sorted(H)\nmi = 10**9\nfor i in range(N-K+1):\n _ = H[i+K] - H[i]\n if mi > _:\n mi = _\nprint(mi)', 'N, K = map(int, input().split())\nH = []\nfor i in range(N):\n h = int(input())\n H.append(h... | ['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s102689695', 's500933387', 's974288105', 's991440287', 's040565919'] | [8280.0, 8280.0, 7076.0, 3060.0, 8276.0] | [248.0, 236.0, 187.0, 19.0, 242.0] | [205, 203, 206, 165, 209] |
p03208 | u253952966 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['n, k = map(int, input().split())\nan = list(map(int, input().split()))\n\nan.sort()\ndn = [-1 for _ in range(n - k + 1)]\nfor i in range(n - k + 1):\n dn[i] = an[i+k] - an[i]\n\nprint(min(dn))\n\n ', 'n, k = map(int, input().split())\nan = []\nfor _ in range(n):\n an.append(int(input()))\n\nan.sort()\ndn = [-1 for... | ['Runtime Error', 'Accepted'] | ['s518705891', 's778599440'] | [3864.0, 11288.0] | [21.0, 256.0] | [189, 207] |
p03208 | u257050137 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['N, K = map(int, input().split())\ntree = []\ndiff = 10 ** 9\nfor n in range(N):\n tree.append(int(input()))\ntree.sort()\nfor i in range(N - (K - 1)):\n print(tree[i], tree[i + 1], tree[i + 2])\n if tree[i + K - 1] - tree[i] < diff:\n diff = tree[i + K - 1] - tree[i]\nprint(diff)', 'N, K = map(int, in... | ['Runtime Error', 'Accepted'] | ['s953340092', 's629185918'] | [10060.0, 7384.0] | [433.0, 251.0] | [286, 302] |
p03208 | u259861571 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['n, k = map(int, input().split())\nh = [int(input()) for _ in range(N)]\n\nh.sort()\nm = sum(h)\n\nfor i in range(n - k):\n m = min(h[i + k] - h[i], m)\nprint(m)\n', '#AtCoder\n\nN, K = (int(x) for x in input().split())\nS = (int(input()) for _ in range(N))\n\nlst = list(S)\n\nprint(max(lst)-min)', 'n, k = map(int,... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s382567593', 's995151624', 's082356919'] | [2940.0, 7084.0, 7384.0] | [17.0, 184.0, 242.0] | [156, 123, 164] |
p03208 | u266014018 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['import sys\nimport numpy as np\n\n# import os\n# path = os.getcwd()\n# path = os.path.join(path,"input.txt")\n\n\ninput = sys.stdin.readline\nN,K = map(int,input().split())\nh = [int(input()) for _ in range(N)]\nh.sort()\nprint(h)\nans = float("inf")\nfor i in range(N-K+1):\n ans = min(ans,h[i+K-1]-h[i])\nprint(an... | ['Wrong Answer', 'Accepted'] | ['s544147687', 's518652676'] | [19808.0, 16740.0] | [271.0, 265.0] | [328, 319] |
p03208 | u273201018 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['def func(L):\n return sum([L[i+1] - L[i] for i in range(len(L)-1)])\n\n\nN, K = map(int, input().split())\n\nH = []\n\nfor n in range(N):\n H.append(int(input()))\n\nH.sort()\n\nprint(min(H)) \n', 'def func(L):\n return sum([L[i+1] - L[i] for i in range(len(L)-1)])\n\n\nN, K = map(int, input().split())\n\nH ... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s035822472', 's101340101', 's066212565'] | [7384.0, 880208.0, 11216.0] | [225.0, 2158.0, 243.0] | [202, 218, 141] |
p03208 | u276317406 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ["n,k = input().split(' ')\nn = int(n)\nk = int(k)\nh = []\nfor i in range(n):\n h.append(int(input()))\nh.sort()\ndiffs = []\nfor i in range(n-k+1):\n diffs = h[i+k] - h[i]\nprint(min(diffs))\n", "n,k = input().split(' ')\nn = int(n)\nk = int(k)\nh = []\nfor i in range(n):\n h.append(int(input()))\nh.sort()\n... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s307806735', 's395589755', 's426900878'] | [7444.0, 11208.0, 11288.0] | [251.0, 235.0, 256.0] | [187, 193, 195] |
p03208 | u281303342 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['N,K = map(int,input().split())\nH = [int(input()) for _ in range(N)]\n\nH.sort()\nans = 10**10\nfor i in range(N-K+1):\n ans = min(ans, H[i-1+K]-H[i])\n print(i,ans)\n\nprint(ans)', '# Python3 (3.4.3)\nimport sys\ninput = sys.stdin.readline\n\n# -------------------------------------------------------------\n# f... | ['Wrong Answer', 'Accepted'] | ['s198714206', 's633940823'] | [8400.0, 7488.0] | [352.0, 141.0] | [176, 493] |
p03208 | u298945776 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['N, K = map(int, input().split(" "))\ntreehight = []\ndifference = []\nfor i in range(N):\n treehight.append(int(input()))\ntreehight.sort()\nfor j in range(N - 1):\n difference.append(treehight[j+1]-treehight[j])\n\nprint(min(difference))\n', 'N, K = map(int, input().split(" "))\ntreehight = []\ndifference = []... | ['Wrong Answer', 'Accepted'] | ['s274929659', 's704394869'] | [11216.0, 11288.0] | [247.0, 248.0] | [236, 242] |
p03208 | u303037478 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['n,k=map(int,input().split())\nhList=[]\nfor i in range(n):\n hList.append(int(input()))\nhList.sort()\n//print(hList)\nans=100000000000000\nfor i in range(n-k+1):\n tmp=hList[i+k-1]-hList[i]\n if(ans>tmp):\n ans=tmp\nprint(ans)', 'n,k=map(int,input().split())\nhList=[]\nfor i in range(n):\n hList.append(int(in... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s269998655', 's961611360', 's247438066'] | [2940.0, 2940.0, 7384.0] | [17.0, 17.0, 257.0] | [222, 223, 222] |
p03208 | u304630225 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['N,K=map(int,input().split())\nL=[]\nfor i in range(N) :\n L.append(int(input()))\nM=[]\nfor x,y in zip(L,L[K-1:]) :\n M.append(y-x)\nprint(min(M))', 'N,K=map(int,input().split())\nL=[]\nfor i in range(N) :\n L.append(int(input()))\nL.sort()\nM=[]\nfor x,y in zip(L,L[K-1:]) :\n M.append(y-x)\nprint(min(M))'] | ['Wrong Answer', 'Accepted'] | ['s430092785', 's286023837'] | [11804.0, 11980.0] | [206.0, 247.0] | [141, 150] |
p03208 | u305018585 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ["import collections\n\nN, K = map(int, input().split(' '))\n\nP = sorted([int(input()) for i in range(N)])\n\n\n\ndef eva(L):\n h_l = min(L)\n h_h = max(L)\n return h_h -h_l\n\ncandidate = []\nresult = eva(P[:3])\n\ndef dfs(now_l,k,l):\n global result\n print(now_l)\n if len(now_l)== k :\n f =... | ['Wrong Answer', 'Accepted'] | ['s914581103', 's723097306'] | [642316.0, 8284.0] | [2144.0, 250.0] | [615, 152] |
p03208 | u306071800 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['n, k = map(int, input())\n\ntree = [int(input()) for i in range(n)]\ntree.sort()\n\nres = (tree[i+k-1] - tree[i] for i in range(n-k+1))\nprint(min(res))', 'n, k = map(int, input())\n\ntree = [int(input()) for i in range(n)]\ntree.sort()\n\nres = (tree(i+k-1) - tree(i) for i range(n-k+11)\nprint(min(res))', 'n, k = ma... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s000836957', 's073020519', 's301020684', 's643043252', 's078958983'] | [3060.0, 2940.0, 3060.0, 2940.0, 7384.0] | [17.0, 17.0, 17.0, 17.0, 226.0] | [146, 143, 146, 143, 154] |
p03208 | u312025627 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ["def main():\n N, K = (int(i) for i in input().split())\n H = [int(i) for i in input().split()]\n H.sort()\n ans = 10**12\n for i in range(N-K+1):\n ans = min(ans, H[i+K-1] - H[i])\n\n print(ans)\n\n\nif __name__ == '__main__':\n main()\n", "def main():\n N, K = (int(i) for i in input().... | ['Runtime Error', 'Accepted'] | ['s004723384', 's514462379'] | [3060.0, 7384.0] | [17.0, 233.0] | [252, 251] |
p03208 | u314050667 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['N, K=map(int,input().split())2h=[int(input())foriinrange(N)]3h.sort()4print(min(h[i+K-1]-h[i]foriinrange(N-K+1)))', 'n,k = map(int, input().split())\nh = [int(input()) for i in range(n)]\nh.sort()\nprint(min(h[i+k-1] - h[i] for i in range(n-k+1)))'] | ['Runtime Error', 'Accepted'] | ['s842747922', 's894777962'] | [2940.0, 7384.0] | [17.0, 226.0] | [113, 127] |
p03208 | u317713173 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['N, K = map(int, input().split())\n\nh = []\nfor i in range(N):\n h.append(int(input()))\n\nh.sort(reverse=True)\nprint(h)\ndh_max = h[0]\n\nfor i in range(N - K + 1):\n dh = max(h[i:K+i]) - min(h[i:K+i])\n if dh < dh_max:\n dh_max = dh\n\nprint(dh_max)', 'N, K = map(int, input().split())\n\nh = []\nfo... | ['Wrong Answer', 'Accepted'] | ['s244746502', 's437872331'] | [10520.0, 7384.0] | [2104.0, 249.0] | [253, 231] |
p03208 | u318427318 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['#-*-coding:utf-8-*-\nimport sys\ninput=sys.stdin.readline\n\ndef ngram(numbers,n):\n return list([numbers[i:i+n] for i in range(len(numbers)-2)])\n\ndef main():\n numbers=[]\n s_numbers=[]\n dp=[]\n n,m = map(int,input().split())\n [numbers.append(int(input())) for _ in range(n)]\n s_numbers=sort... | ['Wrong Answer', 'Accepted'] | ['s031508814', 's562450332'] | [31940.0, 30876.0] | [236.0, 190.0] | [605, 360] |
p03208 | u319818856 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['def christmas_eve(N: int, K: int, H: list) -> int:\n sorted_H = sorted(H, reverse=True)\n return sorted_H[0] - sorted_H[K-1]\n\n\nif __name__ == "__main__":\n N, K = [int(s) for s in input().split()]\n H = [int(input()) for _ in range(N)]\n ans = christmas_eve(N, K, H)\n print(ans)\n', 'def christma... | ['Wrong Answer', 'Accepted'] | ['s105868290', 's441157047'] | [8280.0, 8280.0] | [206.0, 246.0] | [292, 329] |
p03208 | u321623101 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['N,K=(int(i) for i in input().split())\nh=[]\nfor i in range(N):\n h.append(int(input()))\n\nh.sort()\nm=abs(h[0]-h[K-1])\nfor i in range(1,N-K):\n if m>abs(h[i]-h[K-1]):\n m=abs(h[i]-h[K-1])\nprint(m)', 'N,K=(int(i) for i in input().split())\nh=[]\nfor i in range(N):\n h.append(input())\n\nh.sort(reve... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s418071245', 's629931604', 's499380919'] | [7384.0, 10584.0, 7388.0] | [249.0, 204.0, 245.0] | [203, 139, 209] |
p03208 | u325227960 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['n,k=map(int,input().split())\nH=[]\nfor i in range(n):\n H.append(int(input()))\n\nH.sort()\n\nprint(H)\n\nans=H[n-1]-H[0]\n\nfor i in range(n-k+1):\n #print(H[i+k-1]-H[i])\n ans=min(ans,H[i+k-1]-H[i])\n\nprint(ans)\n', 'n,k=map(int,input().split())\nH=[]\nfor i in range(n):\n H.append(int(input()))\n\nH.... | ['Wrong Answer', 'Accepted'] | ['s022769469', 's881711174'] | [10520.0, 7384.0] | [286.0, 252.0] | [210, 211] |
p03208 | u325956328 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['N, K = map(int, input().split())\nh = [int(input()) for _ in range(N)]\nh = sorted(h, reverse=True)\nh = h[:K]\n# print(h)\nprint(max(h) - min(h))\n\n', 'N, K = map(int, input().split())\nh = [int(input()) for _ in range(N)]\nh = sorted(h, reverse=True)\nh = h[:K]\nprint(h)\nprint(max(h) - min(h))\n\n', 'import numpy... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s035527503', 's392228517', 's474695232', 's956337019'] | [8280.0, 11316.0, 17896.0, 17908.0] | [215.0, 219.0, 360.0, 351.0] | [143, 141, 307, 324] |
p03208 | u328694671 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['import sys\n\nN,K=(int(x) for x in input().split())\n\nh=[]\nfor i in range(N):\n\th.append(int(input()))\t\nh.sort()\n\nminimum=10**10\ntmp=N-K\nfor i in range(N-K+1):\n\t#print("i/minimun",i,minimum)\n\tif h[i+K-1]-h[i] < minimum:\n\t\tminimum=h[i+K-1]-h[i]\n\n#print(minimum)\n#print(h)', 'import sys\n\nN,K=(int(x)... | ['Wrong Answer', 'Accepted'] | ['s750342320', 's798131719'] | [7384.0, 7384.0] | [241.0, 237.0] | [266, 293] |
p03208 | u329058683 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['N, K = map(int, input().split())\nh = [int(input()) for i in range(N)]\nh.sort()\nans=[]\nfor i in range(len(h)-K+1):\n b=h[K+1-i]-h[i]\n ans.append(b)\nprint(min(b))', 'N, K = map(int, input().split())\nh = [int(input()) for i in range(N)]\nh.sort()\nans=[]\nfor i in range(len(h)-K+1):\n b=h[K+i-1]-h[i]\n ans.ap... | ['Runtime Error', 'Accepted'] | ['s879344256', 's376762300'] | [11212.0, 11288.0] | [246.0, 241.0] | [161, 163] |
p03208 | u329865314 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['n, k = map(int,input().split())\nlis = []\nfor _ in range(n):\n lis.append(int(input()))\nans = 100000000000000\nfor i in range(n-k+1):\n s = lis[i+k-1]-lis[i]\n if s < ans:\n ans = s\nprint(ans)', 'n, k = map(int,input().split())\nlis = []\nfor _ in range(n):\n lis.append(int(input()))\nans = 100000000000000\... | ['Wrong Answer', 'Accepted'] | ['s849283137', 's703593890'] | [7072.0, 7484.0] | [219.0, 250.0] | [192, 203] |
p03208 | u337626942 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['N, K = map(int, input().split())\nh = [int(input()) for _ in range(N)]\nh.sort()\nMin = h[K] - h[0]\nfor i in range(N-K+1):\n if h[K+i] - h[i+1] < Min:\n Min = h[K+i] - h[K]\n \nprint(Min)', 'N, K = map(int, input().split())\nh = [int(input()) for _ in range(N)]\nh.sort()\nMin = h[K] - h[0]\nfor i in range(N-K... | ['Runtime Error', 'Accepted'] | ['s263576450', 's747232189'] | [7384.0, 7384.0] | [229.0, 231.0] | [187, 189] |
p03208 | u339550873 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['#! /usr/bin/env python3\n# -*- coding: utf-8 -*-\nN, K = [int(x) for x in input().split()]\nheight = []\nfor _ in range(N):\n height.append(int(input()))\n\nheight.sort()\nheight.reverse()\nsublist = []\nfor i in range(N-K+1):\n hmax-hmin = height[i]-height[i+K-1]\n sublist.append(hmax-hmin)\n\nprint(min(sub... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s364350616', 's906205683', 's934038140', 's989085067', 's807204967'] | [2940.0, 11208.0, 7384.0, 3056.0, 11288.0] | [18.0, 245.0, 219.0, 17.0, 281.0] | [311, 307, 307, 308, 309] |
p03208 | u340781749 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['from operator import sub\n\nn, k = map(int, input().split())\nhhh = sorted(int(input()) for _ in range(n))\nprint(min(map(sub, zip(hhh[k - 1:], hhh))))\n', 'from itertools import starmap\nfrom operator import sub\n\nn, k = map(int, input().split())\nhhh = sorted(int(input()) for _ in range(n))\nprint(min(starmap(sub,... | ['Runtime Error', 'Accepted'] | ['s047300158', 's092711202'] | [7908.0, 7928.0] | [214.0, 224.0] | [148, 182] |
p03208 | u343671593 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['N,K = map(int,input().split())\nH = []\nfor i in range(N):\n\tH.append(int(input()))\n\nH.sort()\nans = 100007\nprint(H)\nfor i in range(0,len(H)-K+1):\n\t\n\tif ans >= H[i+K-1] - H[i]:\n\t\tans = H[i+K-1] - H[i]\n\t\t# print(ans)\nprint(ans)\n\n', 'N,K = map(int,input().split())\nH = []\nfor i in range(N):\n\tH.app... | ['Wrong Answer', 'Accepted'] | ['s554441947', 's444030749'] | [10520.0, 7384.0] | [251.0, 236.0] | [258, 260] |
p03208 | u345778634 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['N, K = map(int, input().split())\nH = [int(input()) for _ in range(N)]\nH.sort()\nminim = 1e10\nfor i in range(N-K):\n print(H[i], H[i+K-1])\n minim = min(minim, H[i+K-1] - H[i])\nprint(minim)', 'N, K = map(int, input().split())\nH = [int(input()) for _ in range(N)]\nH.sort()\nminim = 1e10\nfor i in range(N-K+1... | ['Wrong Answer', 'Accepted'] | ['s177516080', 's714709595'] | [13212.0, 13232.0] | [252.0, 186.0] | [191, 167] |
p03208 | u346194435 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['n, k = [int(i) for i in input().split()]\nheights = [int(input()) for i in range(n)]\n\nheights.sort()\n\n\nanswer = max(heights) - min(heights)\n\nfor i in range(0, n-k+1):\n x = heights[i:i + k]\n print(x)\n candidate = max(x) - min(x)\n if candidate < answer:\n answer = candidate\n\nprint(answer... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s413455936', 's585249035', 's247528276'] | [116404.0, 8572.0, 7384.0] | [2104.0, 242.0, 236.0] | [339, 338, 313] |
p03208 | u350093546 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['n,k=map(int,input().split())\na=[int(input()) for i in range(n)]\na.sort()\nx=10**9\nfor i in range(n-k+1):\n x=min(x,a[i+k-1]-a[k])\nprint(x)', 'n,k=map(int,input().split())\na=[int(input()) for i in range(n)]\na.sort()\nx=10**9\nfor i in range(n-k+1):\n x=min(x,a[i+k-1]-a[i])\nprint(x)\n'] | ['Wrong Answer', 'Accepted'] | ['s679933702', 's471563319'] | [7384.0, 7384.0] | [242.0, 240.0] | [137, 138] |
p03208 | u352499693 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['n, k = map(int, input().split())\nh = list(map(int, [input() for i in range(n)]))\nh.sort()\nres = 10**10\nfor i in range(k-1, n):\n res = min(res, h[i]-[i-k+1])\nprint(res)', 'n, k = map(int, input().split())\nh = list(map(int, [input() for i in range(n)]))\nh.sort()\nres = 10**10\nfor i in range(k-1, n):\n re... | ['Runtime Error', 'Accepted'] | ['s804448944', 's656605674'] | [14236.0, 14236.0] | [188.0, 228.0] | [170, 172] |
p03208 | u354915818 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['h = []\nfor i in range(N) : \n s = input()\n h.append(int(s))\n \nh = sorted(h)\nminDiff = h[len(h) - 1] - h[0]\nfor i in range(N) : \n try : \n diff = h[len(h) - K + i] - h[i]\n print(f"diff={h[len(h) - K + i]} - {h[i]} = {diff}")\n minDiff = min(minDiff , diff)\n \n except... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s330233264', 's411686119', 's469807205', 's730437018'] | [2940.0, 2940.0, 2940.0, 8280.0] | [18.0, 18.0, 17.0, 269.0] | [372, 429, 372, 358] |
p03208 | u361826811 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['import sys\nimport itertools\n\n# import numpy as np\n\nread = sys.stdin.buffer.read\nreadline = sys.stdin.buffer.readline\nreadlines = sys.stdin.buffer.readlines\n\nN, K, *H = map(int, read().split())\nH.sort()\nprint(min(H[i+K-1]-H[i]) for i in range(N-K+1))\n', 'import sys\nimport itertools\n\n# import numpy as np... | ['Wrong Answer', 'Accepted'] | ['s744804060', 's743443573'] | [13040.0, 13040.0] | [76.0, 96.0] | [250, 250] |
p03208 | u363407238 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ["n,k = map(int,input().split())\nh=[int(input()) for i in range(n)]\nh=sort(h)\nmi=float('inf')\n \nfor i in range(n-k+1):\n mi = min(mi, h[i+k-1]-h[i])\n \nprint(mi)", "n,k = map(int,input().split())\nh=sorted(list(int(input()) for i in range(n)))\nh+=h\nmi=float('inf')\nansma=0\nansmi=0\na=0\nfor i in range(n):\n... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s456721811', 's734705499', 's749848486'] | [7072.0, 8268.0, 8280.0] | [172.0, 263.0, 243.0] | [160, 280, 163] |
p03208 | u365858785 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['a=list(map(int,input().split()))\nb=list(sorted([int(input()) for i in range(a[0])]))\nans=[]\nfor i in range(a[0]-a[1]+1):\n ans+=[abs(b[a[1]-1]-b[i])]\nprint(min(ans))', 'a=list(map(int,input.split()))\nlis=[]\nfor i in range(a[0]):\n lis+=int(input())\nlis=lis.sort()\nprint(lis)', 'a=list(map(int,input().split()... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s351033647', 's802513144', 's085286713'] | [10924.0, 2940.0, 10924.0] | [242.0, 17.0, 246.0] | [165, 105, 167] |
p03208 | u368796742 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['n,k = map(int,input().split())\nl = [int(input()) for i in range(n)]\nl.sort()\nans = l[-1]\nfor i in range(n-k):\n ans = min(ans,l[i+k]-l[i])\n if ans = 0\n print(0)\n exit()\n \nprint(ans)\n ', 'n,k = map(int,input().split())\nl = [int(input()) for i in range(n)]\nl.sort()\nans = l[-1]\nfor i in range(n-k+1):... | ['Runtime Error', 'Accepted'] | ['s774716965', 's676599887'] | [2940.0, 7384.0] | [17.0, 238.0] | [188, 199] |
p03208 | u370331385 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['N,K = map(int,input().split())\n\nH = []\nfor i in range(N):\n h = int(input())\n H.append(h)\nH.sort()\n\nhmax_hmin = []\nfor i in range(N-K+1):\n print(H[i+K-1],H[i])\n hmax_hmin.append(H[i+K-1] - H[i]) \n \nprint(min(hmax_hmin))', 'N,K = map(int,input().split())\n\nH = []\nfor i in range(N):\n h = int(input(... | ['Wrong Answer', 'Accepted'] | ['s188524505', 's499349217'] | [13052.0, 11288.0] | [391.0, 248.0] | [223, 197] |
p03208 | u370793182 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['N, K = map(int, input())\nh = []\nfor i in range(N):\n h.append(int(input()))\nh.sort()\nmini = 1e9\nfor i in range(N-K+1):\n sub = h[i+K-1] - h[i]\n if(sub < mini){\n mini = sub\nprint(mini)', 'N, K = map(int, input().split())\nh = []\nfor i in range(N):\n h.append(int(input()))\nh.sort()\nmini = 1e9\nfor i i... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s534214313', 's996626322', 's708822524'] | [2940.0, 2940.0, 7384.0] | [17.0, 17.0, 242.0] | [187, 196, 196] |
p03208 | u371132735 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['N, K = map(int, input().split())\nhn = []\nfor i in range(N):\n hn.append(int(input()))\nhn = sorted(hn,reverse=True)\nmin = 99999999\nfor i in range(N-K+1):\n print("hn[i] is {} , hn[K+i] is {}".format(hn[i],hn[K+i-1]))\n if min > (hn[i]-hn[K+i-1]):\n min = hn[i]-hn[K+i-1]\nprint(min)\n', '\nN, K = map(int,inp... | ['Wrong Answer', 'Accepted'] | ['s565543253', 's475564185'] | [11196.0, 11036.0] | [367.0, 238.0] | [283, 193] |
p03208 | u371467115 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['n,k=map(int,input().split())\nh=[int(input()) for _ in range(n)]\nh.sort()\nans=0\n\nfor i in range(n-k+1):\n if ans<h[i+k-1]-h[i]:\n ans=h[i+k-1]-h[i]\n \nprint(ans)', 'n,k=map(int,input().split())\nh=[i for i in range(n)]\nh.sort()\nl=[]\nfor i in range(k-2):\n l.appwnd(abs(h[i]-h[i+k-1]))\nprint(min(l))', ... | ['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s425237154', 's631933571', 's819785055', 's879112570'] | [7484.0, 7088.0, 7384.0, 11292.0] | [227.0, 26.0, 228.0, 238.0] | [164, 132, 165, 151] |
p03208 | u375282392 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['n,k = map(int,input().split())\na=[]\nfor i in range(n):\n\ta.append(int(input()))\n\nsa = sorted(a)\nv=1000000\nfor i in range(n-k+1):\n\tif v > sa[i+k-1]-sa[i] \n\t\tv = sa[i+k-1]-sa[i]\nprint(v)', 'n,k = map(int,input().split())\na=[]\nfor i in range(n):\n\ta.append(int(input()))\n\nsa = sorted(a)\nv=10**9\nfor i ... | ['Runtime Error', 'Accepted'] | ['s712766008', 's895213394'] | [2940.0, 8280.0] | [17.0, 249.0] | [183, 181] |
p03208 | u375695365 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['n,k=map(int,input().split())\nh=[int(input()) for _ in range(n)]\n\n\n', 'n,k=map(int,input().split())\nh=[int(input()) for _ in range(n)]\nh.sort()\nmin1=10**9*1\nsoezi=0\ncount=0\nfor i in range(n-(k-1)):\n count=h[i+(k-1)]-h[i]\n if min1>count:\n min1=count\nprint(min1)\n'] | ['Wrong Answer', 'Accepted'] | ['s958732488', 's959646089'] | [7072.0, 7384.0] | [171.0, 228.0] | [82, 203] |
p03208 | u379440427 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['N, K = map(int, input().split())\n2 h = [int(input()) for i in range(N)]\n3 h.sort()\n4 print(min(h[i+K-1] - h[i] for i in range(N-K+1)))', 'n,k = map(int,input().split())\nh = sorted(list(map(int, [input() for i in range(n)])))\nans = h[n-1]\nfor j in range(n-k+1):\n ans = min(ans, (h[j+k]-h[j]))\nprint(ans)', 'n... | ['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s211852862', 's631687294', 's776393004', 's825996155', 's876211798', 's989260661', 's558185206'] | [2940.0, 14236.0, 14236.0, 14236.0, 14236.0, 14236.0, 14236.0] | [18.0, 226.0, 228.0, 196.0, 193.0, 190.0, 212.0] | [134, 167, 166, 150, 180, 179, 206] |
p03208 | u386782537 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['N,K = map(int,input().split())\ntree_list = [int(input()) for _ in range(N)]\ntree_list = sorted(tree_list)\nans = 10**9\nfor i in range(N-K-1):\n compare = tree_list[i+K]-tree_list[i]\n if ans > compare:\n ans = compare\nprint(ans)\n ', 'N,K = map(int,input().split())\ntree_list = [int(input()) for _... | ['Wrong Answer', 'Accepted'] | ['s273945248', 's972905552'] | [8280.0, 8280.0] | [237.0, 238.0] | [242, 244] |
p03208 | u390618988 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['from sys import stdin\nN, K = [int(x) for x in stdin.readline().rstrip().split()]\nh = [int(stdin.readline().rstrip()) for _ in range(N)]\nh.sort()\ndiff = [h[k + K] - h[k] for k in range(N - K)]\ndiff.sort()\nprint(diff[0])\n', 'from sys import stdin\nN, K = [int(x) for x in stdin.readline().rstrip().split()]\nh = [... | ['Wrong Answer', 'Accepted'] | ['s956085842', 's148742230'] | [11212.0, 11292.0] | [153.0, 153.0] | [219, 226] |
p03208 | u393558821 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ["n, x = map(int, input().split(' '))\nlst = []\nfor i in range(n):\n lst.append(int(input()))\n lst.sort()\n minn = 999999999999\n for i in range(0, n-x+1):\n if lst[i+x]-lst[i] < minn:\n minn = lst[i+x] - lst[i]\n print(minn)", "n, x = map(int, input().split(' '))\nlst = []\nfor i in range(n):\n\tlst.app... | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s270760864', 's280195348', 's357430438', 's406591098', 's624808543', 's490039426'] | [3060.0, 7384.0, 7384.0, 7508.0, 7512.0, 7384.0] | [18.0, 243.0, 241.0, 249.0, 248.0, 225.0] | [229, 239, 238, 245, 243, 137] |
p03208 | u395202850 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['n, k = map(int, input().split())\nh = [int(input()) for _ in range(n)]\nhMin = 10**9\nfor i in range(n - k + 1):\n if h[k + i - 1]-h[i] < hMin:\n hMin = h[k + i - 1]-h[i]\nprint(hMin)\n', 'n, k = map(int, input().split())\nh = sorted([int(input()) for _ in range(n)])\nprint(min(h[k+i-1]-h[i] for i in range(... | ['Wrong Answer', 'Accepted'] | ['s766789947', 's931130874'] | [7072.0, 8280.0] | [191.0, 219.0] | [188, 126] |
p03208 | u398846051 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['N, K = map(int, input().split())\nh = [int(input()) for _ in range(N)]\nh.sort()\nans = 1<<31\nfor i in range(N-K)+1:\n ans = min(ans, h[i+K-1]-h[i]\nprint(ans)', 'N, K = map(int, input().split())\nh = [int(input()) for _ in range(N)]\nh.sort()\nans = 1<<31\nfor i in range(N-K+1):\n ans = min(ans, h[i+K-1]-h[i])\np... | ['Runtime Error', 'Accepted'] | ['s711696894', 's462656523'] | [2940.0, 7384.0] | [18.0, 244.0] | [155, 156] |
p03208 | u405256066 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['import numpy as np\nfrom sys import stdin\nN,K=[int(x) for x in stdin.readline().rstrip().split()]\ndata=[]\nfor i in range(N):\n data.append(int(input()))\ndata.sort()\ndata.reverse()\nans=float("inf")\nfor i in range(N-K+1):\n tmp=data[i]-data[i+K-1]\n if ans > tmp:', 'import numpy as np\nfrom sys import s... | ['Runtime Error', 'Accepted'] | ['s998799101', 's790135618'] | [3060.0, 21544.0] | [17.0, 769.0] | [266, 293] |
p03208 | u411544692 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['N, K = map(int, input().split())\nlengths = list(int(input()) for i in range(N))\nsorted_lengths = sorted(lengthes)\nmin_score = 2**100\n\nfor i in range(N-K+1):\n score = sorted_lengths[i+K-1] - sorted_lengths[i]\n min_score = min(min_score, score)\n\nprint(min_score)', 'N, K = map(int, input().split())\nlengths =... | ['Runtime Error', 'Accepted'] | ['s064589423', 's683540667'] | [7084.0, 8284.0] | [182.0, 252.0] | [262, 261] |
p03208 | u411923565 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['N,K = map(int,input().split())\nh = [int(input()) for _ in range(N)]\nh = sorted(h, reverse = True)\nprint(h)\n\ndiff = 10**9\nfor i in range(N-K+1):\n a = h[i]-h[i+K-1]\n if diff > a:\n diff = a\n if diff == 0:\n break\nprint(diff)', '#C - Christmas Eve\nN,K = map(int,input().split())\nh = [i... | ['Wrong Answer', 'Accepted'] | ['s205530226', 's357880614'] | [15980.0, 14176.0] | [193.0, 178.0] | [244, 254] |
p03208 | u416758623 | 2,000 | 1,048,576 | In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees shoul... | ['n,k = map(int, input().split())\nls = k[int(input()) for _ in range(n)]\nls.sort()\ntmp = 10 ** 9\nfor i in range(n-k+1):\n diff = ls[i+k-1] - ls[i]\n if diff < tmp:\n tmp = diff\nprint(diff)', 'n,k = map(int, input().split())\nh = [int(input()) for _ in range(n)]\nh.sort()\ndis = []\nfor i, j in zip(h, ... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s057455647', 's474793280', 's509371642'] | [2940.0, 12992.0, 8280.0] | [17.0, 277.0, 252.0] | [196, 175, 175] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.