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
u176915127
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 , N_point = map(int,input().split())\nlist_point = input().split()\n\nfor i in range(len(list_point)):\n list_point[i] = int(list_point[i])\n\n\ndistance = []\nfor i in range(len(list_point)):\n \n if i == 0:\n distance.append(list_point[i])\n \n if i == len(list_point)-1:\n distance.append(N - list_poin...
['Wrong Answer', 'Accepted']
['s331872910', 's608589199']
[22348.0, 20276.0]
[249.0, 213.0]
[520, 525]
p02725
u180528413
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(' ')))\nx = k - a[-1]\nfor i in range(n-1):\n y = a[i+1]-a[i]\n if y > x:\n x = y\nprint(k-x)", "k,n = map(int,input().split())\na = list(map(int, input().split(' ')))\nx = k - a[-1] + a[0]\nfor i in range(n-1):\n y = a[i+1]-a[i]\n if ...
['Wrong Answer', 'Accepted']
['s933051485', 's176645111']
[25804.0, 26444.0]
[110.0, 109.0]
[163, 170]
p02725
u181295070
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)\nA.sort()\nm = max(y-x for x,y in zip(A,A[1:]))\nans = k-m\nprint(ans)', 'import numpy as np\nk,n = map(int,input().split())\nA = list(map(int,input().split()))\nA.append(k)\nA.sort()\ndist = np.diff(A)\nans = k-max(dist)\nprint(ans)', 'k...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s739042040', 's830403558', 's300650950']
[25840.0, 34148.0, 26436.0]
[90.0, 237.0, 87.0]
[144, 152, 149]
p02725
u183657342
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())\nA = list(map(int, input().split()))\nA_dist = [0]*N\n\nfor i in range(N-1):\n A_dist[i] = A[i+1]-A[i]\n \nA_dist[N-1] = (K-A[N-1])+A[0]\n\nprint(A_dist)\nA_dist_max = max(A_dist)\nprint(K-A_dist_max)\n ', 'import numpy as np\n\nK, N = map(int, input().s...
['Wrong Answer', 'Accepted']
['s144995810', 's402105901']
[34164.0, 34168.0]
[265.0, 252.0]
[253, 235]
p02725
u185896732
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 pysnooper\n#import numpy\n\n#from collections import Counter,deque\n#from operator import itemgetter,mul\n#from itertools import accumulate,combinations,groupby,combinations_with_replacement,permutations\nfrom sys import stdin,setrecursionlimit\n\n#from copy import deepcopy\n#import heapq\n#import math\n#impo...
['Wrong Answer', 'Accepted']
['s172056435', 's317102644']
[25324.0, 24908.0]
[134.0, 130.0]
[788, 755]
p02725
u189056821
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 ...
['if a[0] == 0:\n print(a[len(a) - 1] - a[1])\nelse:\n print(a[len(a) - 1] - a[0])', 'import numpy as np\n\nk, n = map(int,input().split())\na = np.array(list(map(int, input().split())))\ndiff = a[1:] - a[:-1]\ndiff = np.append(diff, k - a[-1] + a[0])\nif np.argmax(diff) == len(a) - 1:\n print(a[-1] - a[0])\ne...
['Runtime Error', 'Accepted']
['s824133830', 's844193339']
[2940.0, 34160.0]
[17.0, 215.0]
[83, 283]
p02725
u189171855
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())\u3000\nA = list(map(int, input().split()))\n\nli = []\nfor i in range(N - 1):\n li.append(A[i + 1] - A[i]) \n\nli.append(abs(A[0] + (K - A[-1])))\nprint(sum(li) - max(li))', 'try:\n K, N = map(int,input().split())\n A = list(map(int, input().split()))\n\n li = []\n for i i...
['Runtime Error', 'Accepted']
['s694529842', 's645833660']
[8808.0, 31992.0]
[25.0, 110.0]
[193, 242]
p02725
u192433528
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,M = map(int,input().split())\nL = [list(map(int,input().split())) for i in range(M)]\ndict = {}\n \nif M == 0 :\n if N == 1 :\n print(0)\n else :\n print(10**(N-1))\n exit()\n \nfor x in L :\n dict.setdefault(x[0],[])\n dict[x[0]].append(x[1])\ndict.setdefault(1,[1])\n \nfor k,v in dict...
['Runtime Error', 'Accepted']
['s517286456', 's973852830']
[33776.0, 32384.0]
[68.0, 97.0]
[713, 164]
p02725
u196507615
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=[int(x) for x in input().split()]\na=[int(x) for x in input().split()]\n \nsol=[]\nfor i in range(n-1):\n sol.append(a[i+1]-a[i])\nsol.append(a[0]-a[n-1]+k)\n \nsorted(sol)\n#unwanted segment of max length removed while printing\nprint(sum(sol[0:n-1]))', 'l,n=[int(x) for x in input().split()]\na=[int(x) for x in...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s076347004', 's178864506', 's238471794', 's349905559', 's720532282', 's997919048', 's960902208']
[26444.0, 26444.0, 2940.0, 26444.0, 2940.0, 3060.0, 26444.0]
[117.0, 121.0, 17.0, 121.0, 17.0, 17.0, 147.0]
[247, 244, 240, 246, 244, 242, 190]
p02725
u199120400
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\nfor i in range(N):\n if A[i] > K/2:\n A[i] = K/2 - A[i]\n \nA.sort()\nprint(A)\n\nprint(int(A[N-1] - A[0]))', 'K, N = map(int, input().split())\nA = list(map(int, input().split()))\n\nD = [0]*N\n\nfor i in range(N-1):\n D[i] = A[i+1] - A[i]...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s279496687', 's416582270', 's084759329']
[25804.0, 26444.0, 26444.0]
[197.0, 145.0, 136.0]
[174, 195, 187]
p02725
u200316926
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 = map(int, input("K,N:").split())\nAn_list = np.array(input("An:").split(), dtype=int)\n\n\nAn_delta_list = np.array([], dtype=int)\n\n\nfor i in range(len(An_list)-1):\n An_delta_list = np.append(An_delta_list, An_list[i+1] -An_list[i])\nAn_delta_list = np.append(An_delta_list, K - An_list[-1])\n\n\nAn_delt...
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s128524418', 's259664569', 's534916537', 's614943817', 's143484353']
[3064.0, 3064.0, 12432.0, 3060.0, 41296.0]
[17.0, 17.0, 150.0, 17.0, 357.0]
[502, 699, 18, 268, 300]
p02725
u205303316
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()\nLA=A.split()\nK=int(LA[0])\nN=int(LA[1])\n\nB=input()\nLB=B.split()\n\nC=0\nsamax=0\nstart=0\n\nfor n in LB:\n sa=int(int(n)-int(C))\n C=n\n if samax < sa:\n samax=sa\n start=int(n)-int(samax)\n\nans1=int(LB[N-1])-int(LB[0])\nans2=int((K-int(LB[N-1]))+int(start))\n\nif ans2 > ans1:\n ans=ans1\nel...
['Wrong Answer', 'Accepted']
['s772821343', 's907122719']
[18900.0, 19032.0]
[171.0, 170.0]
[321, 327]
p02725
u208120643
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 ...
['"""Boot-camp-for-Beginners_Easy012_C_Next-Prime_30-August-2020.py"""\nimport numpy as np\n\nK, N = map(int, input().split())\nA = list(map(int, input().split()))\n\ntheta = []\nfor i in range(len(A)):\n if i == len(A)-1:\n theta.append(2*np.pi*(K-A[i]+A[0])/K)\n else:\n theta.append(2*np.pi*(A[i+1...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s011819090', 's028053379', 's184192410', 's747759906', 's353566368']
[50748.0, 50756.0, 50628.0, 50988.0, 50988.0]
[258.0, 265.0, 261.0, 266.0, 234.0]
[483, 483, 451, 476, 440]
p02725
u209313313
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=map(int, input().split())\nA=list(map(int, input().split()))\n\nA_sorted=sorted(A)\n\nif sorted_A[N-1]-sorted_A[0] <K/2:\n print(sorted_A[N-1]-sorted_A[0])\n\nelse:\n for i in range (0, N-1):\n if A[i] > K/2:\n A[i]=A[i]-K\n else:\n A[i]=A[i]\n\n a=A_sorted[N-1]-A_s...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s010298976', 's318066609', 's701037441', 's720844151', 's694088325']
[26444.0, 26436.0, 2940.0, 2940.0, 26444.0]
[78.0, 66.0, 17.0, 17.0, 153.0]
[342, 179, 209, 208, 203]
p02725
u211805975
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,m = map(int,input().split())\na = input().split()\na =[int(s) for s in a]\n\na.insert(0,k)\n\ndis = []\n\nfor i in range(m):\n part = int(a[i]) - int(a[i+1])\n dis.append(part)\n del part\n\ndis.append(int(a[m-1]))\ndistance = dis*2\n\nc =[]\nfor j in range(m):\n c = sum(distance[j:j+5])\n\nprint(min(c))', 'k,m...
['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s202067267', 's986881956', 's992980855', 's933083122']
[26444.0, 26444.0, 26444.0, 26436.0]
[296.0, 251.0, 308.0, 122.0]
[291, 272, 296, 193]
p02725
u212328220
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()))\nal = list(map(int(input().split())))\n\ndtlst = [al[0]]\nfor i in range(1,n):\n dtlst.append(al[i]-al[i-1])\ndtlst.append(k - al[-1]+al[0])\n\nprint(k - max(dtlst))', 'k, n = map(int(input().split()))\nal = list(map(int,input().split()))\n\ndtlst = [al[0]]\nfor i in range(1,n):\n d...
['Runtime Error', 'Runtime Error', 'Accepted']
['s152321044', 's956941266', 's366265765']
[9016.0, 8984.0, 32300.0]
[25.0, 26.0, 110.0]
[191, 191, 190]
p02725
u216888678
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())\nA=list(map(int,input().split())\nL_max=0\nfor i in range(A):\n if i<len(A)-1:\n l=A[i+1]-A[i]\n else:\n l=K-A[-1]+A[0]\n if L_max<l:\n L_max=l\nans=sum(A)-L_max\nprint(ans)', 'K,N=map(int,input().split())\nA=list(map(int,input().split()))\nmax_ans=0\nfor i in range(...
['Runtime Error', 'Accepted']
['s212542741', 's749289796']
[2940.0, 26436.0]
[18.0, 132.0]
[213, 230]
p02725
u222185706
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\n\n\nfirst_input = list(map(lambda x:int(x), input().split(" ")))\nsecond_input = list(map(lambda x:int(x), input().split(" ")))\n\n\n#first_input = list(map(lambda x:float(x), input().split(" ")))\n#second_input = list(map(lambda x:float(x), input().split(" ")))\n\n##get string\n#first_input = i...
['Wrong Answer', 'Accepted']
['s602045427', 's923916187']
[34156.0, 39280.0]
[350.0, 401.0]
[558, 527]
p02725
u223555291
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\na,b=map(int,input().split())\nc=list(map(int,input().split()))\nc.sort()\nd=[0]*1000000\nfor i in range(b-1):\n d[i]+=abs(c[i]-c[i+1])\n\nd.append(a-c[-1])\n\nprint(a-max(d))\n\n\n\n', 'import sys\na,b=map(int,input().split())\nc=list(map(int,input().split()))\nc.sort()\nd=[0]*a\nfor i in range(b-1):\n ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s259981373', 's933775041', 's210814397']
[26436.0, 26444.0, 26444.0]
[158.0, 176.0, 162.0]
[181, 175, 191]
p02725
u223904637
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()))\nl.append(l[0]+k)\na=10**10\nfor i in range(n):\n a=min(a,l[i+1]-l[i])\nprint(k-a)', 'k,n=map(int,input().split())\nl=list(map(int,input().split()))\nl.append(l[0]+k)\na=0\nfor i in range(n):\n a=max(a,l[i+1]-l[i])\nprint(k-a)\n']
['Wrong Answer', 'Accepted']
['s249838446', 's246579905']
[25836.0, 26444.0]
[145.0, 161.0]
[142, 138]
p02725
u224119985
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(input(),int.split())\na=list(input(),int.split())\n\nm=0\nfor i in range(n-1):\n d=a[i+1]-a[i]\n m=max(d,m)\nd_last=a[0]+k-a[n-1]\nm=max(d_last,m)\n\nans=k-m\nprint(ans)', 'k,n=map(input(),int.split())\na=list(map(input(),int.split()))\n\nm=0\nfor i in range(n-1):\n d=a[i+1]-a[i]\n m=max(d,m)\nd_l...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s342459410', 's607523811', 's874087169', 's928539198']
[3064.0, 3064.0, 3064.0, 26444.0]
[17.0, 17.0, 18.0, 166.0]
[172, 177, 177, 178]
p02725
u224522483
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())\narray = list(map(int, input().split())) + [n]\na = [array[i] - array[i-1] for i in range(1, n+1)]\nprint(sum(a) - max(a))', 'n, k = map(int, input().split())\narray = list(map(int, input().split()))\narray = array + [array[0] + n]\na = [array[i] - array[i-1] for i in range(1, k+1)]\n...
['Runtime Error', 'Accepted']
['s585461173', 's195885512']
[26436.0, 25832.0]
[94.0, 99.0]
[152, 172]
p02725
u225020286
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()))\nx=[]\ny=[]\nfor i in A:\n if i>10:\n a=20-i\n y.append(a)\n else:\n x.append(i)\nif len(A)==1:\n if A[0]>=10:\n print(20-A[0])\n else:\n print(A[0])\nelse:\n ans=max(x)+max(y)\n print(ans)', 'K,N=map(int,input().split())\nA=list(map(...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s360964611', 's393539240', 's976335280']
[26436.0, 26420.0, 26436.0]
[111.0, 120.0, 121.0]
[256, 237, 177]
p02725
u228303592
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 = []\n\nfor i in range(1,n+1):\n b.append(a[i] - a[i-1])\nb.append(k - a[n] + a[0])\nb = sorted(b)\n\nprint(sum(b:[:n])', 'k,n = map(int,input().split())\na = list(map(int,input().split()))\nb = []\n\nfor i in range(1,n):\n b.append(a[i]-a[i-1])\...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s253068855', 's394154210', 's516882876', 's610523049', 's818666325', 's888776403', 's286290711']
[8952.0, 32312.0, 8996.0, 32364.0, 32252.0, 9040.0, 32172.0]
[24.0, 101.0, 26.0, 70.0, 104.0, 28.0, 120.0]
[181, 176, 180, 177, 175, 183, 183]
p02725
u228976998
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 ...
['x = input()\nnum = int(x.split()[1])\nperimeter = int(x.split()[0])\nhouses = [int(i) for i in input().split()]\n\nmaxDis = perimeter - houses[-1] + houses[0]\ntotal = maxDis\nfor i in range(1, len(houses)):\n maxDis = max(maxDis, houses[i]-houses[i-1])\n total += houses[i]-houses[i-1]\nprint(total)', 'x = inpu...
['Wrong Answer', 'Accepted']
['s979313532', 's728142078']
[31752.0, 31604.0]
[166.0, 162.0]
[296, 303]
p02725
u236666830
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 = map(int, input().split())\nA = list(map(int, input().split()))\n\nA.remove(0)\nA.append(A[0])\n\nmax_distance = 0\npre = 0\n\nfor i in A:\n\n if abs(i - pre) > max_distance:\n max_distance = abs(i - pre)\n pre = i\n\n\n\nprint (K - max_distance)', '\nK, N = map(int, input().split())\nA = list(ma...
['Runtime Error', 'Accepted']
['s894546986', 's601960206']
[26444.0, 26436.0]
[100.0, 161.0]
[249, 167]
p02725
u238956837
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\ndistance = [0]*n\n\nfor i in range(n-1):\n print(a[i+1],a[i])\n distance[i] = a[i+1] - a[i]\ndistance[n-1] = k-a[n-1] + a[0]\n\ndistance.sort(reverse=True)\nprint(distance)\nprint(sum(distance[1:]))', 'k, n = map(int, input().split())\na = lis...
['Wrong Answer', 'Accepted']
['s592927868', 's207657820']
[26420.0, 26444.0]
[442.0, 141.0]
[261, 224]
p02725
u247211039
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=[0]*N\n\nfor i in range(N-1):\n B[i]=A[i+1]-A[i]\n\nB[-1]=K-A[-1]\n\n\nans = K-max(B)\nprint(ans)', 'K,N=map(int, input().split())\nA=list(map(int, input().split()))\n\nB=[0]*N\n\nfor i in range(N-1):\n B[i]=A[i+1]-A[i]\n\nB[-1]=A[0]+K-A[-1]...
['Wrong Answer', 'Accepted']
['s847913264', 's440400037']
[32292.0, 32204.0]
[106.0, 120.0]
[159, 179]
p02725
u247680229
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=list(map(int, input().split()))\n\nA=list(map(int, input().split()))\n\n\nA=np.array(A)\n\nlin=np.array(A[:-1])\nle=np.array(A[1:])\n\nlength=abs(lin-le)\n\nrem=abs(K-A[-1]+A[0])\nprint(length)\nA=np.append(length,rem)\n\nM=np.max(A)\n\nprint(K-M)', 'import numpy as np\n\nK,N=list(map(int, i...
['Wrong Answer', 'Accepted']
['s550465386', 's427769024']
[34140.0, 34140.0]
[218.0, 219.0]
[253, 240]
p02725
u250554058
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(x) for x in input().split())\n min_LIST = []\n LIST = []\n LIST = list(map(int,input().split()))\n\n for i in range(len(LIST) - 1):\n min_LIST.append(LIST[i + 1] - LIST[i])\n if(min_LIST[i] <= (LIST[i + 1] - LIST[i])):\n x = (LIST[i + 1] - LIST[i])\n print(x)\n\n print(...
['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s109992997', 's242852748', 's883188781', 's180466561']
[26444.0, 2940.0, 26444.0, 26444.0]
[292.0, 17.0, 278.0, 102.0]
[526, 456, 526, 482]
p02725
u257265865
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()))\nA=[]\nfor i in range(N-1):\n A.append(L[i+1]-L[i])\nL.append(K-L[L-1]+L[0])\nprint(K-max(L))\n\n', 'K,N=map(int,input().split())\nL=list(map(int,input.split()))\nA=[]\nfor i in range(N-1):\n A.append(L[i+1]-L[i])\nL.append(K-L[L-1]+L[0])\nprint(K-max(L...
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s341252862', 's343581222', 's784064701', 's222186870']
[26444.0, 3060.0, 26444.0, 25840.0]
[115.0, 17.0, 117.0, 116.0]
[153, 149, 151, 151]
p02725
u257332942
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()))\nd = 0\n\nfor i in range(n-1):\n d = (d, a[i+1] - a[i])\nd = (d, k - a[-1] + a[0])\n\nprint(K - d)', 'k, n = map(int, input().split())\na = list(map(int, input().split()))\nd = 0\n\nfor i in range(n-1):\n d = max(d, a[i+1] - a[i])\nd = max(d,...
['Runtime Error', 'Accepted']
['s821856777', 's183297168']
[27504.0, 26444.0]
[159.0, 159.0]
[163, 169]
p02725
u257472411
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()))\na = list(map(int,input().split()))\n\nk = kn[0]\nn = kn[1]\n\n\ndis = []\n\nfor i in range(n):\n if i == 0:\n dis.append(min((a[n-1] - a[0]), (k - a[n-1] + a[0])))\n else:\n dis.append(min((a[i] - a[i-1]), (k - a[i] + a[i-1])))\n\nprint(dis)\ndel dis[dis.index(...
['Wrong Answer', 'Accepted']
['s311892254', 's817791334']
[26444.0, 26444.0]
[218.0, 218.0]
[588, 577]
p02725
u261082314
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())\nn_list=[int(input()) for i in range(n)]\nfor i in range(len(n_list)):\n if n_list[i] > k-n_list[i]:\n n_list[i]=-(k-n_list[i])\nn_list.sort()\nprint(n_list[-1]-n_list[0])\n', 'k,n = map(int,input().split())\nn_list = list(map(int,input().split()))\nfor i in range(len(n_list)):\n i...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s796666428', 's860769775', 's742405575']
[3060.0, 26420.0, 26420.0]
[18.0, 128.0, 178.0]
[200, 200, 212]
p02725
u262244504
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\nl = [0] * N\nhoge = 0\n\nfor n in range(N):\n l[n] = A[n]-hoge\n hoge = hoge + l[n]\n \nl = l + [K-A[N-1]]\n\nprint(sum(l)-max(l))', 'K, N = map(int,input().split())\nA = list(map(int, input().split()))\n\nl = [0] * N\nhoge = 0\n\nfor n in ran...
['Wrong Answer', 'Accepted']
['s846714044', 's385781432']
[26436.0, 26444.0]
[151.0, 134.0]
[193, 237]
p02725
u264312747
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 = list(map(int, input().split()))\nd_list = [a_list[0] + k - a_list[n - 1]]\nfor i in range(0, n - 1):\n d_list.append(a_list[i + 1] - a_list[i])\n print(d_list)\nans = sum(d_list) - max(d_list)\nprint(ans)', 'k, n = map(int, input().split())\na_list = list(map(int, input()....
['Wrong Answer', 'Accepted']
['s454308213', 's218848692']
[107996.0, 26444.0]
[2104.0, 117.0]
[242, 226]
p02725
u265154666
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\nN, K = map(int, input().split())\n\n\nlocations = input().split()\ndists = []\nprev_location = None\n\nfor location in locations:\n if prev_location is None:\n prev_location = int(location)\n else:\n\t dists.append(int(location) - prev_location) \n\t prev_location = int(location)\ndists....
['Wrong Answer', 'Accepted']
['s154526996', 's263693638']
[35972.0, 30376.0]
[421.0, 294.0]
[393, 413]
p02725
u266964556
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 = input().split()\nfor i in range(N):\n A[i] = int(A[i])\nmax = 0\nfor i in range(N-1):\n diff = abs(A[i] - A[i+1])\n if diff >= max:\n max = diff\n\nif abs(K - A[N-1]) >= max:\n max = abs(K - A[N-1])\n\nprint(K - max)', 'K, N = map(int,input().split())\nA = input...
['Wrong Answer', 'Accepted']
['s892673677', 's450226862']
[18636.0, 19140.0]
[152.0, 162.0]
[259, 273]
p02725
u267029978
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())\nlistA = list(map(int,input().split()))\nlistB = []\n\nfor i in listA:\n if i > K/2:\n temp = i - K\n listB.append(temp)\n else:\n listB.append(i)\nprint(listB)\nout1 = max(listA) - min(listA)\nout2 = max(listB) - min(listB)\nif out1 >= out2:\n print(out2)\nelse:\n print(ou...
['Wrong Answer', 'Accepted']
['s532252494', 's517978893']
[26420.0, 26420.0]
[174.0, 147.0]
[305, 272]
p02725
u267300160
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 = list(map(int,input().split()))\nsa = []\nfor i in range(1,N):\n sa.append(abs(A_list[i]-A_list[i-1]))\nsa.append(K-A_list[-1])\nprint(sa)\nprint(sum(sa)-max(sa))\n', 'K,N = map(int,input().split())\nA_list = list(map(int,input().split()))\nsa = []\nfor i in range(1,N):\n ...
['Wrong Answer', 'Accepted']
['s625767593', 's501602776']
[26444.0, 26444.0]
[145.0, 130.0]
[199, 201]
p02725
u269749457
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()\ndistance = list(map(int, input().split()))\n\nrelative = []\nrelative[0] = distance[0]\nfor i in range(1, len(distance)):\n relative[i] = distance[i+1] - distance[i]\nrelative.append(K - distance[-1])\nprint(sum(relative) - max(relative))', 'K, N = input().split()\ndistance = list(map(int,...
['Runtime Error', 'Accepted']
['s049587289', 's402590083']
[26060.0, 26420.0]
[65.0, 117.0]
[258, 261]
p02725
u273787824
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\nimport os\n\ndef remove_empty(target_list: list):\n empty_removed_list = [x for x in target_list if x]\n return empty_removed_list\n\n\ndef get_stdin_str_list(input_str=None):\n if input_str is None:\n input_str = input()\n input_str = input_str.strip()\n input_str_list = input_...
['Runtime Error', 'Accepted']
['s429126553', 's421091300']
[3192.0, 26444.0]
[18.0, 101.0]
[2472, 2541]
p02725
u274244155
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 C():\n kn=list(map(int,input().split()))\n A=list(map(int,input().split()))\n sum=0\n d=[]\n sum_ans=[]\n \n \n for i in range(kn[1]):\n \n if i==kn[1]-1:\n d.append(kn[0]-A[i])\n else:\n d.append(A[i+1]-A[i])\n \n \n for i in range(1,k...
['Wrong Answer', 'Accepted']
['s248873208', 's763323665']
[26444.0, 26444.0]
[182.0, 185.0]
[441, 467]
p02725
u275577311
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()))\ndis = list(map(int, input().split()))\nlists = []\nfor i in range(KN[1]-1):\n lists.append(dis[i+1]-dis[i])\n\nlists.append(KN[0]+dis[0]-dis[KN[1]-1])\nprint(lists)\nprint(KN[0]-max(lists))', 'KN = list(map(int, input().split()))\ndis = list(map(int, input().split()))\nlists =...
['Wrong Answer', 'Accepted']
['s542067219', 's236533393']
[26444.0, 26444.0]
[130.0, 116.0]
[222, 209]
p02725
u276894499
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 collections import deque\nA = deque()\nK, N = map(int, input().split())\nA = list(map(int, input().split()))\nmax = 0\nfor i in range(N-1):\n if abs(A[i]-A[i+1]) > max:\n max = abs(A[i]-A[i+1])\nif abs(A[0]-(K-A[N-1])) > max:\n max = abs(A[0]-A[N-1])\nprint(K - max)', 'K, N = map(int, input().split(...
['Wrong Answer', 'Accepted']
['s929231667', 's084315640']
[25428.0, 25840.0]
[121.0, 114.0]
[274, 236]
p02725
u277312083
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()))\nd = (abs(a[n - 1] - 20) if a[0 == 0] else abs(a[n - 1] - a[0]))\nfor i in range(1, n):\n d = max(d, abs(a[i - 1] - a[i]))\nprint(k - d)\n', 'k, n = map(int, input().split())\na = list(map(int, input().split()))\nd = k + a[0] - a[n - 1]\nfor i i...
['Wrong Answer', 'Accepted']
['s429358072', 's307380634']
[25840.0, 25840.0]
[149.0, 138.0]
[205, 160]
p02725
u283683979
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=a.split(' ')\nfor b in range(n):\n a[b]=int(a[b])\n\nm=0\nfor b in range(n-1):\n if m<=a[b+1]-a[b]:\n m=a[b+1]-a[b]\n\nif m<=k-a[n-1]+a[0]:\n m=k-a[n-1]+a[0]\n\nprint(k-m)", "k,n=map(int,input('').split())\na=input('')\na=a.split(' ')\nfor b in range(n):\n a[b]=int(a[b])\na.sort()\n\nm=0\nfor b i...
['Runtime Error', 'Accepted']
['s415153891', 's666010513']
[3060.0, 18636.0]
[18.0, 162.0]
[177, 229]
p02725
u283782321
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()))\nd = []\n\nfor i in range(N-1):\n d.append(A[i+1] - A[i])\nd.append((K - A[N-1]) + A[0])\n\nprint(d)\nd.remove(max(d))\nprint(sum(d))', 'K, N = map(int, input().split())\nA = list(map(int, input().split()))\nd = []\n\nfor i in range(N-1):\n d.app...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s366211710', 's439854357', 's389222654']
[26436.0, 26004.0, 26444.0]
[131.0, 135.0, 121.0]
[194, 194, 185]
p02725
u285265363
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\nM = 0\nfor i in range(N):\n if M <= A[i] - A[i-1] :\n M = A[i] - A[i-1]\nans = K - M\nprint(ans)\n', 'K, N = map(int, input().split())\nA = list(map(int, input().split()))\n\nM = 0\nfor i in range(N):\n if M <= A[i] - A[i-1] :\n ...
['Wrong Answer', 'Accepted']
['s974126239', 's886187542']
[26444.0, 26444.0]
[132.0, 178.0]
[172, 234]
p02725
u288335507
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()))\ndmin = k - (a[n - 1] - a[0])\nfor i in range(n - 1):\n if (a[i + 1] - a[i]) < dmin:\n dmin = a[i + 1] - a[i]\nprint(k - dmin)', 'k, n = map(int, input().split())\na = list(map(int, input().split()))\ndmax = k - (a[n - 1] - a[0])\nfor i i...
['Wrong Answer', 'Accepted']
['s143208081', 's962368830']
[26436.0, 26444.0]
[100.0, 105.0]
[200, 200]
p02725
u289053627
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(x) for x in input().split()]\nA_list = [int(x) for x in input().split()]\n\nmax_distance = 0\nmax_distance_idx = 0\nfor i in range(0, N-1):\n dist = A_list[i+1]-A_list[i]\n if max_distance < dist:\n max_distance = dist\n max_distance_idx = i\n\nif max_distance <= (K-A_list[N-1]) + (A_list[0]):\n ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s028364329', 's387860331', 's093025786']
[26420.0, 26444.0, 26444.0]
[116.0, 116.0, 116.0]
[400, 425, 411]
p02725
u294385082
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()))\ntm = a[0]\na.append(tm)\nm = 11414114514\n \nfor i in range(n):\n m = min(m,a[i+1]-a[i])\n \nprint(k-m)', 'k,n = map(int,input().split())\na = list(map(int,input().split()))\ntm = a[0]\na.append(tm)\nm = 11414114514\n \nfor i in range(n):\n m = mi...
['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s004875159', 's134936733', 's188694582', 's333622722', 's592737710', 's880395366', 's896715231', 's691049388']
[3060.0, 26420.0, 26444.0, 3060.0, 3060.0, 3064.0, 26060.0, 26436.0]
[17.0, 145.0, 138.0, 17.0, 17.0, 19.0, 170.0, 139.0]
[164, 164, 162, 152, 156, 170, 170, 200]
p02725
u297089927
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()))\nd=0\nfor i in range(N-1):\n if d == 0 and A[i+1]-A[0] >= K/2:\n d=d+A[i]-A[0]+K-A[i+1]-A[0]\nif d == 0:\n d=d+A[N-1]-A[0]\nprint(d)', 'K,N=map(int,input().split())\nA=list(map(int,input().split()))\nList=[]\nfor i in range(N-1):\n b=A[i+1]-A[i]\n ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s066686860', 's276065296', 's277254460']
[26420.0, 26444.0, 26436.0]
[110.0, 148.0, 158.0]
[192, 155, 175]
p02725
u304593245
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\nK,N = list(map(int,input().split()))\nA = list(map(int,input().split()))\nA.append(K)\nB = []\nans = K\nfor i in range(N):\n B.append(abs(A[i]-A[i+1]))\n\nprint(K-max(B))\n', '\n\nK,N = list(map(int,input().split()))\nA = list(map(int,input().split()))\nA.append(K)\nB = []\nans = K\nfor i in range(N):\n B.a...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s025973310', 's734379245', 's742957475']
[32160.0, 32212.0, 32368.0]
[117.0, 130.0, 117.0]
[177, 176, 182]
p02725
u308914480
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])\n\nfor i in range(n):\n l=max(A[i]-A[i-1])\n\nprint(K-l)', 'k,n=map(int,input().split())\na=list(map(int,input().split()))\na.append(k+a[0])\n \nfor i in range(1,n):\n l=max(a[i]-a[i-1])\n \nprint(k-l)', 'k,n=map(int,input().split())\n...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s172803545', 's599009222', 's798855012', 's416176366']
[32172.0, 32280.0, 32180.0, 32360.0]
[70.0, 68.0, 71.0, 134.0]
[131, 135, 133, 142]
p02725
u309120194
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\nK.append(A[0]+K)\nl = K+1\nfor i in range(N):\n l = min(l, A[i+1]-A[i])\n\nprint(K-l)', 'K, N = map(int, input().split())\nA = list(map(int, input().split()))\n \nfor i in range(N):\n if A[i] >= K/2: A[i] -= K\n\nprint(max(A) - min(A))...
['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s395293240', 's705154306', 's964256631', 's383712563']
[24464.0, 32228.0, 32192.0, 32228.0]
[44.0, 109.0, 108.0, 124.0]
[151, 149, 153, 493]
p02725
u311176548
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(' ')))\nk=0\nAnew=[]\nfor i in range(1,N):\n Anew.append(A[i]-A[i-1])\nprint(K-max(Anew))", "K,N=list(map(int,input().split(' ')))\nA=list(map(int,input().split(' ')))\nk=0\nAnew=[]\nfor i in range(1,N):\n Anew.append(abs(A[i]-A[i-1]))\nprint(K...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s339273391', 's769877670', 's824617004', 's343498101']
[26436.0, 26444.0, 26420.0, 26420.0]
[118.0, 123.0, 136.0, 126.0]
[154, 159, 202, 190]
p02725
u311928787
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\nlines = sys.stsin.readlines()\nK, N = map(int, lines[0].srtip().split())\nAs = map(int, lines[1].strip().split())\n\ndiffs =[]\nfor base, switch in zip(arr[:-1], arr[1:]):\n diffs append(switch-base)\n\ndiffs append(arr[0]+K-arr[-1])\n\nprint(K-max(diffs))', 'K, N = list(map(int, input().srtip().split())...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s042330427', 's424111554', 's465785759', 's471715706', 's545482678', 's598977323', 's660133411', 's224509652']
[2940.0, 3060.0, 3060.0, 3064.0, 2940.0, 3060.0, 3064.0, 26420.0]
[17.0, 18.0, 17.0, 17.0, 19.0, 17.0, 18.0, 104.0]
[258, 229, 226, 272, 262, 200, 270, 204]
p02725
u313317027
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())\na_list = list(map(int, input().split()))\n\na_list.append(k)\n\nans_list = np.diff(a_list)\n\nif max(ans_list) == ans_list[-1]:\n print(sum(ans_list) - max(ans_list) - a_list[0])\nelif max(ans_list) == ans_list[0]:\n print(sum(ans_list) - max(ans_list) - an...
['Wrong Answer', 'Accepted']
['s360795066', 's948239200']
[34156.0, 41556.0]
[325.0, 1260.0]
[364, 187]
p02725
u314312196
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()))\nan = list(map(int,input().split()))\n\nmin_list = []\nfor i in range(N):\n if i == 0:\n left = an[i] + K - an[-1]\n right = an[i+1] - an[i]\n elif i == N-1:\n left = an[i] - an[i-1]\n right = an[0] + K - an[N-1]\n else:\n left = an[i]...
['Runtime Error', 'Accepted']
['s689076929', 's654651666']
[26444.0, 26444.0]
[261.0, 260.0]
[409, 412]
p02725
u314837274
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=0\nif max(a)<=k/2.0 or min(a)>=k/2.0:\n for i in range(n):\n ans+=abs(a[i+1]-a[i])\nelse:\n for i in range(n):\n if a[i]>k/2.0:\n a[i]-=k\n else:\n j=i\n for i in range(j):\n ans+=abs(a[i+1]-a[i])\n ans+=abs(a[n]-a[0])\n ...
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s036316605', 's197595416', 's773687481', 's249779701']
[26444.0, 26444.0, 26444.0, 26444.0]
[180.0, 173.0, 198.0, 164.0]
[362, 370, 372, 292]
p02725
u316233444
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(int(i) for i in input().split())\nA.append(A[0])\n#print(A)\n\na=[]\nfor i in range(N-1):\n a.append(abs(A[i]-A[i+1]))\n #print(a)\na.append(abs(K-A[N-1]))\nprint(a)\n\na.remove(max(a)) \nans=sum(a)\nprint(ans)\n', 'K, N = map(int, input().split())\nA = list(map(int, input().spl...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s306239890', 's864173925', 's204204973']
[26444.0, 26188.0, 26100.0]
[151.0, 288.0, 143.0]
[276, 186, 187]
p02725
u319311571
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(' ')))\nt = 0\nid = 0\nl = 0\nfor i in range(n):\n if i < n - 1:\n d = abs(a[i] - a[i + 1])\n else:\n d = k - a[n - 1] + a[0]\n if t < d:\n t = d\n id = i + 1 if i < n - 1 else 0\nfor i in range(n - 1):\n l +=...
['Wrong Answer', 'Accepted']
['s139602177', 's562901729']
[26444.0, 26444.0]
[267.0, 257.0]
[404, 401]
p02725
u320511454
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()))\nsales=list(map(int,input().split()))\nsales.append(sales[0]+k)\nmax_dis=0\nfor i in range(n):\n max_dis=max(max_dis,sales[i+1]-sales[i])\n print(max_dis)\n\nprint(k-max_dis)', 'k,n=list(map(int,input().split()))\nsales=list(map(int,input().split()))\nsales.append(sales[0])\nmax_d...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s476622618', 's540848132', 's811057261']
[25840.0, 26444.0, 26444.0]
[301.0, 148.0, 161.0]
[203, 184, 186]
p02725
u328755070
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()))\nA.sort()\nB = []\n\n\nfor i in range(N-1):\n B.append(K - A[i+1] + A[i])\nB.append(A[N-1] + A[0])\n\nprint(min(B))\n\n\n\n\n\n\n', 'K, N = list(map(int, input().split()))\nA = list(map(int, input().split()))\nB = []\n\n\nfor i in range(N-...
['Wrong Answer', 'Accepted']
['s414004458', 's473853002']
[26436.0, 26444.0]
[135.0, 131.0]
[191, 182]
p02725
u332386346
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 -*-\nK, N = map(int, input().split())\nA = list(map(int, input().split()))\nA.append(A[0])\n\ndistance_max = 0\nfor i in range(N):\n if distance_max < A[i+1] - A[i]:\n distance_max = A[i+1] - A[i]\n\nprint(K-distance_max)\n \n', '# -*- coding: utf-8 -*-\nK, N = map(int, input().sp...
['Wrong Answer', 'Accepted']
['s945503834', 's212242119']
[26444.0, 26444.0]
[103.0, 105.0]
[251, 253]
p02725
u335012204
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(x) for x in input().split())\nA =[int(x) for x in input().split()]\n\nA.append(K + A[0])\nprint(A)\nA_sub = []\n\nfor i in range(len(A)-1):\n A_sub.append(abs(A[i] - A[i + 1]))\n# print(A_sub)\nprint(sum(A_sub) - max(A_sub))', 'K,N=(int(x) for x in input().split())\nA =[int(x) for x in input().split()]\n\...
['Wrong Answer', 'Accepted']
['s188038551', 's573298573']
[26444.0, 26436.0]
[150.0, 138.0]
[226, 228]
p02725
u335950809
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()))\n\nll = l[:]\n\nll.append(k)\nll.pop(0)\ns = []\n\nfor i,j in zip(l,ll):\n s.append(j - i)\n\nprint(k - max(s))', 'k,n = map(int,input().split())\nl = list(map(int,input().split()))\n\ns = []\n\nfor i,j in zip(l[1:],l):\n s.append(i-j)\n\ns.appe...
['Wrong Answer', 'Accepted']
['s228191961', 's019983700']
[26444.0, 26420.0]
[112.0, 111.0]
[169, 165]
p02725
u336564899
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\nx = 0\nindex = 0\n\nfor i in range(n-1):\n if x < a[i+1] - a[i]:\n x = a[i+1] - a[i]\n index = i\n\nif x < k-a[-1]+a[0]:\n x = k-a[-1]+a[0]\n\nprint(k - x,k, x,k-a[-1]+a[0])\n', 'k, n = map(int, input().split())\na = list(ma...
['Wrong Answer', 'Accepted']
['s450556412', 's044565844']
[26444.0, 26444.0]
[103.0, 104.0]
[254, 235]
p02725
u337573893
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()))\n\nc = abs(A[1] - A[N-1])\n\nfor i in range(N-1):\n d = abs(A[i] - A[i+1])\n if c < d:\n c = d\n else:\n c = c\n \nprint(K-c)', 'K, N = map(int, input().split())\n\nA = list(map(int, input().split()))\n\nc = abs(K - A[N-1] + A[0])\n\n...
['Wrong Answer', 'Accepted']
['s756651904', 's279350992']
[32136.0, 32264.0]
[125.0, 124.0]
[196, 200]
p02725
u345132740
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=input().split()\nn=0\nm=1\nS=list()\nfor i in range(int(N)-1):\n S.append(int(A[n+1])-int(A[n]))\n n=n+1\nS.append(int(A[0])+(int(K)-int(A[-1])))\n\nans=int(K)-int(max(S))\nprint(ans)\nprint(S)\n', 'K,N=input().split()\nA=input().split()\nn=0\nm=1\nS=list()\nfor i in range(int(N)-1):\n S.app...
['Wrong Answer', 'Accepted']
['s827074104', 's455138523']
[20660.0, 20148.0]
[199.0, 205.0]
[207, 197]
p02725
u346207191
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,M=(int(x) for x in input().split())\nA=list(map(int, input().split()))\nA=np.array(A)\nB=A[1:]-A[:-1]\nb=max(B)\nc=A[-1]-A[0]\nif c > N/2:\n c=int(c-N/2)\nelse:\n c=c\nd=max(b,c)\nprint(N-d)', 'import numpy as np\n\nN,M=(int(x) for x in input().split())\nA=list(map(int, input().split()))\nA=np.array(A)\nB=A[1...
['Runtime Error', 'Accepted']
['s853909557', 's253226473']
[26444.0, 34160.0]
[65.0, 230.0]
[187, 211]
p02725
u346308892
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 ...
['\nimport numpy as np\nfrom functools import *\nimport sys\nsys.setrecursionlimit(100000)\n\n\n\ndef acinput():\n return list(map(int, input().split(" ")))\n\n\ndef II():\n return int(input())\n\nK,N=acinput()\n\nA=acinput()\nA.append(A[0]+K)\nB=np.array(A)+K\n\na=np.array(A)\n\nprint(K-np.max(a[1:]-a[:-1]))\n\n...
['Wrong Answer', 'Accepted']
['s222640221', 's425760955']
[43176.0, 42848.0]
[1672.0, 1560.0]
[376, 304]
p02725
u346812984
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\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef main():\n K, N = map(int, input().split())\n A = list(map(int, input().split()))\n\n ans = [K - A[i] + A[i - 1] for i in range(1, N)]\n print(min(ans), A[-1] - A[0])\n', 'import sys\n\n\ndef input():\n return sys.stdin.readl...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s043048515', 's761098038', 's573233048']
[2940.0, 25840.0, 25840.0]
[18.0, 102.0, 97.0]
[245, 254, 290]
p02725
u347600233
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())) + [k + a[0]]\nprint(k - max([a[i + 1] - a[i] for i in range(n)]))', 'k, n = map(int, input().split())\na = list(map(int, input().split())) + [k + a[0]]\nprint(k - max([a[i + 1] - a[i] for i in range(n)]))', 'k, n = map(int, input().split())\na = li...
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s169821692', 's286460757', 's629361380', 's633339203', 's002827840']
[32372.0, 32356.0, 32240.0, 32324.0, 32388.0]
[67.0, 70.0, 98.0, 67.0, 95.0]
[133, 133, 126, 133, 136]
p02725
u347640436
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)\nmaxD = 0\nfor n in range(N):\n maxD = min(maxD, A[n+1] - A[n])\nprint(K-maxD)', 'K, N = map(int, input().split())\nA = list(map(int, input().split()))\nA.append(A[0]+K)\nmaxD = 0\nfor n in range(N):\n maxD = max(maxD, A[n+1] - ...
['Wrong Answer', 'Accepted']
['s962989022', 's483403062']
[26420.0, 26420.0]
[154.0, 133.0]
[161, 161]
p02725
u349296334
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 = input().split()\nmax = 0\nfor i in range(len(a)):\n d = a[i]-a[i-1]\n if d>max:\n max=d\nprint(k-max)', 'k, n = input().split()\na = input().split()\nmax = 0\nfor i in range(len(a)):\n if i==0:\n continue\n d = a[i]-a[i-1]\n if d>max:\n max=d\nprint(k-ma...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s033124810', 's485334468', 's893482774', 's451076108']
[18356.0, 18508.0, 18036.0, 18356.0]
[37.0, 37.0, 167.0, 164.0]
[135, 165, 175, 213]
p02725
u350093546
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()))\nfor i in a:\n i+=k\nprint(k-max(a)+min(a))', 'k,n=map(int,input().split())\na=list(map(int,input().split()))\nans=0\nfor i in range(n-1):\n ans=max(ans,a[i+1]-a[i])\nans=max(ans,k-a[-1]+a[0])\nprint(k-ans)']
['Wrong Answer', 'Accepted']
['s200524504', 's506459628']
[26444.0, 32232.0]
[92.0, 124.0]
[103, 154]
p02725
u350412774
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 ...
['kp = list(map(int, input().rsplit()))\nA = list(map(int, input().rsplit()))\nmax_range = kp[0]-A[-1]+A[0]\nfor idx in range(len(A)):\n dif = A[idx+1]-A[idx] \n if dif >max_range:\n max_range = dif\n\nprint(kp[0] - max_range)\n ', 'kp = list(map(int, input().rsplit()))\nA = list(map(int, input().rsplit()))\nmax_...
['Runtime Error', 'Accepted']
['s973339143', 's037703675']
[26444.0, 25840.0]
[113.0, 108.0]
[224, 224]
p02725
u362563655
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 = [0] * N\nfor i in A:\n B[i]=A[i+1]-A[i]\n \nB[N-1]=A[0]+K-A[N-1]\n\nprint(K-max(B))\n', 'K, N = map(int, input().split())\nA = list(map(int, input().split()))\nB = [0] * N\nfor i in range(0, N-1):\n if i < N-1:\n B[i]=A[i+1]-A[i]\n else...
['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s006318179', 's064180915', 's258360079', 's360537367', 's454382219', 's530595674', 's564361158', 's819765064', 's966332423', 's658661356']
[25452.0, 26548.0, 25840.0, 26060.0, 26444.0, 2940.0, 26444.0, 26444.0, 26436.0, 26060.0]
[84.0, 128.0, 86.0, 68.0, 94.0, 18.0, 91.0, 72.0, 89.0, 148.0]
[153, 196, 144, 196, 209, 167, 210, 169, 176, 200]
p02725
u366795445
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)\n\ns = 0\nfor i in range(n):\n s += a[i + 1] - a[i]\nans = s\nfor i in range(n):\n ans = min(ans, s - a[i + 1] - a[i])\n\nprint(ans)', 'k, n = map(int, input().split())\na = list(map(int, input().split()))\na.append(a[0] + k)\n\n...
['Wrong Answer', 'Accepted']
['s640052096', 's856079358']
[26420.0, 26436.0]
[211.0, 159.0]
[210, 167]
p02725
u366836739
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\nimport itertools\n\nk, n = map(int, input().split())\na = list(map(int, input().split()))\nmax = 0\n\nfor i in range(1,n):\n l = a[i] - a[i-1]\n if l < 0:\n l += 20\n if l > max:\n max = l\nprint(k - max)', '# coding: utf-8\nk, n = map(int, input().split())\na = list(map(int, i...
['Wrong Answer', 'Accepted']
['s452953869', 's355711646']
[26444.0, 26436.0]
[123.0, 111.0]
[231, 229]
p02725
u369502636
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()))\naa = a + a\n\nfor j in range(n,2*n):\n aa[j] = aa[j] + k\n\ndis = k\n\nfor i in range((2*n)-1):\n tonari = aa[i+1]-aa[i]\n dis = min(dis,k-tonari)\n\nprint(dis)\nprint(aa)', 'k,n = map(int,input().split())\na = list(map(int,input().split()))...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s077292305', 's308716175', 's582412145']
[34648.0, 32220.0, 32064.0]
[285.0, 239.0, 250.0]
[234, 229, 224]
p02725
u370331385
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 tmp = A[i+1]-K\n B.append(tmp)\nB.extend(A)\n\n\ntmp_sum = 0\nj = 0\n\ndist = []\nfor i in range(1,len(B)):\n d = abs(B[i]-B[i-1])\n tmp_sum += d\n dist.append(d)\n if(i == N-1):\n ans = tmp_sum \n print('a...
['Wrong Answer', 'Accepted']
['s239523013', 's372549122']
[30400.0, 27920.0]
[675.0, 447.0]
[449, 451]
p02725
u374082254
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 samax_index(A):\n samax = 0\n max_i = 0\n prev_v = 0\n for i, v in enumerate(A):\n if samax <= (v - prev_v):\n max_i = i\n samax = v - prev_v\n prev_v = v\n return max_i\n\n\ndef distance(A, start_i, N):\n print(start_i)\n if (start_i == 0) or ((start_i + 1...
['Wrong Answer', 'Accepted']
['s527577252', 's047644771']
[26444.0, 26060.0]
[91.0, 116.0]
[596, 172]
p02725
u376754170
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())\nhome_positions = list(map(int, input().split()))\n\n\ndef max_distance_homes(homes):\n max_distance = 0\n for i in range(len(homes) - 1):\n distance = homes[i + 1] - homes[i]\n if max_distance < distance:\n max_distance = distance\n distance = max(ho...
['Wrong Answer', 'Accepted']
['s900266449', 's288650877']
[26444.0, 26444.0]
[70.0, 88.0]
[441, 462]
p02725
u379142263
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 collections\nimport sys\nimport numpy as np\nsys.setrecursionlimit(1000000000)\n\n\nk,n = map(int,input().split())\na = list(map(int,input().split()))\nd = k//2\naright = []\naleft = []\nfor i in range(len(a)):\n if a[i]>d:\n a[i] -= d\ndiff = []\nfor i in range(len(a)-1):\n d2 = a[i+1]-a[i]\n ...
['Wrong Answer', 'Accepted']
['s408263583', 's762825395']
[34128.0, 26100.0]
[295.0, 131.0]
[359, 256]
p02725
u381585104
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[-1]+a[0])\nprint(sum(a)-max(a))', 'k,n=map(int,input().split())\na = list(map(int,input().split()))\ns = []\nfor i in range(n-1):\n s.append(abs(a[i+1] - a[i]))\ns.append(k-a[-1]+a[0])\nprint(k-max(s))']
['Wrong Answer', 'Accepted']
['s149024927', 's280710087']
[32380.0, 32216.0]
[75.0, 115.0]
[107, 161]
p02725
u382639013
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\nmax_d = 0\nfor i in range(0, N-1):\n if A[i] == 0:\n pass\n else:\n d = abs(A[i] - A[len(A)-1])\n max_d = max(d, max_d)\n\nprint(k - max_d)', 'K, N = map(int, input().split())\nA = list(map(int, input().split())) \n\n...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s057475945', 's606761668', 's678391233']
[26444.0, 25580.0, 26420.0]
[187.0, 142.0, 129.0]
[229, 181, 197]
p02725
u384379887
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 = input().split()\nfor i in range(0, len(A)):\n A[i] = int(A[i])\n\ndist = []\nfor i in range(0, len(A)-1):\n dist.append(A[i+1]-A[i])\ndist.append(A[len(A)-1]-A[0])\nprint(dist)\n\nprint(K-max(dist))\n', 'K, N = map(int, input().split())\nA = input().split()\nfor i in range(...
['Wrong Answer', 'Accepted']
['s350536441', 's369033082']
[20812.0, 21400.0]
[161.0, 148.0]
[232, 230]
p02725
u385873134
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\nsub = A[1] - A[0]\nmax = N * sub\nsub_2 = K - max\n\nprint('sub : ' + str(sub))\nprint('sub2 : ' + str(sub_2))\n\nif sub_2 >= sub:\n print(sub * (N - 1))\nelse:\n print(sub * (N - 2) + sub_2)", 'K, N = list(map(int, input().split())...
['Wrong Answer', 'Accepted']
['s584154461', 's166401155']
[26436.0, 25840.0]
[69.0, 146.0]
[264, 263]
p02725
u387080888
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()))\nb=list(map(int,input().split()))\nc=[]\nfor i in range(a[1]):\n if i==a[1]-1:\n if b[0]==0:\n b[0]=a[0]\n c.append(abs(b[i]-b[0]))\n else:\n c.append(abs(b[i]-a[0]))\n elif i!=a[1]-1:\n c.append(abs(b[i]-b[i+1]))\nprint(a[0]...
['Wrong Answer', 'Accepted']
['s300573813', 's531413125']
[26444.0, 26444.0]
[169.0, 167.0]
[314, 321]
p02725
u391285522
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())\naa = map(int, input().split())\n\nB = []\nfor i in range(1, n):\n B.append(a[i]-a[i-1])\n \nB.append(k-sum(B))\nprint(k-max(B))', 'k, n = map(int, input().split())\naa = map(int, input().split())\n\nB = []\n\nfor i in range(1, n):\n B.append(aa[i]-aa[i-1])\n \nB.append(k-...
['Runtime Error', 'Runtime Error', 'Accepted']
['s119036484', 's413003541', 's926318651']
[18484.0, 18508.0, 26444.0]
[38.0, 36.0, 120.0]
[159, 162, 172]
p02725
u391540332
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 ...
["#!/usr/bin/env python3\n# coding: utf-8\n# import sys\n# import pprint\n# import numpy as np\n# import code\nimport functools\n\nif __debug__:\n debug = lambda *x: None\nelse:\n import logging\n logger = logging.getLogger()\n logger.setLevel(logging.DEBUG)\n ch = logging.StreamHandler()\n ch.setLeve...
['Wrong Answer', 'Accepted']
['s734038324', 's941543163']
[26940.0, 26940.0]
[123.0, 124.0]
[784, 784]
p02725
u391675400
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\nhanbun = k /2\na.sort\nprint(a)\ni = 0\nwhile True:\n if a[i] != 0:\n end = a[i]\n break\n else:\n i += 1\nstart = a[n-1]\n\n\nresult = start - end\nif result < 0:\n result = result * -1\nprint(result)', 'k,n = map(int...
['Wrong Answer', 'Accepted']
['s768594576', 's185942053']
[26444.0, 25836.0]
[82.0, 115.0]
[282, 162]
p02725
u391819434
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 ...
['B1=K-A[N-1]+A[0]\n\nB=[]\ni=0\nwhile i<=N-2:\n B.append(A[i+1]-A[i])\n i=i+1\nB=sorted(B)\nprint(K-max(B1,B[-1]))', 'K,N=map(int,input().split())\nA=list(map(int,input().split()))\n\nB1=K-A[N-1]+A[0]\n\nB=[]\ni=0\nwhile i<=N-2:\n B.append(A[i+1]-A[i])\n i=i+1\nB=sorted(B)\nprint(K-max(B1,B[-1]))']
['Runtime Error', 'Accepted']
['s831723262', 's750637663']
[3064.0, 26444.0]
[17.0, 175.0]
[111, 174]
p02725
u392319141
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 ...
['while True:\n a = 1\n', 'print(0)', 'K, N = map(int, input().split())\nA = list(map(int, input().split()))\nB = [abs(x - y) for x, y in zip(A[1:], A)]\nB += [K - A[-1] + A[0]]\n\nprint(sum(B) - max(B))\n']
['Time Limit Exceeded', 'Wrong Answer', 'Accepted']
['s042489972', 's576350886', 's618182797']
[2940.0, 2940.0, 26616.0]
[2104.0, 17.0, 90.0]
[20, 8, 160]
p02725
u394244719
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()))\ndiff = 0\n\nfor _ in range(len(a)-1):\n if diff < abs(a[_]-a[_+1]):\n diff = abs(a[_]-(a[_+1]))\n\nprint(k-diff)', 'k, n = map(int, input().split())\na = list(map(int,input().split()))[::-1]\ndiff = 0\n\nfor i in range(len(a)-1):\n if ...
['Wrong Answer', 'Accepted']
['s386715430', 's208808045']
[26060.0, 26444.0]
[114.0, 106.0]
[184, 247]
p02725
u394520553
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(x) for x in input().split()]\na=[int(x) for x in input().split()]\nmaxi=0\nfor i in range(n-1):\n cal=abs(a[i]-a[(i+1)])\n if(cal>maxi):\n maxi=cal\nif(k-a[n-1]>maxi):\n maxi=k-a[n-1]\nprint(maxi)', 'k,n=[int(x) for x in input().split()]\na=[int(x) for x in input().split()]\nmaxi=0\nfor i in ...
['Wrong Answer', 'Accepted']
['s077674761', 's369828700']
[26444.0, 26444.0]
[131.0, 129.0]
[212, 234]
p02725
u394731058
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()))\nd = []\nfor i in range(n):\n if i+1<n:\n d.append(abs(l[i+1]-l[i]))\n else:\n if 0 in l:\n d.append(abs(k - l[i]))\n else:\n d.append(abs(k - l[i] + l[0])\nprint(sum(d)-max(d))', 'k, n = map(int, input().split())\nl = list(map...
['Runtime Error', 'Accepted']
['s526280273', 's070850126']
[2940.0, 26600.0]
[17.0, 146.0]
[257, 258]