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 |
|---|---|---|---|---|---|---|---|---|---|---|
p02725 | u397638621 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['K, N = map(int, input().split())\nA = list(map(int, input().split())\ndistances = {}\nfor i in range(1, len(A) + 1):\n\tdistances += (A[i] - A[i - 1]\nmost = max(distances.keys())\noutput = K - most\nprint(output)', 'K, N = map(int, input().split())\nA = list(map(int, input().split())\ndistances = {}\nfor i in range(... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s359109981', 's499615830', 's678193138', 's804025693', 's008661807'] | [2940.0, 2940.0, 2940.0, 2940.0, 25836.0] | [17.0, 17.0, 17.0, 18.0, 119.0] | [205, 247, 223, 251, 227] |
p02725 | u403331159 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['K,N=map(int,input().split())\nA=list(map(int,input().split()))\nans=0\nans+=min(min(A[0],abs(A[0]-K)),abs(A[0]-A[1]))\nfor i in range(1,N-1):\n ans+=min(abs(A[i-1]-A[i]),abs(A[i]-A[i+1]))\nans+=min(min(A[-1],abs(A[-1]-K)),abs(A[-1]-A[-2]))\nprint(ans)', 'K,N=map(int,input().split())\nA=list(map(int,input().split()... | ['Wrong Answer', 'Accepted'] | ['s581222875', 's542336204'] | [26444.0, 26420.0] | [207.0, 129.0] | [247, 173] |
p02725 | u405483159 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['L, k = map( int, input().split() )\na = list( map( int, input().split() ))\na[-1] = a[-1] - L\n\nret = L\nfor i in range( len(a) ):\n ret = min( ret, L - abs(a[i] - a[i-1]))\nprint( ret )', 'L, k = map( int, input().split() )\na = list( map( int, input().split() ))\n \nret = L\nfor i in range( len(a) ):\n if i == 0... | ['Wrong Answer', 'Accepted'] | ['s794437346', 's351081751'] | [26436.0, 26436.0] | [150.0, 160.0] | [181, 238] |
p02725 | u407158193 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['k,n = map(int,input().split())\nA = [int(i) for i in input().split()]\n\nk = int(k/2)\n\n#print(list(map(lambda x:k -x,A)))\n\nprint(sum(list(map(lambda x:k -x,A))))', 'k,n = map(int,input().split())\nA = [int(i) for i in input().split()]\n\nA.append(A[0] + k)\n\nl = 0\nfor i in range(n):\n l = max(l,(A[i+1] - A[i])... | ['Wrong Answer', 'Accepted'] | ['s367224788', 's292749678'] | [26444.0, 26444.0] | [96.0, 173.0] | [158, 157] |
p02725 | u408262366 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['hoge = input().split()\nK = int(hoge[0])\nN = int(hoge[1])\nA_list = list(map(int,input().split()))\n\nkankaku = []\nfor i in range(len(A_list) - 1):\n kankaku.append(A_list[i+1] - A_list[i])\nkankaku.append(A_list[0] - A_list[-1] + K)\n\nprint(kankaku)\n_kankaku_max = max(kankaku)\nprint(K - _kankaku_max)', 'hoge =... | ['Wrong Answer', 'Accepted'] | ['s904772668', 's230079488'] | [26420.0, 26444.0] | [133.0, 123.0] | [296, 281] |
p02725 | u408375121 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['K, N = map(int, input().split())\nA = list(map(int, input().split()))\nA.append(A[0]+K)\nmax_d = A[1] - A[0]\nfor i in range(n):\n d = A[i+1] - A[i]\n if max_d < d:\n max_d = d\nprint(K - max_d)\n', 'K, N = map(int, input().split())\nA = list(map(int, input().split()))\nA.append(A[0]+K)\nmax_d = A[1] - A[0]\nfor... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s165396063', 's643496991', 's183965704'] | [26444.0, 26100.0, 26444.0] | [76.0, 67.0, 109.0] | [192, 193, 192] |
p02725 | u408849410 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['K,N = map(int,input().split())\nA = list(map(int,input()))\nL = []\nT = K+A[0]-A[-1]\nfor i in range(N-1):\n L.append(A[i+1]-A[i])\nprint(K-max(L))', 'K,N = map(int,input().split())\nA = list(map(int,input()))\nL = 0\nfor i in range(0,N-1):\n if A[i+1]-A[i] >L:\n L = A[i+1]-A[i]\nprint(K-L)', 'K,N = map(in... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s196223076', 's530000375', 's883451152'] | [7028.0, 7028.0, 26420.0] | [20.0, 20.0, 115.0] | [142, 144, 145] |
p02725 | u411858517 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['K, N = map(int, input().split())\nA = list(map(int, input().split()))\n\nA.sort()\n\ntmp = 0\nfor i in range(N-1):\n tmp = max(tmp, A[i+1]-A[i])\n \ntmp = max(tmp, K - A[-1])\n\nprint(K - tmp)', 'K, N = map(int, input().split())\nA = list(map(int, input().split()))\n\ntmp = [0 for _ in range(N)]\nfor i in range(N-1... | ['Wrong Answer', 'Accepted'] | ['s851708347', 's666495695'] | [26420.0, 25840.0] | [166.0, 122.0] | [183, 194] |
p02725 | u412197640 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['K, N = map(int, input().split())\ndistances = list(map(int,input().split()))\ndistances.append(K-distances[-1])\n\nfor i in range(N-1, 0,-1):\n distances[i] -= distances[i-1]\nprint(sum(sorted(distances)[:-1]))\n', 'K, N = map(int, input().split())\ndistances = list(map(int,input().split()))\n\nvar = distances[0]\... | ['Wrong Answer', 'Accepted'] | ['s533421177', 's471107286'] | [26436.0, 25840.0] | [134.0, 165.0] | [208, 272] |
p02725 | u412760429 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['p, n = map(int, input().split())\nl = list(map(int, input().split()))\nm = max(p - l[-1], l[0])\nfor i in range(1, n):\n m = max(m, l[i] - l[i - 1])\nprint(m)\n', 'p, n = map(int, input().split())\nl = list(map(int, input().split()))\nm = p - l[-1]\nfor i in range(1, n):\n m = max(m, l[i] - l[i - 1])\nprint(m)\... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s543602385', 's851076910', 's521452635'] | [26444.0, 26420.0, 25840.0] | [135.0, 138.0, 136.0] | [157, 146, 155] |
p02725 | u414050834 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['k,n=map(int,input().split())\na=list(map(int,input().split()))\nans=10**9\nfor i in range(n):\n s=a[i]\n t=0\n for j in range(1,n):\n m=min(abs(s-a[i-j]),abs(s+20-a[i-j]),abs(s-a[i+j]),abs(20-s+a[i+j]))\n t=t+m\n s=a[i-j]\n ans=min(ans,t)\nprint(ans)', 'k,n=map(int,input().split())\na=list(map(int,input(... | ['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s351157992', 's418691447', 's576803061', 's728427634', 's294194706'] | [26444.0, 26436.0, 26444.0, 26444.0, 26444.0] | [612.0, 136.0, 136.0, 136.0, 136.0] | [252, 121, 137, 144, 144] |
p02725 | u418149936 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ["K, N = map(int, input().split(' '))\nA_ls = list(map(int, input().split(' ')))\nrst = -1\nfor i in range(N):\n l = A_ls[(i + 1) % N] - A_ls[i]\n if i < 0:\n l = K - A_ls[i] + A_ls[(i + 1) % N]\n if rst == -1:\n rst = l\n else:\n rst = max(rst, l)\nprint(K - rst)", "K, N = map(int, inp... | ['Wrong Answer', 'Accepted'] | ['s653982341', 's646613256'] | [32252.0, 32236.0] | [147.0, 144.0] | [284, 284] |
p02725 | u425762225 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['K,N = map(int,input().split())\nA = list(map(int,input().split()))\nA.append(A[0])\n\nB = sorted([(A[i+1]- A[i]) for i in range(N)])\nans = K - B[-1]\nprint(ans)\n\n', 'K,N = map(int,input().split())\nA = list(map(int,input().split()))\nA.append(A[0]+K)\n\nB = sorted([(A[i+1]- A[i]) for i in range(N)])\nans = K - B[-... | ['Wrong Answer', 'Accepted'] | ['s737219806', 's340433992'] | [25452.0, 26444.0] | [124.0, 124.0] | [157, 159] |
p02725 | u427163848 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['K = int(input())\nN = int(input())\nA = []\n\nfor i in range(N):\n A.append(int(input()))\n\nB = []\nfor i in range(N-1):\n B[i] = int(A[i] - A[i+1])\n\nB.append(int((K-A[0])-(A[N-1]-K)))\n\nB.sort()\n\nBig = B[N-1]\n\nprint(K-Big)\n\n', 'K,N = map(int, input().split())\nA = [int(N) for N in input().split()]\n... | ['Runtime Error', 'Accepted'] | ['s442696613', 's284868444'] | [3060.0, 26420.0] | [18.0, 170.0] | [222, 202] |
p02725 | u428416104 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['kn = list(map(int, input().split()))\n\na= list(map(int, input().split()))\n\nl=[]\n\nl.append(kn[0]-a[-1])\n\nfor i in range(kn[1]-1):\n l.append(a[i+1]-a[i])\n\nprint(kn[0]-max(l))\n', 'kn = list(map(int, input().split()))\n\na= list(map(int, input().split()))\nl=[]\n\nl.append(kn[0]-a[-1])\n\nfor i in range(kn[... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s391218131', 's718537329', 's259197908'] | [25840.0, 26100.0, 26436.0] | [118.0, 118.0, 116.0] | [175, 173, 181] |
p02725 | u429029348 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['k,n=map(int,input().split())\na=list(map(int,input().split()))\n\nlength=k-a[n-1]-a[0]\nfor i in range(n-1):\n length=max(length,a[i+1]-a[i])\n\nprint(k-length)', 'k,n=map(int,input().split())\na=list(map(int,input().split()))\n\nlength=k-a[n-1]+a[0]\nfor i in range(n-1):\n length=max(length,a[i+1]-a[i])\n\nprint(k... | ['Wrong Answer', 'Accepted'] | ['s696782544', 's413472374'] | [32296.0, 32312.0] | [123.0, 124.0] | [154, 154] |
p02725 | u431484963 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['\nk,n =list(map(int,input().split()))\na = list(map(int,input().split()))\nans = [0]*n \nfor i in range(n):\n if a[i]>k/2:\n a[i] = abs(k-a[i])\n\na.sort(reverse=True)\nkai = a[0]+a[1]\nprint(kai)', '\nk,n =map(int,input().split())\na = list(map(int,input().split()))\na.append(k+a[0])\n#print(a)\nl = 0\nfor... | ['Wrong Answer', 'Accepted'] | ['s226682591', 's528553245'] | [26060.0, 26420.0] | [136.0, 163.0] | [196, 375] |
p02725 | u435480265 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['k,n = map(int,input().split())\nlst_a = list(map(int,input().split()))\ndis_max = 0\nlo_last = lst_a[0]\nfor i in range(1,n):\n ilo = lst_a[i]\n dis_max = max(dis_max, ilo-lo_last)\n lo_last = ilo\nilo = lst_a[0]\ndis_max = max(dis_max, ilo-lo_last)\nprint(k-dis_max)', 'k,n = map(int,input().split())\nlst_a ... | ['Wrong Answer', 'Accepted'] | ['s196605768', 's647803789'] | [26436.0, 26444.0] | [147.0, 142.0] | [266, 268] |
p02725 | u438189153 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['k,n=map(int,input().split())\ndis=list(map(int,input().split()))\nans=[]\nfor i in range(n):\n if i>=1:\n ans.append(dis[i]-dis[i-1])\nprint(k-max(ans))\n', 'k,n=map(int,input().split())\ndis=list(map(int,input().split()))\nans=[]\nfor i in range(n):\n if i>=1:\n ans.append(dis[i]-dis[i-1])\nans.a... | ['Wrong Answer', 'Accepted'] | ['s909826577', 's461087181'] | [32312.0, 32232.0] | [112.0, 112.0] | [157, 189] |
p02725 | u440129511 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['import numpy as np\nk,n=map(int,input().split())\na=list(map(int,input().split()))\na=np.array(a)\na1=abs(a[1:]-a[:-1])\na2=list(a1)\na2.append(abs(a[0]-a[-1]))\nprint(k-max(a1))', 'import numpy as np\nk,n=map(int,input().split())\na=list(int,input().split())\na=np.array(a)\nif max(abs(a[1:]-a[:-1])) < k-abs(a[0]-a[-... | ['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s164304385', 's279929078', 's433750152', 's890968328', 's171514308'] | [36200.0, 34172.0, 34156.0, 34172.0, 34168.0] | [269.0, 365.0, 216.0, 254.0, 288.0] | [171, 197, 160, 173, 179] |
p02725 | u444722572 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['K,N=map(int,input().split())\nA=list(map(int,input().split()))\nA+=[A[0]+K]\nmax_gap=max(y-x for x,y in zip(A,A[1:]))\nprint(max_gap)\nprint(K-max_gap)', 'K,N=map(int,input().split())\nA=list(map(int,input().split()))\nA+=[A[0]+K]\nmax_gap=max(y-x for x,y in zip(A,A[1:]))\nprint(K-max_gap)'] | ['Wrong Answer', 'Accepted'] | ['s776432393', 's303035377'] | [25836.0, 26420.0] | [83.0, 84.0] | [146, 131] |
p02725 | u446601167 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['K,N = input().split()\n\nA = list(map(int, input().split()))\n\nint(K)\nint(N)\n\n\nB = []\nfor i in range(0, len(A)-1):\n B.insert(i,A[i+1]-A[i])\nB.insert(int(N)-1,int(K)-A[int(N)-1]+A[0])\n\nans = 0\n\nprint(B)\n\nfor j in range(int(N)):\n ans += B[j]\n\nans -= max(B)\n\nprint(ans)', 'K,N = input().split()\n... | ['Wrong Answer', 'Accepted'] | ['s100550831', 's104640052'] | [26444.0, 25840.0] | [177.0, 183.0] | [292, 282] |
p02725 | u449697619 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['import statistics\nK,N = map(int,input().split())\nA = [int(n) for n in input().split()]\n\na1 = max(A)-min(A)\n\nmax_v = 0\nfor i in range(len(A)-1):\n A_i = None\n if (A[i+1]-A[i])>max_v:\n max_v = A[i+1]-A[i]\n A_i = i+1\n\na2 = A[A_i-1]+abs(K-A[A_i])\nprint(a2) if a1>a2 else print(a1)', 'impor... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s173169812', 's920565475', 's977527164'] | [28272.0, 28272.0, 28272.0] | [142.0, 197.0, 140.0] | [295, 307, 291] |
p02725 | u453623947 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['k, n = map(int, input().split())\na = list(map(int, input().split())\nb = []\nfor i in range(N):\n d = int(a[i+1]-a[i])\n b.append(int(d))\n\nb.append(K - a[N-1] + a[0])\n\nans = K - max(b)\n\nprint(ans)', 'k,n=map(int,input().split())\na=list(map(int,input().split())\nlists=[]\nfor i in range(N):\n d=int... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s346868783', 's458908390', 's568903171'] | [2940.0, 2940.0, 26436.0] | [18.0, 17.0, 149.0] | [198, 189, 194] |
p02725 | u454472984 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['K,N=map(int,input().split())\nA=list(map(int,input().split()))\nl=0\nfor i in range(N-2):\n if (A[i+2]-A[i+1])>=(A[i+1]-A[i]):\n l=A[i+2]-A[i+1]\nif (20-A[N-1]+A[0])>=l:\nprint(K-l)', 'K,N=map(int,input().split())\nA=list(map(int,input().split()))\nd=[]\nfor i in range(N-1):\n d.append(A[i+1]-A[i])\nd.ap... | ['Runtime Error', 'Accepted'] | ['s566638850', 's246214717'] | [2940.0, 26420.0] | [17.0, 116.0] | [184, 153] |
p02725 | u455477855 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['k , n = map(int, input().split())\narr = list(map(int, input().split()))\n\ndist = 0\n\nfor i in range(len(arr)):\n if i is 0:\n if k - arr[i-1] > dist:\n dist = k - arr[i-1]\n \n if arr[i] - arr[i-1] > dist:\n dist = arr[i] - arr[i-1]\n\nprint(k - dist)', 'k , n = map(int, input().s... | ['Wrong Answer', 'Accepted'] | ['s270869538', 's745390408'] | [26436.0, 26060.0] | [113.0, 115.0] | [275, 293] |
p02725 | u457953718 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['k, n = map(int, input().split())\nl = list(map(int, input().split()))\nmaxi = [k-l[-1]+l[0]]\nfor i in range(1, n):\n maxi = max(l[i] - l[i-1], maxi)\nprint(k-maxi)', 'k, n = map(int, input())\nl = list(map(int, input()))\nmaxi = [k-l[-1]+l[0]]\nfor i in range(1, n):\n maxi = max(l[i] - l[i-1], maxi)\nprint(k-maxi)... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s180305194', 's232300058', 's032461484'] | [26436.0, 3060.0, 26444.0] | [66.0, 17.0, 136.0] | [160, 144, 160] |
p02725 | u459150945 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['K, N = map(int, input().split())\nAn = list(map(int, input().split()))\n\nans = 0\nfor i in range(len(An)-1):\n ans = max(ans, An[i+1]-An[i])\n\n\nans = max(ans, K - An[-1])\n\nprint(K-ans)\n', 'K, N = map(int, input().split())\nAn = list(map(int, input().split()))\n\n\nans = 0\nfor i in range(len(An)-1):\n ans... | ['Wrong Answer', 'Accepted'] | ['s153046303', 's125864759'] | [26444.0, 26444.0] | [165.0, 149.0] | [183, 192] |
p02725 | u459419927 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['from sys import stdin\nfrom collections import deque\nq=deque()\nK,N= list(map(int, (stdin.readline().strip().split())))\nA=list(map(int, (stdin.readline().strip().split())))\nB=A\nmax=A[1]-A[0]\nhome=0\nhome_B=0\nplace=0\nkyori=0\nfor i in range(N-1):\n if max< A[i+1]-A[i]:\n max=A[i+1]-A[i]\n place... | ['Wrong Answer', 'Accepted'] | ['s139847231', 's148050483'] | [25420.0, 25428.0] | [2104.0, 109.0] | [509, 382] |
p02725 | u460745860 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['# ABC160_c\n\nK, N = map(int, input().split())\nA = list(map(int, input().split()))\nans = 0\nfor a in A:\n ans += min(a, K-a)\nprint(ans)\n', 'K, N = map(int, input().split())\nA = list(map(int, input().split()))\ndiff = []\nfor i in range(N):\n if A[i-1] > A[i]:\n diff.append(A[i]-(A[i-1]-K))\n else... | ['Wrong Answer', 'Accepted'] | ['s371170105', 's977655733'] | [32340.0, 32364.0] | [121.0, 139.0] | [135, 232] |
p02725 | u464205401 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['n, k = map(int,input().split())\na = list(map(int,input().split()))\nb = [a[i+1]-a[i] for i in range(k-1)]\nb.append(n-a[-1]+a[0])\nprint(k-max(b))', 'n, k = map(int,input().split())\na = list(map(int,input().split()))\nb = [a[i+1]-a[i] for i in range(k-1)]\nb.append(n-a[-1]+a[0])\nprint(n-max(b))'] | ['Wrong Answer', 'Accepted'] | ['s083302983', 's342919317'] | [32240.0, 32276.0] | [95.0, 93.0] | [143, 143] |
p02725 | u469281291 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['k, n = map(int, input().split())\na = list(map(int, input().split()))\nans = k\nfor i in range(n):\n if (i == 0):\n tmp = a[-1] - a[0]\n else:\n tmp = k-a[i]+a[i-1]\n if (tmp < ans):\n ans = tmp\n print(ans)\nprint(ans)', 'k, n = map(int, input().split())\na = list(map(int, input().sp... | ['Wrong Answer', 'Accepted'] | ['s983247146', 's638210345'] | [26420.0, 25840.0] | [296.0, 134.0] | [241, 226] |
p02725 | u470560351 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['K, N = map(int, input().split())\nA = list(map(int, input().split()))\n\nans = A[N-1] - A[0]\nfor i in range(N-1):\n ans = min(ans, K - A[i+1] - A[i])\nprint(ans)', 'K, N = map(int, input().split())\nA = list(map(int, input().split()))\n\nans = A[N-1] - A[0]\nfor i in range(N-1):\n ans = min(ans, K - (A[i+1] - A[i]... | ['Wrong Answer', 'Accepted'] | ['s949481236', 's317359914'] | [25804.0, 26436.0] | [160.0, 163.0] | [157, 159] |
p02725 | u472197237 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ["def main():\n K, N = map(int, input().split(' '))\n half_k = K // 2\n A = list(map(int, input().split()))\n A.sort()\n A.append(A[0] + K)\n max_diff = A[-1] - half_k + A[0]\n for n in range(0, N - 1, 2):\n if max_diff < A[n + 1] - A[n]:\n max_diff = A[n + 1] - A[n]\n print(K ... | ['Wrong Answer', 'Accepted'] | ['s606980362', 's306494388'] | [26444.0, 26420.0] | [79.0, 80.0] | [360, 315] |
p02725 | u472696272 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['k,n = map(int,input().split())\na = list(map(int,input().split()))\nans = k\nfor i in range(-1,n-1):\n ans = min(ans, k-(n[i+1]-n[i]))\nprint(ans)\n', 'k,n = map(int,input().split())\na = list(map(int,input().split()))\nans = k\nfor i in range(1,n):\n ans = min(ans, k-max(a[i],a[i-1])+min(a[i],a[i-1]))\nprint(ans)'... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s179263310', 's527357514', 's285754549'] | [26420.0, 26444.0, 26436.0] | [65.0, 253.0, 251.0] | [143, 159, 170] |
p02725 | u474122160 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['s=input().split()\nk,n=int(s[0]),int(s[1])\ns=[]\na=input().split()\n\nfor i in range(0,n):\n \n if(i == n-1):\n s.append(abs(int(a[i])+k-int(a[0])))\n else:\n \ts.append(abs(int(a[i])-int(a[i+1])))\nprint(k-max(s))\n \n \n \n\n', 's=input().split()\nk,n=int(s[0]),int(s[1])\ns=[]\na=input().split()\n\nfor i ... | ['Wrong Answer', 'Accepted'] | ['s851886705', 's447379306'] | [18508.0, 20148.0] | [194.0, 198.0] | [220, 220] |
p02725 | u474484450 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ["k, n = map(int, input().split(' '))\na = list(map(int, input().split(' ')))\n\ndiffs = list()\nmax_diff = 0\nfor i in range(n):\n diff = 0\n if i == n-1:\n diff = k + a[0] - a[i]\n else:\n diff = a[i+1] - a[i]\n\n if max_diff < diff:\n max_diff = diff\n diffs.append(diff)\n\nsum(di... | ['Wrong Answer', 'Accepted'] | ['s950051025', 's811950383'] | [26444.0, 26444.0] | [147.0, 156.0] | [317, 324] |
p02725 | u474561976 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['n, k = map(int, input().split(" "))\nhouses = list(map(int, input().split(" ")))\nprint(houses)\ndif_houses = [houses[x+1]-houses[x] for x in range(k-1)]\ndif_houses.append(houses[0]-houses[k-1]+n)\n\nmax_dif = max(dif_houses)\nprint(n-max_dif)', 'n, k = map(int, input().split(" "))\nhouses = list(map(int, input().sp... | ['Wrong Answer', 'Accepted'] | ['s728392754', 's615813303'] | [26444.0, 26444.0] | [119.0, 99.0] | [237, 223] |
p02725 | u482157295 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['k,n = map(int,input().split())\nn_inf = list(map(int,input().split()))\nn_inf.append(k)\nn_inf.insert(0,0)\n#print(n_inf)\nkyori_list = [j for j in range(n+1)]\nfor i in range(n+1):\n kyori_list[i] = n_inf[i+1]-n_inf[i]\n\nkyori_list.sort(reverse=1)\n\nprint(sum(kyori_list[1:n+1]))', 'k,n = map(int,input().split())\... | ['Wrong Answer', 'Accepted'] | ['s174499499', 's551411372'] | [26100.0, 25836.0] | [147.0, 149.0] | [308, 341] |
p02725 | u488178971 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['# 160\nK,N=map(int,input().split())\nA=[int(i) for i in input().split()]\n\nans =[]\n\nfor i in range(N-1):\n ans.append(A[i+1]-A[i])\nans.append(abs(A[0] - (K - A[-1])))\nprint(sum(ans) - max(ans))', '# 160\nK,N=map(int,input().split())\nA=[int(i) for i in input().split()]\n\nans =[]\nfor a in A:\n ans.append(... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s148070339', 's929053005', 's557588726'] | [26436.0, 26436.0, 26228.0] | [125.0, 142.0, 128.0] | [192, 134, 192] |
p02725 | u489153633 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['_in = list(map(int, input().split()))\nk = _in[0]\nn = _in[1]\np = 0\n_i = list(map(int, input().split()))\ndis = 0\nmdis = k - _i[n-1] + _i[0]\nprint(mdis)\nfor i in range(1,n):\n dis = _i[i] - _i[i-1]\n print(dis)\n if dis>mdis:\n mdis = dis\nprint(k-mdis)', '_in = list(map(int, input().split()))\nk... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s443026488', 's609997718', 's507909279'] | [26444.0, 26444.0, 26444.0] | [240.0, 251.0, 111.0] | [261, 263, 234] |
p02725 | u491550356 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['import math\n\nk, n = map(int, input().split())\nA = list(map(int, input().split()))\nA.append(k)\nans = 0\nfor i in range(0, n):\n ans = max(ans, abs(A[i] - A[i+1]))\n\nprint(k-ans)', 'k, n = map(int, input().split())\nA = list(map(int, input().split()))\nA.append(k+A[0])\n\nans = 0\nfor i in range(0, n):\n an... | ['Wrong Answer', 'Accepted'] | ['s303973655', 's255689679'] | [26444.0, 26420.0] | [152.0, 157.0] | [176, 163] |
p02725 | u492414556 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['def solve():\n K = int(input())\n N = int(input())\n vals = [None] * N\n ans = 99999999\n for i in range(N):\n vals[i] = int(input())\n for i in range(N):\n cc = -1\n if i == 0:\n cc = vals[N-1] - vals[0]\n else:\n cc = vals[i-1] + K - vals[i]\n ans = min(ans, cc)\n print(ans)\nsolve()... | ['Runtime Error', 'Accepted'] | ['s122418070', 's792228991'] | [3060.0, 26444.0] | [18.0, 161.0] | [307, 352] |
p02725 | u492749916 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['K, N = map(int, input().split())\na = list(input().split())\n\na = [int(i) for i in a]\n\ndiff = list()\ndiff.insert(0,K-a[N-1]+a[0]) \nfor i in range(2,N+1): # seq 2 to N-1\n diff.insert(i-1,abs(a[i-1]-a[i-2]))\n\nprint (diff)\n\nprint (sum(diff)-max(diff))', 'K, N = map(int, input().split())\na = list(input(... | ['Wrong Answer', 'Accepted'] | ['s997319855', 's225117391'] | [24908.0, 24856.0] | [186.0, 161.0] | [260, 262] |
p02725 | u493318999 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['k,n = map(int,input().split())\na = list(map(int,input().split()))\nmin = 10000000\nfor i in range(n-1):\n if min > a[i+1]-a[i]:\n min = a[i+1]-a[i]\nif min > k-a[n-1]+a[0]:\n min = k-a[n-1]+a[0]\nprint(k-min)', 'k,n = map(int,input().split())\na = list(map(int,input().split()))\nmax = 0\nfor i in range(... | ['Wrong Answer', 'Accepted'] | ['s995608609', 's016199477'] | [25920.0, 25452.0] | [107.0, 104.0] | [214, 207] |
p02725 | u493555013 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['K,N = map(int,input().split())\nA = list(map(int,input().split()))\n\nmx = K - A[N-1] +A[0]\nfor i in range(N-1):\n if A[i+1] - A[i] > mx:\n mx = A[i+1] - A[i]\n \nans = sum(A) - mx\nprint(ans)\n ', 'K,N = map(int,input().split())\nA = list(map(int,input().split()))\n\nmx = K - A[N-1] +A[0]\nfor i in range(N-... | ['Wrong Answer', 'Accepted'] | ['s823909389', 's812616879'] | [26444.0, 25452.0] | [104.0, 107.0] | [194, 186] |
p02725 | u496687522 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['K, N = map(int, input().split())\nA = list(map(int, input().split()))\n\nans_root = K\nfor i range(N):\n if i==0:\n root = A[N-1] - A[0]\n else:\n root = A[i-1]+K - A[i]\n if ans_root > root:\n ans_root = root\nprint(ans_root)', 'K, N = map(int, input().split())\nA = list(map(int, input(... | ['Runtime Error', 'Accepted'] | ['s553668075', 's150815893'] | [2940.0, 26100.0] | [17.0, 128.0] | [245, 248] |
p02725 | u498531348 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['A = list(map(int, input().split()))\n\n\n\nA = sorted(A)\nL = []\nANS = 0\n\nA_max = max(A)\n\nfor i in range(N-1):\n L.append(abs(A[i+1]-A[i]))\n \nL.append(K + A[0] - A_max)\n\nL = sorted(L)\n\n\nL.pop(-1)\n\nfor i in range(len(L)):\n ANS = ANS + L[i]\n \nprint(ANS)\n ', 'K, N = map(int, input().... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s684965629', 's711307674', 's752097107'] | [9100.0, 32376.0, 32360.0] | [26.0, 160.0, 153.0] | [266, 295, 299] |
p02725 | u498575211 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['N, K = map(int, input().split())\na = list(map(int, input().split()))\na.append(N+a[0]-a[-1])\nmax = 0\nfor i in range(len(a)-1):\n p = abs(a[i]-a[i+1])\n max = p if max < p else max\nprint(N-max)\n', 'N, K = map(int, input().split())\na = list(map(int, input().split()))\na.append(N+a[0])\n#print(a)\nmax = 0\nfor i... | ['Wrong Answer', 'Accepted'] | ['s951701890', 's740634277'] | [25452.0, 26004.0] | [128.0, 131.0] | [192, 196] |
p02725 | u501451051 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['k, n = map(int, input().split())\nclist = list(map(int, input().split()))\n \nmax1 = 0\nind = 0\nfor i in range(n-1):\n tmp = clist[i+1] - clist[i]\n if tmp > max1:\n max1 = tmp\n ind = i\n \nprint(clist[ind]+(k-clist[ind+1]))', 'k, n = map(int, input().split())\nclist = list(map(int, input().spli... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s753543927', 's788998916', 's890958114'] | [26444.0, 25840.0, 25836.0] | [112.0, 122.0, 123.0] | [235, 216, 204] |
p02725 | u502389123 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['K, N = map(int, input().split())\nA = list(map(int, input().split()))\n\nans = 1e9\nfor i in range(N):\n ans = min(ans, min(A[(i+N-1)%N] + K - A[i], A[i] + K - A[(i+1)%N]))\n\nprint(ans)', 'K, N = map(int, input().split())\nA = list(map(int, input().split()))\n\ndist = [K - A[N-1] + A[0]]\nfor i in range(N-1):\n ... | ['Wrong Answer', 'Accepted'] | ['s568684153', 's851257916'] | [26444.0, 25840.0] | [276.0, 114.0] | [182, 170] |
p02725 | u507457124 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['import numpy as np\nK, N = map(int, input().split())\nA = input().split()\ndiff = np.append(np.array(A[1:]) - np.array(A[:-1]), K - A[-1])\ndiff = np.delete(diff, np.argmax(diff))\nprint(diff.sum())', 'import numpy as np\nK, N = map(int, input().split())\nA = np.array(list(map(int, input().split())))\ndiff = np.appen... | ['Runtime Error', 'Accepted'] | ['s680541149', 's773589796'] | [59568.0, 50796.0] | [171.0, 179.0] | [193, 194] |
p02725 | u508842013 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['K,N=map(int,input().split())\nA=list(map(int,input().split()))\nC = A.sort()\nB=C[1:]-C[:-1]\nB.append(K+C[0]-C[N-1])\nprint(K-max(B))', 'import numpy as np\n\nK,N=map(int,input().split())\nA=list(map(int,input().split()))\nA.sort()\nx=np.array(A[1:])\ny=np.array(A[:-1])\nB=x-y\nB.append(K+A[0]-A[N-1])\nprint(K-int(m... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s220934294', 's344335515', 's384317536', 's402932740', 's550064927', 's657481597', 's853561525', 's838975090'] | [25840.0, 3060.0, 42088.0, 25840.0, 34156.0, 26444.0, 26420.0, 34148.0] | [71.0, 17.0, 783.0, 71.0, 247.0, 73.0, 68.0, 248.0] | [129, 177, 173, 125, 184, 175, 125, 191] |
p02725 | u512099209 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['K, N = list(map(int, input().split()))\nA = list(map(int, input().split()))\n\ndistance = [0] * N\n\nfor i in range(N - 1):\n distance[i] = A[i + 1] - A[i]\n\ndistance[-1] = K - A[-1]\n\nprint(K - max(distance))', 'K, N = list(map(int, input().split()))\nA = list(map(int, input().split()))\n\ndistance = [0] * N\n\nf... | ['Wrong Answer', 'Accepted'] | ['s918665149', 's135919758'] | [26444.0, 26420.0] | [113.0, 111.0] | [202, 210] |
p02725 | u516554284 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['n,k=map(int,input().split())\na=list(map(int,input().split()))\nans=0\nfor x in range(n-1):\n b=a[x+1]-a[x]\n ans=max(ans,b)\n \nc=k-a[n-1]+a[0]\n\nprint(max(ans,c))\n', 'n,k=map(int,input().split())\na=list(map(int,input().split()))\nans=0\nfor x in range(n-1):\n b=a[x+1]-a[x]\n ans=max(ans,b)\n \nc=k-a[n]+a[0... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s435570907', 's531283999', 's771916183'] | [32232.0, 32388.0, 32204.0] | [130.0, 126.0, 130.0] | [160, 157, 163] |
p02725 | u516927307 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['k, n = map(int, input().split())\na = list(map(int, input().split()))\n\nd = [k-a[-1]+a[0]]\n\nfor i in range(n-1):\n d.append(a[i+1]-a[i])\n\nprint(a-max(dist))\n', 'k, n = map(int, input().split())\na = list(map(int, input().split()))\n\nd = [k-a[-1]+a[0]]\n\nfor i in range(n-1):\n d.append(a[i+1]-a[i])\n\npr... | ['Runtime Error', 'Accepted'] | ['s011892606', 's292873393'] | [26060.0, 25928.0] | [112.0, 118.0] | [157, 155] |
p02725 | u518891382 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['k,n = map(int, input().split())\nA = list(map(int, input().split()))\n\npath = 0\n\nfor i in range(n):\n if i == 0:\n path += min(abs(A[i]-A[n-1]),abs(A[i]-A[i+1]))\n elif i == n-1:\n path += min(abs(A[i]-A[i-1]),abs(A[i]-A[0]))\n else:\n path += min(abs(A[i]-A[i+1]),abs(A[i]-A[i-1]))\n\... | ['Wrong Answer', 'Accepted'] | ['s039305105', 's584178945'] | [33732.0, 32220.0] | [192.0, 101.0] | [318, 199] |
p02725 | u519922200 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['K, N = map(int, input().split())\nA = list(map(int, input().split()))\nB=[]\nfor i in range(N-1):\n B.append(A[i+1]-A[i])\nB.append(A[N-1]-A[0])\nprint(N-max(B))', 'K, N = map(int, input().split())\nA = list(map(int, input().split()))\nB=[]\nfor i in range(N-1):\n B.append(A[i+1]-A[i])\nB.append(K-(A[N-1]-A[0])... | ['Wrong Answer', 'Accepted'] | ['s388927333', 's720741252'] | [26436.0, 26436.0] | [118.0, 119.0] | [158, 162] |
p02725 | u520331522 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['k,n = int(input().split())\n\nl = list(map(int, input().split()))\nm = [0]*n\ncount = 0\n\nfor i in range(n-1):\n m[count] = l[i+1] - l[i]\n count+=1\nm[n-1] = k - l(n-1) + l[0]\n\nprint(k - max(m))', 'k,n = input().split()\nk = int(k)\nn = int(n)\n\nl = list(map(int, input().split()))\nm = [0]*n\ncount = 0\n\n... | ['Runtime Error', 'Accepted'] | ['s891744647', 's115603338'] | [3064.0, 26444.0] | [17.0, 130.0] | [193, 210] |
p02725 | u526094365 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['K, N = map(int, input().split())\nA = list(map(int, input().split()))\n\nB = []\nfor i in range(N - 1):\n B.append(abs(A[i] - A[i + 1]))\n\n\nB.append(abs(K - A[-1] - A[0]))\n\nB = sorted(B)\n\nprint(sum(B[:-1]))\n', 'K, N = map(int, input().split())\nA = list(map(int, input().split()))\n\nB = []\nA = sorted(A)\nf... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s081082585', 's201075988', 's437824339', 's509996541', 's625841854'] | [26436.0, 26436.0, 35924.0, 42708.0, 43772.0] | [155.0, 157.0, 260.0, 1116.0, 889.0] | [204, 218, 199, 248, 236] |
p02725 | u528887718 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['K,N = map(int,input().split())\nA = list(map(int,input().split()))\nsub = [abs(A[i] - A[i+1]) for i in range(N-1)]\nsub.append(K-A[N-1])\nprint(K-max(sub))', 'K,N = map(int,input().split())\nA = list(map(int,input().split()))\nsub = [abs(A[i] - A[i+1]) for i in range(N-1)]\nsub.append(K-A[N-1]+A[0])\nprint(K-max(sub)... | ['Wrong Answer', 'Accepted'] | ['s462867686', 's352517935'] | [25920.0, 26444.0] | [111.0, 108.0] | [151, 157] |
p02725 | u531219227 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['K,N = map(int,input().split())\nA = []\nfor i in range(N):\n A.append(int(input()))\nA_m=[]\n\nfor i in range(1,N):\n A_m.append(int(A[i] - A[i-1]))\n \n\nif abs(A[N-1]-A[0]) > 10:\n A_m.append(A[0]-A[N-1] +20)\nelse:\n A_m.append(A[N-1]-A[0])\n \nX = sum(A_m) - max(A_m)\n\nprint(X)', 'K,N = map(int,input().s... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s177917274', 's448172335', 's443860727'] | [7092.0, 7092.0, 25452.0] | [26.0, 27.0, 119.0] | [274, 201, 186] |
p02725 | u531599639 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['K, N = map(int, input().split())\nA = list(map(int, input().split()))\nA.sort()\nm = 0\nfor i in range(1, len(A)):\n if A[i]-A[i-1]>m:\n m=A[i]-A[i-1]\nif K-A[-1]+A[1]>m:\n print(A[-1]-A[1])\nelse:\n print(K-m)\n', 'K, N = map(int, input().split())\nA = list(map(int, input().split()))\nA.sort()\nm = 0... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s062155381', 's242400732', 's707530874'] | [25840.0, 26444.0, 26444.0] | [109.0, 107.0, 106.0] | [217, 206, 217] |
p02725 | u536034761 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['K, N = map(int, input().split())\nA = list(map(int, input().split()))\nlongest = 0\nfor i in range(N):\n longest = max(longest, A[i + 1] - A[i])\nlongest = max(longest, A[0] + K - A[-1])\nprint(K - longest)', 'K, N = map(int, input().split())\nA = list(map(int, input().split()))\nlongest = 0\nfor i in range(N - 1):\... | ['Runtime Error', 'Accepted'] | ['s390725127', 's581627038'] | [26444.0, 26436.0] | [160.0, 162.0] | [201, 205] |
p02725 | u536685012 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['k, n = input().split()\na = list(map(int, input().split()))\n\nmax = 0\n\nfor i in range(n - 1):\n if a[i + 1] - a[i] > max:\n max = a[i + 1] - a[i]\n\nif (k - a[n]) + a[0] >= max:\n max = (k - a[n]) + a[0]\n\nprint(k - max)', 'k, n = input().split()\nk, n = int(k), int(n)\na = list(map(int, input().split()))\n\... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s246516325', 's271926592', 's538471195'] | [25836.0, 26436.0, 26444.0] | [65.0, 104.0, 102.0] | [217, 240, 248] |
p02725 | u537142137 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['I = input().split()\nK = int(I[0])\nN = int(I[1])\n\nI = input().split()\n\nA = [ int(I[0]) ]\nL = [ A[0] ]\nfor i in range(1,N):\n A.append( int(I[i]) )\n L.append( A[i] - A[i-1] )\n\nL[0] = A[0]+(K-A[N-1])\n\nA.sort()\nprint(L[N-1])\n\n \n', 'I = input().split()\nK = int(I[0])\nN = int(I[1])\n\nI = input().split... | ['Wrong Answer', 'Accepted'] | ['s102272063', 's773450920'] | [28792.0, 29584.0] | [161.0, 182.0] | [226, 229] |
p02725 | u538784937 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['K,N = map(int,input().split())\ndis = list(map(int,input().split()))\nprint(sum(dis)-max(dis))\n\n', 'K,N = map(int,input().split())\ndis = list(map(int,input().split()))\ndif = []\nfor i in range(N-1):\n dif.append(int(dis[i+1]-dis[i]))\n \ndif.append(int(K-dis[N-1]+dis[0]))\nprint(K-max(dif))\n\n'] | ['Wrong Answer', 'Accepted'] | ['s716899592', 's283603025'] | [32352.0, 32304.0] | [76.0, 119.0] | [94, 190] |
p02725 | u540166312 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['k, n = map(int, input().split())\na = list(map(int, input().split()))\na.append(k+a[0])\ndist = [abs(a[i+1]-a[i]) for i in range(n)]\n\nprint(a)\nprint(k-max(dist))', 'k, n = map(int, input().split())\na = list(map(int, input().split()))\na.append(k+a[0])\ndist = [abs(a[i+1]-a[i]) for i in range(n)]\n\nprint(k-max(di... | ['Wrong Answer', 'Accepted'] | ['s039902553', 's061543131'] | [26436.0, 26420.0] | [122.0, 109.0] | [158, 149] |
p02725 | u548069143 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['k,n=map(int,input().split())\nb=list(map(int, input().split()))\nb.sort()\na=[b[0]+k-b[n-1]]\nfor i in range(n-1):\n a.append(b[i+1]-b[i])\n print(b[i])\nprint(k-max(a))\n', 'k,n=map(int,input().split())\nb=list(map(int, input().split()))\nb.sort()\na=[b[0]+k-b[n-1]]\nfor i in range(n-1):\n a.append(b[i+1]-b... | ['Wrong Answer', 'Accepted'] | ['s619833949', 's553246993'] | [26436.0, 26444.0] | [290.0, 120.0] | [169, 153] |
p02725 | u548545174 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['K, N = map(int, input().split())\nA = list(map(int, input().split()))\nA = [0] + A + [K] \n\ndiff = []\nfor i in range(len(A)):\n if i < N+1:\n diff.append(A[i+1] - A[i])\n\nlongest_interval = diff.index(max(diff))\ndiff.pop(longest_interval)\nans = sum(diff)\n\nprint(ans)\n', 'K, N = map(int, input().split... | ['Wrong Answer', 'Accepted'] | ['s147607361', 's208512730'] | [26420.0, 26444.0] | [142.0, 136.0] | [282, 280] |
p02725 | u548976218 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['k, n = map(int, input().split())\na = list(map(int, input().split()))\n\nall_length = k*2\npoint = []\nfor i in range(n):\n a_left = k-a[i]\n a_right = k+a[i]\n point.append(a_left)\n point.append(a_right)\npoint = list(set(point))\npoint.sort()\n\nnum = len(point)\nnum = round(num)\ndistance = []\nfor i... | ['Runtime Error', 'Accepted'] | ['s695276556', 's743040755'] | [55724.0, 26444.0] | [2105.0, 163.0] | [457, 150] |
p02725 | u549494450 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ["a=input().split(' ')\nb=input().split(' ')\nc=0\nfor i in int(a[1]):\n if i != a[1]-1:\n if int(b[i+1]) - int(b[i]) > c:\n c = int(b[i+1]) - int(b[i])\n else:\n if int(a[0]) - int(b[-1])+ int(b[0]) > c:\n c = int(a[0]) - int(b[-1])+ int(b[0])\nprint(int(a[0])-c)", "a=input().... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s678086153', 's726403378', 's242399551'] | [18704.0, 18508.0, 18508.0] | [35.0, 36.0, 220.0] | [294, 300, 307] |
p02725 | u556589653 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['K,N = map(int,input().split())\nnow = -10**9\nfor i in range(N):\n if i == N-1:\n if K-A[N-1]+A[i]>now:\n now = K-A[N-1]+A[i]\n else:\n if A[i+1]-A[i] > now:\n now = A[i+1]-A[i]\nprint(K-now)', 'K,N = map(int,input().split())\nA = list(map(int,input().split()))\nnow = K-A[N-1]+A[0]\nfor i in range(N... | ['Runtime Error', 'Accepted'] | ['s866938366', 's770209586'] | [3060.0, 26060.0] | [17.0, 104.0] | [200, 166] |
p02725 | u561294476 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['K, N = map(int, input().split())\nA = list(map(int, input().split()))\n\n\n\nAN = A[0]+(K-sum(A))\nA2 = A[1:N]\nA2.append(AN)\n\nprint(sum(A2)-max(A2))\n', 'K, N = map(int, input().split())\nA = list(map(int, input().split()))\n\n\nA2 = [A[i+1] - A[i] for i in range(N-1)]\nAN = A[0]+(A[0]+(K-A[N-1]))\nA2.append(AN)\n... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s058937592', 's571132139', 's654120137', 's612761022'] | [26444.0, 26420.0, 26444.0, 26548.0] | [77.0, 100.0, 76.0, 101.0] | [187, 216, 182, 209] |
p02725 | u564657854 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['K,N = map(int,input().split())\nA_str = input().split()\nA = [int(h) for h in A_str]\nprint(A)\nD = []\nfor i in range(1,N):\n D.append(A[i]-A[i-1])\nD.append(A[0]+(K-A[N-1]))\nprint(D)\nmaximum = max(D)\nprint(K-maximum)', 'K,N = map(int,input().split())\nA_str = input().split()\nA = [int(h) for h in A_str]\nD = []... | ['Wrong Answer', 'Accepted'] | ['s399494126', 's484311182'] | [30536.0, 27980.0] | [158.0, 129.0] | [212, 194] |
p02725 | u569776981 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['N = int(input())\nx = 0\na = []\nfor i in range(2,N,2):\n while i % 2 == 0:\n i //= 2\n x += 1\n a.append(x)\n x = 0\na = sorted(a)\na = a[::-1]\nprint(a[0])', 'K, N = map(int,input().split())\nA = list(map(int,input().split()))\nx = []\n\nfor i in range(N - 1):\n x.append(A[i + 1] - A[i])\n... | ['Runtime Error', 'Accepted'] | ['s556812130', 's927618711'] | [9032.0, 32372.0] | [24.0, 117.0] | [169, 198] |
p02725 | u571395477 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['def main():\n K, N = [int(_) for _ in input().split()]\n A = map(int, input().split())\n mx = 0\n\n for i in range(N-1):\n dis = A[i+1]-A[i]\n if dis > mx:\n mx = dis\n se = A[N-1] - A[0]\n if (k-(se)) > mx:\n mx = k - se\n print(mx)\nmain()', 'def main():\n K, ... | ['Runtime Error', 'Accepted'] | ['s882082256', 's988152996'] | [18064.0, 25840.0] | [34.0, 94.0] | [281, 294] |
p02725 | u574464625 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['k,n = map(int, input().split())\n\na= list(map(int,input().split()))\nsa=[0]*n\nfor i in range(n-1):\n sa[i]=a[i+1]-a[i]\n sa[n-1]=a[0]+(k-a[n-1])\nprint(sa)\nans=max(sa)\nans=k-ans\nprint(ans)', 'k,n = map(int, input().split())\n\na= list(map(int,input().split()))\nsa=[0]*n\nfor i in range(n-1):\n sa[i]=a[i... | ['Wrong Answer', 'Accepted'] | ['s528620043', 's734740771'] | [32180.0, 32148.0] | [150.0, 146.0] | [189, 190] |
p02725 | u574590381 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['\nk, n = list(map(int,input().split()))\na = list(map(int,input().split()))\n\nres= a[n-1]\n\nmax=0\nn_prev=0\n\nfor nn in a:\n if (nn-n_prev) < (k-a[n-1]):\n res=(nn-n_prev)\n n_prev=nn\n\nprint(res)\n\n', '\nk, n = list(map(int,input().split()))\na = list(map(int,input().split()))\n\nres= a[n-1]\n\nm... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s107179165', 's528314052', 's570282916'] | [25840.0, 25840.0, 26444.0] | [136.0, 115.0, 97.0] | [202, 202, 201] |
p02725 | u578647703 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['K, N = map(int, input().split())\nA = list(map(int, input().split()))\nresult = 0\nmx = -float("inf")\nfor i in range(N-1):\n mx = max(mx, A[i+1] - A[i])\nmx = max(mx, K - A[-1])\n\nresult = K - mx\nprint(result)', 'K, N = map(int, input().split())\nA = list(map(int, input().split()))\nresult = 0\nmx = -float("inf... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s045000033', 's841193084', 's201146422'] | [25840.0, 26420.0, 26436.0] | [154.0, 163.0, 157.0] | [206, 213, 213] |
p02725 | u581403769 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['k, n = map(int, input().split())\na = list(map(int, input().split()))\n\nspace = []\nfor i in range(n - 1):\n s = a[i + 1] - a[i]\n space.append(s)\nspace.append(k - a[n - 1])\n\nprint(k - max(space))', 'k, n = map(int, input().split())\na = list(map(int, input().split()))\n\nspace = []\nfor i in range(n - 1):\... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s504142992', 's525468933', 's998042736', 's009648425'] | [26436.0, 26444.0, 26444.0, 26004.0] | [124.0, 123.0, 124.0, 124.0] | [197, 204, 204, 204] |
p02725 | u589913372 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['import numpy as np\nk,n = map(int, input().split())\na = list(map(int, input().split()))\nb = np.zeros(n)\nfor i in range(0,n-1):\n b[i] = a[i+1] -a[i]\n\nb[n-1] = k - a[n-1] + a[0]\nprint(a,b)\nans = k - max(b)\nprint(int(ans))', 'import numpy as np\nk,n = map(int, input().split())\na = list(map(int, input().split(... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s466989217', 's820863486', 's469408932'] | [34144.0, 42800.0, 26420.0] | [328.0, 458.0, 117.0] | [219, 216, 199] |
p02725 | u590198086 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['p, n = map(int,input().split())\nl = list(map(int,input().split()))\nans = min(max(l)-min(l), p-max(l)+ min(l))', 'p, n = map(int,input().split())\nl = list(map(int,input().split()))\nl.sort()\nval = l[-1]-l[0]\nfor i in range(1,n):\n val = min(val, l[-1] - l[i] + p-l[-1]+l[i-1])\nprint(val)\n'] | ['Wrong Answer', 'Accepted'] | ['s967784106', 's732806865'] | [25836.0, 25840.0] | [80.0, 178.0] | [109, 175] |
p02725 | u592035627 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['M,N = list(map(int,input().split()))\nA = input().split()\nA.append(M)\ndis = 0\nfor i in range(N):\n if A[i+1]-A[i] >= dis:\n dis = A[i+1]-A[i]\n \nprint(A[-2]-A[0]-(dis-A[1]-A[0]))', 'M,N = list(map(int,input().split()))\nA = list(map(int,input().split()))\nA.append(M+A[0])\ndis = 0\nfor i in range... | ['Runtime Error', 'Accepted'] | ['s838326040', 's770121030'] | [18508.0, 26444.0] | [34.0, 127.0] | [191, 181] |
p02725 | u592248346 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['#include <stdio.h>\nint main(void){\n long k,n,i,max=-1,a[200000];\n scanf("%ld%ld",&k,&n);\n for(i=0;i<n;i++) scanf("%ld",&a[i]);\n for(i=0;i<n-1;i++){\n int tmp=a[i+1]-a[i];\n if(tmp>max) max=tmp;\n }\n printf("%ld",k-max);\n return 0;\n}', 'k,n = map(int,input().split())\na = lis... | ['Runtime Error', 'Accepted'] | ['s528353964', 's053212540'] | [2940.0, 25836.0] | [17.0, 158.0] | [264, 142] |
p02725 | u595064211 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['K, N = map(int, input().split())\nA = list(map(int, input().split()))\nmi = float("inf")\nma = 0\ntokei = 1\nans = 0\n\nfor index, tmp in enumerate(A):\n if index==0:\n left = tmp\n elif index == 1:\n right = tmp\n b1 = right - left\n b2 = left+K-right\n# print(b1)\n# ... | ['Wrong Answer', 'Accepted'] | ['s470087105', 's744722909'] | [26444.0, 26420.0] | [447.0, 227.0] | [694, 207] |
p02725 | u595289165 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['k, n = map(int, input().split())\na = list(map(int, input().split()))\nfor i in range(n):\n a.append(k+a[i])\nright = [0]\n\nfor i in range(1, 2*n):\n right.append(right[-1] + a[i] - a[0])\n\nans = abs(a[0] - a[-2])\nfor i in range(1, n):\n ans = min(ans, abs(a[i] - a[n+i-1]))\nprint(ans)\n\n\n', 'k, n = map... | ['Wrong Answer', 'Accepted'] | ['s631017670', 's220590884'] | [40292.0, 38348.0] | [341.0, 323.0] | [289, 291] |
p02725 | u595786324 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['n,k = map(int,input().split())\na = sorted([i for i in map(int,input().split())])\nmaxi = -1\nans = (n + (n - a[-1]%n))%n + a[0]\n#print(ans)\nfor i in range(1,len(a)):\n maxi = max(maxi,a[i] - a[i - 1])\n ans += a[i] - a[i - 1]\nmaxi = max(maxi,(a[-1] + (a[-1] - a[0]))%n)\nans -= maxi\nprint(ans)\n\n', 'n,k = ... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s271875428', 's688679360', 's412197545'] | [26420.0, 26444.0, 26444.0] | [216.0, 203.0, 208.0] | [296, 291, 298] |
p02725 | u598888192 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['n,k = list(map(int,input().split()))\narr = list(map(int,input().split()))\nmax_d = k-arr[-1] + arr[0]\nfor i in range(n):\n max_d = max(max_d,arr[i+1]-arr[i])\nprint(k-max_d)', 'n,k, = list(map(int,input().split()))\narr = list(map(int,input().split()))\nmax_d = k-arr[-1] + arr[0]\nfor i in range(n):\n max_d = max... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s026693010', 's256673986', 's265913590'] | [25804.0, 26444.0, 26436.0] | [148.0, 150.0, 151.0] | [171, 173, 175] |
p02725 | u599669731 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['k,n=map(int,input().split())\na=list(map(int,input().split()))\na.append(a[0])\ndis=[]\nfor i in range(n):\n d=abs(a[i]-a[i+1])\n if d>k/2:\n d=k-d\n dis.append(d)\nprint(dis,k-max(dis))', 'k,n=map(int,input().split())\na=list(map(int,input().split()))\na.append(a[0])\ndis=[]\nfor i in range(n):\n ... | ['Wrong Answer', 'Accepted'] | ['s560733109', 's382002256'] | [26444.0, 26444.0] | [192.0, 176.0] | [193, 189] |
p02725 | u601980345 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['K = int(input())\nN = int(input())\nA = {}\nfor i in range(N):\n A[i] = int(input())\nmax = 0\nfor i in range(N):\n len = 0\n if i == 0:\n len = int(A[i] + (K - A[N - 1]))\n else:\n len = int(A[i] - A[i - 1])\n\n if len > max:\n max = len\n\nprint(K - max)', 'K, N = map(int, input(... | ['Runtime Error', 'Accepted'] | ['s362957388', 's339894002'] | [3064.0, 26444.0] | [17.0, 147.0] | [276, 261] |
p02725 | u602773379 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['# -*- coding: utf-8 -*-\n\nK,N = map(int,input().split())\nAn = list(map(int,input().split()))\n\nBn=An[1:]+[K+An[0]]\nprint(An)\nprint(Bn)\ndis = [x-y for x,y in zip(An,Bn)]\nprint(K-abs(min(dis)))\n', '# -*- coding: utf-8 -*-\n\nK,N = map(int,input().split())\nAn = list(map(int,input().split()))\n\nBn=An[1:]+[K+An[... | ['Wrong Answer', 'Accepted'] | ['s664691150', 's224355848'] | [25836.0, 26436.0] | [125.0, 89.0] | [190, 170] |
p02725 | u604114648 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['K,N=map(int,input().split())\nA=list(map(int,input().split()))\nn=2*10^6\nfor i in range(N):\n m = abs(A[i-1] - A[i])\n if n > m:\n n = m\nprint(m)', 'K,N=map(int,input().split())\nA=list(map(int,input().split()))\nn=2*10^6\nfor i in range(N):\n m = abs(A[i-1] - A[i])\n if n > m:\n n = m\nprint(m)', 'K,N=ma... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s846665892', 's865456469', 's772430530'] | [26420.0, 26420.0, 25452.0] | [122.0, 121.0, 125.0] | [145, 145, 277] |
p02725 | u605601159 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['k, n = [int(i) for i in input().strip().split()]\narr = [int(i) for i in input().strip().split()] + [k + arr[0]]\nmax_d = 0\nfor i in range(1, n + 1):\n max_d = max(max_d, abs(arr[i] - arr[i - 1]))\nprint(k - max_d)', 'k, n = [int(i) for i in input().strip().split()]\narr = [int(i) for i in input().strip().split()... | ['Runtime Error', 'Accepted'] | ['s782467194', 's951867500'] | [24564.0, 26444.0] | [71.0, 151.0] | [213, 219] |
p02725 | u607729897 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ["import sys\nread = sys.stdin.buffer.read\nreadline = sys.stdin.buffer.readline\nreadlines = sys.stdin.buffer.readlines\n\ndef main():\n K, N = map(int, readline().split())\n A = list(map(int, readline().split()))\n d = [A[i]-A[i-1] for i in range(1,N)]\n ans = min(K-max(d), max(d))\n print(ans)\n re... | ['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s052729330', 's862784109', 's886753593', 's587838674'] | [20456.0, 13964.0, 20424.0, 20424.0] | [92.0, 60.0, 117.0, 95.0] | [351, 320, 403, 386] |
p02725 | u608493167 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['a,b = map(int,input().split())\nList = [int(i) for i in input().split()]\ns = [0]*b\ns[b-1] = abs(a- List[b-1])\nfor i in range(b-1):\n s[i] = abs(List[i]-List[i+1])\nprint(a-max(s))', 'a,b = map(int,input().split())\nList = [int(i) for i in input().split()]\ns = [0]*b\ns[b-1] = abs(List[0] + a- List[b-1])\nfor i ... | ['Wrong Answer', 'Accepted'] | ['s155015293', 's343562540'] | [26420.0, 24948.0] | [131.0, 129.0] | [179, 189] |
p02725 | u609814378 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['import itertools\nK, N = map(int, input().split())\nA = list(map(int, input().split()))\n\nA_list = list(itertools.permutations(l, N))\n\nprint(A_list)', 'import itertools\nK, N = map(int, input().split())\nA = list(map(int, input().split()))\n\nA_list = list(itertools.permutations(l, N))\nans = 10**8\nfor i in A_lis... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s213981202', 's303522544', 's262383550'] | [26444.0, 26444.0, 26436.0] | [69.0, 65.0, 174.0] | [145, 503, 154] |
p02725 | u612261372 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['from fractions import gcd\nA, B, C, D = map(int, input().split())\n\nif A % C ==0:ca = A//C-1\nelse: ca = A//C\ncb = B//C\n\n\nif A % D ==0: ad = A//D-1\nelse:da = A//D \ndb = B//D\n\nlcm = C * D //gcd(C,D)\nif A % lcm==0: cda = A//lcm-1\nelse:cda = A//lcm\ncdb = B//lcm\n\nprint(B-A+1-((cb-ca)+(db-da)-(cdb-cda)))', '... | ['Runtime Error', 'Accepted'] | ['s019989919', 's426083578'] | [5076.0, 26444.0] | [35.0, 262.0] | [297, 466] |
p02725 | u612895604 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['import numpy as np\n\nK, N = map(int, input().split(" "))\nloc = list(map(int, input().split(" ")))\nloc = np.array(loc)\n\ndist = np.diff(loc)\nnp.append(dist,K - loc[N-1] + loc[0])\n\nmost_far = np.max(dist)\nprint(K-most_far)', 'import numpy as np\n\nK, N = map(int, input().split(" "))\nloc = list(map(int, input()... | ['Wrong Answer', 'Accepted'] | ['s108851209', 's836973313'] | [42420.0, 34168.0] | [1013.0, 211.0] | [218, 231] |
p02725 | u612975321 | 2,000 | 1,048,576 | There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to ... | ['k, n = map(int,input().split())\na = list(map(int,input().split()))\n\nans = 10**6 + 1\nfor i in range(n):\n ans = min(a[-1] - a[i])\n a.append(a[i]+k)\nprint(ans)', 'k, n = map(int,input().split())\na = list(map(int,input().split()))\n\nans = 10**6 + 1\nfor i in range(n):\n ans = min(ans, a[-1] - a[i])\n ... | ['Runtime Error', 'Accepted'] | ['s285633524', 's028682477'] | [32204.0, 32156.0] | [69.0, 151.0] | [162, 168] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.