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
p03317
u623819879
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen element...
['n,k=map(int,input().split())\nprint((n-1+k)//(k-1))', 'n,k=map(int,input().split())\nprint(int((n-1)/(k-1)))', 'n,k=map(int,input().split())\nprint((n-1)//(k-1))', 'n,k=map(int,input().split())\nprint(int((n-1)/k))', 'n,k=map(int,input().split())\nprint(int((n-1)/k))', 'n,k=map(int,input().split())\nprint(int((n-1)/(...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s026671942', 's109836776', 's139798426', 's153923352', 's218207039', 's529908567', 's732608853']
[2940.0, 2940.0, 2940.0, 3060.0, 2940.0, 2940.0, 2940.0]
[17.0, 18.0, 17.0, 20.0, 18.0, 17.0, 17.0]
[50, 52, 48, 48, 48, 51, 50]
p03317
u631914718
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen element...
['n, k = LI()\na = LI()\nl = len(a[:a.index(1)])\nr = len(a[a.index(1):])\n\nif l == 0:\n left = 0\nelif l < k:\n left = 1\nelse:\n left = math.ceil((l - k) / (k - 1)) + 1\n\nif r == 0:\n right = 0\nelif r < k:\n right = 1\nelse:\n right = math.ceil((r - k) / (k - 1)) + 1\n\nprint(left + right)', 'imp...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s015898062', 's372012616', 's831199316', 's305640161']
[3064.0, 3064.0, 3064.0, 13876.0]
[17.0, 17.0, 17.0, 45.0]
[292, 249, 296, 161]
p03317
u634208461
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen element...
['N, K = map(int, input().split())\nA = list(map(int, input().split()))\ncount = 0\nfor i in range(int(N / (K - 1))):\n if i * (K - 1) + K <= N - 1:\n m = min(A[i * (K - 1):i * (K - 1) + K])\n for j in range(i * (K - 1), i * (K - 1) + K):\n A[j] = m\n count += 1\n else:\n m ...
['Runtime Error', 'Accepted']
['s658656090', 's280138798']
[141088.0, 13812.0]
[1862.0, 39.0]
[554, 117]
p03317
u636162168
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen element...
['n,k=map(int,input().split())\na=list(map(int,input().split()))\ntmp=min(a)\ncount_min=Counter(a)[tmp]\nkazu=n-count_min\nif kazu%(k-1)==0:\n print(kazu//(k-1))\nelse:\n print(kazu//(k-1)+1)', 'from collections import Counter\nn,k=map(int,input().split())\na=list(map(int,input().split()))\ntmp=min(a)\ncount_min=...
['Runtime Error', 'Accepted']
['s669613594', 's271072389']
[13880.0, 19936.0]
[43.0, 56.0]
[187, 219]
p03317
u637918426
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen element...
['import math\n\nN, K = map(int, input().split())\nA = list(input().split())\nA_lis = [int(A[i]) for i in range(N)]\nindex = A_lis.index(1)\n\nif N == K:\n print(1)\nelse:\n left = math.ceil(index / (K-1))\n leftamari = index % (K-1)\n right = math.ceil(max(0, N - K - index + leftamari) / (K-1))\n print(...
['Wrong Answer', 'Accepted']
['s586182166', 's691113034']
[13796.0, 13924.0]
[50.0, 48.0]
[323, 358]
p03317
u638902622
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen element...
['from sys import stdin\n\nN, K = [int (x) for x in stdin.readline().rstrip().split()]\nA = [int (x) for x in stdin.readline().rstrip().split()]\n\nfront = 0\ntail = 0\ncount = 0\n\nfor i in range(N):\n if A[i] == 1:\n break\n else:\n front += 1\ntail = N - (front + 1)\n\ncount += (front + 1)//2\nco...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s888378184', 's916421135', 's528501279']
[13880.0, 13880.0, 14008.0]
[55.0, 54.0, 39.0]
[396, 395, 327]
p03317
u648901783
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen element...
['N,K = map(int,input().split())\nA = list(map(int, input().split()))\n\nmin_ind = A.index(1)\n\n\nprint((N-1)//(K-1))', 'N,K = map(int,input().split())\nA = list(map(int, input().split()))\n\nmin_ind = A.index(1)\n\nprint(int((N-1)/(K-1)) if (N-1)%(K-1)==0 else (N-1)//(K-1)+1)']
['Wrong Answer', 'Accepted']
['s010290967', 's383180329']
[13880.0, 14008.0]
[40.0, 42.0]
[110, 151]
p03317
u656487313
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen element...
["\n\nN, K = map(int, input().split())\nA = [input().split()]\n\n# if N == K:\n# print(1)\n# elif N - K == 1:\n# print(2)\n# else:\n# print(N/K-1)\ni = 1\nwhile N-K > 0:\n N = N-K +1\n i = i+1\n print('Nの中身'+str(N))\n print('iの中身'+str(i))\n\nprint(i)\n\n\n # if N != K:\n \n \n # else...
['Wrong Answer', 'Accepted']
['s830715842', 's201543811']
[10736.0, 10420.0]
[125.0, 35.0]
[613, 461]
p03317
u657541767
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen element...
['N, K = map(int, input().split())\nA = [int(x) for x in input().split()]\nminIndex = A.index(min(A))\nif K == len(A):\n print(1)\nelse:\n if K == 2:\n cnt1 = (minIndex+1) - 1\n cnt2 = (len(A)-minIndex) - 1\n else:\n cnt1 = (minIndex+1)//(K-1)\n cnt2 = (len(A)-minIndex)//(K-1)\n ...
['Wrong Answer', 'Accepted']
['s928373568', 's700996106']
[13880.0, 13812.0]
[46.0, 45.0]
[348, 179]
p03317
u658113376
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen element...
['Len, Split = map(int,input().split())\nNums = map(int,input().split())\nprint(Len/(Split-1))', 'Len, Split = map(int, input().split())\n_res = Len % Split\nif _res:\n print(int((Len / (Split - 1))) + 1)\nelse:\n print(int((Len / (Split - 1))))\n', 'Len, Split = map(int, input().split())\n_res = (Len - 1) % (Spl...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s512787989', 's935654816', 's314130301']
[10420.0, 3060.0, 3060.0]
[27.0, 19.0, 17.0]
[90, 149, 200]
p03317
u665038048
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen element...
['import statistics\n\n\ndef calculate_median(lst):\n lst.sort()\n median_right = lst[int(len(lst)/2)]\n median_left = lst[int(len(lst)/2)-1]\n return median_right, median_left\n\n\nN = int(input())\nX = list(map(int, input().split()))\nX_copy = X.copy()\nmedian_right, median_left = calculate_median(X)\nfor...
['Runtime Error', 'Runtime Error', 'Accepted']
['s593664988', 's779462800', 's204526188']
[5148.0, 3064.0, 13812.0]
[36.0, 18.0, 41.0]
[443, 423, 115]
p03317
u670180528
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen element...
['n,k,*l=map(int,open(0).read().split());i=l.index(1);k-=1;print(i//k+(n-i-1)//k)', 'from math import*\nn,k=map(int,input().split())\nprint(ceil(~-n/~-k))']
['Wrong Answer', 'Accepted']
['s540262601', 's566541238']
[13940.0, 3060.0]
[41.0, 18.0]
[79, 67]
p03317
u686036872
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen element...
['N, K = map(int, input().split())\nA = list(map(int, input().split()))\n\nprint(1+(N-K)//(K-1))\n\ncnt = 1\nlength = K\nwhile True:\n if length >= N:\n print(cnt)\n break\n length += K-1 \n cnt += 1', 'N, K = map(int, input().split())\nA = list(map(int, input().split()))\n\ncnt = 1\nlength = K\n...
['Wrong Answer', 'Accepted']
['s428418637', 's749131708']
[13880.0, 13880.0]
[48.0, 49.0]
[208, 185]
p03317
u686230543
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen element...
['n, k = map(int, input().split())\nprint((n - 1) // (k - 1))', 'n, k = map(int, input().split())\nprint(1 + (n - 2) // (k - 1))']
['Wrong Answer', 'Accepted']
['s518134200', 's678772018']
[3060.0, 3060.0]
[17.0, 17.0]
[58, 62]
p03317
u689322583
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen element...
['#coding: utf-8\n \nN, K = map(int, input().split())\nA = list(map(int, input().split()))\n \nif(N==K):\n ans = 1\n \nprint(ans)', "N, K = list(map(int, input().strip().split(' ')))\nA = list(map(int, input().strip().split(' ')))\n\n\nmin_idx = A.index(min(A))\n\nif min_idx < K:\n min_idx = K - 1\n\n\nelif (N - ...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s329701400', 's778679471', 's753146911']
[14004.0, 14008.0, 14008.0]
[40.0, 42.0, 168.0]
[122, 627, 544]
p03317
u689701565
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen element...
['#coding: utf-8\n\ninputN, inputK = map(int, input().split())\ninputA = list(map(int, input().split()))\nminNumber = inputN\nminPos = 0\n\nfor i in range(len(inputA)):\n if inputA[i] < minNumber:\n minNumber = inputA[i]\n minPos = i\n\nsplitNumber = (inputN+1) / (inputK-1)\nprint (splitNumber)\n\n', '...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s051169588', 's081155011', 's662030596', 's005445328']
[14008.0, 14008.0, 14004.0, 14008.0]
[49.0, 47.0, 47.0, 46.0]
[299, 499, 543, 521]
p03317
u695079172
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen element...
['n,k = map(int,input().split())\n\nlst = list(map(int,input().split()))\n\nid_one = lst.index(1)\nleft_length = len(lst[0:id_one])\n#print(left_length)\nright_length = len(lst[id_one:])-1\n#print(right_length)\n\ncounter = 0\nmn = min(left_length,right_length)\nmx = max(left_length,right_length)\n\nmx -= mn % (k-1)\n...
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s031992923', 's065870159', 's582425438', 's662413869', 's732078030', 's883649202', 's152943234']
[14008.0, 13880.0, 13880.0, 14008.0, 13880.0, 14008.0, 13812.0]
[50.0, 44.0, 42.0, 48.0, 50.0, 50.0, 48.0]
[431, 459, 441, 530, 390, 446, 396]
p03317
u698479721
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen element...
['import sys\nN,K = map(int, input().split())\nlis = [int(i) for i in input().split()]\nif N == 1:\n print(1)\n sys.exit()\nind = lis.index(1)+1\npre = ind-1\npos = N-ind\nif pre%(K-1)==0:\n a = pre//(K-1)\nelse:\n a = pre//(K-1)+1\nif pos%(K-1)==0:\n b = pos//(K-1)\nelse:\n b = pos//(K-1)+1\nprint(1+a+b)', 'impo...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s122272621', 's778370147', 's406524363']
[13812.0, 13880.0, 13880.0]
[44.0, 45.0, 47.0]
[293, 306, 251]
p03317
u716043626
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen element...
['import math\nn, k = map(int,input().split())\na = list(map(int,input().split()))\nprint(math.ceil(n-1)/(k-1))', 'import math\nn, k = map(int,input().split())\na = list(map(int,input().split()))\nprint(math.ceil((n-1)/(k-1)))']
['Wrong Answer', 'Accepted']
['s508648458', 's195305435']
[13812.0, 13812.0]
[39.0, 39.0]
[106, 108]
p03317
u723590269
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen element...
['def function(n,k,a):\n ind1 = a.index(1)\n pre = len(a[:ind1])\n ex = len(a[ind1:]) \n ans = -(-pre//(k-1)) + -(-ex//(k-1))\n if n == k:\n ans = 1\n return int(ans)\n\nprint(function(n,k,a))', 'n,k = map(int,input().split())\na = list(map(int,input().split()))\n\nans = -(-(n-1)//(k-1))\n\n...
['Runtime Error', 'Accepted']
['s900269496', 's259401704']
[3060.0, 13812.0]
[17.0, 39.0]
[209, 101]
p03317
u731368968
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen element...
['n,k=map(int, input().split())\na=map(int, input().split())\nprint(N-K+1)', 'n, k = map(int, input().split())\na = list(map(int, input().split()))\nans = 0\nfor i in range(1, n, k - 1):\n ans += 1\nprint(ans)']
['Runtime Error', 'Accepted']
['s136275984', 's311609979']
[10420.0, 14004.0]
[26.0, 45.0]
[70, 129]
p03317
u734816542
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen element...
['import math\nn, m = map(int, input().split())\ns = map(int, input().split())\nprint(math.ceil(m-1/2))', 'import math\nn, m = map(int, input().split())\ns = map(int, input().split())\nprint(math.ceil((n-1)/(m-1)))\n']
['Wrong Answer', 'Accepted']
['s019372906', 's306954853']
[10420.0, 10420.0]
[25.0, 26.0]
[98, 105]
p03317
u738835924
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen element...
['N, k = map(int, input().split())\nnum = input().rstrip().split()\n\nt = 0\n\nfor i in range(N):\n if num[i] == "1":\n one = i\n break\n \nleft = one\nright = N - one - 1\n\nif left + right + 1 <= k:\n t = 1\n left=0\n right=0\n \nelif left <= k - 1:\n left = 0\n right -= (k - 1) - left - 1\n t += 1\n...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s420815303', 's641144206', 's737243648', 's262900634']
[10420.0, 10420.0, 10420.0, 9848.0]
[35.0, 37.0, 35.0, 35.0]
[468, 458, 443, 194]
p03317
u747602774
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen element...
['N,K = map(int,input().split())\nA = list(map(int,input().split()))\nind = A.index(1)\nans = (ind+K-2)//(K-1)+(N-1-ind+K-2)//(K-1)\nif (ind+K-2)%(K-1)+(N-1-ind+K-2)%(K-1) <= K-1:\n ans -= 1\nprint(ans)\n', 'N,K=map(int,input().split())\nprint((N-2)//(K-1))', 'N,K=map(int,input().split())\nprint((N-2)//(K-1)+1)']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s548421882', 's563314528', 's025699480']
[13880.0, 2940.0, 2940.0]
[40.0, 17.0, 17.0]
[199, 48, 50]
p03317
u762420987
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen element...
['N, K = map(int, input().split())\nAlist = list(map(int, input().split()))\nsplit_index = Alist.index(1)\nleft_l, right_l = split_index, N - split_index - 1\nprint(left_l, right_l)\nif N <= K:\n print(1)\nelse:\n print(left_l // (K - 1) + int(left_l % (K - 1) != 0) + right_l // (K - 1) + int(right_l % (K - 1) !=...
['Wrong Answer', 'Accepted']
['s686175905', 's082353851']
[13880.0, 14004.0]
[41.0, 40.0]
[315, 129]
p03317
u764956288
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen element...
['n, k = map(int, input().split())\nAs = list(map(int, input().split()))\n\nidx = As.index(i)\nleft = idx\nright = n - idx - 1\n\nn_l = (left + k - 1) // (k - 1)\nn_r = (right + k - 1) // (k - 1)\n\nprint(n_l + n_r)', 'n, k = map(int, input().split())\nAs = list(map(int, input().split()))\n\nidx = As.index(min(As))\nle...
['Runtime Error', 'Accepted']
['s992684918', 's137640326']
[13880.0, 14008.0]
[40.0, 43.0]
[203, 223]
p03317
u770077083
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen element...
['n, k = map(int, input().split())\na = list(map(int, input().split()))\nmin_idx = a.index(1)\nmin_count = n\nfor i in range(min_idx-2, min_idx+3):\n if 0 <= i < n - 2:\n s_idx = l_idx = min_idx\n if s_idx > 0: s_idx = i\n if l_idx < n: l_idx = i + 2\n print("Start: {}..{}".format(s_idx, ...
['Wrong Answer', 'Accepted']
['s327093579', 's230316917']
[13812.0, 3060.0]
[369.0, 17.0]
[657, 79]
p03317
u774160580
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen element...
['N, K = list(map(int, input().split()))\nA = [int(a) for a in input().split()]\nprint((N - 1 + K - 2) / (K - 1))\n', 'N, K = list(map(int, input().split()))\nA = [int(a) for a in input().split()]\nprint((N - 2) // (K - 1) + 1)\n']
['Wrong Answer', 'Accepted']
['s026579963', 's400791318']
[13880.0, 13880.0]
[45.0, 44.0]
[110, 107]
p03317
u780698286
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen element...
['n, k = map(int, input().split())\na = list(map(int, input().split()))\nans = (n-1)/(k-1)\nif ans % 1 == 0:\n print(int(ans))\nelse:\n print(ans // 1 + 1)', 'from math import ceil\nn, k = map(int, input().split())\na = list(map(int, input().split()))\nprint(ceil((n-1)/(k-1)))']
['Wrong Answer', 'Accepted']
['s169831397', 's716302043']
[20500.0, 20496.0]
[50.0, 54.0]
[162, 115]
p03317
u781262926
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen element...
['import sys\nfrom math import ceil\ninputs = sys.stdin.readlines()\n\nn, k = map(int, inputs[0].split())\nA = list(map(int, inputs[1].split()))\n\nif n == k:\n print(1)\nelse:\n former = index_min(A)[0]\n latter = n - 1 - former\n ceil(former / (k-1)), ceil(latter / (k-1))\n print(ceil(former / (k-1)) +...
['Runtime Error', 'Runtime Error', 'Accepted']
['s011051748', 's160415129', 's354485533']
[13992.0, 13992.0, 13992.0]
[39.0, 40.0, 40.0]
[327, 327, 165]
p03317
u790301364
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen element...
["import math\ndef main15():\n strbuf1 = input('');\n strbuf2 = input('');\n strbufs1 = strbuf1.split();\n strbufs2 = strbuf2.split();\n buf1 = [];\n buf2 = [];\n ba = 0;\n for i in range(2):\n buf1.append(int(strbufs1[i]));\n for i in range(buf1[0]):\n buf2.append(int(strbufs2[...
['Runtime Error', 'Runtime Error', 'Accepted']
['s564001698', 's669282150', 's859248504']
[12724.0, 12792.0, 12724.0]
[50.0, 50.0, 50.0]
[731, 729, 741]
p03317
u794652722
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen element...
['import math\n\nN,K = map(int,input().split())\nA = list(map(int,input().split()))\n\nprint(math.floor((N-1)/(K-1)))\n', 'import math\n\nN,K = map(int,input().split())\nA = list(map(int,input().split()))\n\nprint(math.ceil((N-1)/(K-1)))\n']
['Wrong Answer', 'Accepted']
['s551429310', 's916353997']
[13812.0, 13812.0]
[41.0, 39.0]
[111, 110]
p03317
u799065076
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen element...
['def f(m,n):\n ret=m/n\n ret_=int(ret)\n if ret_==ret:\n return ret_\n else:\n return ret_+1\n \nN,K=list(map(int,input().split()))\na=np.array(list(map(int,input().split())))\nprint(f(np.sum(a!=min(a)),K-1))', 'import numpy as np\n\ndef f(m,n):\n ret=m/n\n ret_=int(ret)\n if re...
['Runtime Error', 'Accepted']
['s420703572', 's159437345']
[3060.0, 23972.0]
[18.0, 299.0]
[228, 248]
p03317
u801359367
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen element...
['A,B = map(int,input().split())\nprint(math.ceil((A-B)/(B-1))+1)', 'A,B = list(map(int,input().split()))\n_ =input()\nprint(math.ceil((A-B)/(B-1))+1)', 'A,B = list(map(int,input().split()))\nprint(math.ceil((A-B)/(B-1))+1)', 'import math\nA,B = list(map(int,input().split()))\n_ =input()\nprint(math.ceil((A-B)/(B-1))+1...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s110679846', 's314585460', 's486719057', 's090870638']
[3060.0, 4724.0, 3060.0, 4724.0]
[18.0, 18.0, 18.0, 19.0]
[62, 79, 68, 91]
p03317
u809108154
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen element...
['n, k=map(int,input().split())\na=list(map(int,input().split()))\nprint((n-1)//(k-1))', 'n,k=map(int,input().split())\na=(n-1)/(k-1)\nif a!=int(a):\n print(int(a)+1)\nelse:\n print(int(a))']
['Wrong Answer', 'Accepted']
['s513907709', 's101133828']
[13880.0, 3060.0]
[40.0, 17.0]
[82, 100]
p03317
u814271993
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen element...
['a,b=map(int, input().split())\nc=list(map(int, input().split()))\nd -= 1\nprint(a//d)', 'import math\nn, k = map(int,input().split())\ninput()\nprint(math.ceil((n-1)/(k-1)))']
['Runtime Error', 'Accepted']
['s788442096', 's707451446']
[20284.0, 10140.0]
[46.0, 32.0]
[82, 81]
p03317
u814986259
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen element...
['N,K=map(int,input().split())\nimport math\nA=int(input().split())\nans=1\nans+=math.ceil(N-K)/(K-1)\nprint(ans)', 'N,K=map(int,input().split())\nimport math\nA=list(map(int,input().split()))\nans=1\nans+=math.ceil(N-K)/(K-1)\nprint(ans)', 'N,K=map(int,input().split())\nimport math\nA=list(map(int,input().split()))\na...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s715315299', 's731285070', 's786601805']
[10420.0, 13812.0, 13812.0]
[24.0, 40.0, 40.0]
[106, 116, 118]
p03317
u818213347
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen element...
['n,k = map(int,input().split())\nA = list(map(int,input.split()))\n\nif (n-1)%%(k-1) == 0:\n print(n-1/k-1)\nelse:\n print((n-1//k-1)+1)\n \n\n\n\n\n', 'n,k = map(int,input().split())\nA = list(map(int,input().split()))\n\nprint(-((1-n)//(k-1)))\n']
['Runtime Error', 'Accepted']
['s684719558', 's533505009']
[9016.0, 20512.0]
[22.0, 48.0]
[139, 90]
p03317
u820560680
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen element...
['N, K = map(int, input().split())\nA = list(map(int, input().split()))\ndef kiriage(a, b): \n return (a + b - 1) // b\n\nprint(kiriage((N - 1, K - 1)))\n', 'N, K = map(int, input().split())\nA = list(map(int, input().split()))\ndef kiriage(a, b): \n return (a + b - 1) // b\n\nprint(kiriage(N - 1, K - 1))\n']
['Runtime Error', 'Accepted']
['s451834286', 's043263259']
[14008.0, 14008.0]
[41.0, 42.0]
[162, 160]
p03317
u826929627
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen element...
['N,K = map(int,input().split())\nA = list(map(int,input().split()))\n\ninf = 10 ** 18\n\nfor i in range(1,inf):\n N -= (K - 1)a\n if N <= 1:\n print(i)\n break\n ', 'N,K = map(int,input().split())\nA = list(map(int,input().split()))\n\ninf = 10 ** 18\n\nfor i in range(1,inf):\n N -= (K - 1)\n if N <= 1:\n ...
['Runtime Error', 'Accepted']
['s960454637', 's758983287']
[2940.0, 13880.0]
[17.0, 46.0]
[160, 159]
p03317
u842964692
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen element...
['N,K=map(int,input().split())\nA=list(map(int,input.split()))\n\nans=1\nX=N-K\n\nwhile X>0:\n X-=K-1\n ans+=1\nprint(ans)', 'N,K=map(int,input().split())\nA=list(map(int,input().split()))\n\nans=1\nX=N-K\n\nwhile X>0:\n X-=K-1\n ans+=1\nprint(ans)\n']
['Runtime Error', 'Accepted']
['s048989666', 's536940709']
[3060.0, 13880.0]
[17.0, 46.0]
[113, 116]
p03317
u853010060
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen element...
['N, K = map(int, input().split())\nA = [int(x) for x in input().split()]\nans = 1\nif N == K:\n print(1)\n exit()\nelse:\n if (N-K+1)%K == 0:\n ans += N-K+1\n else:\n ans += (N-K+1)%K+1\nprint(ans)\n', 'N, K = map(int, input().split())\nA = [int(x) for x in input().split()]\nans = 1\nn = (N-K...
['Wrong Answer', 'Accepted']
['s762258562', 's071831370']
[13880.0, 13880.0]
[44.0, 44.0]
[212, 149]
p03317
u853900545
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen element...
['import math\nn,k = map(int,input().split())\na = list(map(int,input().split()))\nprint(math.floor((n-1)/(k-1)))\n', 'import math\nn,k = map(int,input().split())\na = list(map(int,input().split()))\nprint(math.floor((n-1)//(k-1)))\n', 'n,k = map(int,input().split())\na = list(map(int,input().split()))\nprint((n-1)//(k...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s267169236', 's708604471', 's709064984', 's254658288']
[13812.0, 13812.0, 13880.0, 13812.0]
[43.0, 41.0, 40.0, 39.0]
[109, 110, 85, 108]
p03317
u855380359
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen element...
['n, k = map(int, input().split())\na = list(map(int, input().split()))\n\nif (n-k)%(k-1) ==0:\n print((n-k)//(k-1)+1)\nelse:\n print((n-k)//(k-1)+3)\n ', 'n, k = map(int, input().split())\na = list(map(int, input().split()))\n\nx = n//(k-1) + 1\nprint(x)', 'n, k = map(int, input().split())\na = list(map(int, input(...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s178150974', 's312467118', 's795240021']
[13880.0, 13880.0, 13880.0]
[43.0, 40.0, 40.0]
[146, 95, 144]
p03317
u857070771
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen element...
['n,k=map(int,input().split())\n*a,=map(int,input().split())\nprint(((n-2)//(k-1)+1)', 'n,k=map(int,input().split())\n*a,=map(int,input().split())\nprint((n-2)//(k-1)+1)']
['Runtime Error', 'Accepted']
['s600794962', 's552600057']
[2940.0, 13880.0]
[17.0, 40.0]
[80, 79]
p03317
u858523893
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen element...
['N, K = map(int, input().split())\na = list(map(int, input().split()))\n\namin = min(a)\n\nif len(myarr) == myarr.count(amin) :\n print("0")\nelse :\n if K == 1 : \n print(N - myarr.count(amin))\n else :\n if (N - a.count(amin)) % (K - 1) == 0 :\n print((N - a.count(amin)) // (K - 1))...
['Runtime Error', 'Runtime Error', 'Accepted']
['s026481427', 's489593910', 's237792433']
[13812.0, 14008.0, 14008.0]
[42.0, 43.0, 46.0]
[375, 375, 363]
p03317
u867826040
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen element...
['//#define _GLIBCXX_DEBUG\n//\n#include <bits/stdc++.h>\nusing namespace std;\ntypedef long long ll;\n\nint main() {\n cin.tie(0);\n ios::sync_with_stdio(false);\n int n,k; cin >> n >> k;\n int a[n]; for (int i = 0; i<n; i++) cin >> a[i];\n cout << (((n-k)+(k-2))/(k-1))+1 << "\\n";\n}', '//#define _GLIB...
['Runtime Error', 'Runtime Error', 'Accepted']
['s636876510', 's933652427', 's901820705']
[8768.0, 9000.0, 20312.0]
[21.0, 25.0, 50.0]
[337, 298, 109]
p03317
u868600519
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen element...
['N, K = map(int, input().split())\nA = list(map(int, input().split()))\n\nprint(ceil((N - 1) / (K - 1)))\n', 'from math import ceil\n\nN, K = map(int, input().split())\nA = list(map(int, input().split()))\n\nprint(ceil((N - 1) / (K - 1)))\n']
['Runtime Error', 'Accepted']
['s958047974', 's734135688']
[14004.0, 13812.0]
[40.0, 43.0]
[101, 124]
p03317
u875855656
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen element...
['n,k=map(int,input().split())\nl=[int(i) for i in input().split()]\nc=0\nmn=min(l)\nwhile len(l)>=1:\n if mn==min(l):\n m=l.index(min(l))\n if m==0:\n l=l[m+1:]\n elif m+l[k-1::-1].index(min(l))==len(l):\n c+=m//(k-1)\n if m%(k-1)!=0:\n c+=1\n l=l[m+1:]\n else:\n c+=1\n ...
['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s073016063', 's117117754', 's896775114', 's943186746']
[13880.0, 13812.0, 13880.0, 14008.0]
[52.0, 2104.0, 2104.0, 50.0]
[384, 462, 402, 105]
p03317
u902151549
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen element...
['# coding: utf-8\nimport re\nimport math\nfrom collections import defaultdict\nfrom collections import deque\nfrom fractions import Fraction\nimport itertools\nfrom copy import deepcopy\nimport random\nimport time\nimport os\nimport queue\nimport sys\nimport datetime\nfrom functools import lru_cache\n#@lru_cache(maxsi...
['Wrong Answer', 'Accepted']
['s877191477', 's277757179']
[17120.0, 17120.0]
[66.0, 63.0]
[3551, 3545]
p03317
u905582793
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen element...
['N,K = map(int, input().split())\nA = list(map(int, input().split()))\nprint((N-1)//(K-1))', 'N,K = map(int, input().split())\nA = list(map(int, input().split()))\nprint((N-1+K-1-1)//(K-1))']
['Wrong Answer', 'Accepted']
['s280308641', 's847479129']
[14008.0, 14004.0]
[41.0, 41.0]
[87, 93]
p03317
u906428167
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen element...
['n,k = map(int,input().split())\n\nif n == k:\n print(1)\nelse:\n c = 1\n a = n-k\n while a > 0:\n c = +1\n a -= k-1\n print(c)', 'n,k = map(int,input().split())\n\nif n == k:\n print(1)\nelse:\n c = 1\n a = n-k\n while a > 0:\n c += 1\n a -= k-1\n print(c)']
['Wrong Answer', 'Accepted']
['s297062099', 's203352246']
[3060.0, 3060.0]
[23.0, 27.0]
[127, 127]
p03317
u908349502
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen element...
['n, k = map(int,input().split())\na = list(map(int,input().split()))\nplace = 0\nfor i in range(n):\n if a[i] == 1:\n place = i+1\n\nl = (place-1)//(k-1) if (place-1)%(k-1)==0 else (place-1)//(k-1)+1\na = k-1-(place-1)%(k-1)\nr = (n-place)//(k-1) if (n-place)%(k-1)==0 else (n-place)//(k-1)+1\na += k-1-(n-place)%(k...
['Wrong Answer', 'Accepted']
['s253697516', 's773818294']
[14008.0, 13880.0]
[49.0, 40.0]
[365, 131]
p03317
u909991537
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen element...
['import numpy as np\nimport math\n\nn, k = (int(i) for i in input().split()) \nx_list = [int(i) for i in input().split()] \n\nmin_num = min(x_list)\ngroup_list = []\n\ncount = 0\nfor x in x_list:\n if x == min_num:\n group_list.append(count)\n count = 0\n continue\n count += 1\n\nif x != min_num:\n group_...
['Wrong Answer', 'Accepted']
['s255619226', 's190708715']
[23424.0, 3060.0]
[188.0, 18.0]
[432, 84]
p03317
u918601425
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen element...
['N,K=[int(s) for s in input().split()]\nls=[int(s) for s in input().split()]\ndef ceil(n,m):\n if n%m==0:\n return n//m\n else:\n return (n//m)+1\na=ls.index(1)\nif K==N:\n print(1)\nelif (K==N-1 and (a==0 or a==N-1)):\n print(1):\nelse:\n print(ceil(a,K-1)+ceil(N-a-1,K-1))\n\n\n', 'N,K=[int(s) for s in inp...
['Runtime Error', 'Accepted']
['s375540825', 's066389590']
[2940.0, 3060.0]
[17.0, 17.0]
[274, 59]
p03317
u924406834
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen element...
['N,K = map(int,input().split())\nA = list(map(int,input().split()))\nprint((N-K)//(K-1)+1)', 'n,k = map(int,input().split())\na = list(map(int,input().split()))\nif (n - 1) % (k - 1) == 0:\n print((n-1) // (k-1))\nelse:\n print((n-1) // (k-1) + 1)']
['Wrong Answer', 'Accepted']
['s066613397', 's367596588']
[14008.0, 13880.0]
[40.0, 39.0]
[87, 150]
p03317
u928758473
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen element...
['import os\nimport sys\nfrom collections import defaultdict, Counter\nfrom itertools import product, permutations,combinations, accumulate\nfrom operator import itemgetter\nfrom bisect import bisect_left,bisect\nfrom heapq import heappop,heappush,heapify\nfrom math import ceil, floor, sqrt\nfrom copy import deepcopy\n...
['Wrong Answer', 'Accepted']
['s396610199', 's226868266']
[14516.0, 14324.0]
[46.0, 44.0]
[512, 470]
p03317
u928784113
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen element...
['N,K = list(map(int,input().split()))\nA = list(map(int,input().split()))\n\nprint((N-1) // (K-1))', 'N,K = map(int,input().split())\nA = list(map(int,input().split()))\n\nfor i in range(1,10**5+1):\n if i >= (N-K)/(K-1) + 1:\n print(i)\n exit()']
['Wrong Answer', 'Accepted']
['s333283942', 's586103915']
[14004.0, 14004.0]
[42.0, 54.0]
[94, 154]
p03317
u933341648
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen element...
['n, k = map(int, input().split())\na = input()\n\nprint((n-1)//(k-1))', 'n, k = map(int, input().split())\na = input()\n\nprint((n-1)//(k-1) if n > k else 1)', 'n, k = map(int, input().split())\na = input()\n\nprint(((n-1)+(k-2))//(k-1))']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s171247338', 's257840580', 's330084578']
[4724.0, 4724.0, 4724.0]
[18.0, 18.0, 18.0]
[65, 81, 73]
p03317
u934246119
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen element...
['n, k = map(int, input().split())\na_tmp = input().split()\na = [[] for i in range(n)]\nfor i in range(n):\n a[i] = int(a_tmp[i])\nif n != k:\na1 = a.index(1)\nsol = 0\na_left = a1\na_right = len(a)-1-a1\nif a_left % (k-1) == 0:\n sol += int(a_left / (k-1))\nelse:\n sol += int(a_left / (k-1)) + 1\nif a_right ...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s795154265', 's872365436', 's576560862']
[2940.0, 17208.0, 13812.0]
[17.0, 75.0, 63.0]
[440, 579, 225]
p03317
u940102677
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen element...
['n,k = map(int,input().split())\nprint((n-1)//(k-1))', 'n,k = map(int,input().split())\nprint((n-1)//(k-1) + ((n-1)%(k-1) > 0))']
['Wrong Answer', 'Accepted']
['s448569741', 's296719545']
[2940.0, 3060.0]
[19.0, 17.0]
[50, 70]
p03317
u941434715
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen element...
['#coding: utf-8\nimport math\nimport heapq\nimport bisect\nimport numpy as np\nfrom collections import Counter\n#from scipy.misc import comb\n\nN,K = map(int, input().split())\nA = list(map(int, input().split()))\n\nans = math.floor((N-1)/(K-1))\nprint(ans)', '#coding: utf-8\nimport math\nimport heapq\nimport bisect\n...
['Wrong Answer', 'Accepted']
['s049573053', 's889230662']
[23464.0, 23464.0]
[173.0, 172.0]
[244, 243]
p03317
u941489790
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen element...
['import math\n\nN,K=list(map(int, input().split()))\nA=list(map(int, input().split()))\n\nif(N!=K):\n print(math.ceil(N/(K-1)))\nelse if((N+1)/K==2):\n print(2)\nelse:\n print(1)', 'import math\n\nN,K=list(map(int, input().split()))\nA=list(map(int, input().split()))\n\n\nprint(math.ceil((N-1)/(K-1)))']
['Runtime Error', 'Accepted']
['s743992103', 's584198895']
[2940.0, 13812.0]
[18.0, 39.0]
[176, 114]
p03317
u941753895
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen element...
['import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time\n\nsys.setrecursionlimit(10**7)\ninf=10**20\nmod=10**9+7\n\ndef LI(): return list(map(int,input().split()))\ndef I(): return int(input())\ndef LS(): return input().split()\ndef S(): return input()\n\ndef main():\n a,b=LI()\n l=...
['Wrong Answer', 'Accepted']
['s940060006', 's006227057']
[16300.0, 16296.0]
[97.0, 68.0]
[348, 414]
p03317
u957722693
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen element...
['import numpy\nn,r=map(int,input().split())\nl=list(map(int,input().split()))\nkey=l.index(1)\nans=numpy.ceil((1+key)/r)+numpy.ceil((n-key+2)/r)\nprint(int(ans))', 'import numpy\nn,r=map(int,input().split())\nl=list(map(int,input().split()))\nans=numpy.ceil((n-1)/(r-1))\nprint(int(ans))']
['Wrong Answer', 'Accepted']
['s972982433', 's899381284']
[25860.0, 26280.0]
[336.0, 352.0]
[155, 118]
p03317
u970899068
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen element...
['import numpy as np\nn,k=map(int, input().split())\na=list(map(int, input().split()))\n\n\nprint(-(-(n-1))//(k-1))', 'n,k=map(int, input().split())\na=list(map(int, input().split()))\n \nprint(-(-(n-1)//(k-1)))\n']
['Wrong Answer', 'Accepted']
['s902419216', 's834946617']
[23364.0, 13880.0]
[172.0, 39.0]
[108, 90]
p03317
u977193988
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen element...
['import math\nn.k=map(int,input().split())\nA=[int(i) for i in input().split()]\nprint(math.ceil(n/k))\n', 'import math\nn,k=map(int,input().split())\nA=[int(i) for i in input().split()]\nprint(1+math.ceil((n-k)/(k-1)))\n']
['Runtime Error', 'Accepted']
['s677833020', 's212615310']
[2940.0, 13812.0]
[17.0, 43.0]
[99, 109]
p03317
u978313283
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen element...
['N,K=map(int,input().split())\nA=list(map(int,input().split())) \nprint((N-K)//(K-1)+1+0 if (N-K)%(K-1)==0 else 1)\n', 'N,K=map(int,input().split())\nA=list(map(int,input().split()))\nprint((N-K)%2+2)', 'N,K=map(int,input().split())\nA=list(map(int,input().split())) \nprint((N-K)//(K-1) + 1 if (N-K)%(K-1)==0 else (N-K...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s156992202', 's634886053', 's197973373']
[13880.0, 13812.0, 14008.0]
[41.0, 41.0, 41.0]
[112, 78, 128]
p03317
u979823197
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen element...
['n,k =int(x) for x in input().split()\ns = list(int(y) for y in input().split())\ndef min(a):\n min = 1000000\n for i in range(len(a)):\n if min > a[i]:\n min = a[i]\n index = i\n return index\nc = min(s)\nnum = (c-1)//k + (len(s)-c)//k +2\nprint(num)\n\n\n \n', 'nk=list(map(int, input().split()))...
['Runtime Error', 'Accepted']
['s632458071', 's836950787']
[2940.0, 14008.0]
[17.0, 60.0]
[265, 713]
p03317
u982591663
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen element...
['N, K = map(int, input().split())\nA = list(map(int, input().split()))\nans = 0\n \nassert K > 3\n \nprint(114514)', 'N, K = map(int, input().split())\nA = list(map(int, input().split()))\nans = 0\n \nassert K > 50\n \nprint(114514)', 'N, K = map(int, input().split())\nA = list(map(int, input().split()))\nans = 0\n \n...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s108766785', 's142684268', 's191421264', 's304110009', 's393111895', 's557771900', 's591866059', 's621356754', 's627909190', 's628063926', 's800271102', 's814552338', 's997467242', 's952200623']
[14008.0, 13880.0, 14008.0, 13880.0, 13880.0, 13880.0, 13812.0, 13812.0, 13812.0, 13812.0, 13812.0, 14008.0, 13812.0, 13812.0]
[40.0, 41.0, 41.0, 41.0, 39.0, 43.0, 41.0, 40.0, 41.0, 42.0, 41.0, 41.0, 41.0, 41.0]
[107, 108, 108, 108, 107, 107, 314, 107, 294, 315, 315, 123, 306, 197]
p03317
u983967747
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen element...
["import sys\n\n\ndef solve(n, k, as):\n if (n-1)%(k-1)==0:\n return (n-1)/(k-1)\n else:\n return round((n-1)/(k-1))\n\n\ndef readQuestion():\n line = sys.stdin.readline().rstrip()\n [str_n, str_k] = line.split(' ')\n line = sys.stdin.readline().rstrip()\n as = line.split(' ')\n retur...
['Runtime Error', 'Accepted']
['s926559260', 's287862031']
[2940.0, 14900.0]
[17.0, 43.0]
[645, 647]
p03317
u992519990
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen element...
['import math\nN,K = map(int,input().split())\na = list(map(int,input().split()))\nprint(N,K)\nprint(math.ceil((N-1)/(K-1)))', 'import math\nN,K = map(int,input().split())\na = list(map(int,input().split()))\nprint(math.ceil((N-1)/(K-1)))']
['Wrong Answer', 'Accepted']
['s314410654', 's308789463']
[13812.0, 13812.0]
[40.0, 40.0]
[118, 107]
p03318
u007550226
2,000
1,048,576
Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(123) = 1 + 2 + 3 = 6. We will call an integer n a **Snuke number** when, for all positive integers m such that m > n, \frac{n}{S(n)} \leq \frac{m}{S(m)} holds. Given an integer K, list the K smallest Snuke numbers.
['import heapq\ndef sk(k):\n tempk = k\n ret = 0\n while tempk!=0:\n ret+=tempk%10\n tempk//=10\n return ret\nk= int(input())\nansl = []\nheapq.heapify(ansl)\nmmin = 99999999.0\nfor i in range(1,3*k+1):\n if i%10==0:pass\n else:\n temp = i/sk(i)\n heapq.heappush(ansl,(temp,...
['Wrong Answer', 'Accepted']
['s641732994', 's505753054']
[9388.0, 9056.0]
[28.0, 56.0]
[451, 558]
p03318
u121921603
2,000
1,048,576
Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(123) = 1 + 2 + 3 = 6. We will call an integer n a **Snuke number** when, for all positive integers m such that m > n, \frac{n}{S(n)} \leq \frac{m}{S(m)} holds. Given an integer K, list the K smallest Snuke numbers.
['m=float("INF")\nsunukes=[]\nfor i in range(15,-1,-1):\n for j in range(100,10,-1):\n #print(i,j)\n sunuke=j*(10**i)-1\n s=str(sunuke)\n sn=0\n for k in range(len(s)):\n sn+=int(s[k])\n x=sunuke/sn\n #print(sn,x,i,j,j*10**i-1)\n if x<=m :\n ...
['Wrong Answer', 'Accepted']
['s361261858', 's069909017']
[3060.0, 3188.0]
[23.0, 51.0]
[443, 477]
p03318
u160244242
2,000
1,048,576
Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(123) = 1 + 2 + 3 = 6. We will call an integer n a **Snuke number** when, for all positive integers m such that m > n, \frac{n}{S(n)} \leq \frac{m}{S(m)} holds. Given an integer K, list the K smallest Snuke numbers.
["k = int(input())\n\ndef func(a):\n s = 0\n for i in str(a):\n s += int(i)\n return a/s\n\ncandidate_lst = []\nfor i in range(18):\n for j in range(1, 150):\n candidate_lst.append(int(str(j) + '9' * i))\ncandidate_lst = sorted(candidate_lst)\n\ncount = 0\nindex = -1\nsnuke = 1\nwhile count <...
['Wrong Answer', 'Accepted']
['s775653137', 's501263967']
[3188.0, 3312.0]
[688.0, 584.0]
[676, 687]
p03318
u163320134
2,000
1,048,576
Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(123) = 1 + 2 + 3 = 6. We will call an integer n a **Snuke number** when, for all positive integers m such that m > n, \frac{n}{S(n)} \leq \frac{m}{S(m)} holds. Given an integer K, list the K smallest Snuke numbers.
["k=int(input())\nans=[]\nfor i in range(1,10): \n ans.append(str(i))\n \nfor i in range(1,10): \n ans.append(str(i)+'9')\n \nfor i in range(1,10): \n ans.append(str(i)+'99')\n \nfor i in range(10): \n ans.append('1'+str(i)+'99')\nfor i in range(2,10): \n ans.append(str(i)+'999')\n \nfor i in range(1,3): \n f...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s355336521', 's895356746', 's468920362']
[3316.0, 3316.0, 3316.0]
[18.0, 19.0, 20.0]
[2280, 2203, 2275]
p03318
u236127431
2,000
1,048,576
Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(123) = 1 + 2 + 3 = 6. We will call an integer n a **Snuke number** when, for all positive integers m such that m > n, \frac{n}{S(n)} \leq \frac{m}{S(m)} holds. Given an integer K, list the K smallest Snuke numbers.
['import math\nK=int(input())\nk=0\nm=0\ndef D(x):\n s=str(x)\n array=list(map(int,list(s)))\n return sum(array)\nN=1\nS=1\na=0\nprint(N)\nwhile k<=K:\n N+=10**a\n S=D(N)\n if a<math.log10(N/S):\n a+=1\n N=(N//10**a+1)*10**a-1 \n S=D(N)\n print(N)\n k+=1\n \n \n', 'import math\nK=int(input())\nk=2\...
['Wrong Answer', 'Accepted']
['s976926796', 's466173433']
[3188.0, 3188.0]
[24.0, 24.0]
[258, 257]
p03318
u334712262
2,000
1,048,576
Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(123) = 1 + 2 + 3 = 6. We will call an integer n a **Snuke number** when, for all positive integers m such that m > n, \frac{n}{S(n)} \leq \frac{m}{S(m)} holds. Given an integer K, list the K smallest Snuke numbers.
["# -*- coding: utf-8 -*-\nimport bisect\nimport heapq\nimport math\nimport random\nimport sys\nfrom collections import Counter, defaultdict\nfrom decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal\nfrom functools import lru_cache, reduce\nfrom itertools import combinations, combinations_with_replacement, product, pe...
['Time Limit Exceeded', 'Time Limit Exceeded', 'Accepted']
['s343074536', 's672354438', 's290270431']
[5456.0, 5452.0, 5452.0]
[2104.0, 2104.0, 413.0]
[1576, 1686, 1743]
p03318
u368780724
2,000
1,048,576
Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(123) = 1 + 2 + 3 = 6. We will call an integer n a **Snuke number** when, for all positive integers m such that m > n, \frac{n}{S(n)} \leq \frac{m}{S(m)} holds. Given an integer K, list the K smallest Snuke numbers.
['N = int(input())\nM = N//10\nk = N%10\nd=0\nfor j in range (M):\n for i in range(2,11):\n print(i*10**d-1)\n d += 1 \nif k != 0:\n for i in range(2,2+k):\n print(i*10**d-1)', 'def R(x):\n return x / sum(map(int, str(x)))\nK = int(input())\nD = 0\nl = 0\nfor i in range(K):\n D += 10**l\n ...
['Wrong Answer', 'Accepted']
['s207211113', 's671221431']
[3060.0, 3060.0]
[17.0, 20.0]
[185, 164]
p03318
u381416158
2,000
1,048,576
Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(123) = 1 + 2 + 3 = 6. We will call an integer n a **Snuke number** when, for all positive integers m such that m > n, \frac{n}{S(n)} \leq \frac{m}{S(m)} holds. Given an integer K, list the K smallest Snuke numbers.
['import math\n\ndef s(n):\n ret = 0\n\n while n > 0:\n ret += n % 10\n n = n // 10\n \n return ret\n\ndef snuke(n):\n candidate = []\n\n for d in range(int(math.log(n, 10)) + 2):\n x = n - (n % 10**d) + (10**d - 1)\n candidate.append(x)\n \n min_value = candidate...
['Wrong Answer', 'Accepted']
['s564969586', 's472814853']
[8936.0, 9140.0]
[26.0, 45.0]
[529, 586]
p03318
u407160848
2,000
1,048,576
Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(123) = 1 + 2 + 3 = 6. We will call an integer n a **Snuke number** when, for all positive integers m such that m > n, \frac{n}{S(n)} \leq \frac{m}{S(m)} holds. Given an integer K, list the K smallest Snuke numbers.
['def s(n):\n\tsum = 0\n\tfor c in str(n):\n\t\tsum += int(c)\n\treturn sum\n\ndef isSunuke(n):\n\tfor m in range(n+1, n * 100):\n\t\tif (n / s(n)) > (m / s(m)):\n\t\t\treturn False\n\treturn True\n\nk = int(input())\nfound=0\nn = 1\nwhile(found < k):\n\tsn = str(n)\n\tlength = len(sn)\n\tnines = 0\n\tfor c in sn:\n\t\...
['Wrong Answer', 'Accepted']
['s730572353', 's584532833']
[3064.0, 3828.0]
[2104.0, 347.0]
[398, 1099]
p03318
u434208140
2,000
1,048,576
Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(123) = 1 + 2 + 3 = 6. We will call an integer n a **Snuke number** when, for all positive integers m such that m > n, \frac{n}{S(n)} \leq \frac{m}{S(m)} holds. Given an integer K, list the K smallest Snuke numbers.
['from math import log10 as l\ns=lambda f:sum(map(int,list(str(f))))\np=lambda a,j:(a//10**(j+1)+1)*10**(j+1)-1\nn=int(input())\na=1\nfor i in range(n):\n print(a)\n if(a<10):\n a+=1\n continue\n a+=1\n k=[p(a,j) for j in range(int(l(a)))]\n o=[p(a,j)/s(p(a,j)) for j in range(int(l(a)))]\n a=k[o.index(min(o...
['Wrong Answer', 'Accepted']
['s709863728', 's678207470']
[3316.0, 3572.0]
[63.0, 66.0]
[308, 307]
p03318
u473633103
2,000
1,048,576
Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(123) = 1 + 2 + 3 = 6. We will call an integer n a **Snuke number** when, for all positive integers m such that m > n, \frac{n}{S(n)} \leq \frac{m}{S(m)} holds. Given an integer K, list the K smallest Snuke numbers.
['# coding: utf-8\n# Your code here!\nk = int(input())\nk = 100\ncount = 0\nans = []\nminN = 10**15\n\nfor i in reversed(range(5)):\n for j in reversed(range(1,10**4)):\n num = str(j)+"9"*i*3\n n = sum([int(k) for k in num])\n n = int(num)/n\n if(num == "379999"):\n print("tes"...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Time Limit Exceeded', 'Accepted']
['s365938545', 's371376997', 's383636637', 's528204101', 's747744313', 's852914941', 's323716387']
[3064.0, 3064.0, 3060.0, 3060.0, 3060.0, 3064.0, 3188.0]
[186.0, 407.0, 185.0, 22.0, 17.0, 2104.0, 59.0]
[461, 414, 378, 372, 271, 389, 401]
p03318
u496344397
2,000
1,048,576
Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(123) = 1 + 2 + 3 = 6. We will call an integer n a **Snuke number** when, for all positive integers m such that m > n, \frac{n}{S(n)} \leq \frac{m}{S(m)} holds. Given an integer K, list the K smallest Snuke numbers.
['import sys \n\nK = int(input())\n\nif K <= 0:\n sys.exit(0)\n\nstep = 1 \nsnuke = 1 \n\nwhile K >= 0:\n if step < snuke/sum(map(int, str(snuke))):\n snuke += 9 * step\n step *= 10\n else:\n print(snuke)\n snuke += step\n K -= 1', 'import sys \n\nK = int(input())\n\nif K <= ...
['Wrong Answer', 'Accepted']
['s515083874', 's316944658']
[3188.0, 3060.0]
[19.0, 20.0]
[254, 253]
p03318
u497046426
2,000
1,048,576
Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(123) = 1 + 2 + 3 = 6. We will call an integer n a **Snuke number** when, for all positive integers m such that m > n, \frac{n}{S(n)} \leq \frac{m}{S(m)} holds. Given an integer K, list the K smallest Snuke numbers.
["K = int(input())\n\nif K < 10:\n num_list = [i for i in range(1, K+1)]\n print(*num_list, sep='\\n')\nelse:\n num_list = [i for i in range(1, 10)]\n n = 19\n digits = 2\n while len(num_list) < K:\n num_list.append(n)\n if str(n+1)[0] > 3:\n digits += 1\n n += 10**(dig...
['Runtime Error', 'Accepted']
['s184045417', 's446300519']
[3064.0, 3188.0]
[18.0, 25.0]
[343, 360]
p03318
u517152997
2,000
1,048,576
Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(123) = 1 + 2 + 3 = 6. We will call an integer n a **Snuke number** when, for all positive integers m such that m > n, \frac{n}{S(n)} \leq \frac{m}{S(m)} holds. Given an integer K, list the K smallest Snuke numbers.
['# -*- coding: utf-8 -*-\n# \nimport math\nimport sys\nimport itertools\nimport numpy as np\nfrom operator import itemgetter\n\nk =int(input())\nnmax=0\ns = []\nfor i in range(1,200):\n for j in range(14):\n p = i\n for ii in range(j):\n p=p*10+9\n q = i // 100 + (i // 10) % 10 + i %...
['Wrong Answer', 'Accepted']
['s684630800', 's666693794']
[22296.0, 21656.0]
[1621.0, 308.0]
[543, 544]
p03318
u533885955
2,000
1,048,576
Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(123) = 1 + 2 + 3 = 6. We will call an integer n a **Snuke number** when, for all positive integers m such that m > n, \frac{n}{S(n)} \leq \frac{m}{S(m)} holds. Given an integer K, list the K smallest Snuke numbers.
['\nK = int(input())\nketa = 1\nnow = 1\ndef sunuke(n):\n a = 0\n for i in str(n):\n a+=int(i)\n return(n/a)\ncount=0\nwhile count < k:\n if sunuke(ima) <= sunuke(ima+keta):\n print(ima)\n ima += keta\n count += 1\n else:\n ima += 9*keta\n keta *= 10\n\n', '\nK =...
['Runtime Error', 'Runtime Error', 'Accepted']
['s103156694', 's189237679', 's075441070']
[2940.0, 2940.0, 3188.0]
[17.0, 18.0, 22.0]
[298, 292, 284]
p03318
u547167033
2,000
1,048,576
Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(123) = 1 + 2 + 3 = 6. We will call an integer n a **Snuke number** when, for all positive integers m such that m > n, \frac{n}{S(n)} \leq \frac{m}{S(m)} holds. Given an integer K, list the K smallest Snuke numbers.
['k=input()\na=0\nb=1\nfor i in range(k):\n a+=b\n print(a)\n if b<(a+b)/sum(map(int,str(a+b))):\n b*=10', 'k=int(input())\na=0\nb=1\nfor i in range(k):\n a+=b\n print(a)\n if b<(a+b)/sum(map(int,str(a+b))):\n b*=10']
['Runtime Error', 'Accepted']
['s486905655', 's993293613']
[3060.0, 3188.0]
[17.0, 20.0]
[101, 106]
p03318
u594859393
2,000
1,048,576
Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(123) = 1 + 2 + 3 = 6. We will call an integer n a **Snuke number** when, for all positive integers m such that m > n, \frac{n}{S(n)} \leq \frac{m}{S(m)} holds. Given an integer K, list the K smallest Snuke numbers.
["from itertools import chain, count, islice\n\ndef f():\n j = int(input())\n cs = '123456789'\n xs = ['123456789', (c+'9' for c in cs)] \n for x in chain(*xs):\n if j == 0: return\n yield x\n j -= 1\n\n for i in count(2):\n for n in range(i-1, i*10-1):\n if j == 0:...
['Wrong Answer', 'Accepted']
['s755571457', 's156735101']
[3060.0, 3188.0]
[20.0, 47.0]
[379, 388]
p03318
u619458041
2,000
1,048,576
Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(123) = 1 + 2 + 3 = 6. We will call an integer n a **Snuke number** when, for all positive integers m such that m > n, \frac{n}{S(n)} \leq \frac{m}{S(m)} holds. Given an integer K, list the K smallest Snuke numbers.
["import sys\n\ndef S(n):\n return n / sum(map(int, str(n)))\n\n\ndef f(n):\n d = 0\n C = [n]\n while S(n) > (10**(d-1) / (9*d)):\n c = 10**(d+1) * (n // 10**(n+1) + 1) - 1\n C.append(c)\n \n Smin = float('inf')\n res = 0\n for c in C:\n if S(c) < Smin:\n res = c \n return res\n \ndef main():\n...
['Runtime Error', 'Accepted']
['s312991580', 's692347983']
[3064.0, 3188.0]
[17.0, 82.0]
[449, 470]
p03318
u620480037
2,000
1,048,576
Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(123) = 1 + 2 + 3 = 6. We will call an integer n a **Snuke number** when, for all positive integers m such that m > n, \frac{n}{S(n)} \leq \frac{m}{S(m)} holds. Given an integer K, list the K smallest Snuke numbers.
['K=int(input())\nfor i in range(1,K):\n if i<=9:\n print(i)\n elif i%10==0:\n pass\n elif i<=19:\n a=(i-10)*10+9\n print(a)\n elif i<=29:\n a=(i-20)*100+99\n print(a)\n elif i<=39:\n a=(i-30)*1000+999\n print(a)\n elif i<=49:\n a=(i-40)*1...
['Wrong Answer', 'Accepted']
['s479745310', 's194911697']
[3064.0, 20404.0]
[18.0, 916.0]
[1143, 733]
p03318
u631277801
2,000
1,048,576
Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(123) = 1 + 2 + 3 = 6. We will call an integer n a **Snuke number** when, for all positive integers m such that m > n, \frac{n}{S(n)} \leq \frac{m}{S(m)} holds. Given an integer K, list the K smallest Snuke numbers.
['MAX = 10**15+1\n\ndef find_next_n(n):\n cand = []\n n_str = str(n)\n n_list = list(n_str)\n for i in range(1,len(str(n))+1):\n n_list[-i] = \'9\'\n cand.append(int("".join(n_list)))\n cand_result = [num/snuke(num) for num in cand]\n min_idx = cand_result.index(min(cand_result))\n\n ...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s362017330', 's567135572', 's634153067', 's780399822', 's977994504', 's668958884']
[3316.0, 3064.0, 3316.0, 3060.0, 3060.0, 3188.0]
[45.0, 2104.0, 45.0, 17.0, 19.0, 76.0]
[838, 567, 842, 402, 411, 1025]
p03318
u684026548
2,000
1,048,576
Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(123) = 1 + 2 + 3 = 6. We will call an integer n a **Snuke number** when, for all positive integers m such that m > n, \frac{n}{S(n)} \leq \frac{m}{S(m)} holds. Given an integer K, list the K smallest Snuke numbers.
['k = int(input())\n\ns = [1, 2, 3, 4, 5, 6, 7, 8]\n\nl = 1\n\nwhile len(s) <= k:\n for i in range(1, 11):\n s.append((10 ** l) * i - 1)\n if len(s) > k:\n break\n l += 1\n\n\nfor i in s:\n print(i)', 'k = int(input())\n\na = 1\nb = 1\n\ndef snk(n):\n s = 0\n for i in str(n):\n ...
['Wrong Answer', 'Accepted']
['s909811390', 's923214870']
[3060.0, 3060.0]
[18.0, 22.0]
[215, 229]
p03318
u724892495
2,000
1,048,576
Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(123) = 1 + 2 + 3 = 6. We will call an integer n a **Snuke number** when, for all positive integers m such that m > n, \frac{n}{S(n)} \leq \frac{m}{S(m)} holds. Given an integer K, list the K smallest Snuke numbers.
['k = int(input())\nif k < 10:\n print(k)\n exit()\n\nprint(9 + (k-9)*10)\n', 'k = int(input())\nif k < 10:\n print(k)\n exit()\n\nprint((k-8)*10-1)\n\n\n# return sum(list(map(int, str(n))))\n#\n# l = []\n\n# l.append([i, s(i), i/s(i)])\n#\n# l.sort(key=lambda x:x[2])\n\n# print(l[i])\n#\n# max ...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s060096659', 's126039458', 's646512561', 's442133601']
[2940.0, 2940.0, 3188.0, 5712.0]
[70.0, 17.0, 26.0, 118.0]
[73, 403, 736, 875]
p03318
u734548018
2,000
1,048,576
Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(123) = 1 + 2 + 3 = 6. We will call an integer n a **Snuke number** when, for all positive integers m such that m > n, \frac{n}{S(n)} \leq \frac{m}{S(m)} holds. Given an integer K, list the K smallest Snuke numbers.
['# /user/bin/python\n# -*- coding: utf-8 -*-\nimport sys\n\n\nk = int(input())\nstep = ret = 1\nfor _ in range(k):\n if step < ret / sum(map(int, list(str(ret)))):\n ret += 9*step\n step *= 10\n else:\n print(ret)\n ret += step\n', '# /user/bin/python\n# -*- coding: utf-8 -*-\n\nt = i = 1\nk = int(input(...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s731736989', 's789150982', 's331607937']
[3188.0, 3188.0, 3188.0]
[21.0, 21.0, 20.0]
[228, 193, 149]
p03318
u782098901
2,000
1,048,576
Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(123) = 1 + 2 + 3 = 6. We will call an integer n a **Snuke number** when, for all positive integers m such that m > n, \frac{n}{S(n)} \leq \frac{m}{S(m)} holds. Given an integer K, list the K smallest Snuke numbers.
['def dsum(n):\n ret = 0\n while n > 0:\n ret += n % 10\n n //= 10\n return ret\n\n\ndef g(n):\n return n / dsum(n)\n\nK = int(input())\n\nres = []\nbase = 1\nfor i in range(15):\n for j in range(1, 150):\n res.append(base * (j + 1) - 1)\n base *= 10\n\nres.sort()\nres = list(set(...
['Runtime Error', 'Accepted']
['s068271922', 's248307849']
[3188.0, 3188.0]
[19.0, 24.0]
[555, 255]
p03318
u832039789
2,000
1,048,576
Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(123) = 1 + 2 + 3 = 6. We will call an integer n a **Snuke number** when, for all positive integers m such that m > n, \frac{n}{S(n)} \leq \frac{m}{S(m)} holds. Given an integer K, list the K smallest Snuke numbers.
['res = []\nfor digit in range(1,16):\n if digit<=3:\n for i in range(2,11):\n res.append(10**(digit-1)*i-1)\n elif 4<=digit<=12:\n for i in range(11,(digit-2)*10):\n res.append(i*10**(digit-2)-1)\n for i in range(digit-2,11):\n res.append(i*10**(digit-1)-1)\n...
['Wrong Answer', 'Accepted']
['s082526760', 's566338860']
[3064.0, 3188.0]
[17.0, 18.0]
[572, 609]
p03319
u001024152
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen element...
['import sys\n\nN, K = map(int, input().split())\nA = list(map(int, input().split()))\n\nif N == K:\n print(1)\n sys.exit()\n\nprint((N-K)//(K-1)+1)\n', 'import sys\nfrom math import ceil\n\nN, K = map(int, input().split())\nA = list(map(int, input().split()))\n\nif N == K:\n print(1)\n sys.exit()\n\nprint(...
['Wrong Answer', 'Accepted']
['s383238044', 's371310348']
[14008.0, 13812.0]
[40.0, 41.0]
[144, 171]
p03319
u010090035
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen element...
['n,k=map(int,input().split())\nh=[]\nfor i in range(n):\n h.append(int(input()))\nh.sort()\n\nans=9999999999999\nfor i in range(n-k+1):\n ans=min(ans,h[i+k-1]-h[i])\nprint(ans)', 'n,k=map(int,input().split())\na=list(map(int,input().split()))\nprint(-(-(n-1)//(k-1)))\n']
['Runtime Error', 'Accepted']
['s784053475', 's142369117']
[4724.0, 13880.0]
[25.0, 41.0]
[172, 86]
p03319
u028973125
2,000
1,048,576
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen element...
['import sys\n\ninput = sys.stdin.readline\nN, K = map(int, input().split())\nA = list(map(int, input().split()))\n\npos = A.index(1)\nprint(pos)\nans = 0\nleft = pos\nwhile 0 < left:\n left -= K - 1\n ans += 1\nright = pos\nwhile right < N - 1:\n right += K - 1\n ans += 1\n\nprint(ans)', 'import sys\n\ninp...
['Wrong Answer', 'Accepted']
['s895504744', 's089189890']
[20568.0, 20796.0]
[56.0, 50.0]
[279, 134]