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 |
|---|---|---|---|---|---|---|---|---|---|---|
p02724 | u904331908 | 2,000 | 1,048,576 | Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.) Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn? (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.) | ['money = int(input())\n\ngohyakuen = money // 500\n\ngoen = (money-(gohyaken*500)) // 5\n\nhappy = 1000 * gohyakuen + 5 * goen\n\nprint(happy)', 'money = int(input())\n\ngohyakuen = money // 500\n\ngoen = (money-(gohyakuen*500)) // 5\n\nhappy = 1000 * gohyakuen + 5 * goen\n\nprint(happy)\n'] | ['Runtime Error', 'Accepted'] | ['s616374877', 's723954135'] | [9068.0, 9152.0] | [25.0, 29.0] | [133, 135] |
p02724 | u904995051 | 2,000 | 1,048,576 | Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.) Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn? (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.) | ['x = int(input())\n(x//500)*1000+(x%500//5)*5', 'x = int(input())\nprint((x//500)*1000+(x%500//5)*5)'] | ['Wrong Answer', 'Accepted'] | ['s282958796', 's728848896'] | [9164.0, 8968.0] | [27.0, 31.0] | [43, 50] |
p02724 | u906501980 | 2,000 | 1,048,576 | Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.) Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn? (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.) | ['def main():\n n = int(input())\n print(n//500+(n%500)//5*5)\n\nif __name__ == "__main__":\n main()', 'x = int(input())\nprint(x//500*1000+(x%500//5)*5)\n'] | ['Wrong Answer', 'Accepted'] | ['s422711279', 's704670946'] | [2940.0, 2940.0] | [18.0, 17.0] | [102, 49] |
p02724 | u909815117 | 2,000 | 1,048,576 | Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.) Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn? (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.) | ['n = int(input())\nprint(1000 * (n // 500) + (n % 500) // 5)', '\n#codeforces\ngi = lambda : list(map(int,input().split()))\nn, = gi()\nprint(1000 * (n // 500) + ((n % 500) // 5) * 5)'] | ['Wrong Answer', 'Accepted'] | ['s843381223', 's958352502'] | [2940.0, 2940.0] | [17.0, 17.0] | [58, 196] |
p02724 | u912650255 | 2,000 | 1,048,576 | Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.) Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn? (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.) | ['X = int(input())\n\n#500\nX_500 = X // 500 * 2\n#5\nX_5 = (X % 500) // 5\n\nprint(X_500 + X_5)\n', 'X = int(input())\n\n#500\nX_500 = X // 500 * 2\n#5\nX_5 = (X % 500) // 5 * 5\n\nprint(X_500 + X_5)\n', 'X = int(input())\n\n#500\nX_500 = X // 500 * 1000\n#5\nX_5 = (X % 500) // 5 * 5\n\nprint(X_500 + X_5)\n'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s372805522', 's671316236', 's258262561'] | [2940.0, 2940.0, 2940.0] | [17.0, 17.0, 17.0] | [88, 92, 95] |
p02724 | u914802579 | 2,000 | 1,048,576 | Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.) Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn? (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.) | ['n = int(input());x=n//500\nk=x*1000+5*(n-x*500)//5\nprint(k)', 'n=int(input())\nk=1000*(n//500);n=n%500\nprint(k+n-n%5)'] | ['Wrong Answer', 'Accepted'] | ['s595981829', 's952794741'] | [2940.0, 2940.0] | [18.0, 17.0] | [58, 53] |
p02724 | u917558625 | 2,000 | 1,048,576 | Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.) Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn? (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.) | ['X=int(input())\na=int(X//500)\nX=X%500\nb=int(X//5)\nprint(a+b)', 'X=int(input())\na=int(X//500)\nX=X%500\nb=int(X//5)\nprint(a*1000+b*5)'] | ['Wrong Answer', 'Accepted'] | ['s547282567', 's960012511'] | [2940.0, 2940.0] | [18.0, 17.0] | [59, 66] |
p02724 | u921168761 | 2,000 | 1,048,576 | Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.) Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn? (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.) | ['x = int(input())\nprint(x // 500 * 1000 + x % 500)', 'x = int(input())\nprint(x // 500 * 1000 + x // 5 * 5)\n', 'x = int(input())\nprint(x // 500 * 1000 + (x%500) // 5 * 5)\n'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s694623358', 's789426319', 's779840054'] | [2940.0, 2940.0, 2940.0] | [17.0, 18.0, 17.0] | [49, 53, 59] |
p02724 | u921632705 | 2,000 | 1,048,576 | Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.) Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn? (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.) | ['X = int(input())\na = X%500\nprint(a*1000+a%5*5)', 'X = int(input())\nprint((X%500)%5)', 'X = int(input())\nprint(X//500*1000+X%500//5*5)'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s523227141', 's822115773', 's171100075'] | [9056.0, 9108.0, 9052.0] | [26.0, 31.0, 29.0] | [46, 33, 46] |
p02724 | u924507375 | 2,000 | 1,048,576 | Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.) Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn? (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.) | ['x = int(input())\nq, mod = divmod(x, 500)\nprint(q*2000 + 5*(mod//5))', 'x = int(input())\nq, mod = divmod(x, 500)\nprint(q*1000 + 5*(mod//5))'] | ['Wrong Answer', 'Accepted'] | ['s654502173', 's081386581'] | [2940.0, 2940.0] | [17.0, 17.0] | [67, 67] |
p02724 | u928480992 | 2,000 | 1,048,576 | Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.) Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn? (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.) | ['x = int(input())\nHP = 0\nwhile x > 500:\n x -= 500\n HP += 1000\nwhile x > 5:\n x -= 5\n HP += 5\nif x < 5:\n print(0)\nprint(HP)', '\nusing namespace std;\n\nint main() {\n int x;\n int HP = 0;\n bool FUCK = false;\n \n cin >> x;\n\n if(x < 5){\n cout << 0 << endl;\n FUCK = true;\n }\n \n while(x >= 500){\n HP += 1000;\n x -= 500;\n }\n \n while(x >= 5){\n HP += 5;\n x -= 5;\n }\n \n if(FUCK == false){\n cout << HP << endl;\n }\n \n}', 'x = input()\nHP = 0\nwhile x > 500:\n x -= 500\n HP += 1000\nwhile x > 5:\n x -= 5\n HP += 5\nif x < 5:\n print(0)\nprint(HP)', 'x = int(input())\nHP = 0\nFUCK = False\n\nif x < 5:\n print(0)\n FUCK = True\n\nwhile x >= 500:\n x -= 500\n HP += 1000\n\nwhile x >= 5:\n x -= 5\n HP += 5\n\nif not FUCK:\n print(HP)\n'] | ['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s517114402', 's590936942', 's600541729', 's264055571'] | [2940.0, 2940.0, 2940.0, 2940.0] | [401.0, 17.0, 17.0, 422.0] | [125, 398, 120, 176] |
p02724 | u929996201 | 2,000 | 1,048,576 | Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.) Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn? (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.) | ['a = int(input())\nb = a//500*1000\nc = (a%500)/5*5\nprint(int(b+c))', 'a = int(input())\nb = a//500*1000\nc = (a%500)//5*5\nprint(int(b+c))'] | ['Wrong Answer', 'Accepted'] | ['s266417364', 's468510926'] | [9028.0, 9168.0] | [27.0, 32.0] | [64, 65] |
p02724 | u932868243 | 2,000 | 1,048,576 | Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.) Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn? (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.) | ['k,n=map(int,input().split())\nlista=list(map(int,input().split())) \nans=[]\nfor i in range(n):\n ans.append(lista[i+1]-lista[i])\nprint(k-max(ans))', 'x=int(input())\ngoh=x//500\ngo=(x-goh*500)//5\nprint(1000*goh+go*5)'] | ['Runtime Error', 'Accepted'] | ['s941103279', 's439224284'] | [2940.0, 2940.0] | [18.0, 17.0] | [144, 64] |
p02724 | u934053315 | 2,000 | 1,048,576 | Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.) Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn? (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.) | ['n = int(input())\npl = 0\n\nq, mod = divmod(10, 500)\npl += q * 1000\n\nq, mod = divmod(10, 5)\npl += q * 5\n\nprint(pl)\n', 'n = int(input())\npl = 0\n \nq, mod = divmod(n, 500)\npl += q * 1000\n\nq, mod = divmod(mod, 5)\npl += q * 5\n\nprint(pl)'] | ['Wrong Answer', 'Accepted'] | ['s541507309', 's084440509'] | [2940.0, 3060.0] | [17.0, 18.0] | [112, 112] |
p02724 | u935840914 | 2,000 | 1,048,576 | Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.) Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn? (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.) | ['X = int(input())\nprint((X // 500) * 1000 + (X // 500) // 5 * 5)\n', 'X = int(input())\nprint((X // 500) * 1000 + (X % 500) // 5 * 5)\n'] | ['Wrong Answer', 'Accepted'] | ['s066553638', 's270158949'] | [2940.0, 2940.0] | [18.0, 19.0] | [64, 63] |
p02724 | u944643608 | 2,000 | 1,048,576 | Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.) Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn? (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.) | ['X = int(input())\nt = X % 500\nT = X // 500 * 1000\nT += t // 5 * 5', 'X = int(input())\nt = X % 500\nT = X // 500 * 1000\nT += t // 5 * 5\nprint(T)'] | ['Wrong Answer', 'Accepted'] | ['s742728509', 's109612455'] | [2940.0, 2940.0] | [17.0, 17.0] | [64, 73] |
p02724 | u948521599 | 2,000 | 1,048,576 | Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.) Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn? (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.) | ['X = int(input())\nans =0 \nwhile(1):\n print(X)\n if X < 5:\n break\n elif X<500:\n tmp = X // 5\n ans +=tmp*5\n X = X% 5\n else:\n tmp = X // 500\n ans +=tmp*1000\n X = X %500\nprint(ans)', 'X = int(input())\nans =0 \nwhile(1):\n if X < 5:\n break\n elif X<500:\n tmp = X // 5\n ans +=tmp*5\n X = X% 5\n else:\n tmp = X // 500\n ans +=tmp*1000\n X = X %500\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s836919935', 's148237267'] | [3060.0, 3060.0] | [17.0, 18.0] | [235, 222] |
p02724 | u950337877 | 2,000 | 1,048,576 | Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.) Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn? (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.) | ['coin = int(input())\nsiawase = 0\nif coin >= 500:\n siawase = siawase + coin / 500 * 1000\n amari = coin % 500\n siawase = siawase + amari/5 *5\nelif coin >= 5:\n siawase = siawase + coin / 5 * 5\n \nprint(int(siawase))', 'coin = int(input())\nsiawase = 0\nif coin >= 500:\n siawase = siawase + int(coin / 500) * 1000\n amari = coin % 500\n print(siawase)\n print(amari)\n siawase = siawase + int(amari / 5) *5\nelif coin >= 5:\n siawase = siawase + int(coin / 5) * 5\n \nprint(int(siawase))\n\n', 'coin = int(input())\nsiawase = 0\nif coin >= 500:\n siawase = siawase + int(coin / 500) * 1000\n amari = coin % 500\n siawase = siawase + int(amari / 5) *5\nelif coin >= 5:\n siawase = siawase + int(coin / 5) * 5\n \nprint(int(siawase))\n'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s059540763', 's531669002', 's627735574'] | [2940.0, 3060.0, 2940.0] | [17.0, 17.0, 18.0] | [225, 280, 243] |
p02724 | u957872856 | 2,000 | 1,048,576 | Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.) Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn? (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.) | ['x = int(input())\na = x//500\nb = (x%500)//5\nprint(a+b)', 'x = int(input())\na = x//500\nb = (x%500)//5\nprint(a*1000+b*5)\n'] | ['Wrong Answer', 'Accepted'] | ['s696429478', 's840382735'] | [2940.0, 2940.0] | [17.0, 17.0] | [53, 61] |
p02724 | u960524878 | 2,000 | 1,048,576 | Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.) Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn? (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.) | ['n = int(input())\n\nprint(1000*(n//500)+5*(n//5))', 'n = int(input())\n\na = n//500\nb = (n%500)//5\n\nprint(1000*a+5*b)\n'] | ['Wrong Answer', 'Accepted'] | ['s110680087', 's171443852'] | [2940.0, 2940.0] | [17.0, 17.0] | [47, 63] |
p02724 | u962423738 | 2,000 | 1,048,576 | Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.) Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn? (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.) | ['x=int(input())\n\nif n!=0:\n\tans1=n//500\n\tsub=n-(ans1*500)\n\tans2=sub//5\n\n\tprint((ans1*1000)+(ans2*5))\n\nelse:\n\tprint(0)', 'n=int(input())\n \nif n!=0:\n\tans1=n//500\n\tsub=n-(ans1*500)\n\tans2=sub//5\n \n\tprint((ans1*1000)+(ans2*5))\n \nelse:\n\tprint(0)'] | ['Runtime Error', 'Accepted'] | ['s930365596', 's488755121'] | [9120.0, 9160.0] | [29.0, 28.0] | [115, 118] |
p02724 | u969080040 | 2,000 | 1,048,576 | Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.) Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn? (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.) | ['X=int(input())\ng=X//500\nh=X-500*g\ni=h//5\nj=1000*g+5*i\ninput(j)', 'X=int(input())\ng=X//500\nh=X-g\ni=h//5\nj=1000*g+5*i\ninput(j)', 'X=int(input())\ng=X//500\nh=X-500*g\ni=h//5\nj=1000*g+5*i\nprint(j)'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s677966022', 's785643032', 's502887935'] | [2940.0, 3064.0, 2940.0] | [18.0, 18.0, 18.0] | [62, 58, 62] |
p02724 | u970082363 | 2,000 | 1,048,576 | Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.) Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn? (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.) | ['x = int(input())\n\na = x//500\nb = (x - a*500)//5\nprint(a,b)\nprint(a*1000 + b*5)\n', 'x = int(input())\n\na = x//500\nb = (x - a*500)//5\nprint(a*1000 + b*5)\n'] | ['Wrong Answer', 'Accepted'] | ['s628692334', 's328583706'] | [2940.0, 2940.0] | [18.0, 18.0] | [79, 68] |
p02724 | u970308980 | 2,000 | 1,048,576 | Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.) Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn? (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.) | ['X = int(input())\nd, v = divmod(X, 500)\nprint(d * 1000 + v * 5)', 'X = int(input())\nd, v = divmod(X, 500)\nprint(d * 1000 + v * 5)', 'X = int(input())\nd1 = X // 500\nX -= d1 * 500\nd2 = X // 5\nprint(d1 * 1000 + d2 * 5)\n'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s223090863', 's371773131', 's166584632'] | [2940.0, 2940.0, 2940.0] | [17.0, 17.0, 17.0] | [62, 62, 83] |
p02724 | u971096161 | 2,000 | 1,048,576 | Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.) Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn? (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.) | ['X = int(input())\nans = 0\nans += X//500 * 1000\nX = X % 500\nans += X // 500 * 5\n\nprint(ans)', 'X = int(input())\nans = 0\nans += X//500 * 1000\nx = x % 500\nans += X // 500 * 5\n\nprint(ans)', 'X = int(input())\nans = 0\nans += X//500 * 1000\nX = X % 500\nans += X // 5 * 5\n\nprint(ans)'] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s308321211', 's603065713', 's477098124'] | [2940.0, 3064.0, 2940.0] | [18.0, 17.0, 17.0] | [89, 89, 87] |
p02724 | u978494963 | 2,000 | 1,048,576 | Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.) Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn? (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.) | ['x=int(input())\nh=(x//500)*1000\nx%=500\nh+=x//5\nprint(h)', 'x=map(int,input().split())\nh=x//500 * 1000\nx%=500\nh+=x//5\nprint(h)', 'x=int(input())\nh=(x//500)*1000\nx%=500\nh+=(x//5)*5\nprint(h)\n'] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s718193061', 's920278541', 's389055063'] | [2940.0, 2940.0, 2940.0] | [17.0, 17.0, 17.0] | [54, 66, 59] |
p02724 | u980205854 | 2,000 | 1,048,576 | Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.) Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn? (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.) | ['\nX = int(input())\nans = 1000*(X%500)\nX //= 500\nans += 5*(X%5)\nprint(ans)', '\nX = int(input())\nans = 1000*(X//500)\nX %= 500\nans += 5*(X//5)\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s375622393', 's545851213'] | [2940.0, 2940.0] | [17.0, 17.0] | [90, 91] |
p02724 | u986884213 | 2,000 | 1,048,576 | Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.) Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn? (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.) | ['x = int(input())\nans = 0\nans += 1000*x//500 + 5*(x%500)//5\nprint(ans)', 'x = int(input())\nq = x//500\np = (x%500)//5\nans = 1000*q + 5*p\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s521248476', 's683426347'] | [2940.0, 2940.0] | [17.0, 18.0] | [69, 72] |
p02724 | u995163736 | 2,000 | 1,048,576 | Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.) Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn? (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.) | ['x = int(input())\nprint((x//500)*5 + ((x%500)//5)*5)', 'x = int(input())\nprint((x//500)*1000 + ((x%500)//5)*5)'] | ['Wrong Answer', 'Accepted'] | ['s459389183', 's425387945'] | [9036.0, 8924.0] | [27.0, 29.0] | [51, 54] |
p02724 | u997036872 | 2,000 | 1,048,576 | Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.) Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn? (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.) | ['x = int(input())\nprint(x//500*100 + x%500//5*5)', 'x = int(input())\nprint(x//500*1000 + x%500//5 *5)'] | ['Wrong Answer', 'Accepted'] | ['s600061708', 's722087660'] | [2940.0, 2940.0] | [17.0, 17.0] | [47, 49] |
p02724 | u998741086 | 2,000 | 1,048,576 | Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.) Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn? (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.) | ['#!/usr/bin/env python3\n\nx = int(input())\na = x//500\nx -= a*500\nb = x//5\nprint(a*1000+b*5)\n~ ', '#!/usr/bin/env python3\n\nx = int(input())\na = x//500\nx -= a*500\nb = x//5\nprint(a*1000+b*5)'] | ['Runtime Error', 'Accepted'] | ['s387205586', 's592294612'] | [2940.0, 2940.0] | [17.0, 17.0] | [109, 89] |
p02725 | u000040786 | 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 be traveled when you start at one of the houses and visit all the N houses. | ['k, n = map(int, input().split())\na = list(map(int, input().split()))\nb = []\nb.append(k - a[n-1] - a[0])\nfor i in range(n-1):\n b.append(a[i + 1] - a[i])\nprint(k - max(b))', 'k, n = map(int, input().split())\na = list(map(int, input().split()))\nb = []\nb.append(k - a[n-1] + a[0])\nfor i in range(n-1):\n b.append(a[i + 1] - a[i])\nprint(k - max(b))'] | ['Wrong Answer', 'Accepted'] | ['s728897336', 's654210433'] | [25840.0, 25836.0] | [117.0, 119.0] | [172, 172] |
p02725 | u000770457 | 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 be traveled when you start at one of the houses and visit all the N houses. | ['k,n=map(int,input().split())\na=map(int,input().split())\nmax = -1\nfor i in range(0,n-1):\n if max>abs(a[i]-a[i+1]):\n max=abs(a[i]-a[i+1])\nif max>(k-a[n-1])+a[0]:\n max=(k-a[n-1])+a[0]\n \nprint(k-max)', 'k,n=map(int,input().split())\na=list(map(int,input().split()))\nmax = -1\nfor i in range(0,n-1):\n d=abs(a[i+1]-a[i])\n if max<d:\n max=d\nif max<k-a[n-1]+a[0]:\n max=k-a[n-1]+a[0]\n \nprint(k-max)'] | ['Runtime Error', 'Accepted'] | ['s085286810', 's690466474'] | [18484.0, 26444.0] | [36.0, 117.0] | [201, 194] |
p02725 | u004482945 | 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 be traveled when you start at one of the houses and visit all the N houses. | ['k, n = map(int, input().split())\nhouse_list = list(map(int, input().split()))\nfor i in range(n):\n house_list.append(house_list[i] - k)\ntmp_list = sorted(house_lise)\nans_list = []\nfor j in range(n + 1):\n ans_list.append(tmp_list[j + n - 1] - tmp_list[j])\nprint(min(ans_list)', 'k, n = map(int, input().split())\nhouse_list = list(map(int, input().split()))\nfor i in range(n):\n house_list.append(house_list[i] - k)\ntmp_list = sorted(house_list)\nans_list = []\nfor j in range(n + 1):\n ans_list.append(tmp_list[j + n - 1] - tmp_list[j])\nprint(min(ans_list)', 'k, n = map(int, input().split())\nhouse_list = list(map(int, input().split()))\nfor i in range(n):\n house_list.append(house_list[i] - k)\ntmp_list = sorted(house_list)\nans_list = []\nfor j in range(n + 1):\n ans_list.append(tmp_list[j + n - 1] - tmp_list[j])\nprint(min(ans_list))'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s147536502', 's922339682', 's860321621'] | [2940.0, 3060.0, 32520.0] | [17.0, 17.0, 187.0] | [275, 275, 276] |
p02725 | u005815259 | 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 be traveled when you start at one of the houses and visit all the N houses. | ['n= [int(x) for x in input().split()]\nl = [int(x) for x in input().split()]\nlake = n[0]\nnum_ie = n[1]\nkyori = []\nfor i in range(num_ie-1):\n kyori.append(l[i+1]-l[i])\nkyori.append(lake - l[num_ie-1] + l[0])\noutput = 0\noutput += sum(kyori) \noutput -= max(kyori)\n\nprint(kyori)\nprint(output)', 'n= [int(x) for x in input().split()]\nl = [int(x) for x in input().split()]\nlake = n[0]\nnum_ie = n[1]\nkyori = []\nfor i in range(num_ie-1):\n kyori.append(l[i+1]-l[i])\nkyori.append(lake - l[num_ie-1] + l[0])\noutput = 0\noutput += sum(kyori) \noutput -= max(kyori)\n\nprint(output)\n\n'] | ['Wrong Answer', 'Accepted'] | ['s868167104', 's797519567'] | [26444.0, 24948.0] | [138.0, 123.0] | [289, 278] |
p02725 | u011277545 | 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 be traveled when you start at one of the houses and visit all the N houses. | ['K,N=map(int, input().split())\nA=list(map(int, input().split()))\ndist=[]\nfor i in range(len(A)):\n print(A[i])\n if i==0:\n dist.append(K-A[len(A)-1]+A[i])\n dist.append(A[i+1]-A[i])\n\n elif i<len(A)-1:\n dist.append(K-A[i+1]+A[i])\n dist.append(A[i+1]-A[i])\n\ntarget=max(dist)\nprint(K-target)', 'K,N=map(int, input().split())\nA=list(map(int, input().split()))\ndist=[]\nfor i in range(len(A)):\n if i==0:\n dist.append(K-A[len(A)-1]+A[i])\n dist.append(A[i+1]-A[i])\n\n elif i<len(A)-1:\n dist.append(K-A[i+1]+A[i])\n dist.append(A[i+1]-A[i])\n\ntarget=max(dist)\nprint(K-target)', 'K,N=map(int, input().split())\nA=list(map(int, input().split()))\ndist=[]\ndist.append(K-A[-1]+A[0])\nfor i in range(1,len(A)):\n dist.append(A[i]-A[i-1])\n\ntarget=max(dist)\nprint(K-target)'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s677324943', 's791271909', 's023901234'] | [26444.0, 26444.0, 26420.0] | [419.0, 227.0, 117.0] | [321, 305, 186] |
p02725 | u016302627 | 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 be traveled when you start at one of the houses and visit all the N houses. | ['K, N = int(input().split())\nA = list(map(int, input().split()))\nmax = A[1] - A[0]\nfor i in range(1, N-1):\n if max < A[i+1] - A[i]:\n max = A[i+1] - A[i]\nif max < K - A[N-1]:\n max = K - A[N+1]\nprint(K - max)', 'K,N = map(int,input().split())\nA = list(map(int, input().split()))\nmax = K + A[0] - A[N-1]\nfor i in range(N-1):\n if max < A[i+1] - A[i]:\n max = A[i+1] - A[i]\nprint(K - max)'] | ['Runtime Error', 'Accepted'] | ['s563786028', 's784833691'] | [3060.0, 26436.0] | [17.0, 103.0] | [218, 182] |
p02725 | u019075898 | 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 be traveled when you start at one of the houses and visit all the N houses. | ['#C\nk, n = [int(_) for _ in input().split()]\na = [int(_) for _ in input().split()]\nb = []\nfor i in range(len(a)):\n if i == 0:\n b.append(k - a[len(a)] + a[0])\n else:\n b.append(a[i] - a[i - 1])\nprint(k - max(b))', '#C\nk, n = [int(_) for _ in input().split()]\na = [int(_) for _ in input().split()]\nb = []\nfor i in range(len(a)):\n if i == 0:\n b.append(k - a[len(a) - 1] + a[0])\n else:\n b.append(a[i] - a[i - 1])\nprint(k - max(b))'] | ['Runtime Error', 'Accepted'] | ['s864381934', 's929263122'] | [26444.0, 26436.0] | [72.0, 129.0] | [228, 232] |
p02725 | u023229441 | 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 be traveled when you start at one of the houses and visit all the N houses. | ['k,n=map(int,input().split())\nA=list(map(int,input().split()))\nans=348736286328\nfor i in range(n-1):\n ans=min(ans,A[i+1]-A[i])\nans=min(ans,k-(A[n-1]-A[0]))\nprint(ans)\n ', 'k,n=map(int,input().split())\nA=list(map(int,input().split()))\nans=-1\nfor i in range(n-1):\n ans=max(ans,A[i+1]-A[i])\nprint(sum(A)- max(ans,k-(A[n-1]-A[0])))\n', 'k,n=map(int,input().split())\nA-list(map(int,input().split()))\nans=-1\nfor i in range(n-1):\n ans=max(ans,A[i+1]-A[i])\nprint(sum(A)- max(ans,k-(A[n-1]-A[0])))', 'k,n=map(int,input().split())\nA=list(map(int,input().split()))\nans=-1\nfor i in range(n-1):\n ans=max(ans,A[i+1]-A[i])\nprint(k- max(ans,k-(A[n-1]-A[0])))\n'] | ['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s092488880', 's440804996', 's607728177', 's067308415'] | [26444.0, 26060.0, 3060.0, 26436.0] | [167.0, 163.0, 17.0, 147.0] | [169, 157, 156, 152] |
p02725 | u024340351 | 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 be traveled when you start at one of the houses and visit all the N houses. | ['import numpy as np\na, b = map(int, input().split())\nl = list(map(int, input().split()))\nf = b - 1\ng = b - 2\nc = int(l[-1])\nd = int(l[0])\nv = list([1]*b)\nfor i in range (f):\n \tv[i] = l[i+1]-l[i]\nv[f] = a + l[0] - l[-1]\nprint(v)\nif\tmax(v) == v[f]:\n\tprint(l[-1]-l[0])\nelse:\n\tprint(a-max(v))', 'a, b = map(int, input().split())\nl = list(map(int, input().split()))\nf = b - 1\ng = b - 2\nc = int(l[-1])\nd = int(l[0])\nv = list([1]*b)\nfor i in range (f):\n \tv[i] = l[i+1]-l[i]\nv[f] = a + l[0] - l[-1]\nif\tmax(v) == v[f]:\n\tprint(l[-1]-l[0])\nelse:\n\tprint(a-max(v))'] | ['Wrong Answer', 'Accepted'] | ['s009476085', 's997441027'] | [34152.0, 26444.0] | [262.0, 117.0] | [288, 260] |
p02725 | u026731851 | 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 be traveled when you start at one of the houses and visit all the N houses. | ['k,n = map(int, input().split())\nA = [int(x) for x in input().split()]\nc=[]\nfor i in range(n-1):\n c.append(A[i+1]-A[i])\nc.append(k-A[n-1])\nprint(k-max(c))', 'k,n = map(int, input().split())\nA = [int(x) for x in input().split()]\nc=[]\nfor i in range(n-1):\n c.append(A[i+1]-A[i])\nc.append(k-A[n-1]+A[0])\nprint(k-max(c))'] | ['Wrong Answer', 'Accepted'] | ['s590494639', 's342179184'] | [26420.0, 26420.0] | [126.0, 124.0] | [154, 159] |
p02725 | u028014940 | 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 be traveled when you start at one of the houses and visit all the N houses. | ['\nK, N = map(int, input().split())\nA = list(map(int, input().split()))\nlst = []\nfor i in range(N-1):\n diff = abs(A[i + 1] - A[i])\n lst.append(diff)\n\nif A[0] == 0:\n lst.append(K - A[N - 1])\n\nelse:\n lst.append(K - (A[N - 1] - A[0]))\n\nprint(lst)\nprint(K - max(lst))', '\nK, N = map(int, input().split())\nA = list(map(int, input().split()))\nlst = []\nfor i in range(1, N-1):\n diff_1 = abs(A[i + 1] - A[i])\n lst.append(diff_1)\n diff_2 = abs(A[i] - A[i - 1])\n lst.append(diff_2)\n\nlst.append(K + A[0] - A[N-1])\nprint(lst)\nprint(K - max(lst))', '\nK, N = map(int, input().split())\nA = list(map(int, input().split()))\nlst = []\nfor i in range(N-1):\n diff = abs(A[i + 1] - A[i])\n lst.append(diff)\n\nif A[0] == 0:\n lst.append(K - A[N - 1])\n\nelse:\n lst.append(A[N - 1] - A[0])\n\nprint(lst)\nprint(K - max(lst))', '\nK, N = map(int, input().split())\nA = list(map(int, input().split()))\nlst = []\nfor i in range(1, N-1):\n diff_1 = abs(A[i + 1] - A[i])\n lst.append(diff_1)\n\nlst.append(K + A[0] - A[N-1])\nprint(K - max(lst))'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s123373548', 's956732875', 's994621400', 's531236913'] | [25452.0, 26444.0, 26444.0, 26444.0] | [152.0, 228.0, 142.0, 135.0] | [273, 278, 267, 210] |
p02725 | u030669569 | 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 be traveled when you start at one of the houses and visit all the N houses. | ['K, N = list(map(int, input().split()))\nlst_A = list(map(int, input().split())) \n\ndef main(K, N, lst_A):\n\n lst_A = [0] + lst_A\n lst_A.append(K)\n diff_dis = [lst_A[i+1] - lst_A[i] for i in range(N+1)]\n\n sum_dis = sum(diff_dis)\n return sum_dis - max(diff_dis)\n\nif __name__ == "__main__":\n\n answer = main(K, N, lst_A)\n print(answer)', 'K, N = list(map(int, input().split()))\nlst_A = list(map(int, input().split())) \n\ndef main(K, N, lst_A):\n\n diff_dis = [lst_A[i+1] - lst_A[i] for i in range(N-1)]\n diff_dis.append(K-lst_A[-1] + lst_A[0])\n\n sum_diff = sum(diff_dis)\n answer = sum(diff_dis)\n\n for diff in diff_dis:\n _answer = sum_diff - diff\n answer = min(answer, _answer)\n\n return answer\n\nif __name__ == "__main__":\n\n answer = main(K, N, lst_A)\n print(answer)'] | ['Wrong Answer', 'Accepted'] | ['s394269776', 's008119416'] | [26444.0, 26444.0] | [92.0, 125.0] | [349, 461] |
p02725 | u033724502 | 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 be traveled when you start at one of the houses and visit all the N houses. | ['k=input().split(" ")[0]\na = list(map(lambda x: int(x), input().split("\\n")[1].split(" ")))\ndf = max(a) - min(a)\nprint(min(df, k - df))', 'k=int(input().split(" ")[0])\na = sorted(map(lambda x: int(x), input().split("\\n")[0].split(" ")))\ndfs=[k-a[len(a)-1]+a[0]]\nfor i in range(len(a) - 1):\n dfs.append(a[i+1]-a[i])\nprint(sum(dfs)-max(dfs))'] | ['Runtime Error', 'Accepted'] | ['s292484504', 's318916223'] | [5824.0, 25840.0] | [21.0, 143.0] | [134, 203] |
p02725 | u036492525 | 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 be traveled when you start at one of the houses and visit all the N houses. | ['k,n=map(int,input().split())\na=list(map(int,input().split()))\nb=[0]*n\nfor i in range(n):\n\tif i == n-1:\n\t\tb[i]=k-a[i]+a[0]\n\t\tprint("I")\n\telse:\n\t\tb[i]=a[i+1]-a[i]\n\tprint(i,b[i])\n\t\t\nmax_a=0\nfor i in range(n):\n\tif b[i]>max_a:\n\t\tmax_a=b[i]\n\t\tprint(i,max_a)\n\nprint(k-max_a)', 'k,n=map(int,input().split())\na=list(map(int,input().split()))\nb=[0]*n\nfor i in range(n):\n\tif i == n-1:\n\t\tb[i]=k-a[i]+a[0]\n\telse:\n\t\tb[i]=a[i+1]-a[i]\nmax_a=0\nfor i in range(n):\n\tif b[i]>max_a:\n\t\tmax_a=b[i]\nprint(k-max_a)'] | ['Wrong Answer', 'Accepted'] | ['s572241301', 's243916358'] | [26444.0, 26436.0] | [399.0, 163.0] | [267, 218] |
p02725 | u038676814 | 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 be traveled when you start at one of the houses and visit all the N houses. | ['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, abs(A[n-1]-k))\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])\n\nd1 = (k - A[n-1]) + A[0]\nd = max(d, d1)\nprint(k-d)'] | ['Wrong Answer', 'Accepted'] | ['s493566024', 's546319734'] | [32320.0, 32324.0] | [126.0, 124.0] | [162, 177] |
p02725 | u039860745 | 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 be traveled when you start at one of the houses and visit all the N houses. | ['K,N = map(int,input().split())\nA = list(map(int,input().split()))\n\nans = 0\nfor i in range(N-1):\n ans = max(ans,A[i+1] - A[i])\n print(ans)\n \nans = max(ans,K-A[-1]+A[0])\nprint(K-ans)', 'K,N = map(int,input().split())\nA = list(map(int,input().split()))\n\nans = 0\nfor i in range(N-1):\n ans = max(ans,A[i+1] - A[i])\n\n \nans = max(ans,K-A[-1]+A[0])\nprint(K-ans)'] | ['Wrong Answer', 'Accepted'] | ['s562497070', 's898343986'] | [32352.0, 32160.0] | [182.0, 126.0] | [183, 171] |
p02725 | u039934639 | 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 be traveled when you start at one of the houses and visit all the N houses. | ['K, N = map(int, input().split())\nA = list(map(int, input().split()))\n\nA.append(A[0]+K)\n\nprint(A)\n\nfor i in range(K):\n L = A[i+1]-A[i]\nans = K-max(L)\n\nprint(ans)', 'K, N = map(int, input().split())\nA = list(map(int, input().split()))\n\nA.append(A[0]+K)\n\nfor i in K:\n L = A[i+1]-A[i]\nans = K-max(L)\n\nprint(ans)\n\n\n', 'K, N = map(int, input().split())\nA = list(map(int, input().split()))\n\nif A[N-1]-A[N-2] >= 10:\n ans = (K-A[N-1])+A[N-2]\nelse:\n ans = A[0]+A[N-1]\n \nprint(ans)', 'K, N = map(int, input().split())\nA = list(map(int, input().split()))\n\nA.append(A[0]+K)\nL = []\n\nfor i in range(N):\n a = A[i+1]-A[i]\n L.append(a)\nans = K-max(L)\n\nprint(ans)'] | ['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s254697888', 's445729354', 's707772856', 's829981192'] | [26444.0, 26444.0, 26420.0, 26420.0] | [116.0, 65.0, 69.0, 123.0] | [161, 147, 159, 172] |
p02725 | u046158516 | 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 be traveled when you start at one of the houses and visit all the N houses. | ['K, N = map(int, input().split())\nhouselist = list(map(int, input().split()))\nmax=0\nfor i in range(1,N-1):\n if houselist(i)-houselist(i-1)>max:\n max=houselist(i)-houselist(i-1)\nif K+houselist(0)-houselist(N)>max:\n max=K+houselist(0)-houselist(N)\nprint(K-max)', 'K, N = map(int, input().split())\nhouselist = list(map(int, input().split()))\nmax=0\nfor i in range(1,N):\n if houselist[i]-houselist[i-1]>max:\n max=houselist[i]-houselist[i-1]\nif K+houselist[0]-houselist[N]>max:\n max=K+houselist[0]-houselist[N]\nif max==0:\n print(0)\nelse:\n print(K-max)\n', 'K, N = map(int, input().split())\nhouselist = list(map(int, input().split()))\nmax=0\nfor i in range(1,N-1):\n if houselist[i]-houselist[i-1]>max:\n max=houselist[i]-houselist[i-1]\nif K+houselist[0]-houselist[N]>max:\n max=K+houselist[0]-houselist[N]\nif max==0:\n print(0)\nelse:\n print(K-max)', 'K, N = map(int, input().split())\nhouselist = list(map(int, input().split()))\nmax=0\nfor i in range(1,N-1):\n if houselist[i]-houselist[i-1]>max:\n max=houselist[i]-houselist[i-1]\nif K+houselist[0]-houselist[N]>max:\n max=K+houselist[0]-houselist[N]\nprint(K-max)', 'K, N = map(int, input().split())\nhouselist = list(map(int, input().split()))\nmax=0\nfor i in range(1,N):\n if houselist[i]-houselist[i-1]>max:\n max=houselist[i]-houselist[i-1]\nif K+houselist[0]-houselist[N-1]>max:\n max=K+houselist[0]-houselist[N-1]\nif max==0:\n print(0)\nelse:\n print(K-max)\n'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s206944189', 's625243546', 's677264261', 's795944130', 's111744687'] | [26420.0, 26444.0, 25840.0, 26444.0, 26444.0] | [66.0, 109.0, 103.0, 103.0, 102.0] | [262, 291, 292, 262, 295] |
p02725 | u047197186 | 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 be traveled when you start at one of the houses and visit all the N houses. | ['k, n = [int(elem) for elem in input().split()]\na_lst = [int(elem) for elem in input().split()]\n\ndiff = []\nfor i, a in enumerate(a_lst[:-1]):\n diff.append(a_lst[i+1] - a)\ndiff.append((a_lst[0] + k) - a_lst[-1])\nprint(diff)\n\nres = sum(diff) - max(diff)\nprint(res)', 'k, n = [int(elem) for elem in input().split()]\na_lst = [int(elem) for elem in input().split()]\n\ndiff = []\nfor i, a in enumerate(a_lst[:-1]):\n diff.append(a_lst[i+1] - a)\ndiff.append((a_lst[0] + k) - a_lst[-1])\n\nres = sum(diff) - max(diff)\nprint(res)'] | ['Wrong Answer', 'Accepted'] | ['s796896709', 's187481462'] | [26228.0, 26444.0] | [136.0, 133.0] | [264, 252] |
p02725 | u047719604 | 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 be traveled when you start at one of the houses and visit all the N houses. | ['n,k = map(int,input().split())\nlst = list(map(int,input().split()))\nlst.append(k+lst[0])\nmaxe = 0\nfor i in range(1,n+1):\n maxe =max(maxe,lst[i]-lst[i-1])\nprint(k-maxe) ', 'k,n = map(int,input().split())\nlst = list(map(int,input().split()))\nlst.append(k+lst[0])\nmaxe = 0\nfor i in range(1,n+1):\n maxe =max(maxe,lst[i]-lst[i-1])\nprint(k-maxe) '] | ['Runtime Error', 'Accepted'] | ['s813175652', 's345966330'] | [26444.0, 26444.0] | [136.0, 144.0] | [185, 185] |
p02725 | u053035261 | 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 be traveled when you start at one of the houses and visit all the N houses. | ['from copy import deepcopy\n\nk, n = map(int, input().split())\n\na = list(map(int, input().split()))\na = sorted(a)\nmax_ = max(a)\nmin_ = min(a)\na_ = deepcopy(a)\nans = 100000000000\nfor index in range(len(a)):\n # temp = max(a) - min(a)\n # print(max_,min_)\n temp = max_ - min_\n max_ = min_ + k\n if index != len(a)-1:\n min_ = a[index+1]\n a[index] = a[index] + k\n # print(temp)\n if ans > temp:\n ans = temp\n\nmax_ = max(a_)\nmin_ = min(a_)\n\nfor index in reversed(range(len(a))):\n \n # temp = (max(a_) - min(a_))\n print(max_,min_)\n temp = max_-min_\n min_ = max_ -k\n if index != 0:\n max_ = a_[index-1]\n print(temp)\n # a_[index] -= k\n if ans > temp:\n ans = temp\n\nprint(ans)\n', 'from copy import deepcopy\n\nk, n = map(int, input().split())\n\na = list(map(int, input().split()))\na = sorted(a)\nmax_ = max(a)\nmin_ = min(a)\na_ = deepcopy(a)\nans = 100000000000\nfor index in range(len(a)):\n # temp = max(a) - min(a)\n # print(max_,min_)\n temp = max_ - min_\n max_ = min_ + k\n if index != len(a)-1:\n min_ = a[index+1]\n a[index] = a[index] + k\n # print(temp)\n if ans > temp:\n ans = temp\n\nmax_ = max(a_)\nmin_ = min(a_)\n\nfor index in reversed(range(len(a))):\n \n # temp = (max(a_) - min(a_))\n # print(max_,min_)\n temp = max_-min_\n min_ = max_ -k\n if index != 0:\n max_ = a_[index-1]\n # print(temp)\n # a_[index] -= k\n if ans > temp:\n ans = temp\n\nprint(ans)\n'] | ['Wrong Answer', 'Accepted'] | ['s993576492', 's183883792'] | [27044.0, 25672.0] | [815.0, 441.0] | [771, 775] |
p02725 | u054825571 | 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 be traveled when you start at one of the houses and visit all the N houses. | ['K,N=map(int,input().split())\nA=list(map(int,input().split()))\nl=[]\np = A[-1]-K\nfor a in A:\n l.append(a-l)\n p=a\nprint(sum(l)-max(l))', 'K,N=map(int,input().split())\nA=list(map(int,input().split()))\nl=[]\np = A[-1]-K\nfor a in A:\n l.append(a-p)\n p=a\nprint(sum(l)-max(l))\n'] | ['Runtime Error', 'Accepted'] | ['s579524643', 's872955652'] | [32352.0, 32244.0] | [69.0, 98.0] | [133, 134] |
p02725 | u065040863 | 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 be traveled when you start at one of the houses and visit all the N houses. | [',N = map(int, input().split())\nAN = max = i = j = 0\nc = []\n\nA = [int(N) for N in input().split()]\nwhile i+1 != N:\n c.append(A[i+1] - A[i])\n if c[i] > max:\n max = c[i]\n i = i+1\n\nc.append(A[0] - 0 + K - A[N-1])\n\nif A[0] - 0 + K - A[N-1] > max:\n max = A[0] - 0 + K - A[N-1]\n\nwhile j != N:\n AN = AN + c[j]\n j = j + 1\n\nAN = AN - max\n\nprint(AN)', 'K,N = map(int, input().split())\nAN = max = i = j = 0\nc = []\n\nA = [int(N) for N in input().split()]\nwhile i+1 != N:\n c.append(A[i+1] - A[i])\n if c[i] > max:\n max = c[i]\n i = i+1\n\nc.append(A[0] - 0 + K - A[N-1])\n\nif A[0] - 0 + K - A[N-1] > max:\n max = A[0] - 0 + K - A[N-1]\n\nwhile j != N:\n AN = AN + c[j]\n j = j + 1\n\nAN = AN - max\n\nprint(AN)\n'] | ['Runtime Error', 'Accepted'] | ['s501058704', 's428693610'] | [2940.0, 26444.0] | [17.0, 212.0] | [363, 365] |
p02725 | u068142202 | 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 be traveled when you start at one of the houses and visit all the N houses. | ['k, n = map(int, input().split())\na = list(map(int, input().split()))\ndistances = [0] * n\nfor i in range(n - 1):\n distances[i] = a[i] - a[i + 1]\ndistances[n] = k - a[n] + a[0]\nprint(k - max(distances))', 'k, n = map(int, input().split())\na = list(map(int, input().split()))\ndistances = [0] * n\nfor i in range(n - 1):\n distances[i] = a[i + 1] - a[i]\ndistances[n - 1] = k - a[n - 1] + a[0]\nprint(k - max(distances))\n'] | ['Runtime Error', 'Accepted'] | ['s490966854', 's104846156'] | [26444.0, 25796.0] | [116.0, 110.0] | [201, 210] |
p02725 | u069273180 | 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 be traveled when you start at one of the houses and visit all the N houses. | ['k,n=int(input().split())\na = list(map(int,input().split()))\nm = k-a[n-1]+a[0]\n \nfor i in range(n-1):\n\tm = max(m,a[i+1]-m[n])\n\nx = k-m\nprint(x)', 'k,n=int(input().split())\na = list(map(int,input().split()))\nm = int(0)\n\nfor i in range(n-1)\n\tm = max(m,a[i+1]-m[n])\n\nx = k-m\nprint(x)', 'k,n=map(int,input().split())\na = list(map(int,input().split()))\nm = k-a[n-1]+a[0]\nfor i in range(n-1):\n\tm = max(m,a[i+1]-a[i])\nx = k-m\nprint(x)'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s319918852', 's867912447', 's734421351'] | [3060.0, 2940.0, 26436.0] | [17.0, 17.0, 164.0] | [142, 133, 143] |
p02725 | u075303794 | 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 be traveled when you start at one of the houses and visit all the N houses. | ['K,N=map(int,input().split())\nA=list(map(int,input().split()))\ntemp=0\nfor i in range(N):\n tmep+=min(A[i],K-A[i])\nprint(min(A[-1]-A[0],temp)', 'K,N=map(int,input().split())\nA=list(map(int,input().split()))\ntemp=10**9\nfor i in range(N-1):\n temp=min(temp,A[i]+K-A[i+1])\n\nprint(min(A[-1]-A[0],temp))'] | ['Runtime Error', 'Accepted'] | ['s245919672', 's732147795'] | [8980.0, 32168.0] | [26.0, 136.0] | [139, 153] |
p02725 | u075401284 | 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 be traveled when you start at one of the houses and visit all the N houses. | ['k, n = map(int, input().split())\na = list(map(int, input().split()))\n\ng = 0\nfor i in range(n-1):\n tmp = a[i+1]-a[i]\n if tmp > g:\n g = tmp\ntmp = a[0] + (k - a[n-1])\nif tmp < g:\n g = tmp\n\nprint(k-g)', 'n, k = map(int, input().split())\na = list(map(int, input().split()))\n\ng = 0\nfor i in range(n):\n tmp = a[i+1]-a[i]\n if tmp > g:\n g = tmp\n\nprint(k-g)', 'k, n = map(int, input().split())\na = list(map(int, input().split()))\n\ng = 0\nfor i in range(n-1):\n tmp = a[i+1]-a[i]\n if tmp > g:\n g = tmp\ntmp = a[0] + (k - a[n-1])\nif tmp > g:\n g = tmp\n\nprint(k-g)\n'] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s233055512', 's868151707', 's590001236'] | [32072.0, 32312.0, 32192.0] | [103.0, 102.0, 105.0] | [202, 152, 203] |
p02725 | u077019541 | 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 be traveled when you start at one of the houses and visit all the N houses. | ['K,N=map(int, input().split())\nAs=[int(i) for i in input().split()]\nans=0\nfor num in range(1,len(As)-1):\n ans+=As[num+1]-As[num]\nprint(ans)', 'K,N=map(int, input().split())\nAs=[int(i) for i in input().split()]\nans=[]\nfor num in range(0,len(As)-1):\n ans.append(As[num+1]-As[num])\nans.append((K-max(As))+min(As))\nans.sort()\nprint(sum(ans[:-1]))'] | ['Wrong Answer', 'Accepted'] | ['s550230657', 's856816052'] | [26444.0, 26444.0] | [117.0, 158.0] | [141, 202] |
p02725 | u078816252 | 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 be traveled when you start at one of the houses and visit all the N houses. | ['20 3\n0 5 15', 'K,N = map(int,input().split())\nA = list(map(int,input().split()))\nB = [0 for i in range(N)]\nC = 0\nfor i in range(N):\n if i == N-1:\n B[i] = A[0] + K - A[i]\n else:\n B[i] = A[i+1] - A[i]\n if B[i] > C:\n C = B[i]\nprint(K-C)'] | ['Runtime Error', 'Accepted'] | ['s388346944', 's395999038'] | [2940.0, 26436.0] | [17.0, 152.0] | [11, 230] |
p02725 | u081899737 | 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 be traveled when you start at one of the houses and visit all the N houses. | ['k, n = map(int, input().split())\na = list(map(int, input().split()))\nd = 0\nfor v in range(n-1):\n d = max(0, a[v+1]-a[v])\nprint(k-d)', 'k, n = map(int, input().split())\na = list(map(int, input().split()))\nd = 0\nfor v in range(n-1):\n d = max(0, a[v+1]-a[v])\nprint(d)', 'k, n = map(int, input().split())\na = list(map(int, input().split()))\nd = a[0] - a[n - 1] + k\nfor v in range(n-1):\n d = max(0, a[v+1]-a[v])\nprint(k-d)\n', 'K, N = map(int, input().split())\nA = list(map(int, input().split()))\n\nresult = A[0] - A[N - 1] + K\nfor i in range(N - 1):\n result = max(result, A[i + 1] - A[i])\nprint(K - result)'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s138076902', 's285060668', 's911609857', 's373274784'] | [26436.0, 26444.0, 26444.0, 26444.0] | [154.0, 160.0, 132.0, 164.0] | [134, 132, 153, 181] |
p02725 | u084889225 | 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 be traveled when you start at one of the houses and visit all the N houses. | ['def main():\n k, n = map(int, input().split())\n a = list(map(int, input().split()))\n max_d = k - a[-1]\n for i in range(n - 1):\n max_d = max(max_d, a[i + 1] - a[i])\n print(k - max_d)\n\n\nif __name__ == "__main__":\n main()\n', 'def main():\n k, n = map(int, input().split())\n a = list(map(int, input().split()))\n max_d = k - a[-1] + a[0]\n for i in range(n - 1):\n max_d = max(max_d, a[i + 1] - a[i])\n print(k - max_d)\n\n\nif __name__ == "__main__":\n main()\n'] | ['Wrong Answer', 'Accepted'] | ['s802997341', 's529364843'] | [25452.0, 26436.0] | [126.0, 136.0] | [243, 250] |
p02725 | u085772923 | 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 be traveled when you start at one of the houses and visit all the N houses. | ['k , n = (int(x) for x in input().split())\na = [int(i) for i in input().split()]\n\nfor i in range(n-1):\n b.append(a[i+1] - a[i])\n \nb.append(a[0] + k -a[n-1])\n\nlans=0\nans = 999999999999\n\nfor i in range(len(b)):\n lans = 0\n for j in range(len(b)):\n if i != j:\n lans = b[j] + lans\n ans = min(ans,lans)\n \nprint(ans)', 'k , n = (int(x) for x in input().split())\na = [int(i) for i in input().split()]\nb = []\n \nfor i in range(n-1):\n b.append(a[i+1] - a[i])\n \nb.append(a[0] + k -a[n-1])\n\nans=0 \nb.sort()\n \nfor i in range(len(b)-1):\n ans = b[i] + ans\n\nprint(ans)'] | ['Runtime Error', 'Accepted'] | ['s826517044', 's862459895'] | [26436.0, 25452.0] | [73.0, 176.0] | [344, 247] |
p02725 | u086869007 | 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 be traveled when you start at one of the houses and visit all the N houses. | ["def main():\n \n arg = getInput(input())\n ans = process(arg)\n print(ans)\n \ndef process(arg):\n ans = 0\n ensyu = arg[0][0]\n kensu = arg[0][1]\n aida = list()\n for x in range(arg[0][1]):\n mae = arg[1][x-1]\n b = arg[1][x]\n if x == 0:\n w = b + arg[1][kensu-1]\n else:\n w = b - mae\n aida.append(w)\n\n m = max(aida)\n for y in aida:\n if y != m:\n ans = ans + y\n return ans\n\ndef getInput(input):\n k , n = map(int , input().split())\n al = list(map(int , input().split()))\n\n return [[k,n],al]\n\nif __name__ == '__main__':\n main()\n", "def main():\n arg = getInput(1)\n \n ans = process(arg)\n print(ans)\n \ndef process(arg):\n ans = 0\n print(arg)\n ensyu = arg[0][0]\n kensu = arg[0][1]\n aida = list()\n for x in range(arg[0][1]):\n mae = arg[1][x-1]\n b = arg[1][x]\n if x == 0:\n w = b + arg[1][kensu-1]\n else:\n w = b - mae\n aida.append(w)\n\n print(aida)\n m = max(aida)\n for y in aida:\n if y != m:\n ans = ans + y\n return ans\n\ndef getInput(input):\n \n n = 2\n \n ret = None\n ret2 = None\n if n == 1:\n pass\n \n \n \n .split()\n \n .split('T')\n else:\n for x in range(n):\n \n if x == 1:\n \n ret = list(map(int, '20 3'.split()))\n else:\n # ret2 = list(map(int, input[x].split()))\n ret2 = list(map(int, '5 10 15'.split()))\n\n return [ret, ret2]\n\nif __name__ == '__main__':\n main()\n", "def main():\n \n arg = getInput(input())\n ans = process(arg)\n print(ans)\n \ndef process(arg):\n ans = 0\n ensyu = arg[0][0]\n kensu = arg[0][1]\n aida = list()\n for x in range(arg[0][1]):\n mae = arg[1][x-1]\n b = arg[1][x]\n if x == 0:\n w = b + arg[1][kensu-1]\n else:\n w = b - mae\n aida.append(w)\n\n m = max(aida)\n for y in aida:\n if y != m:\n ans = ans + y\n return ans\n\ndef getInput(input):\n \n n = 2\n \n ret = None\n ret2 = None\n if n == 1:\n pass\n \n \n \n .split()\n \n .split('T')\n else:\n for x in range(n):\n \n ret = list(map(int, input[x].split()))\n\n return ret\n\nif __name__ == '__main__':\n main()\n", "def main():\n \n arg = getInput(input())\n ans = process(arg)\n print(ans)\n \ndef process(arg):\n ans = 0\n ensyu = arg[0][0]\n kensu = arg[0][1]\n aida = list()\n for x in range(arg[0][1]):\n mae = arg[1][x-1]\n b = arg[1][x]\n if x == 0:\n w = b + arg[1][kensu-1]\n else:\n w = b - mae\n aida.append(w)\n\n m = max(aida)\n for y in aida:\n if y != m:\n ans = ans + y\n return ans\n\ndef getInput(input):\n \n n = 2\n \n ret = None\n ret2 = None\n if n == 1:\n pass\n \n \n \n .split()\n \n .split('T')\n else:\n for x in range(n):\n \n if x == 1:\n ret = list(map(int, input[x].split()))\n \n else:\n ret2 = list(map(int, input[x].split()))\n # ret2 = list(map(int, '5 10 15'.split()))\n\n return [ret, ret2]\n\nif __name__ == '__main__':\n main()\n", "def main():\n arg = getInput(1)\n \n ans = process(arg)\n print(ans)\n \ndef process(arg):\n ans = 0\n ensyu = arg[0][0]\n kensu = arg[0][1]\n aida = list()\n for x in range(arg[0][1]):\n mae = arg[1][x-1]\n b = arg[1][x]\n if x == 0:\n w = b + arg[1][kensu-1]\n else:\n w = b - mae\n aida.append(w)\n\n m = max(aida)\n for y in aida:\n if y != m:\n ans = ans + y\n return ans\n\ndef getInput(input):\n \n n = 2\n \n ret = None\n ret2 = None\n if n == 1:\n pass\n \n \n \n .split()\n \n .split('T')\n else:\n for x in range(n):\n \n if x == 1:\n \n ret = list(map(int, '20 3'.split()))\n else:\n # ret2 = list(map(int, input[x].split()))\n ret2 = list(map(int, '5 10 15'.split()))\n\n return [ret, ret2]\n\nif __name__ == '__main__':\n main()\n", "def main():\n input1 = input()\n input2 = input()\n k , n = map(int , input1.split())\n al = list(map(int , input2.split()))\n arg = [[k,n],al]\n ans = process(arg)\n print(ans)\n \ndef process(arg):\n ans = 0\n ensyu = arg[0][0]\n kensu = arg[0][1]\n aida = list()\n for x in range(arg[0][1]):\n mae = arg[1][x-1]\n b = arg[1][x]\n if x == 0:\n \n w = b + ensyu - arg[1][kensu-1]\n else:\n w = b - mae\n aida.append(w)\n\n m = max(aida)\n flg = False\n for y in aida:\n if flg == True or y != m :\n ans = ans + y\n else:\n flg = True\n return ans\n\ndef getInput(input):\n\n return \n\nif __name__ == '__main__':\n main()\n"] | ['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s423227171', 's681374653', 's712197666', 's907772336', 's966606021', 's092126485'] | [3064.0, 3064.0, 3064.0, 3064.0, 3064.0, 27220.0] | [17.0, 18.0, 18.0, 18.0, 18.0, 129.0] | [657, 1240, 986, 1209, 1209, 764] |
p02725 | u087118202 | 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 be traveled when you start at one of the houses and visit all the N houses. | ['k,n=map(int,input().split())\na=list(map(int,input().split()))\n\nl=[]\na.append(k)\nfor i in range(0,n):\n abs_= abs(a[i]-a[i+1])\n l.append(abs_)\nabc=l.pop(l.index(max(l)))\nprint(k-abc)', 'k,n=map(int,input().split())\na=list(map(int,input().split()))\n\na.append(a[0]+k)\nl=0\nfor i in range(0,n):\n l=max(l,a[i+1]-a[i])\nprint(k-l)'] | ['Wrong Answer', 'Accepted'] | ['s660902841', 's865964462'] | [32264.0, 32384.0] | [123.0, 126.0] | [182, 138] |
p02725 | u088552457 | 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 be traveled when you start at one of the houses and visit all the N houses. | ['def count_section_by_zero(data):\n count = 0\n flg = False\n start = 0\n for i, d in enumerate(data):\n if flg is False and d != 0:\n count += 1\n flg = True\n \n if d == 0:\n flg = False\n return count\n\ndef input_list():\n return list(map(int, input().split()))\n\ndef input_list_str():\n return list(map(str, input().split()))\n\ndef lcm_base(x, y):\n return (x * y) // fractions.gcd(x, y)\n\ndef lcm_list(numbers):\n return reduce(lcm_base, numbers, 1)\n\ndef gcd(*numbers):\n return reduce(fractions.gcd, numbers)\n\ndef gcd_list(numbers):\n return reduce(fractions.gcd, numbers)\n\ndef combinations_count(n, r):\n return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))\n\n\ndef divide_two(arg):\n c = 0\n while True:\n if c >= 2:\n break\n if arg % 2 != 0:\n break\n arg //= 2\n c += 1\n return c\n\n\ndef prime_factorize(n):\n a = []\n while n % 2 == 0:\n a.append(2)\n n //= 2\n f = 3\n while f * f <= n:\n if n % f == 0:\n a.append(f)\n n //= f\n else:\n f += 2\n if n != 1:\n a.append(n)\n return a\n\ndef main():\n n, m = input_list()\n a = input_list()\n b = []\n for i in range(m):\n if i == 0:\n b.append((n - a[-1]) + a[0])\n continue\n b.append(a[i] - a[i-1])\n print(b)\n bm = max(b)\n print(sum(b) - bm)\nimport math\nimport fractions\nimport collections\nimport itertools\nfrom functools import reduce\nmain()', 'def count_section_by_zero(data):\n count = 0\n flg = False\n start = 0\n for i, d in enumerate(data):\n if flg is False and d != 0:\n count += 1\n flg = True\n \n if d == 0:\n flg = False\n return count\n\ndef input_list():\n return list(map(int, input().split()))\n\ndef input_list_str():\n return list(map(str, input().split()))\n\ndef lcm_base(x, y):\n return (x * y) // fractions.gcd(x, y)\n\ndef lcm_list(numbers):\n return reduce(lcm_base, numbers, 1)\n\ndef gcd(*numbers):\n return reduce(fractions.gcd, numbers)\n\ndef gcd_list(numbers):\n return reduce(fractions.gcd, numbers)\n\ndef combinations_count(n, r):\n return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))\n\n\ndef divide_two(arg):\n c = 0\n while True:\n if c >= 2:\n break\n if arg % 2 != 0:\n break\n arg //= 2\n c += 1\n return c\n\n\ndef prime_factorize(n):\n a = []\n while n % 2 == 0:\n a.append(2)\n n //= 2\n f = 3\n while f * f <= n:\n if n % f == 0:\n a.append(f)\n n //= f\n else:\n f += 2\n if n != 1:\n a.append(n)\n return a\n\ndef main():\n n, m = input_list()\n a = input_list()\n b = []\n for i in range(m):\n if i == 0:\n b.append((n - a[-1]) + a[0])\n continue\n b.append(a[i] - a[i-1])\n bm = max(b)\n print(sum(b) - bm)\nimport math\nimport fractions\nimport collections\nimport itertools\nfrom functools import reduce\nmain()'] | ['Wrong Answer', 'Accepted'] | ['s591127640', 's091941512'] | [28304.0, 28432.0] | [144.0, 118.0] | [1492, 1481] |
p02725 | u091307273 | 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 be traveled when you start at one of the houses and visit all the N houses. | ['k, n = (int(i) for i in input().split())\nst [int(i) for i in input().split()]\n\nst = sorted(st)\nst.append(st[0] + k)\n\ndiffs = [st[i+1] - st[i] for i in range(n)]\n\nprint(k - max(diffs))\n', 'def main():\n k, n = (int(i) for i in input().split())\n st = [int(i) for i in input().split()]\n\n st = sorted(st)\n st.append(st[0] + k)\n\n diffs = [st[i+1] - st[i] for i in range(n)]\n\n print(k - max(diffs))\n\nmain()\n'] | ['Runtime Error', 'Accepted'] | ['s062907811', 's672097872'] | [8896.0, 31440.0] | [26.0, 101.0] | [184, 230] |
p02725 | u093861603 | 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 be traveled when you start at one of the houses and visit all the N houses. | ['K,N=map(int,input().split())\nA=list(map(int,input().split()))\nA.sort()\ndist=[A[0]+K-A[-1]]+[A[i]-A[i-1] for i in range(1,N)]\nprint(k-max(dist))', 'K,N=map(int,input().split())\nA=list(map(int,input().split()))\nA.sort()\ndist=[A[0]+K-A[-1]]+[A[i]-A[i-1] for i in range(1,N)]\nprint(K-max(dist))'] | ['Runtime Error', 'Accepted'] | ['s540622481', 's262041841'] | [26060.0, 26060.0] | [102.0, 101.0] | [143, 143] |
p02725 | u094999522 | 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 be traveled when you start at one of the houses and visit all the N houses. | ['(k,n),*a = [list(map(int,i.split())) for i in open(0)]\na.append(a[0]+k)\nprint(k - min(a[i+1]-a[i] for i in range(n)))', '(k,n),*a = [[*map(int,i.split())] for i in open(0)]\na.append(a[0]+k)\nprint(k - min(a[i+1]-a[i] for i in range(n)))', 'k,n,*a = map(int, open(0).read().split())\na.append(a[0]+k)\nprint(k - max(a[i+1]-a[i] for i in range(n)))'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s142847700', 's257966468', 's089906211'] | [26228.0, 2940.0, 25124.0] | [64.0, 17.0, 99.0] | [117, 114, 104] |
p02725 | u096294926 | 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 be traveled when you start at one of the houses and visit all the N houses. | ['K,N =list(map(int,input().split()))\nA = list(map(int,input().split()))\nC = list()\nans = int()\nA.append(K)\nA.append(int(0))\nB = list(sorted(A))\nfor i in range(len(B)-1):\n C.append(B[i+1]-B[i])\nC.remove(0)\nC = sorted(C)\nprint(C)\nfor i in range(N-1):\n ans += C[i]\nprint(ans)', 'K,N =list(map(int,input().split()))\nA = list(map(int,input().split()))\nC = list()\nans = int()\nB = list(sorted(A))\nfor i in range(len(B)-1):\n C.append(B[i+1]-B[i])\nC.append((K-B[-1])+(B[0]))\nC = sorted(C)\nfor i in range(N-1):\n ans += C[i]\nprint(ans)'] | ['Runtime Error', 'Accepted'] | ['s818470185', 's848214177'] | [26444.0, 26444.0] | [185.0, 183.0] | [278, 255] |
p02725 | u098982053 | 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 be traveled when you start at one of the houses and visit all the N houses. | ['K,N = map(int,input().split(" "))\nA = [int(i) for i in input().split(" ")]\na1 = [i for i in A if i<=K/2]\na2 = [j for j in A if j>K/2]\n\nMax = 0\nif len(a1)==0:\n print(a2[-1]-a2[0])\nelif len(a2)==0:\n print(a1[-1]-a1[0])\nelse:\n for i in range(len(a1)-1):\n if a1[i+1] - a1[i] > Max:\n Max = a1[i+1] - a1[i]\n \n for j in range(len(a2)-1):\n if a2[j+1] - a2[j]>Max:\n Max = a2[j+1] - a2[j]\n \n if a1[0]+K-a2[-1]>Max:\n Max = a1[0]+K-a2[-1]\n \n if a2[0]+a1[-1]>Max:\n Max = a2[0]-a1[-1]\n \n print(K-Max)', 'K,N = map(int,input().split(" "))\nA = [int(i) for i in input().split(" ")]\na1 = [i for i in A if i<=K/2]\na2 = [j for j in A if j>K/2]\n\nMax = 0\n\nfor i in range(len(a1)-1):\n if a1[i+1] - a1[i] > Max:\n Max = a1[i+1] - a1[i]\n \nfor j in range(len(a2)-1):\n if a2[j+1] - a2[j]>Max:\n Max = a2[j+1] - a2[j]\n \nif a1[0]+K-a2[-1]>Max:\n Max = a1[0]+K-a2[-1]\n \nif a2[0]+a1[-1]>Max:\n Max = a2[0]-a1[-1]\n \nprint(K-Max)', 'K,N = map(int,input().split(" "))\nA = [int(i) for i in input().split(" ")]\na1 = [i for i in A if i<=K/2]\na2 = [j for j in A if j>K/2]\n\nMax = 0\nif len(a1)==0:\n print(a2[-1]-a2[0])\nelif len(a2)==0:\n print(a1[-1]-a1[0])\nelse:\n for i in range(len(a1)-1):\n if a1[i+1] - a1[i] > Max:\n Max = a1[i+1] - a1[i]\n \n for j in range(len(a2)-1):\n if a2[j+1] - a2[j]>Max:\n Max = a2[j+1] - a2[j]\n \n if a1[0]+K-a2[-1]>Max:\n Max = a1[0]+K-a2[-1]\n \n if a2[0]-a1[-1]>Max:\n Max = a2[0]-a1[-1]\n \n print(K-Max)'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s546286652', 's565997663', 's569483006'] | [26444.0, 26444.0, 26444.0] | [171.0, 169.0, 166.0] | [593, 448, 593] |
p02725 | u102223485 | 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 be traveled when you start at one of the houses and visit all the N houses. | ['# coding: utf-8\nK, N = map(int, input().split())\nA = list(map(int, input().split()))\n\nlst = [A[i + 1] - A[i] for i in range(N - 1)]\n# print(lst)\nprint(K - max(lst))', '# coding: utf-8\nK, N = map(int, input().split())\nA = list(map(int, input().split()))\n\n# print("A:", A)\nA = A + [K + A[0]]\n# print("A:", A)\n\nlst = [A[i + 1] - A[i] for i in range(N - 1)]\n# print(lst)\nprint(K - max(lst))', '# coding: utf-8\nK, N = map(int, input().split())\nA = list(map(int, input().split()))\n\n# print("A:", A)\nA = A + [K + A[0]]\n# print("A:", A)\n\nlst = [A[i + 1] - A[i] for i in range(N)]\n# print(lst)\nprint(K - max(lst))\n'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s672997328', 's887785040', 's347079144'] | [26444.0, 25836.0, 25452.0] | [105.0, 101.0, 102.0] | [164, 231, 228] |
p02725 | u103198430 | 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 be traveled when you start at one of the houses and visit all the N houses. | ['import sys\n\n\ndef input() -> str:\n return sys.stdin.readline().rstrip("\\r\\n")\n\n\ndef main():\n k, n = map(int, input().split())\n houses = [int(s) for s in input().split()]\n houses = [k-houses[-1]] + houses\n distance = 0\n for i in range(1, n+1):\n distance = max(distance, houses[i] - houses[i-1])\n print(k - distance)\n\n\nif __name__ == "__main__":\n\n main()\n', 'import sys\n\n\ndef input() -> str:\n return sys.stdin.readline().rstrip("\\r\\n")\n\n\ndef main():\n k, n = map(int, input().split())\n houses = [int(s) for s in input().split()]\n distance = 0\n for i in range(n):\n distance = max(distance, houses[i] - houses[i-1])\n print(k - distance)\n\n\nif __name__ == "__main__":\n\n main()\n', 'import sys\n\n\ndef input() -> str:\n return sys.stdin.readline().rstrip("\\r\\n")\n\n\ndef main():\n k, n = map(int, input().split())\n houses = [int(s) for s in input().split()]\n houses = houses + [houses[0] + k]\n distance = 0\n for i in range(1, len(houses)):\n distance = max(distance, houses[i] - houses[i-1])\n print(k - distance)\n\n\nif __name__ == "__main__":\n\n main()\n'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s375327637', 's688119180', 's244221204'] | [24564.0, 24908.0, 26444.0] | [118.0, 118.0, 121.0] | [383, 341, 392] |
p02725 | u106181248 | 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 be traveled when you start at one of the houses and visit all the N houses. | ['k, n = map(int,input().split())\na = list(map(int,input().split()))\nd = []\nx = 0\n\nfor i in range(n):\n x = abs(a[i] - a[i-1])\n if x > k/2:\n x = x - int(k/2) \n d.append(x)\n\nprint(d)\nprint(sum(d)-max(d))', 'k, n = map(int,input().split())\na = list(map(int,input().split()))\nd = []\nx = 0\n\nfor i in range(n):\n x = abs(a[i] - a[i-1])\n if x > k/2:\n x = abs(x - k) \n d.append(x)\n\nprint(sum(d)-max(d))'] | ['Wrong Answer', 'Accepted'] | ['s320256046', 's259596292'] | [26444.0, 26100.0] | [188.0, 166.0] | [205, 194] |
p02725 | u106342872 | 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 be traveled when you start at one of the houses and visit all the N houses. | ['k, n = map(int, input().split())\na = list(map(int, input().split()))\n\nm = 10 ** 12\nfor i in range(1,len(a)-1):\n r = k - abs(a[i] - a[i-1])\n l = k - abs(a[i] - a[i+1])\n print(r,l)\n if min(r,l) <= m:\n m = min(r,l)\n\nr = abs(a[-1] - a[0])\nl = k - abs(a[1] - a[0])\nif min(r,l) <= m:\n m = min(r,l)\n\nr = k - abs(a[-1] - a[-2])\nl = abs(a[-1] - a[0])\nif min(r,l) <= m:\n m = min(r,l)\n \nprint(m)\n', 'k, n = map(int, input().split())\na = list(map(int, input().split()))\n\nm = 10 ** 12\nfor i in range(1,len(a)-1):\n r = k - abs(a[i] - a[i-1])\n l = k - abs(a[i] - a[i+1])\n if min(r,l) <= m:\n m = min(r,l)\n\nr = abs(a[-1] - a[0])\nl = k - abs(a[1] - a[0])\nif min(r,l) <= m:\n m = min(r,l)\n\nr = k - abs(a[-1] - a[-2])\nl = abs(a[-1] - a[0])\nif min(r,l) <= m:\n m = min(r,l)\n \nprint(m)\n'] | ['Wrong Answer', 'Accepted'] | ['s169779731', 's408098148'] | [26444.0, 26420.0] | [475.0, 249.0] | [413, 398] |
p02725 | u106778233 | 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 be traveled when you start at one of the houses and visit all the N houses. | ['k,n=map(int,input().split())\na=list(map(int,input().split()))\na.sort()\nb=len(a)\ndiff=max(a)-min(a)\ntemp1=a[0]\nfor i in range(1,b):\n temp2=a[i]\n a[i]=a[i]-temp1\n temp1=temp2\n\n\nla=k-diff\na[0]=la\n\nprint(min(a))', 'k,n=map(int,input().split())\na=list(map(int,input().split()))\na.sort()\nb=len(a)\ndiff=max(a)-min(a)\ntemp1=a[0]\nfor i in range(1,b):\n temp2=a[i]\n a[i]=a[i]-temp1\n temp1=temp2\n\n\nla=k-diff\na[0]=la\n\nprint(k-min(a))', 'k,n=map(int,input().split())\na=list(map(int,input().split()))\na.sort()\nb=len(a)\ndiff=max(a)-min(a)\ntemp1=a[0]\nfor i in range(1,b):\n temp2=a[i]\n a[i]=a[i]-temp1\n temp1=temp2\n\n\nla=k-diff\na[0]=la\n\nprint(sum(a)-max(a))\n'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s558755912', 's900309516', 's486153022'] | [26060.0, 25836.0, 26444.0] | [135.0, 134.0, 137.0] | [216, 218, 224] |
p02725 | u108898293 | 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 be traveled when you start at one of the houses and visit all the N houses. | ['import numpy as np\na,b=map(int,input().split())\n\nn_l=list(map(int,input().split()))\nn_l=list(sorted(n_l))\n\narr = np.array(n_l)\n\ndiff = np.diff(arr)\n\nprint(a-max(diff))\n', 'import numpy as np\na,b=map(int,input().split())\n#print(a)\nn_l=list(map(int,input().split()))\nn_l=list(sorted(n_l))\n\narr = np.array(n_l)\n\n\ndiff = np.diff(arr)\n#print(diff)\n#print(max(diff))\nprint(a-max(diff))', 'import numpy as np\na,b=map(int,input().split())\n#print(a)\nn_l=list(map(int,input().split()))\nn_l.append(n_l[0]+a)\nn_l=list(sorted(n_l))\n\narr = np.array(n_l)\n\n\ndiff = np.diff(arr)\n#print(diff)\n#print(max(diff))\nprint(a-max(diff))'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s497081228', 's909847802', 's587334034'] | [42676.0, 43144.0, 34140.0] | [937.0, 1788.0, 240.0] | [168, 277, 298] |
p02725 | u113255362 | 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 be traveled when you start at one of the houses and visit all the N houses. | ['K,N=map(int,input().split())\nList = list(map(int, input().split()))\nres = 0\nmid = 0\nfor i in range(N):\n if i == N-1:\n res+= K-List[i]+List[0]\n mid = max(mid,K-List[i]+List[0])\n else:\n res+= List[i+1]+List[i]\n mid = max(mid,List[i+1]-List[i])\nres = res - mid\nprint(res)\n ', 'K,N=map(int,input().split())\nList = list(map(int, input().split()))\nres = 0\nmid = 0\nfor i in range(N):\n if i == N-1:\n res+= K-List[i]+List[0]\n mid = max(mid,K-List[i]+List[0])\n else:\n res+= List[i+1]-List[i]\n mid = max(mid,List[i+1]-List[i])\nres = res - mid\nprint(res)'] | ['Wrong Answer', 'Accepted'] | ['s991627632', 's886747385'] | [32992.0, 33292.0] | [172.0, 166.0] | [287, 282] |
p02725 | u116038906 | 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 be traveled when you start at one of the houses and visit all the N houses. | ['\nK,N = (int(x) for x in input().split(" "))\nA = [0]\nfor i in input().split():\n if i !="0":\n A.append( int(i) )\n\n\nx =[A[i+1] - A[i] for i,v in enumerate(A[:-1]) ]\nif N < len(x):\n x.append(K - A[-1] +A[1])\nelse:\n x.append(K -A[-1])\n\nkyori_min = K - max(x)\nprint(kyori_min)', '\nK,N = (int(x) for x in input().split(" "))\nA = list(map(int, input().split()))\nA.append(0) \n\n\nkyori = [ A[i+1] -A[i] for i,v in enumerate(A[:-1]) ]\nkyori[-1] = kyori[-1] + K \nkyori.append(A[0] -A[-1] ) \nx_saisyo_saigo = kyori[-2] +kyori[-1]\nkyori.append(x_saisyo_saigo) \n\n\nkyori_min = K - max(kyori)\nprint(kyori_min)'] | ['Wrong Answer', 'Accepted'] | ['s564826408', 's299906800'] | [26444.0, 26444.0] | [142.0, 108.0] | [394, 623] |
p02725 | u122428774 | 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 be traveled when you start at one of the houses and visit all the N houses. | ['K,N = (int(x) for x in input().split())\nal = [int(x) for x in input().split()]\nd = [al[x+1]-al[x] for x in range(0, N-1)]\nd.append(K-al[-1]-al[0])\nprint(sum(d)-max(d))', 'K,N = (int(x) for x in input().split())\nal = [int(x) for x in input().split()]\nd = [al[x+1]-al[x] for x in range(0, N-1)]\nd.append(K-al[-1]+al[0])\nprint(sum(d)-max(d))'] | ['Wrong Answer', 'Accepted'] | ['s362386474', 's998536938'] | [26444.0, 26420.0] | [111.0, 106.0] | [167, 167] |
p02725 | u127110353 | 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 be traveled when you start at one of the houses and visit all the N houses. | ['import numpy as np\n\ninput1=list(map(int,input().split()))\ninput2=list(map(int, input().split()))\n\ndistance=[]\nfor order,value in enumerate(input2):\n if order==0:\n pass\n else:\n distance.append(value-input2[order-1])\n\n\ndistance.append(input1[0]-np.array(distance).sum())', 'input1=list(map(int,input().split()))\ninput2=list(map(int, input().split()))\n\ndistance=[]\nfor order,value in enumerate(input2):\n if order==0:\n pass\n else:\n distance.append(value-input2[order-1])\ndistance.append(input1[0]-sum(distance))\n\nprint(input1[0]-max(distance))'] | ['Wrong Answer', 'Accepted'] | ['s233750983', 's697280217'] | [34168.0, 25804.0] | [267.0, 126.0] | [288, 287] |
p02725 | u128661070 | 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 be traveled when you start at one of the houses and visit all the N houses. | ['# coding:utf-8\nk, n = map(int, input().split())\na = list(map(int, input().split()))\na += k\nfor i in range(n+1):\n l = max(l, a[i+1]-a[i])\n\nprint(k-l)', '# coding:utf-8\nk, n = map(int, input().split())\na = list(map(int, input().split()))\na.append(k)\nl = 0\nfor i in range(n):\n l = max(l, a[i+1]-a[i])\n \nprint(k-l)', '# coding:utf-8\nk, n = map(int, input().split())\na = list(map(int, input().split()))\na += k\nl = 0\nfor i in range(n+1):\n l = max(l, a[i+1]-a[i])\n \nprint(k-l)', '# coding:utf-8\nk, n = map(int, input().split())\na = list(map(int, input().split()))\na.append(k+a[0])\nl = 0\nfor i in range(n):\n l = max(l, a[i+1]-a[i])\n \nprint(k-l)'] | ['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s100765562', 's768814741', 's779689922', 's351477291'] | [26444.0, 26420.0, 26420.0, 26420.0] | [66.0, 163.0, 66.0, 164.0] | [149, 159, 156, 164] |
p02725 | u129961029 | 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 be traveled when you start at one of the houses and visit all the N houses. | ['a,b=map(int,input().split())\ns=list(map(int,input().split()))\nans=[]\nfor i in range(b-1):\n ans.append(s[i]-s[i-1])\nans.append(a-s[b]+s[0])\nprint(a-max(ans))\n\n\n\n\n\n', 'a,b=map(int,input().split())\ns=list(map(int,input().split()))\nans=[]\nfor i in range(b-1):\n ans.append(s[i]-s[i-1])\nans.append(a-s[b]+s[0])\nprint(sum(ans)-max(ans))\n\n\n\n\n\n', 'a,b=map(int,input().split())\ns=list(map(int,input().split()))\nans=[]\nfor i in range(b-1):\n ans.append(s[i+1]-s[i])\nans.append(a-s[b]+s[0])\nprint(a-max(ans))\n\n\n\n\n\n', 'a,b=map(int,input().split())\ns=list(map(int,input().split()))\nans=[]\nfor i in range(b-1):\n ans.append(s[i+1]-s[i])\nans.append(a-s[b-1]+s[0])\nprint(a-max(ans))\n\n\n\n\n\n'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s264318310', 's386580489', 's614668236', 's912987888'] | [26444.0, 26100.0, 25840.0, 25840.0] | [111.0, 115.0, 112.0, 115.0] | [165, 172, 165, 167] |
p02725 | u131464432 | 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 be traveled when you start at one of the houses and visit all the N houses. | ['k,n = map(int,input().split())\na = list(map(int,input().split()))\na.sort()\nm = k-a[n-1] + a[0]\nfor i in range(1,n):\n ans = 0\n ans = k-a[i]+a[i-1] \n print(ans)\n m = min(ans,m)\nprint(m)', 'k,n = map(int,input().split())\na = list(map(int,input().split()))\na.sort()\nm = a[n-1] - a[0]\nfor i in range(1,n):\n ans = 0\n ans = k-a[i]+a[i-1]\n m = min(ans,m)\nprint(m)'] | ['Wrong Answer', 'Accepted'] | ['s610625987', 's047080089'] | [32388.0, 32372.0] | [209.0, 139.0] | [187, 171] |
p02725 | u132049876 | 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 be traveled when you start at one of the houses and visit all the N houses. | ['lines = input().split()\ndists = []\nfor base, switch in zip(As[:-1], As[1:]):\n dists.append(switch - base)\ndists.append(As[0]+(K-As[-1]))\nprint(K - max(dists))', 'import sys\nlines = sys.stdin.readlines()\nK, N = map(int, lines[0].strip().split())\nAs = map(int, lines[1].strip().split())\nfor idx, A in enumerate(As[:-1]):\n dists.append(A - As[idx+1])\ndists.append(As[0]+(K-As[-1]))\nprint(K - max(dists))\n', 'import sys\nlines = sys.stdin.readlines()\nK, N = map(int, lines[0].strip().split())\nAs = map(int, lines[1].strip().split())\ndists = []\nfor idx, A in enumerate(As[:-1]):\n dists.append(A - As[idx+1])\ndists.append(As[0]+(K-As[-1]))\nprint(K - max(dists))', 'import sys\nlines = sys.stdin.readlines()\nK, N = map(int, lines[0].strip().split())\nAs = map(int, lines[1].strip().split())\ndists = []\nfor base, switch in zip(As[:-1], As[1:]):\n dists.append(switch - base)\ndists.append(As[0]+(K-As[-1]))\nprint(K - max(dists))', 'lines = input().split()\nK, N = map(int, lines[0].strip().split())\nAs = map(int, lines[1].strip().split())\ndists = []\nfor base, switch in zip(As[:-1], As[1:]):\n dists.append(switch - base)\ndists.append(As[0]+(K-As[-1]))\nprint(K - max(dists))\n', 'lines = map(int, input().split())\nK, N = map(int, lines[0].strip().split())\nAs = map(int, lines[1].strip().split())\ndists = []\nfor base, switch in zip(As[:-1], As[1:]):\n dists.append(switch - base)\ndists.append(As[0]+(K-As[-1]))\nprint(K - max(dists))\n', 'lines = input().split()\nK, N = map(int, lines[0].split())\nAs = map(int, lines[1].split())\ndists = []\nfor base, switch in zip(As[:-1], As[1:]):\n dists.append(switch - base)\ndists.append(As[0]+(K-As[-1]))\nprint(K - max(dists))', 'K, N = map(int, input().split())\nAs = map(int, input().split())\ndists = []\nfor base, switch in zip(As[:-1], As[1:]):\n dists.append(switch - base)\ndists.append(As[0]+(K-As[-1]))\nprint(K - max(dists))', 'K, N = list(map(int, input().split()))\nAs = list(map(int, input().split()))\ndists = []\nfor base, switch in zip(As[:-1], As[1:]):\n dists.append(switch - base)\ndists.append(As[0]+(K-As[-1]))\nprint(K - max(dists))'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s014182703', 's125494210', 's208199910', 's219308947', 's282051801', 's628277509', 's773659056', 's839807981', 's662227466'] | [3060.0, 18476.0, 18476.0, 18476.0, 3060.0, 3060.0, 3060.0, 18484.0, 26060.0] | [18.0, 36.0, 35.0, 35.0, 17.0, 17.0, 17.0, 34.0, 105.0] | [161, 240, 250, 258, 244, 254, 227, 201, 213] |
p02725 | u135116520 | 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 be traveled when you start at one of the houses and visit all the N houses. | ['K,N=map(int,input().split())\nA=list(map(int,input().split()))\nB=sorted(A)\ns=K-B[N-1]\nt=B[N-1]-B[N-2]\nif s>t:\n m=B[N-1]-B[0]\nelse:\n m=B[N-2]+K-B[N-1]\nprint(m)', 'K,N=map(int,input().split())\nA=list(map(int,input().split()))\nma=0\nfor i in range(N-1):\n ma=max(ma,A[i+1]-A[i])\nprint(min(K-ma,A[N-1]-A[0]))\n'] | ['Wrong Answer', 'Accepted'] | ['s313387027', 's032768876'] | [26436.0, 26436.0] | [73.0, 148.0] | [159, 142] |
p02725 | u140191608 | 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 be traveled when you start at one of the houses and visit all the N houses. | ['N , M = (map(int , input().split()))\nA = list(map(int , input().split()))\nA.insert(0,0)\na_lis = []\nfor i in range(0,len(A)-1):\n a_lis.append(A[i+1]-A[i])\nprint(N - max(a_lis))', 'N , M = (map(int , input().split()))\nA = list(map(int , input().split()))\nA.append(N)\na_lis = []\nfor i in range(len(A)-1):\n a_lis.append(A[i+1]-A[i])\nprint(N - max(a_lis))', 'N , M = (map(int , input().split()))\nA = list(map(int , input().split()))\na_lis = []\nfor i in range(len(A)-1):\n a_lis.append(A[i+1]-A[i])\na_lis.append((N+A[0]) - A[-1])\nprint(N - max(a_lis))'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s155133645', 's429702060', 's144753652'] | [26444.0, 26420.0, 25840.0] | [119.0, 117.0, 119.0] | [178, 174, 193] |
p02725 | u143322814 | 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 be traveled when you start at one of the houses and visit all the N houses. | ['k,n = map(int, input().split())\na = list(map(int, input().split()))\n\nb = []\nfor i in range(n-1):\n b.append(a[i+1]-a[i])\nb.append(k-a[n-1])\n\nprint(min(k-max(b), sum(b)))', 'k,n = map(int, input().split())\na = list(map(int, input().split()))\n\nb = []\nfor i in range(n-1):\n b.append(a[i+1]-a[i])\nb.append(k-a[n-1])\n\nprint(k-max(b))', 'k,n = map(int, input().split())\na = list(map(int, input().split()))\n\nif a[0] == 0:\n print(a[n-1]-n[1])\nelse:\n print(a[n-1]-n[0])', 'k,n = map(int, input().split())\na = list(map(int, input().split()))\n\nb = [a[0]]\nfor i in range(n-1):\n b.append(a[i+1]-a[i])\nb.append(k-a[n-1])\nprint(sum(b)-max(b))', 'k,n = map(int, input().split())\na = list(map(int, input().split()))\n\nb = []\nfor i in range(n-1):\n b.append(a[i+1]-a[i])\nb.append((k-a[n-1])+a[0])\nprint(k-max(b))'] | ['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s083221878', 's551259586', 's605122975', 's932574553', 's967439539'] | [26444.0, 26444.0, 25836.0, 27672.0, 26436.0] | [117.0, 116.0, 65.0, 119.0, 119.0] | [171, 158, 134, 166, 164] |
p02725 | u143492911 | 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 be traveled when you start at one of the houses and visit all the N houses. | ['# A = [list(map(int, input().split())) for _ in range(3)]\n# X = int(input())\n# B = [int(input()) for _ in range(n)]\n# A = list(map(int, input().split()))\nk, n = map(int, input().split())\nA = list(map(int, input().split()))\nA.append(A[0]+k)\ndiff = 0\nfor i in range(n):\n diff = A[i+1]-A[i]\nprint(k-max(diff))\n', '# A = [list(map(int, input().split())) for _ in range(3)]\n# X = int(input())\n# B = [int(input()) for _ in range(n)]\n# A = list(map(int, input().split()))\nk, n = map(int, input().split())\nA = list(map(int, input().split()))\nA.append(A[0]+k)\ndiff = 0\nfor i in range(n):\n diff = max(A[i+1]-A[i], diff)\nprint(k-diff)\n'] | ['Runtime Error', 'Accepted'] | ['s747242726', 's420213731'] | [26420.0, 26420.0] | [106.0, 146.0] | [310, 316] |
p02725 | u145145077 | 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 be traveled when you start at one of the houses and visit all the N houses. | ['k,n=map(int,input().split())\na=list(map(int, input().split()))\nmax_dis = 0\nfor i in range(n):\n if i == n-1:\n dis = k - a[i]\n else:\n dis = a[i+1] - a[i]\n max_dis = max(max_dis,dis)\nprint(k-max_dis)', 'k,n=map(int,input().split())\na=list(map(int, input().split()))\nmax_dis = 0\nfor i in range(n):\n if i == n-1:\n dis = (k+a[0]) - a[i]\n else:\n dis = a[i+1] - a[i]\n max_dis = max(max_dis,dis)\nprint(k-max_dis)'] | ['Wrong Answer', 'Accepted'] | ['s970014479', 's770673663'] | [26444.0, 26444.0] | [166.0, 181.0] | [205, 212] |
p02725 | u148981246 | 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 be traveled when you start at one of the houses and visit all the N houses. | ['k, n = map(int, input().split())\na = list(map(int, input().split()))\nprint(a)\n\nd = [a[i+1] - a[i] for i in range(n - 1)]\nd.append(a[0] - a[n-1] + k)\nprint(k - max(d))', 'k, n = map(int, input().split())\na = list(map(int, input().split()))\n\nd = [a[i+1] - a[i] for i in range(n - 1)]\nd.append(a[0] - a[n-1] + k)\nprint(k - max(d))'] | ['Wrong Answer', 'Accepted'] | ['s945006684', 's717660061'] | [32272.0, 32264.0] | [112.0, 99.0] | [166, 157] |
p02725 | u151365505 | 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 be traveled when you start at one of the houses and visit all the N houses. | ['k,n = map(int,input().split())\t\na = list(map(int,input().split()))\nD=[A[0]-A[-1]+K]\nfor i in range(N-1):\n D.append(A[i+1]-A[i])\nprint(K-max(D))', 'K,N = map(int,input().split())\t\nA = list(map(int,input().split()))\nD=[A[0]-A[-1]+K]\nfor i in range(N-1):\n D.append(A[i+1]-A[i])\nprint(K-max(D))'] | ['Runtime Error', 'Accepted'] | ['s694817784', 's294498470'] | [26420.0, 26420.0] | [66.0, 117.0] | [146, 146] |
p02725 | u153823221 | 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 be traveled when you start at one of the houses and visit all the N houses. | ['a = list(map(int, input().split()))\nk = a[0]\nn = a[1]\n\nway = list(map(int,input().split())) \n\ni = 0\ndis = []\n\nfor i in range(n):\n if way[i] < k // 2:\n dis.append((k // 2 - way[i]))\n elif way[i] == k//2:\n dis.append(way[i])\n else:\n dis.append(k - way[i])\n\nroute = []\nroute.append(way[n-1] - way[0])\n\nx = 1\n\nfor x in range(n):\n route.append(dis[x] + way[x - 1])\n\nprint(route)\nprint(min(route))', 'a = list(map(int, input().split()))\nk = a[0]\nn = a[1]\n\n\n\nway = list(map(int,input().split())) \n\ni = 0\ndis = [] \n\nfor i in range(n):\n if way[i] < (k // 2):\n dis.append(k // 2 - way[i])\n elif way[i] == k // 2:\n dis.append(way[i])\n else:\n dis.append(k - way[i])\n\nprint(dis)\n\nroute = []\nroute.append(way[n-1] - way[0])\n\nx = 1\n\nfor x in range(n):\n route.append(dis[x] + way[x - 1])\n\n\nprint(min(route))', 'a = list(map(int, input().split()))\nk = a[0]\nn = a[1]\n\nway = list(map(int,input().split())) \n\ni = 0\ndis = [] \n\nfor i in range(n):\n if way[i] < k // 2:\n dis.append((k // 2 - way[i]))\n elif way[i] == k//2:\n dis.append(way[i])\n else:\n dis.append(k - way[i])\n\nprint(dis)\n\nroute = []\nroute.append(way[n-1] - way[0])\n\nx = 1\n\nfor x in range(n):\n route.append(dis[x] + way[x - 1])\n\nprint(min(route))', 'k,n=map(int,input().split())\nA=[int(i) for i in input().split()]\ndif=[A[i+1]-A[i] for i in range(n-1)]\ndif.append(k-A[-1]+A[0])\nprint(k-max(dif))'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s413792521', 's674375103', 's844083735', 's747713285'] | [33932.0, 29700.0, 30832.0, 26444.0] | [228.0, 235.0, 235.0, 111.0] | [404, 409, 434, 145] |
p02725 | u163320134 | 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 be traveled when you start at one of the houses and visit all the N houses. | ['k,n=map(int,input().split())\narr=list(map(int,input().split()))\narr.append(arr[0])\nans=10**18\nfor i in range(n):\n dist1=(k-arr[i])%k+arr[i-1]\n dist2=arr[i]+(k-arr[i+1])%k\n ans=min(ans,dist1,dist2)\nprint(ans)', 'k,n=map(int,input().split())\narr=list(map(int,input().split()))\nans=10**18\nfor i in range(n):\n dist1=(k-arr[i])%k+arr[i-1]\n dist2=arr[i]+(k-arr[(i+1)%n])%k\n ans=min(ans,dist1,dist2)\nprint(ans)', 'k,n=map(int,input().split())\narr=list(map(int,input().split()))\nans=10**18\nfor i in range(n):\n dist1=(arr[i-1]-arr[i])%k\n dist2=(arr[i]-arr[(i+1)%n])%k\n ans=min(ans,dist1,dist2)\nprint(ans)'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s052397005', 's791637456', 's135727655'] | [26444.0, 26436.0, 26420.0] | [246.0, 263.0, 232.0] | [210, 195, 191] |
p02725 | u163783894 | 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 be traveled when you start at one of the houses and visit all the N houses. | ["# import sys\n# import math\n# import itertools\n# from collections import deque\n# from collections import defaultdict\n# import heapq\n# import copy\n\n# import numpy as np\n# from scipy.special import comb\n\n\n\n# INF = 1001001001001\n# MOD = 1000000007\n\n\ndef main():\n\n K, N = map(int, input().split())\n A = list(map(int, input().split()))\n\n if N == 2:\n d = abs(A[0]-A[1])\n print(min(d, K-d))\n else:\n max_d = N - A[N-1] + A[0]\n for i in range(N - 1):\n max_d = max(max_d, abs(A[i] - A[i+1]))\n print(K - max_d)\n\n\nif __name__ == '__main__':\n main()\n", "# import sys\n# import math\n# import itertools\n# from collections import deque\n# from collections import defaultdict\n# import heapq\n# import copy\n\n# import numpy as np\n# from scipy.special import comb\n\n\n\n# INF = 1001001001001\n# MOD = 1000000007\n\n\ndef main():\n\n K, N = map(int, input().split())\n A = list(map(int, input().split()))\n\n if N == 2:\n d = abs(A[0]-A[1])\n print(min(d, K-d))\n else:\n max_d = K - A[N-1] + A[0]\n for i in range(N - 1):\n max_d = max(max_d, abs(A[i] - A[i+1]))\n print(K - max_d)\n\n\nif __name__ == '__main__':\n main()\n"] | ['Wrong Answer', 'Accepted'] | ['s847881080', 's751224470'] | [25452.0, 25452.0] | [141.0, 129.0] | [697, 697] |
p02725 | u165368960 | 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 be traveled when you start at one of the houses and visit all the N houses. | ['k, n = map(int, input().split())\na = list(map(int, input().split()))\nlength = []\n\nfor i in range(n-1):\n length.append(a[i+1] - a[i])\n\nlength.append(a[0] + k - a[n-1])\n\nprint(length)\nmax_length = max(length)\nans = k- max_length\n\nprint(ans)', 'k, n = map(int, input().split())\na = list(map(int, input().split()))\nlength = []\n\nfor i in range(n-1):\n length.append(a[i+1] - a[i])\nlength.append(a[0] + k - a[n-1])\n\nmax_length = max(length)\nans = k- max_length\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s446603923', 's936895950'] | [26444.0, 26436.0] | [129.0, 116.0] | [239, 223] |
p02725 | u167647458 | 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 be traveled when you start at one of the houses and visit all the N houses. | ['a.append(a[0] + k)\nm = []\nfor i in range(n):\n m.append(m, a[i+1] - a[i])\nprint(k - max(m))', 'k, n = map(int, input().split())\na = list(map(int, input().split()))\na.append(a[0] + k)\nm = []\nfor i in range(n):\n m.append(m, a[i+1] - a[i])\nprint(k - max(m))', 'k, n = map(int, input().split())\na = list(map(int, input().split()))\na.append(a[0] + k)\nm = []\nfor i in range(n):\n m.append(a[i+1] - a[i])\nprint(k - max(m))'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s099507873', 's690980488', 's509899413'] | [2940.0, 26444.0, 26420.0] | [18.0, 65.0, 116.0] | [93, 162, 159] |
p02725 | u169350228 | 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 be traveled when you start at one of the houses and visit all the N houses. | ['import numpy as np\nk,n = map(int,input().split())\na = np.array(input().split(),dtype=int)\nmax = 0\nfor i in range(n):\n if max < a[i]-a[i-1]:\n max = a[i]-a[i-1]\n\nprint(k-max)\n', 'import numpy as np\nk,n = map(int,input().split())\na = np.array(input().split(),dtype=int)\nmax = 0\nfor i in range(n):\n if max < (a[i]-a[i-1])%k:\n max = (a[i]-a[i-1])%k\n\nprint(k-max)\n'] | ['Wrong Answer', 'Accepted'] | ['s794518541', 's936343669'] | [34388.0, 33800.0] | [338.0, 548.0] | [183, 191] |
p02725 | u174203233 | 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 be traveled when you start at one of the houses and visit all the N houses. | ['K, N = map(int, input().split())\nA = list(map(int, input().split())) \nd = []\ninterval = 0\nfor i in range(N):\n d.append(A[i] - interval)\n interval += A[i]\nd.append(K-interval+A[0])\nprint(K - max(d))', 'K, N = map(int, input().split())\nA = list(map(int, input().split())) \nd = []\ninterval = 0\nfor i in range(1, N):\n d.append(A[i] - A[i-1])\nd.append(K-A[N-1]+A[0])\nprint(K - max(d))'] | ['Wrong Answer', 'Accepted'] | ['s222195440', 's493043088'] | [26436.0, 26060.0] | [143.0, 117.0] | [199, 179] |
p02725 | u175590965 | 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 be traveled when you start at one of the houses and visit all the N houses. | ['k,n = map(int,input().spliut())\na = list(map(int,input().split()))\nans = a[0]+(k-a[-1])\nfor i in range(n-1):\n ans = max(ans,a[i+1]-a[i])\nprint(k-ans)', 'k,n = map(int,input().split())\na = list(map(int,input().split()))\nans = a[0]+(k-a[-1])\nfor i in range(n-1):\n ans = max(ans,a[i+1]-a[i])\nprint(k-ans)'] | ['Runtime Error', 'Accepted'] | ['s226306813', 's790866270'] | [9148.0, 31956.0] | [26.0, 128.0] | [152, 151] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.