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
p02628
u926266624
2,000
1,048,576
A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.) Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.
['n,k = list(map(int,input().split()))\n\np = lilst(map(int, input().split()))\n\np.sort()\n\nprint(sum(p[:k]))\n', 'n,k = list(map(int,input().split()))\n\np = list(map(int, input().split()))\n\np.sort()\n\nprint(sum(p[:k]))']
['Runtime Error', 'Accepted']
['s740475920', 's724741936']
[9108.0, 9108.0]
[26.0, 28.0]
[104, 102]
p02628
u929217794
2,000
1,048,576
A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.) Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.
['n, k = map(int, input().split())\np = list(map(int, input().split()))\n\np.sort()\n\nans = 0\nfor i in range(k):\n ans += p.pop(0)', 'n, k = map(int, input().split())\np = list(map(int, input().split()))\n\np.sort()\n\nans = p[:k].sum()\n \nprint(ans)', 'n, k = map(int, input().split())\np = list(map(int, input().split()))\n\np.sort()\n\nans = sum(p[:k])\n \nprint(ans)']
['Wrong Answer', 'Runtime Error', 'Accepted']
['s112031738', 's731813538', 's515290321']
[9200.0, 9168.0, 9256.0]
[23.0, 26.0, 24.0]
[124, 111, 110]
p02628
u929996201
2,000
1,048,576
A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.) Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.
['a,b = map(int,input().split())\nc = []\nfor _ in range(a):\n\tc.append(int(input()))\nsort(c)\nprint(sum(c[0:b]))', 'a,b = map(int,input().split())\nc = list(map(int,input().split()))\nc.sort()\nprint(sum(c[0:b]))']
['Runtime Error', 'Accepted']
['s725494357', 's833046664']
[9160.0, 9260.0]
[26.0, 32.0]
[107, 93]
p02628
u930223782
2,000
1,048,576
A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.) Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.
['N, K = map(int, input().split())\nA = list(map(int, input().split()))\nA.sort()\nsum = 0\nfor x in A[0:N]:\n sum = sum + x\nprint(sum)', 'N, K = map(int, input().split())\nA = list(map(int, input().split()))\nA.sort()\nsum = 0\nfor x in A[0:K]:\n sum = sum + x\nprint(sum)']
['Wrong Answer', 'Accepted']
['s825079272', 's099315058']
[9236.0, 9244.0]
[30.0, 33.0]
[131, 131]
p02628
u932370518
2,000
1,048,576
A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.) Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.
['\nif __name__ == "__main__":\n N, K = [int(a) for a in input().split()]\n P = list(map(int, input().split()))\n list.sort(P)\n print(P)\n ans = sum(P[:K])\n print(ans)\n', '\nif __name__ == "__main__":\n N, K = [int(a) for a in input().split()]\n P = list(map(int, input().split()))\n list.sort(P)\n ans = sum(P[:K])\n print(ans)\n']
['Wrong Answer', 'Accepted']
['s847028508', 's138465000']
[9196.0, 9248.0]
[31.0, 31.0]
[167, 156]
p02628
u932868243
2,000
1,048,576
A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.) Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.
['n,k=map(int,input().split())\np=list(map(int(input().split()))\np.sort()\nq=p[:k]\nprint(sum(q))\n ', 'n,k=map(int,input().split())\np=list(map(intinput().split()))\np.sort()\nq=p[:k]\nprint(sum(q))\n ', 'n,k=map(int,input().split())\np=list(map(int,input().split()))\np.sort()\nq=p[:k]\nprint(sum(q))\n']
['Runtime Error', 'Runtime Error', 'Accepted']
['s027647350', 's900919827', 's488508266']
[8908.0, 9056.0, 8964.0]
[24.0, 25.0, 31.0]
[100, 99, 93]
p02628
u933650305
2,000
1,048,576
A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.) Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.
['a = list(map(int,input().split()))\nb = list(map(int,input().split()))\nb.sort()\nfor i in b[a[1]]:\n c=0\n c+=b[i]\n return c\nprint(c)', 'a = list(map(int,input().split()))\nb = list(map(int,input().split()))\nb.sort()\nc=0\nfor i in b[a[1]]:\n c+=b[i]\n return c\nprint(c)\n', 'N, K = map(int, input().split())\np = list(map(int, input().split()))\nprint(sum(sorted(p)[:K]))\n']
['Runtime Error', 'Runtime Error', 'Accepted']
['s065100092', 's320739759', 's556834956']
[8924.0, 9032.0, 9232.0]
[27.0, 24.0, 29.0]
[132, 131, 95]
p02628
u935254309
2,000
1,048,576
A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.) Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.
['N,K = map(int,input().split())\n\np=list(map(int,input().split()))\n\np.sort()\nprint(p)\n\nsum = 0\n\nfor i in range(K):\n print(i)\n sum += p[i]\n \n \nprint(sum)', 'N,K = map(int,input().split())\n\np=list(map(int,input().split()))\np.sort()\n\nsum = 0\n\nfor i in range(K):\n sum += p[i]\n \n \nprint(sum)']
['Wrong Answer', 'Accepted']
['s478685085', 's156990309']
[9128.0, 9248.0]
[34.0, 28.0]
[162, 139]
p02628
u935511247
2,000
1,048,576
A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.) Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.
['nn=int(input())\nkk=int(input())\nnum_value = list(map(int, input().split())) \nnum_value.sort()\ngoukei=0\nfor i in range(kk):\n goukei=goukei+num_value[kk]\nprint(goukei)', 'nn=int(input())\nkk=int(input())\nnum_value = list(map(int, input().split())) \nnum_value.sort()\ngoukei=0\nfor i in range(kk):\n for k in range(nn-i):\n if num_value[i]>num_value[k]:\n num_value[i],num_value[k]=num_value[k],num_value[i]\ngoukei=goukei+num_value[i]\nprint(goukei)\n\n', 'nn=int(input())\nkk=int(input())\nnum_value = list(map(int, input().split())) \nnum_value.sort()\ngokei=0\nfor i in range(kk):\n gokei=gokei+num_value[i]\nprint(gokei)\n', 'nn=int(input())\nkk=int(input())\nnum_value = list(map(int, input().split())) \nnum_value.sort()\ngoukei=0\nfor i in range(kk):\n goukei=gokei+num_value[i]\nprint(goukei)\n', 'nn=int(input())\nkk=int(input())\nnum_value = list(map(int, input().split())) \nnum_value.sort()\ngoukei=0\nfor i in range(kk):\n goukei=goukei+num_value[kk]\nprint(goukei)\n', 'nn,kk=map(int,input.split())\nnum_value = list(map(int, input().split())) \nnum_value.sort()\ngokei=0\nfor i in range(kk):\n gokei=gokei+num_value[i]\nprint(gokei)\n\n', 'nn,kk=map(int,input().split())\nnum_value = list(map(int, input().split())) \nnum_value.sort()\ngokei=0\nfor i in range(kk):\n gokei=gokei+num_value[i]\nprint(gokei)\n\n']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s037662405', 's215913005', 's217593196', 's445131637', 's513594443', 's935011945', 's787641319']
[9084.0, 8988.0, 9084.0, 9112.0, 9068.0, 9032.0, 9180.0]
[25.0, 23.0, 25.0, 30.0, 27.0, 27.0, 27.0]
[168, 293, 163, 166, 169, 161, 163]
p02628
u940402366
2,000
1,048,576
A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.) Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.
['n,k=map(int,input().split())\np=list(map(int,input().split()))\npnew=sorted(p)\nsums=0\nfor i in range(k):\n sums=sums+pnew[i]\n \nprint(pnew)\nprint(sums)', 'n,k=map(int,input().split())\np=list(map(int,input().split()))\npnew=sorted(p)\nsums=0\nfor i in range(k):\n sums=sums+pnew[i]\n \n\nprint(sums)']
['Wrong Answer', 'Accepted']
['s478027014', 's017163879']
[9256.0, 9032.0]
[32.0, 27.0]
[153, 142]
p02628
u942280986
2,000
1,048,576
A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.) Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.
['n,k=map(int,input().split())\nL=map(int,input().split())\n\nL_2=sorted(L)\n\nL_3=L_2[0:k]\nprint(L_3)\nprint(sum(L_3))', 'n,k=map(int,input().split())\nL=map(int,input().split())\n\nL_2=sorted(L)\n\nL_3=L_2[0:k]\nprint(sum(L_3))']
['Wrong Answer', 'Accepted']
['s395631234', 's557406345']
[9248.0, 9252.0]
[24.0, 29.0]
[111, 100]
p02628
u944302117
2,000
1,048,576
A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.) Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.
['n, k = map(int, input().split())\npList = map(int, input().split())\nlist.sort(pList)\nscore = 0\nfor i in range(k):\n score += pList[i]\nprint(score)', 'n, k = map(int, input().split())\npList = map(int, input().split())\n\n#pList = [50, 100, 80, 120, 80]\nlist.sort(pList)\nscore = 0\nfor i in range(k):\n score += pList[i]\nprint(score)', 'n, k = map(int, input().split())\npList = map(int, input().split())\n\n#pList = [50, 100, 80, 120, 80]\nlist.sort(pList)\nscore = 0\nfor i in range(k):\n score += pList[i]\nprint(score)', 'n, k = map(int, input().split())\n#pList = map(int, input().split())\nsplit = input().split()\npList = [int(i) for i in split]\nlist.sort(pList)\nscore = 0\nfor i in range(k):\n score += pList[i]\nprint(score)']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s067979918', 's411780425', 's736660555', 's446840965']
[9232.0, 9196.0, 9164.0, 9080.0]
[34.0, 26.0, 22.0, 28.0]
[147, 192, 192, 204]
p02628
u944886577
2,000
1,048,576
A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.) Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.
['a,b=map(int,input().split())\nc=[]\nc=input().split()\nd=c.sort()\nprint(d)\nans=0\nfor i in range(0,b):\n ans+=d[i]\n\nprint(ans)', 'a,b=map(int,input())\nc=[]\nc=input().split()\nd=c.sorted()\nans=0\nfor i in range(b):\n ans+=c[i]\nprint(ans)\n \n', 'a,b=map(int,input().split())\nc=list(map(int,input().split()))\nd=c.sort()\nprint(d)\nans=0\nfor i in range(0,b):\n ans+=d[i]\n\nprint(ans)', 'a,b=map(int,input().split())\nc=list(map(int,input().split()))\nprint(c)\nd=sorted(c)\nans=0\nfor i in range(0,b):\n ans+=d[i]\nprint(ans)', 'a,b=map(int,input().split())\nc=[]\nc=map(int,input().split())\nd=list(c)\nd2=sorted(d)\nans=0\nfor i in range(b):\n ans+=d2[i]\nprint(ans)']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s017530233', 's378734750', 's435893801', 's933154849', 's630434633']
[9216.0, 9032.0, 9232.0, 9184.0, 9160.0]
[26.0, 27.0, 28.0, 29.0, 28.0]
[121, 107, 131, 131, 132]
p02628
u945200821
2,000
1,048,576
A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.) Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.
["import itertools\nimport sys\nfrom typing import Callable, List, NoReturn\n\n\ndef main() -> NoReturn:\n readline: Callable[[], str] = sys.stdin.readline\n n, k = map(int, readline().rstrip().split()) # type: int,...\n p: List[int] = [int(_) for _ in readline().rstrip().split()]\n\n print(sum(p.sort()[:k]))\n\n\nif __name__ == '__main__':\n main()\n", "import itertools\nimport sys\nfrom typing import Callable, List, NoReturn\n\n\ndef main() -> NoReturn:\n readline: Callable[[], str] = sys.stdin.readline\n n, k = map(int, readline().rstrip().split()) # type: int,...\n p: List[int] = [int(_) for _ in readline().rstrip().split()]\n p.sort()\n print(sum(p[:k]))\n\n\nif __name__ == '__main__':\n main()\n"]
['Runtime Error', 'Accepted']
['s545036220', 's309362359']
[10304.0, 10100.0]
[33.0, 44.0]
[352, 357]
p02628
u948368898
2,000
1,048,576
A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.) Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.
['if __name__ == "__main__":\n N, K = list(map(int, input().split()))\n p = list(map(int, input().split()))\n\n print(p)\n p.sort()\n print(p)\n\n sum = 0\n for i in range(K):\n sum += p[i]\n \n print(sum)', 'if __name__ == "__main__":\n N, K = list(map(int, input().split()))\n p = list(map(int, input().split()))\n p.sort()\n sum = 0\n for i in range(K):\n sum += p[i]\n \n print(sum)']
['Wrong Answer', 'Accepted']
['s492132893', 's157060682']
[9192.0, 9184.0]
[38.0, 27.0]
[225, 197]
p02628
u949315872
2,000
1,048,576
A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.) Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.
['n,k = map(int , input().split(""))\np = list(map(int , input()).split(""))\n \np.sort()\n \ntemp = 0\nfor i in p[:k] :\n temp += i\nprint(temp)', 'n,k = map(int , input().split( ))\np = list(map(int , input().split( ))\n \np.sort()\n \ntemp = 0\nfor i in p[:k] :\n temp += i\nprint(temp)', 'n,k = int(input()).split()\np = list(int(input()).split())\n \np1 = sorted(p)\n \ntemp = 0\nfor i in p[k] :\n temp += i\nprint(temp)', 'n,k = map(int , input().split())\np = list(map(int , input()).split())\n \np1 = sorted(p)\n \ntemp = 0\nfor i in p[k] :\n temp += i\nprint(temp)', 'n,k = map(int , input().split())\np = list(map(int , input()).split())\n \np1 = sorted(p)\n \ntemp = 0\nfor i in p[:k] :\n temp += i\nprint(temp)', 'n,k = map(int , input().split( ))\np = list(map(int , input()).split( ))\n \np.sort()\n \ntemp = 0\nfor i in p[:k] :\n temp += i\nprint(temp)', 'n,k = map(int , input().split())\np = list(map(int , input()).split())\n \np1 = sorted(p)\n \ntemp = 0\nfor i in p1[:k] :\n temp += i\nprint(temp)', 'n,k = int(input()).split()\np = list(int(input()).split())\n\np1 = sorted(p)\n\ntemp = 0\nfor i in p[k] :\n temp += i\n return temp\nprint(temp)', 'n,k = map(int , input().split())\np = list(map(int , input()).split())\n \np.sort()\n \ntemp = 0\nfor i in p[:k] :\n temp += i\nprint(temp)', 'n,k = map(int , input().split( ))\np = list(map(int , input().split( )))\n \np.sort()\n \ntemp = 0\nfor i in p[:k] :\n temp += i\nprint(temp)']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s043432552', 's071533583', 's114224193', 's140186918', 's216678038', 's416150732', 's605527460', 's832570326', 's999847042', 's924659950']
[9044.0, 8968.0, 9168.0, 9044.0, 9104.0, 9008.0, 9120.0, 8952.0, 8900.0, 9156.0]
[24.0, 22.0, 26.0, 26.0, 22.0, 26.0, 28.0, 26.0, 27.0, 29.0]
[136, 133, 125, 137, 138, 134, 139, 137, 132, 134]
p02628
u949679249
2,000
1,048,576
A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.) Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.
['a, b = [int(x) for x in input().split()]\ncs = [int(x) for x in input().split()]\nprint(a, b)\nprint(cs)\ncs.sort()\n\nprint(sum(cs[:b]))', 'a, b = [int(x) for x in input().split()]\ncs = [int(x) for x in input().split()]\ncs.sort()\n\nprint(sum(cs[:b]))']
['Wrong Answer', 'Accepted']
['s841410351', 's721059871']
[9204.0, 9248.0]
[35.0, 30.0]
[131, 109]
p02628
u951997475
2,000
1,048,576
A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.) Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.
['from sys import stdin\n\nN, K = map(int, input().split())\nprices = list(map(int, input().split()))\n\nprices = sorted(prices)\n\nsum = 0\nfor i in range(0, K):\n print(prices[i])\n sum += prices[i]\nprint(sum)', 'from sys import stdin\n\nN, K = map(int, input().split())\nprices = list(map(int, input().split()))\n\nprices = sorted(prices)\n\nsum = 0\nfor i in range(0, K):\n sum += prices[i]\nprint(sum)']
['Wrong Answer', 'Accepted']
['s697923893', 's582419341']
[9180.0, 9200.0]
[31.0, 30.0]
[205, 184]
p02628
u955125992
2,000
1,048,576
A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.) Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.
['n, k = map(int, input().split())\np = sorted(list(int, input().split()))\n\nans = 0\nfor i in range(k):\n ans += p[i]\n\nprint(ans)', 'n, k = map(int, input().split())\np = sorted(list(map(int, input().split())))\n\nans = 0\nfor i in range(k):\n ans += p[i]\n\nprint(ans)']
['Runtime Error', 'Accepted']
['s529957342', 's220703999']
[9056.0, 9108.0]
[23.0, 34.0]
[127, 132]
p02628
u960956996
2,000
1,048,576
A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.) Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.
['N, K = int(input().split())\njuice = []\nfor i in range(N):\n juice.append(list(map(int,input().split())))\njuice.sort()\nfor i in range(K):\n print (juice[0] + juice[1] + juice[2])', 'N, K = int(input().split())\njuice = []\nfor i in range(N):\n juice.append(list(input().split()))\njuice.sort()\nfor i in range(K):\n print (juice[0:K])', 'N, K = int(input().split())\njuice = []\nfor i in range(N):\n juice.append(list(input().split()))\njuice.sort()\nprint (sum(juice[0:K]))', 'N,K = map(int, input().split())\n*a, = map(int, input().split())\nprint (sum(sorted(a)[:K]))']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s136347517', 's252191406', 's264453523', 's113299265']
[9100.0, 9040.0, 8852.0, 9276.0]
[26.0, 23.0, 26.0, 28.0]
[179, 150, 134, 90]
p02628
u967484343
2,000
1,048,576
A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.) Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.
['a = input().split()\n# a[0] is N個\n# a[1] is K個\nb = list(map(int, input().split()))\nb.sort()\n\nprint(b)\nsum = 0\n\nfor i in range(int(a[1])):\n sum += b[i]\n\nprint(sum)', 'a = input().split()\nb = input().split()\nb.sort()\nsum = 0\n\nfor i in range(int(a[1])):\n sum += int(b[i])\n\nprint(sum)', 'a = input().split()\n# a[0] is N個\n# a[1] is K個\nb = input().split()\nb.sort()\nsum = 0\n\nfor i in range(int(a[1])):\n sum += int(b[i])\n\nprint(sum)', '#include <stdio.h>\n\nvoid swap(int *a,int *b){\n int tmp;\n tmp = *a;\n *a = *b;\n *b = tmp; \n return;\n}\n\nint main(void){\n int i,j,ans=0,N,K,p[1000];\n\n //入力部\n scanf("%d %d",&N,&K);\n for(i=0; i<N; i++){\n scanf("%d",&p[i]);\n }\n\n //計算部\n for(i=0;i<N-1;i++){\n for(j=i;j<N-1;j++){\n if(p[j]>p[j+1]){\n swap(&p[j],&p[j+1]);\n }\n }\n }\n for(i=0;i<K;i++){\n ans+=p[i];\n }\n\n //表示部\n printf("%d\\n",ans);\n\n return 0;\n}\n\n\n', 'a = input().split()\n# a[0] is N個\n# a[1] is K個\nb = list(map(int, input().split()))\nb.sort()\n\nsum = 0\n\nfor i in range(int(a[1])):\n sum += b[i]\n\nprint(sum)']
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s190707448', 's399191025', 's634184035', 's768602382', 's706634955']
[9248.0, 9092.0, 8972.0, 8928.0, 9248.0]
[25.0, 27.0, 24.0, 25.0, 31.0]
[168, 117, 147, 538, 159]
p02628
u968580153
2,000
1,048,576
A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.) Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.
['n,k=map(int,input().split(" "))\nl=list(map(int,input().split(" "))\nl.sort()\ns=0\nfor i in range(k):\n s+=l[i]\nprint(s)', '#!/usr/bin/env python\n# ---------------------------------------------------------------------------------------!\nimport os\nimport sys\nfrom io import BytesIO, IOBase\n# from bisect import bisect_left as bl #c++ lowerbound bl(array,element)\n# from bisect import bisect_right as br #c++ upperbound br(array,element)\n\n\n# ---------------------------------------MAIN()-----------------------------------------------!\ndef main():\n sys.stdin = open(\'input.txt\', \'r\')\n sys.stdout = open(\'output.txt\', \'w\')\n n, k = map(int, input().split(" "))\n l = list(map(int, input().split(" ")))\n l.sort()\n s=0\n for i in range(k):\n s+=l[i]\n print(s)\n\n\n# -----------------------------------------------------------------------------------------!\n# region fastio\nBUFSIZE = 8192\n\n\nclass FastIO(IOBase):\n newlines = 0\n\n def _init_(self, file):\n self._fd = file.fileno()\n self.buffer = BytesIO()\n self.writable = "x" in file.mode or "r" not in file.mode\n self.write = self.buffer.write if self.writable else None\n\n def read(self):\n while True:\n b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\n if not b:\n break\n ptr = self.buffer.tell()\n self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)\n self.newlines = 0\n return self.buffer.read()\n\n def readline(self):\n while self.newlines == 0:\n b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\n self.newlines = b.count(b"\\n") + (not b)\n ptr = self.buffer.tell()\n self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)\n self.newlines -= 1\n return self.buffer.readline()\n\n def flush(self):\n if self.writable:\n os.write(self._fd, self.buffer.getvalue())\n self.buffer.truncate(0), self.buffer.seek(0)\n\n\nclass IOWrapper(IOBase):\n def _init_(self, file):\n self.buffer = FastIO(file)\n self.flush = self.buffer.flush\n self.writable = self.buffer.writable\n self.write = lambda s: self.buffer.write(s.encode("ascii"))\n self.read = lambda: self.buffer.read().decode("ascii")\n self.readline = lambda: self.buffer.readline().decode("ascii")\n\n\nsys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)\ndef input(): return sys.stdin.readline().rstrip("\\r\\n")\n\n\n\n\nif __name__ == "__main__":\n main()\n', 'n, k = map(int, input().split(" "))\nl = list(map(int, input().split(" "))\nl.sort()\ns=0\nfor i in range(k):\n s+=l[i]\nprint(s)', '\n n, k = map(int, input().split(" "))\n l = list(map(int, input().split(" ")))\n l.sort()\n s=0\n for i in range(k):\n s+=l[i]\n print(s)\n\n\n\n', '\n\n# ---------------------------------------MAIN()-----------------------------------------------!\nn, k = map(int, input().split(" "))\nl = list(map(int, input().split(" ")))\nl.sort()\ns=0\nfor i in range(k):\n s+=l[i]\nprint(s)\n\n\n# -----------------------------------------------------------------------------------------!\n\n']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s016027151', 's200601994', 's952142485', 's997017399', 's866011609']
[8868.0, 9200.0, 9020.0, 8988.0, 9104.0]
[23.0, 28.0, 24.0, 19.0, 28.0]
[119, 2502, 126, 160, 320]
p02628
u969848070
2,000
1,048,576
A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.) Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.
['n, k = map(int, input().split())\np = list(map(int, input().split()))\np = p.sort()\nprint(sum(p[:k]))', 'n, k = map(int, input().split())\np = list(map(int, input().split()))\np.sort()\nprint(sum(p[:k]))']
['Runtime Error', 'Accepted']
['s406712102', 's127129502']
[8956.0, 9064.0]
[26.0, 27.0]
[99, 95]
p02628
u972036293
2,000
1,048,576
A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.) Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.
['N, M = int(input().split())\nlist = str(input().split())\nlist.sort()\ntotal = 0\nfor i in [0:M]:\n total += list[i]\nprint(total)\n\n', 'N, M = map(int, input().splilt())\nL = list(map(int, input().splilt()))\nprint(sum(sorted(L)[:M]))', 'N, M = map(int, input().splilt())\np = list(map(int, input().splilt()))\nprint(sum(sorted(p)[:M]))', 'N, K = map(int, input().split())\np = list(map(int, input().split()))\nprint(sum(sorted(p)[:K]))']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s083392193', 's923559273', 's950552740', 's849300391']
[8904.0, 9004.0, 8908.0, 9084.0]
[20.0, 24.0, 25.0, 26.0]
[127, 96, 96, 94]
p02628
u972479304
2,000
1,048,576
A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.) Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.
['N = int(input())\nK = int(input())\np = []\n\nfor i in range(N):\n x = int(input())\n p.append(x)\n\np.sort()\n\ny = 0\n\nfor i in range(K):\n y += p[i]\n\nprint(y)\n', 'K = list(map(int, input().split()))\np = list(map(int, input().split()))\np.sort()\ny = 0\nfor i in range(K[1]):\n y += p[i]\nprint(y)\n']
['Runtime Error', 'Accepted']
['s560253209', 's018863495']
[8980.0, 9168.0]
[27.0, 25.0]
[159, 132]
p02628
u974918235
2,000
1,048,576
A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.) Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.
['N, K = map(int, input().split())\nprice = [input() for _ in range(N)]\nprice.sort()\nprint(sum(price[:3]))', 'N, K = map(int, input().split())\nprice = [int(input()) for _ in range(N)]\nprice.sort()\nprint(sum(price[:3]))', 'N, K = map(int, input().split())\nprice = list(map(int, input().split()))\nprice.sort()\nprint(sum(price[:K]))']
['Runtime Error', 'Runtime Error', 'Accepted']
['s153757856', 's958317203', 's282195338']
[9108.0, 8956.0, 9168.0]
[26.0, 22.0, 28.0]
[103, 108, 107]
p02628
u978167553
2,000
1,048,576
A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.) Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.
['inputs = [input() for i in range(2)]\n\nN = inputs[0].split()[0]\nK = inputs[0].split()[1]\np = [int(pn) for pn in inputs[1].split()]\n\nans = sum(p.sort()[0:K])\nprint(ans)', 'inputs = [input() for i in range(2)]\n\nN = int(inputs[0].split()[0])\nK = int(inputs[0].split()[1])\np = [int(pn) for pn in inputs[1].split()]\n\nans = sum(sorted(p)[0:K])\nprint(ans)']
['Runtime Error', 'Accepted']
['s529934173', 's368513986']
[9136.0, 9148.0]
[27.0, 27.0]
[166, 177]
p02628
u981418135
2,000
1,048,576
A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.) Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.
["n,k = map(int,input().split)\n\ns = input().rstrip().split(' ')\na = int(s[0]) \nsorted = []\nsorted.append(a)\n\nfor i in range(1,n):\n a = int(s[i]) \n sorted.append(a)\n \n main = i\n sub = i-1\n while main = 0:\n if(sorted[sub] > sorted[main]):\n stock = sorted[sub]\n sorted[sub] = sorted[main]\n sorted[main] = stock\n else:\n break\n \n main -= 1\n sub -= 1\n\nsum = 0\nfor j in range(0,k):\n sum += sorted[j]\n \nprint(sum)\n ", "n,k = map(int,input().split)\n \ns = input().rstrip().split(' ')\nst = []\n \nfor i in range(0,n):\n a = int(s[i]) \n st.append(a)\n\nnew_st = sorted(st)\nsum = 0\nfor j in range(0,k):\n sum += new_st[j]\n \nprint(sum)\n ", "n,k = map(int,input().split())\n \ns = input().rstrip().split(' ')\nst = []\n \nfor i in range(0,n):\n a = int(s[i]) \n st.append(a)\n \nnew_st = sorted(st)\nsum = 0\nfor j in range(0,k):\n sum += new_st[j]\n \nprint(sum)"]
['Runtime Error', 'Runtime Error', 'Accepted']
['s237033076', 's891084452', 's152329132']
[8972.0, 9056.0, 9224.0]
[26.0, 24.0, 30.0]
[452, 213, 211]
p02628
u981747421
2,000
1,048,576
A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.) Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.
['N,K = map(int,input().split())\nlist[N] = input().split()\nMIN = int(list[0])\nSUM = 0\nfor j in range(0,K):\n for i in list:\n if MIN > int(i):\n MIN = int(i)\n list.remove(str(MIN))\n SUM += MIN\n MIN = int(list[0])\nprint(SUM)\n', 'N,K = map(int,input().split())\nlist = input().split()\nMIN = int(list[0])\nSUM = 0\nimport sys\nif K<1 or N<1 or K>1000 or N>1000:\n sys.exit()\nfor j in range(0,K):\n for i in list:\n if(i<1 or i>1000):\n sys.exit()\n if MIN > int(i):\n MIN = int(i)\n list.remove(str(MIN))\n SUM += MIN\n MIN = int(list[0])\nprint(SUM)\n\n', 'N,K = map(int,input().split())\nlist = map(int,input().split())\nMIN = list[0]\nSUM = 0\nfor j in range(1,K):\n for i in list:\n if MIN > list[i]:\n MIN = list[i]\n list.delete(MIN)\n SUM += MIN\n MIN = list[0]\nprint(SUM)', 'N,K = map(int,input().split())\nimport sys\nif N==1:\n print(input())\n sys.exit()\nlist = input().split()\nMIN = 1001\nSUM = 0\nfor j in range(0,K):\n for i in list:\n if MIN > int(i):\n MIN = int(i)\n list.remove(str(MIN))\n SUM += MIN\n MIN = 1001\nprint(SUM)\n']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s423442035', 's448027587', 's548522553', 's803978546']
[9180.0, 9120.0, 9228.0, 9212.0]
[27.0, 21.0, 26.0, 113.0]
[231, 332, 223, 266]
p02628
u998082063
2,000
1,048,576
A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.) Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.
['n, k = inpl()\np = inpl()\np = sorted(p)\nans = 0\nfor i in range(n):\n ans += p[i]\n if i+1 == k:\n break\nprint(ans)', "from collections import defaultdict, deque\nimport sys\nimport heapq\nimport bisect\nimport itertools\nimport queue\nimport copy\nimport time\nsys.setrecursionlimit(10**8)\nINF = float('inf')\nmod = 10**9+7\neps = 10**-7\n\ndef inp(): return int(sys.stdin.readline())\n\ndef inpl(): return list(map(int, sys.stdin.readline().split()))\n\ndef inpl_str(): return list(sys.stdin.readline().split())\n\nn, k = inpl()\np = inpl()\np = sorted(p)\nans = 0\nfor i in range(n):\n ans += p[i]\n if i+1 == k:\n break\nprint(ans)"]
['Runtime Error', 'Accepted']
['s003324100', 's845747126']
[9044.0, 10024.0]
[27.0, 36.0]
[123, 503]
p02628
u999503965
2,000
1,048,576
A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.) Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.
['n.k=map(int,input().split())\nlis=list(map(int,input().split()))\n\nans=0\nfor i in range(k):\n mi=min(lis)\n ans+=mi\n lis.remove(mi)\n \nprint(ans)', 'n,k=map(int,input().split())\nlis=list(map(int,input().split()))\n\nans=0\nfor i in range(k):\n mi=min(lis)\n ans+=mi\n lis.remove(mi)\n \nprint(ans)\n']
['Runtime Error', 'Accepted']
['s927329987', 's320656713']
[9004.0, 9240.0]
[27.0, 44.0]
[144, 145]
p02629
u000660752
2,000
1,048,576
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?"
['n=int(input())\ndef num2alpha(num):\n if num<=26:\n return chr(64+num)\n elif num%26==0:\n return num2alpha(num//26-1)+chr(90)\n else:\n return num2alpha(num//26)+chr(64+num%26)\n\nprint(num2alpha(n))', 'n=int(input())\ndef num2alpha(num):\n if num<=26:\n return chr(64+num)\n elif num%26==0:\n return num2alpha(num//26-1)+chr(90)\n else:\n return num2alpha(num//26)+chr(64+num%26)\n\nprint(num2alpha(n).lower())']
['Wrong Answer', 'Accepted']
['s150455233', 's560227454']
[9180.0, 9172.0]
[28.0, 31.0]
[221, 229]
p02629
u003142309
2,000
1,048,576
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?"
['import string\n\n\nN = int(input())\nn_digits = len(str(1000000000000001))\nletters = string.ascii_lowercase\n\nx = N - 1\nans = []\n# while True:\n# x -= 1\n# mod = x % 26\n\n# x = x // 26\n# if x <= 0:\n# break\n\n# print(ans)\n# print("".join([ letters[v] for v in ans ]))\n\nwhile True:\n mod = x % 26\n div = x // 26\n \n ans.append(mod)\n if div == 0:\n break\n x = div - 1\n\nans = ans[::-1]\nprint(ans)\nprint("".join([ letters[v] for v in ans ]))', 'import string\n\n\nN = int(input())\nn_digits = len(str(1000000000000001))\nletters = string.ascii_lowercase\n\nx = N\nans = []\n# while True:\n# x -= 1\n# mod = x % 26\n\n# x = x // 26\n# if x <= 0:\n# break\n\n# print(ans)\n# print("".join([ letters[v] for v in ans ]))\n\nwhile True:\n x -= 1\n mod = x % 26\n # div = x // 26\n x = x // 26\n \n ans.append(mod)\n if div == 0:\n break\n\nans = ans[::-1]\nprint("".join([ letters[v] for v in ans ]))', 'import string\n\n\nN = int(input())\nn_digits = len(str(1000000000000001))\nletters = string.ascii_lowercase\n\nx = N - 1\nans = []\n# while True:\n# x -= 1\n# mod = x % 26\n\n# x = x // 26\n# if x <= 0:\n# break\n\n# print(ans)\n# print("".join([ letters[v] for v in ans ]))\n\nwhile True:\n x -= 1\n mod = x % 26\n # div = x // 26\n x = x // 26\n \n ans.append(mod)\n if div == 0:\n break\n\nans = ans[::-1]\nprint("".join([ letters[v] for v in ans ]))', 'import string\n\n\nN = int(input())\nn_digits = len(str(1000000000000001))\nletters = string.ascii_lowercase\n\nx = N\nans = []\nwhile True:\n x -= 1\n mod = x % 26\n ans = [ mod ] + ans\n x = x // 26\n if x <= 0:\n break\n\nprint(ans)\nprint("".join([ letters[v] for v in ans ]))', 'import string\n\n\nN = int(input())\nn_digits = len(str(1000000000000001))\nletters = string.ascii_lowercase\n\nx = N\nans = []\n# while True:\n# x -= 1\n# mod = x % 26\n\n# x = x // 26\n# if x <= 0:\n# break\n\n# print(ans)\n# print("".join([ letters[v] for v in ans ]))\n\nwhile True:\n x -= 1\n mod = x % 26\n x = x // 26\n \n ans.append(mod)\n if x == 0:\n break\n\nans = ans[::-1]\nprint(ans)\nprint("".join([ letters[v] for v in ans ]))', 'import string\n\n\nN = int(input())\nn_digits = len(str(1000000000000001))\nletters = string.ascii_lowercase\n\n# x = N - 1\nx = N\nans = []\n# while True:\n# x -= 1\n# mod = x % 26\n\n# x = x // 26\n# if x <= 0:\n# break\n\n# print(ans)\n# print("".join([ letters[v] for v in ans ]))\n\nwhile True:\n x -= 1\n mod = x % 26\n # div = x // 26\n x = x // 26\n \n ans.append(mod)\n \n if x == 0:\n break\n # x = div - 1\n\nans = ans[::-1]\nprint("".join([ letters[v] for v in ans ]))']
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s159649073', 's248660086', 's410305173', 's579324562', 's796017938', 's821541476']
[9884.0, 9964.0, 9968.0, 9856.0, 9984.0, 9892.0]
[40.0, 38.0, 34.0, 39.0, 41.0, 38.0]
[511, 509, 513, 297, 498, 556]
p02629
u012484950
2,000
1,048,576
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?"
['# -*- coding: utf-8 -*-\n\nimport numpy as np\n\ns = input()\n\nx = np.base_repr(int(s), 26)\n\nstrings = {\n"1": "a",\n"2": "b",\n"3": "c",\n"4": "d",\n"5": "e",\n"6": "f",\n"7": "g",\n"8": "h",\n"9": "i",\n"A": "j",\n"B": "k",\n"C": "l",\n"D": "m",\n"E": "n",\n"F": "o",\n"G": "p",\n"H": "q",\n"I": "r",\n"J": "s",\n"K": "t",\n"L": "u",\n"M": "v",\n"N": "w",\n"O": "x",\n"P": "y",\n"Q": "z"\n}\n\nr = \'\'\nfor i in list(x):\n r += strings[i]\n\nprint(x, r)\n', "# -*- coding: utf-8 -*-\n\nn = int(input())\n\nr = ''\n\ndef to_moji(x: int):\n if x == 0:\n x = 26\n return chr(96 + x)\n\ndef devide(x, moji):\n a = x // 26\n b = x % 26\n\n if b == 0:\n a -= 1\n\n if a < 1:\n moji = to_moji(b) + moji\n return moji\n elif 1 <= a and a <= 26:\n moji = to_moji(b) + moji\n moji = to_moji(a) + moji\n return moji\n else:\n moji = to_moji(b) + moji\n return devide(a, moji)\n\nprint(devide(n, r))\n"]
['Runtime Error', 'Accepted']
['s155388414', 's803130053']
[27120.0, 9112.0]
[129.0, 30.0]
[420, 487]
p02629
u014268998
2,000
1,048,576
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?"
["n = 123456789\n\nm = {}\nfor i in range(0,26):\n m[i] = chr(97+i)\n\nans = ''\nwhile 1:\n\n n -= 1\n\n x = n // 26\n y = n % 26\n\n ans = m[y] + ans\n\n n = x\n if n == 0:\n break\n\nprint(ans)\n", "n = int(input())\n\nm = {}\nfor i in range(0,26):\n m[i] = chr(97+i)\n\nans = ''\nwhile 1:\n\n n -= 1\n\n x = n // 26\n y = n % 26\n\n ans = m[y] + ans\n\n n = x\n if n == 0:\n break\n\nprint(ans)\n"]
['Wrong Answer', 'Accepted']
['s997764067', 's084137318']
[9092.0, 9076.0]
[30.0, 30.0]
[184, 187]
p02629
u014333473
2,000
1,048,576
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?"
["N=int(input())\nalphabet='zabcdefghijklmnopqrstuvwxyz'\nresult = ''\nwhile N > 0:\n result = alphabet[N%26]+result\n if N%26==0:\n N-=1\n N//=26\nprint(result)", "N=int(input())\nalphabet=list('abcdefghijklmnopqrstuvwxyz')\nresult = []\nwhile N >= 0:\n num, N = N%26, N//26\n result.append(alphabet[num-1])\nprint(''.join(result)[::-1])", "N=int(input())\nalphabet=list('zabcdefghijklmnopqrstuvwxyz')\nresult = ''\nwhile N > 0:\n result = alphabet[N%26]+result\n if N%26==0:\n N-=1\n N//=26\nprint(result)", "N=int(input())\nalphabet=list('zabcdefghijklmnopqrstuvwxyz')\nresult = ''\nwhile N > 0:\n result = alphabet[N%26]+result\n if N%26==0:\n N-=1\n N//=26\nprint(result)"]
['Time Limit Exceeded', 'Time Limit Exceeded', 'Time Limit Exceeded', 'Accepted']
['s164816826', 's500218206', 's544679262', 's819802436']
[9912.0, 98824.0, 9828.0, 9172.0]
[2206.0, 2209.0, 2205.0, 32.0]
[159, 169, 165, 163]
p02629
u014562811
2,000
1,048,576
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?"
["def func(tmp):\n print(tmp)\n ans = ''\n sub_ans = tmp/26\n if sub_ans >0:\n ans += func(int(sub_ans))\n\n ans += chr(96 + int(tmp)%26)\n \n return ans\n\n \ntmp = int(input())\nprint(func(tmp)[1:])", "def func(tmp):\n ans = ''\n sub_ans = (tmp-1)/26\n if int(sub_ans) >0:\n ans += func(int(sub_ans))\n if (tmp-1) <= 0:\n ans+='a'\n else:\n \tans += chr(97 + int(tmp-1)%26)\n return ans\n\n \ntmp = int(input())\nprint(func(tmp))\n \n "]
['Wrong Answer', 'Accepted']
['s194099414', 's641895296']
[9172.0, 9176.0]
[32.0, 33.0]
[198, 235]
p02629
u015593272
2,000
1,048,576
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?"
["\ndef main():\n import collections\n\n N = int(input())\n A_s = list(map(int, input().split()))\n Q = int(input())\n\n summ = sum(A_s)\n CNT_A = collections.Counter(A_s)\n\n\n for i in range(Q):\n before, after = map(int, input().split())\n \n tmp_cnt = CNT_A[before]\n \n if (tmp_cnt > 0):\n tmp_before = CNT_A[before] * (after - before)\n summ += tmp_before\n\n N_before=CNT_A[before]\n\n del CNT_A[before]\n N_after = CNT_A[after]\n \n if (N_after > 0):\n CNT_A[after] = N_after + N_before\n else:\n CNT_A[after] = N_before\n \n \n print(summ)\n\n\nif __name__ == '__main__':\n main()\n", "N = int(input())\n\nbitts = ''\nans = ''\n\ndic = 'abcdefghijklmnopqrstuvwxyz'\n\nwhile (N > 0):\n N -= 1\n \n b = N // 26\n mod = N - 26 * b\n bitts += str(mod)\n \n ans += dic[mod]\n \n N = N // 26\n \n\nprint(ans[::-1])\n\n"]
['Runtime Error', 'Accepted']
['s231176847', 's917717204']
[9388.0, 9172.0]
[31.0, 34.0]
[754, 235]
p02629
u016336953
2,000
1,048,576
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?"
['num=int(input())\n\n\ndef num2alpha(num):\n if num<=26:\n return chr(64+num)\n elif num%26==0:\n return num2alpha(num//26-1)+chr(90)\n else:\n return num2alpha(num//26)+chr(64+num%26)\n\nans=num2alpha(num)\n\nprint(ans)', 'num=int(input())\n\n\ndef num2alpha(num):\n if num<=26:\n return chr(64+num)\n elif num%26==0:\n return num2alpha(num//26-1)+chr(90)\n else:\n return num2alpha(num//26)+chr(64+num%26)\n\nans=num2alpha(num).lower()\n\nprint(ans)']
['Wrong Answer', 'Accepted']
['s515335416', 's288459424']
[9192.0, 9168.0]
[30.0, 33.0]
[236, 244]
p02629
u016843859
2,000
1,048,576
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?"
['def my_index_multi(l, x):\n return [i for i, _x in enumerate(l) if _x == x]\nN=int(input())\nA=list(map(int,input().split()))\nQ=int(input())\nBC=[]\nfor i in range(Q):\n BC.append(list(map(int,input().split())))\nfor i in BC:\n if i[0] in A:\n indexlist=my_index_multi(A,i[0])\n for j in indexlist:\n A[j]=i[1]\n print(sum(A))', 'def my_index_multi(l, x):\n return [i for i, _x in enumerate(l) if _x == x]\nN=int(input())\nA=list(map(int,input().split()))\nQ=int(input())\nBC=[]\nfor i in range(Q):\n BC.append(list(map(int,input().split())))\nfor i in BC:\n if i[0] in A:\n indexlist=my_index_multi(A,i[0])\n for j in indexlist:\n A[j]=i[1]\n print(sum(A))', 'def num2alpha(num):\n if num<=26:\n return chr(64+num)\n elif num%26==0:\n return num2alpha(num//26-1)+chr(90)\n else:\n return num2alpha(num//26)+chr(64+num%26)\nN=int(input())\nprint(num2alpha(N).lower())']
['Runtime Error', 'Runtime Error', 'Accepted']
['s040421544', 's807902012', 's513463245']
[9232.0, 9008.0, 9168.0]
[29.0, 26.0, 28.0]
[351, 351, 228]
p02629
u017415492
2,000
1,048,576
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?"
['n=int(input())\nN=0\nN+=n\nk=n\nddd=[]\nfor i in range(1,15):\n ddd.append((26**i)//25-1)\nketa=0\nsyo=0\nkou=0\nfor i in range(1,15):\n if (26**i-1)//25 == n:\n keta=i\n break\n if (26**i-1)//25 < n < (26**(i+1)-1)//25:\n keta=i\n break\nans=[]\nfor i in range(keta):\n ans.append(n%27)\n n=n//26\nans.reverse()\nalf="zabcdefghijklmnopqrstuvwxyz"\nanss=""\nprint(ans)\nif not N in ddd:\n for i in ans:\n anss+=alf[i]\n print(anss)\nelse:\n print("z"*keta)', 'n=int(input())\nalf = list("abcdefghijklmnopqrstuvwxyz")\nans=""\ni=0\nwhile n-26**i>=0:\n n-=26**i\n i+=1\n\nfor j in range(i):\n n,b=divmod(n,26)\n ans+=str(alf[b])\nprint(ans[::-1])']
['Wrong Answer', 'Accepted']
['s897246893', 's756197309']
[9092.0, 9092.0]
[34.0, 29.0]
[449, 177]
p02629
u018679195
2,000
1,048,576
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?"
["N = int(input())\nans = ''\nfor i in range(1, 99):\n if N <= 26 ** i:\n N -= 1\n for j in range(i):\n ans += chr(ord('a') + N % 26)\n N //= 26\n break\n else:\n N -= 26 ** i\n print(ans[::-1]) \n", "a = int(input())\ns = []\nret = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v',\n 'w', 'x', 'y', 'z',\n ]\nwhile a > 0:\n a -= 1 \n shang = int(a / 26)\n yushu = int(a % 26)\n print(shang, yushu)\n s.append(yushu) \n a = shang\n\ns.reverse()\n# print(s)\nv = ''\nfor i in range(len(s)):\n v += ret[s[i]]\nprint(v)\n", "a = int(input())\ns = []\nret = ['z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v',\n 'w', 'x', 'y', 'z',\n ]\nwhile a > 0:\n a -= 1\n shang = int(a / 26)\n yushu = int(a % 26)\n # print(shang, yushu)\n s.append(yushu+1)\n a = shang\n\ns.reverse()\n# print(s)\nv = ''\nfor i in range(len(s)):\n v += ret[s[i]]\nprint(v)\n"]
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s120008601', 's811415447', 's585832089']
[9148.0, 9160.0, 9200.0]
[29.0, 31.0, 29.0]
[248, 491, 399]
p02629
u019053283
2,000
1,048,576
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?"
['def num2alpha(num):\n if num<=26:\n return chr(64+num)\n elif num%26==0:\n return num2alpha(num//26-1)+chr(90)\n else:\n return num2alpha(num//26)+chr(64+num%26)\n\nn = num2alpha(123456789)\nprint(n.lower())', 'def num2alpha(num):\n if num<=26:\n return chr(64+num)\n elif num%26==0:\n return num2alpha(num//26-1)+chr(90)\n else:\n return num2alpha(num//26)+chr(64+num%26)\n\na=int(input())\nn = num2alpha(a)\nprint(n.lower())']
['Wrong Answer', 'Accepted']
['s325961697', 's416488583']
[9100.0, 9180.0]
[26.0, 30.0]
[228, 235]
p02629
u020472025
2,000
1,048,576
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?"
["n = 1\nN = int(input())\n\nwhile True:\n if 26*(26**n-1)/25 >= N:\n break\n else:\n n +=1\n\nalpha = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']\nnum = []\n\nnum = [0 for _ in range(n)]\n\nfor i in reversed(range(n)):\n print('i :', i)\n for j in range(1,27):\n pre = 26*(26**i-1)/25\n if 26**i * j + pre >= N:\n num[i] = alpha[j-1]\n\n N -= 26**i * j\n break\n\n\nprint(''.join(num[::-1]))", "n = 1\nN = int(input())\n\nwhile True:\n if 26*(26**n-1)/25 >= N:\n break\n else:\n n +=1\n\nalpha = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']\nnum = []\n\nnum = [0 for _ in range(n)]\n\nfor i in reversed(range(n)):\n for j in range(1,27):\n pre = 26*(26**i-1)/25\n if 26**i * j + pre >= N:\n num[i] = alpha[j-1]\n\n N -= 26**i * j\n break\n\n\nprint(''.join(num[::-1]))"]
['Wrong Answer', 'Accepted']
['s331565635', 's695994604']
[9172.0, 9192.0]
[34.0, 31.0]
[484, 466]
p02629
u021906447
2,000
1,048,576
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?"
['N =int(input())\nans = ""\n\nwhile True:\n matsubi = N%26\n matsubi = chr(64+matsubi)\n ans += matsubi\n N = N/26\n N = int(N)\n if N<26:\n last = chr(64+N)\n ans += last\n break;\n\nans2 = ans[::-1]\nprint(ans2.lower())', 'N =int(input())\nans = ""\n\nwhile True:\n N-=1\n matsubi = N%26\n matsubi = chr(96+matsubi+1)\n ans += matsubi\n\n if N//26 == 0:\n break\n else:\n N//=26\n\nans = ans[::-1]\nprint(ans)']
['Wrong Answer', 'Accepted']
['s262794198', 's703490219']
[9020.0, 9156.0]
[28.0, 35.0]
[226, 187]
p02629
u024340351
2,000
1,048,576
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?"
["N = int(input())\n\nS = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']\n\nfor j in range (0, 1000000):\n\tfor i in range (0, 26):\n\t\tS.append(S[j]+chr(96+i))\n\nprint(S[N])", "\nN = int(input())\n\nS = str()\n\nimport math\n\nK = [26, 702, 18278, 475254, 12356630, 321272406, 8353082582, 217180147158, 5646683826134, 146813779479510]\n\nif K.count(N) > 0:\n\tfor i in range (0, K.index(N)+1):\n\t\tS=S+'z'\n\tprint(S)\n\texit()\n\nimport bisect\nP = bisect.bisect_right(K, N)\nMel = N- K[P-1]\n\nfor i in range (0, P):\n\tK = Mel//(26**(P-i))\n\tMel = Mel-K*(26**(P-i))\n\tS=S+chr(97+K)\n\nS=S+chr(96+Mel)\n\nprint(S)", "N = int(input())\nAlphabet = str('abcdefghijklmnopqrstuvwxyz')\nimport bisect\n\nList = [0, 26, 702, 18278, 475254, 12356630, 321272406, 8353082582, 217180147158, 5646683826134, 146813779479510, 3817158266467286, 99246114928149462, 2580398988131886038, 67090373691429037014, 1744349715977154962390, 45353092615406029022166, 1179180408000556754576342, 30658690608014475618984918]\nV = []\n\nif List.count(N) == 1:\n\tfor i in range (0, List.index(N)):\n\t\tV.append('z')\n\tprint(*V, sep = '')\n\texit()\n\nk = 26\nA = [0]\nfor i in range (2, 20):\n\tA.append(k)\n\tk = k+26**i\n \nS = []\n\nB = bisect.bisect_right(A, N)\n\nN = N-A[B-1]-1\nfor i in range (0, B):\n\tS.append(Alphabet[N%26])\n\tN = N//26\n \nS = reversed(S)\nprint(*S, sep = '')"]
['Time Limit Exceeded', 'Runtime Error', 'Accepted']
['s530676160', 's974982877', 's483866764']
[668648.0, 9088.0, 9156.0]
[2233.0, 35.0, 30.0]
[247, 407, 712]
p02629
u024550857
2,000
1,048,576
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?"
["N = int(input()) \nS = ''\nK = (26 + 26**2 + 26**3 + 26**4 + 26**5 + 26**6 + 26**7 + 26**8 + 26**9 + 26**10)\n\nfor outer in range(10):\n K -= 26**(10 - outer)\n print(K)\n if N > K:\n \n for iter in range(27):\n if N <= K + (iter) * 26**(10 - outer -1 ):\n S += chr(97+iter - 1)\n N -= (iter) * 26**(10 - outer - 1)\n break\n\n\n# if N > (26 + 26**2 + 26**3 + 26**4 + 26**5 + 26**6 + 26**7 + 26**8 + 26**9):\n# for iter in range(25):\n# if N < (26 + 26**2 + 26**3 + 26**4 + 26**5 + 26**6 + 26**7 + 26**8) +iter * 26**9:\n\n# N -= iter * 26**9\n# break\n\n\n\nprint(S)", "N = int(input()) \nS = ''\nK = (26 + 26**2 + 26**3 + 26**4 + 26**5 + 26**6 + 26**7 + 26**8 + 26**9 + 26**10+ 26**11)\n\nfor outer in range(11):\n K -= 26**(11 - outer)\n \n if N > K:\n \n for iter in range(27):\n if N <= K + (iter) * 26**(11 - outer -1 ):\n S += chr(97+iter - 1)\n N -= (iter) * 26**(11 - outer - 1)\n break\n\n\n# if N > (26 + 26**2 + 26**3 + 26**4 + 26**5 + 26**6 + 26**7 + 26**8 + 26**9):\n# for iter in range(25):\n# if N < (26 + 26**2 + 26**3 + 26**4 + 26**5 + 26**6 + 26**7 + 26**8) +iter * 26**9:\n\n# N -= iter * 26**9\n# break\n\n\n\nprint(S)"]
['Wrong Answer', 'Accepted']
['s225873857', 's849072178']
[9136.0, 9152.0]
[32.0, 31.0]
[690, 700]
p02629
u025463382
2,000
1,048,576
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?"
["def Base_10_to_n(X, n):\n #print(X)\n if (int(X/n)):\n return Base_10_to_n(int(X/n), n)+' '+str(X%n)\n return str(X%n)\nn = int(input()) -1\nan = Base_10_to_n(n,26)\nans = [chr(int(i)+96) for i in an.split()]\nif len(ans)>1:\n ans[-1] = chr(ord(ans[0-1]) +1)\nprint(''.join(ans))", "from bisect import bisect_left\nn = int(input())\nlis = [0]*13\nfor i in range(1,13):\n lis[i] = 26**i + lis[i-1]\n#print(lis)\nnum = bisect_left(lis,n)\nn -= lis[num-1]\nn -= 1\nans = ''\nfor i in range(num):\n i = num-i-1\n ans += chr(n//(26**i) +97)\n n %= 26**i\nprint(ans)"]
['Wrong Answer', 'Accepted']
['s255278370', 's781375403']
[9200.0, 9212.0]
[28.0, 33.0]
[282, 271]
p02629
u028014940
2,000
1,048,576
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?"
["\nimport math\n\nn=int(input())\nal=[chr(ord('a') + i) for i in range(26)]\n# print(al)\n# print(int(math.log(n,26))+1)\n\nlst=[]\nfor i in range(1,10):\n amari=n%26\n print(amari)\n n=n//26\n lst.append(al[amari-1])\n if n==0:\n break\n\n\nprint(''.join(lst[::-1]))\n", "n=int(input())\nans=''\ncheck='abcdefghijklmnopqrstuvwxyz' \nwhile n!=0:\n n-=1\n ans+=check[n%26] \n n//=26\nprint(ans[::-1])"]
['Wrong Answer', 'Accepted']
['s037670357', 's456135621']
[9188.0, 9124.0]
[29.0, 26.0]
[271, 281]
p02629
u030278108
2,000
1,048,576
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?"
['n = int(input())\n\ndef num2alpha(num):\n if num<=26:\n return chr(64+num)\n elif num%26==0:\n return num2alpha(num//26-1)+chr(90)\n else:\n return num2alpha(num//26)+chr(64+num%26)\n\n\nx = num2alpha(n)\nprint(x)', 'n = int(input())\n\ndef num2alpha(num):\n if num<=26:\n return chr(64+num)\n elif num%26==0:\n return num2alpha(num//26-1)+chr(90)\n else:\n return num2alpha(num//26)+chr(64+num%26)\n\n\nX = num2alpha(n)\nprint(X.swapcase())']
['Wrong Answer', 'Accepted']
['s048648488', 's744378412']
[9164.0, 9184.0]
[36.0, 32.0]
[231, 242]
p02629
u035044350
2,000
1,048,576
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?"
["N = int(input())\nans = ''\n \nwhile N > 0:\n\tN -= 1\n\tans += chr(ord('a') + N % 26).lower()\n\tN = N // 26\n print(ans[::-1])", 'def main():\n N = int(input())\n ans = \'\'\n \n while N > 0:\n N -= 1\n ans += chr(ord(\'a\') + N % 26).lower()\n N = N // 26\n print(ans[::-1])\n \n \nif __name__ == "__main__":\n main()\n']
['Runtime Error', 'Accepted']
['s653916603', 's221383903']
[8884.0, 8976.0]
[31.0, 32.0]
[121, 209]
p02629
u035210736
2,000
1,048,576
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?"
['a = list(\'abcdefghijklmnopqrstuvwxyz\')\nn = int(input()) - 1\n\nans = ""\nwhile True:\n b = n // 26\n c = n % 26\n print(b)\n print(c)\n if b == 0:\n ans = a[c] + ans\n break\n elif b == 1:\n ans = a[b - 1] + a[c] + ans\n break\n else:\n ans = a[c] + ans\n n = b - 1\n \nprint(ans)', 'a = list(\'abcdefghijklmnopqrstuvwxyz\')\nn = int(input()) - 1\n\nans = ""\nwhile True:\n b = n // 26\n c = n % 26\n if b == 0:\n ans = a[c] + ans\n break\n elif b == 1:\n ans = a[b - 1] + a[c] + ans\n break\n else:\n ans = a[c] + ans\n n = b - 1\n \nprint(ans)']
['Wrong Answer', 'Accepted']
['s286732027', 's688198186']
[8992.0, 9152.0]
[29.0, 26.0]
[290, 268]
p02629
u035885928
2,000
1,048,576
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?"
["s=int(input())\nd=[]\nwhile s>0:\n d.append(chr(s%26+97))\n s//=26\nt=''\nfor i in reversed(d):\n t+=i\nprint(t) ", "s=int(input())-1\nd=[]\nwhile s>=0:\n d.append(chr(s%26+97))\n s//=26\n s-=1\nt=''\nfor i in reversed(d):\n t+=i\nprint(t) "]
['Wrong Answer', 'Accepted']
['s269919242', 's403000407']
[8956.0, 9180.0]
[31.0, 31.0]
[109, 119]
p02629
u037675241
2,000
1,048,576
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?"
['n = int(input())\ntmp = n\nans = []\n\ni = 1\n\nwhile n > 0:\n n -= 1\n r = n % 26\n ans.append(r)\n\n n = n // 26\n\n\nans.reverse()\nprint(ans)\nfor a in ans:\n print(chr(ord("a") + a), end="")', 'n = int(input())\ntmp = n\nans = ""\n\ni = 1\n\nwhile n > 0:\n n -= 1\n r = n % 26\n ans += chr(ord("a") + r)\n\n n = n // 26\n\nprint(ans[::-1])']
['Wrong Answer', 'Accepted']
['s217717704', 's695627917']
[9044.0, 9176.0]
[30.0, 30.0]
[193, 144]
p02629
u038408819
2,000
1,048,576
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?"
["num = int(input())\nans = ''\nwhile num > 26:\n num, rest = divmod(num, 26)\n ans += s[rest - 1]\n #print(ans)\nans += s[num - 1]\nprint(ans[::-1])", "num = int(input())\ns = 'abcdefghijklmnopqrstuvwxyz'\nans = ''\n\nwhile num > 0:\n num, rest = divmod(num, 26)\n ans += s[rest - 1]\n if rest == 0:\n num -= 1\n\nans += s[num - 1]\nprint(ans[::-1])", "num = int(input())\ns = 'abcdefghijklmnopqrstuvwxyz'\nans = ''\n\nwhile num > 0:\n num -= 1\n num, rest = divmod(num, 26)\n ans += s[rest]\n #if rest == 0:\n \nprint(ans[::-1])"]
['Runtime Error', 'Wrong Answer', 'Accepted']
['s016206461', 's576883962', 's335660027']
[9168.0, 9124.0, 9100.0]
[28.0, 32.0, 33.0]
[149, 202, 194]
p02629
u039876942
2,000
1,048,576
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?"
['n = int(input())\nl = []\nwhile n:\n N -= 1\n l.append(chr(97+(n % 26)))\n n //= 26\n\nprint("".join(l[::-1]))\n', 'N = int(input())\nl = []\nwhile N:\n N -= 1\n l.append(chr(97+(N % 26)))\n N //= 26\n\nprint("".join(l[::-1]))\n']
['Runtime Error', 'Accepted']
['s662874659', 's832431924']
[9076.0, 9004.0]
[25.0, 30.0]
[113, 113]
p02629
u039934639
2,000
1,048,576
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?"
['n = int(input())\n\ndef NumToAlpha(n):\n if n<=26:\n return chr(64+n)\n elif n%26==0:\n return NumToAlpha(n//26-1)+chr(90)\n else:\n return NumToAlpha(n//26)+chr(64+n%26)\n \nN = NumToAlpha(n)\nprint(N)', 'n = int(input())\n\ndef NumToAlpha(n):\n if n<=26:\n return chr(96+n)\n elif n%26==0:\n return NumToAlpha(n//26-1)+chr(122)\n else:\n return NumToAlpha(n//26)+chr(96+n%26)\n \nN = NumToAlpha(n)\nprint(N)']
['Wrong Answer', 'Accepted']
['s176795871', 's712115437']
[9000.0, 9012.0]
[27.0, 35.0]
[228, 229]
p02629
u050622763
2,000
1,048,576
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?"
['\ndef C():\n import math\n n= int(input())\n\n counter = 0\n for i in range(1,13):\n if int(26*(pow(26,i-1))/(26-1)) <= n < int(26*(pow(26,i))/(26-1)):\n counter = i\n break\n kekka = n - int(26*(pow(26,counter-1))/(26-1))\n\n alplist=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]\n\n kekkalist = []\n i = counter-1\n while i>= 0 :\n sho = int(kekka / pow(26,i))\n kekka = kekka - pow(26,i)*sho\n\n print(sho)\n i -=1\n if i >= 0:\n kekkalist.append(alplist[sho])\n else:\n kekkalist.append(alplist[sho])\n\n\n print("".join(kekkalist))\n\n\nC()\n', '\ndef C():\n import math\n n= int(input())\n\n counter = 0\n for i in range(1,13):\n if int(26*(pow(26,i-1))/(26-1)) <= n < int(26*(pow(26,i))/(26-1)):\n counter = i\n break\n kekka = n - int(26*(pow(26,counter-1))/(26-1))\n\n alplist=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]\n\n kekkalist = []\n i = counter-1\n while i>= 0 :\n sho = int(kekka / pow(26,i))\n kekka = kekka - pow(26,i)*sho\n\n i -=1\n if i >= 0:\n kekkalist.append(alplist[sho])\n else:\n kekkalist.append(alplist[sho])\n\n\n print("".join(kekkalist))\n\n\nC()\n']
['Wrong Answer', 'Accepted']
['s672424241', 's739258031']
[9256.0, 9240.0]
[33.0, 30.0]
[698, 679]
p02629
u052244548
2,000
1,048,576
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?"
["N = int(input())\n\nans = 0\ncnt = 0\nadd = []\nsum = []\nwhile ans < N:\n add.append(ans)\n sum.append(ans**(cnt+1))\n cnt += 1\n ans += (26**cnt)\n\n\nA = N - add[cnt-1]\nprint(A)\nname =[]\nfor i in reversed(range(cnt)):\n div = A // (26**i)\n if i == 0:\n name.append(div-1)\n else:\n name.append(div)\n A -= div * (26**i)\n\n\nname_a =''\nfor i in range(cnt):\n name_a += chr(name[i]+97)\nprint(name_a)\n", "N = int(input())\n\nans = 0\ncnt = 0\nadd = []\nsum = []\nwhile ans < N:\n add.append(ans)\n sum.append(ans**(cnt+1))\n cnt += 1\n ans += (26**cnt)\n\n\nA = N - add[cnt-1]\nname =[]\nfor i in reversed(range(cnt)):\n if i == 0:\n div = A\n else:\n div = (A-1) // (26**i)\n\n if i == 0 or div == 26:\n name.append(div-1)\n A -= (div-1) * (26**i)\n else:\n name.append(div)\n A -= div * (26**i)\n\n\n\nname_a =''\nfor i in range(cnt):\n name_a += chr(name[i]+97)\nprint(name_a)"]
['Wrong Answer', 'Accepted']
['s916725346', 's284433581']
[9100.0, 9192.0]
[32.0, 31.0]
[421, 510]
p02629
u054556734
2,000
1,048,576
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?"
['import numpy as np\nimport scipy.sparse as sps\nimport scipy.misc as spm\nimport collections as col\nimport functools as func\nimport itertools as ite\nimport fractions as frac\nimport math as ma\nfrom math import cos,sin,tan,sqrt\nimport cmath as cma\nimport copy as cp\nimport sys\nimport re\nimport bisect as bs\nsys.setrecursionlimit(10**7)\nEPS = sys.float_info.epsilon\nPI = np.pi; EXP = np.e; INF = np.inf\nMOD = 10**9 + 7\n\ndef sinput(): return sys.stdin.readline().strip()\ndef iinput(): return int(sinput())\ndef imap(): return map(int, sinput().split())\ndef fmap(): return map(float, sinput().split())\ndef iarr(n=0):\n if n: return [0 for _ in range(n)]\n else: return list(imap())\ndef farr(): return list(fmap())\ndef sarr(n=0):\n if n: return ["" for _ in range(n)]\n else: return sinput().split()\ndef barr(n): return [False for _ in range(n)]\ndef adj(n): return [[] for _ in range(n)]\n\nn = iinput()\nch = ["z"]+[chr(i) for i in range(ord("a"), ord("a")+25)]\n\ndef cnt26(num):\n cnt = 0\n while 1:\n if 26 ** cnt > num: return cnt - 1\n else: cnt += 1\n\ns = ""\ndig = cnt26(n)\nwhile dig >= 1:\n div,mod = divmod(n, 26**dig)\n #print(div,mod)\n n = mod\n s += ch[div]\n dig -= 1\ns += ch[mod]\nprint(s)\n', 'import numpy as np\nimport scipy.sparse as sps\nimport scipy.misc as spm\nimport collections as col\nimport functools as func\nimport itertools as ite\nimport fractions as frac\nimport math as ma\nfrom math import cos,sin,tan,sqrt\nimport cmath as cma\nimport copy as cp\nimport sys\nimport re\nimport bisect as bs\nsys.setrecursionlimit(10**7)\nEPS = sys.float_info.epsilon\nPI = np.pi; EXP = np.e; INF = np.inf\nMOD = 10**9 + 7\n\ndef sinput(): return sys.stdin.readline().strip()\ndef iinput(): return int(sinput())\ndef imap(): return map(int, sinput().split())\ndef fmap(): return map(float, sinput().split())\ndef iarr(n=0):\n if n: return [0 for _ in range(n)]\n else: return list(imap())\ndef farr(): return list(fmap())\ndef sarr(n=0):\n if n: return ["" for _ in range(n)]\n else: return sinput().split()\ndef barr(n): return [False for _ in range(n)]\ndef adj(n): return [[] for _ in range(n)]\n\nn = iinput()\nch = ["z"]+[chr(i) for i in range(ord("a"), ord("a")+25)]\n\nans = ""\nwhile n>0:\n if n%26: ans = ch[n%26] + ans; n //= 26\n else: ans = ch[n%26] + ans; n //= 26; n -= 1\nprint(ans)\n']
['Runtime Error', 'Accepted']
['s727968981', 's706904592']
[37808.0, 37692.0]
[188.0, 210.0]
[1222, 1083]
p02629
u054825571
2,000
1,048,576
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?"
['N=int(input())\nketa=1\na=26\nwhile N>a:\n a*=26\n keta+=1\nans=""\nfor i in range(keta-1,0,-1):\n a=N//(26**i)-1\n N=N%(26**i)\n ans+=chr(ord(\'a\')+a)\nans+=chr(ord(\'a\')+N//(26**i))\nprint(ans)', 'N=int(input())\nketa=1\na=26\nwhile N>a:\n a*=26\n keta+=1\nans=""\nfor i in range(keta-1,0,-1):\n a=N//(26**i)-1\n N=N%(26**i)\n ans+=chr(ord(\'a\')+a)\nans+=chr(ord(\'a\')+N//(26**i))\nprint(ans)', 'N=int(input())\nketa=1\na=26\nans=""\nwhile N>0:\n N-=1\n ans+=chr(ord(\'a\')+N%26)\n N=N//26\nprint(ans[::-1])']
['Runtime Error', 'Runtime Error', 'Accepted']
['s489465493', 's496059638', 's193188859']
[9164.0, 9088.0, 9160.0]
[31.0, 30.0, 31.0]
[186, 186, 104]
p02629
u057948305
2,000
1,048,576
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?"
['import string\nalpha = string.ascii_lowercase\n\nn = int(input())\n\nans = []\nwhile (n):\n res = (n % 26)\n print("n % 26: ", n % 26)\n print("letra: ", alpha[res-1])\n print(" n // 26: ", n // 26)\n ans.append(alpha[res-1])\n if (n <= 26):\n break\n if n % 26:\n n = n // 26\n else:\n n = n // 26\n n = n - 1\n\n\n# print(ans)\nans = ans[::-1]\nprint(ans)\n\n# 1 -> 26\n# 2 -> 26 * 26 + 26\n# 3 -> 26 * 26 * 26\n', 'import string\nalpha = string.ascii_lowercase\n\nn = int(input())\n\nans = []\nwhile (n):\n res = (n % 26)\n # print("n % 26: ", n % 26)\n # print("letra: ", alpha[res-1])\n # print(" n // 26: ", n // 26)\n ans.append(alpha[res-1])\n if (n <= 26):\n break\n if n % 26:\n n = n // 26\n else:\n n = n // 26\n n = n - 1\n\n\n# print(ans)\nans = ans[::-1]\nprint("".join(ans))\n\n# 1 -> 26\n# 2 -> 26 * 26 + 26\n# 3 -> 26 * 26 * 26\n']
['Wrong Answer', 'Accepted']
['s219180386', 's189860058']
[9856.0, 9964.0]
[39.0, 39.0]
[438, 453]
p02629
u058592821
2,000
1,048,576
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?"
["from decimal import *\nn = Decimal(input())\nans = ''\nwhile True:\n q, mod = divmod(n, Decimal('26'))\n ans = (chr(ord('a') + mod-1)) + ans\n if q == 0:\n break\n else:\n n = Decimal(q)\nprint(ans)\n \n", "n = int(input())\nans = ''\nwhile True:\n q, mod = divmod(n, 26)\n if mod == 0:\n ans = 'z' + ans\n q -= 1\n else:\n ans = (chr(ord('a') + mod-1)) + ans\n if q == 0:\n break\n else:\n n = q\nprint(ans)\n \n"]
['Wrong Answer', 'Accepted']
['s241443325', 's380403384']
[10068.0, 9064.0]
[37.0, 32.0]
[220, 244]
p02629
u062510078
2,000
1,048,576
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?"
["N = int(input())\nans = ''\nfor i in range(1, 99):\nif N <= 26 ** i:\nN -= 1\nfor j in range(i):\nans += chr(ord('a') + N % 26)\nN //= 26\nbreak\nelse:\nN -= 26 ** i\nprint(ans[::-1]) # reversed", "N = int(input())\nans = ''\nwhile N > 0:\n N -= 1\n ans += chr(ord('a') + N % 26)\n N //= 26\nprint(ans[::-1])"]
['Runtime Error', 'Accepted']
['s467296880', 's005412037']
[8928.0, 9104.0]
[23.0, 29.0]
[183, 107]
p02629
u065079240
2,000
1,048,576
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?"
['N=int(input())\nketa=0\nn=N\nketakari=0\nwhile(1):\n keta+=1\n ketakari+=26**keta\n if N<=ketakari:\n break\nfor j in range(1,keta):\n N-=26**j\nans=""\n#print(keta)\n#print(ans)\nprint(N)\nN-=1\nfor i in range(keta):\n kari=N%26\n ans=chr(ord("a")+kari)+ans\n N//=26\nprint(ans)', 'N=int(input())\nketa=0\nn=N\nketakari=0\nwhile(1):\n keta+=1\n ketakari+=26**keta\n if N<=ketakari:\n break\nfor j in range(1,keta):\n N-=26**j\nans=""\n#print(keta)\n#print(ans)\n#print(N)\nN-=1\nfor i in range(keta):\n kari=N%26\n ans=chr(ord("a")+kari)+ans\n N//=26\nprint(ans)']
['Wrong Answer', 'Accepted']
['s737878770', 's093746471']
[9192.0, 9176.0]
[31.0, 29.0]
[287, 288]
p02629
u065099501
2,000
1,048,576
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?"
["n = input()\nA = list(map(int, input().split()))\n\nN = int(input())\nans = ''\nfor i in range(1, 99):\n if N <= 26 ** i:\n N -= 1\n for j in range(i):\n ans += chr(ord('a') + N % 26)\n N //= 26\n break\n else:\n N -= 26 ** i\nprint(ans[::-1]) ", "N = int(input())\nans = ''\nfor i in range(1, 99):\n if N <= 26 ** i:\n N -= 1\n for j in range(i):\n ans += chr(ord('a') + N % 26)\n N //= 26\n break\n else:\n N -= 26 ** i\nprint(ans[::-1]) "]
['Runtime Error', 'Accepted']
['s768111514', 's699777923']
[8976.0, 9140.0]
[23.0, 29.0]
[286, 237]
p02629
u066120361
2,000
1,048,576
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?"
['n = int(input())\nA = list(map(int, input().split()))\nq = int(input())\n\ntable = [0] * 100010\n\n\nfor i in A:\n table[i] += 1\n\n sum = 0\n\n for i in A:\n sum += i\n\n for i in range(q):\n b, c = map(int, input().split())\n cnt = table[b]\n sum += (c - b) * cnt\n table[c] += table[b]\n table[b] = 0\n print(sum)', "N = int(input())\nname = ''\nwhile N>0:\n N, r = divmod(N-1, 26)\n name = chr(65+r)+name\nprint(name.lower())"]
['Runtime Error', 'Accepted']
['s865630959', 's772052576']
[9196.0, 9156.0]
[28.0, 28.0]
[335, 110]
p02629
u069699931
2,000
1,048,576
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?"
["N=int(input())\nlis=[chr(i) for i in range(97, 97+26)]\nans=''\nwhile N>0:\n N-=1\n ans+=lis[N%26]\n N=N//26\nprint(ans[::-1]", "N=int(input())\nlis=[chr(i) for i in range(97, 97+26)]\nans=''\nwhile N>0:\n N-=1\n ans+=lis[N%26]\n N=N//26\nprint(ans[::-1])"]
['Runtime Error', 'Accepted']
['s285989540', 's343272140']
[8856.0, 9108.0]
[31.0, 30.0]
[127, 128]
p02629
u069978048
2,000
1,048,576
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?"
["N = int(input())\ncount = 0\nans = list()\nr = 0\nalp = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']\n\nwhile N > 26**count:\n count+=1\n\ncount = count - 1\n\nwhile count > 0:\n A = N % 26\n B = N // 26\n ans.append(A)\n N = B\n count = count - 1\n\n#print(N)\nA = N % 26\nB = N // 26\n\nif B == 0:\n ans.append(A-1)\n ans.append(9)\nelse:\n ans.append(A)\n ans.append(B-1)\n\n#print(ans)\n\nfor i in range(0, len(ans)):\n ans[i] = alp[ans[i]]\n\n#print(ans)\n\nprint(''.join(ans))", "N = int(input())\ncount = 0\nans = list()\nr = 0\nalp = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']\n\nwhile N > 26**count:\n count+=1\n\ncount = count - 1\n#print(count)\n\nwhile count > 0:\n N = N - 26**count\n count = count - 1\n\n#print(N)\n\nN = N - 1\nA = 1\nwhile A != 0:\n A = N // 26\n B = N % 26\n ans.append(B)\n N = A\n\n#print(ans)\n\nwhile len(ans) < count + 2:\n ans.append(0)\n\n#print(N)\n#print(ans)\nans.reverse()\n#print(ans)\n\nfor i in range(0, len(ans)):\n ans[i] = alp[ans[i]]\n\n#print(ans)\n\nprint(''.join(ans))", "N = int(input())\ncount = 0\nans = list()\nr = 0\nalp = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']\n\nwhile N > 26**count:\n count+=1\n\ncount = count - 1\n#print(count)\n\nwhile count != 0:\n N = N - 26**count\n count = count - 1\n\n#print(N)\n\nN = N - 1\nA = 1\nwhile A != 0:\n A = N // 26\n B = N % 26\n ans.append(B)\n N = A\n\n\nwhile len(ans) == count + 1:\n ans.append(0)\n\n#print(N)\n#print(ans)\nans.reverse()\n#print(ans)\n\nfor i in range(0, len(ans)):\n ans[i] = alp[ans[i]]\n\nprint(ans)\n\nprint(''.join(ans))", "N = int(input())\ncount = 0\nans = list()\nr = 0\nalp = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']\nd = -1\n\n\nwhile N > 26**count + d:\n count+=1\n d = 26**(count-1) + d\n\n#print(count)\ncount = count - 1\ncount2 = count\n\nwhile count > 0:\n #print(N)\n N = N - 26**count\n #print(N)\n count = count - 1\n\n#print(N)\n#print(N)\nN = N - 1\n#print(N)\nA = 1\nwhile N > 0:\n A = N // 26\n B = N % 26\n #print(ans)\n ans.append(B)\n #print(ans)\n N = A\n\n#print(ans)\n#print(len(ans))\n#print(count2+1)\n\nwhile len(ans) < count2 + 1:\n ans.append(0)\n #print(len(ans))\n\n#print(N)\n#print(len(ans))\n#print(ans)\nans.reverse()\n#print(ans)\n\nfor i in range(0, len(ans)):\n ans[i] = alp[ans[i]]\n\n#print(ans)\n\nprint(''.join(ans))"]
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s106436647', 's141204747', 's922573210', 's127730411']
[9248.0, 113084.0, 111632.0, 9252.0]
[28.0, 2209.0, 2209.0, 51.0]
[540, 586, 575, 790]
p02629
u074353394
2,000
1,048,576
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?"
["N = int(input())\nalph = {key + 1: val for key, val in enumerate('abcdefghijklmnopqrstuvwxyz')}\nalph[0] = 'z'\nanswer = ''\nwhile N >= 1:\n answer = alph[N % 26] + answer\n if N == 26:\n break\n N //= 26\n\n print(answer)", "N = int(input())\nalph = {key + 1: val for key, val in enumerate('abcdefghijklmnopqrstuvwxyz')}\nalph[0] = 'z'\nanswer = ''\nwhile N >= 1:\n answer = alph[N % 26] + answer\n if N == 26:\n break\n N = (N - 1) // 26\n\nprint(answer)"]
['Time Limit Exceeded', 'Accepted']
['s177196068', 's094691928']
[9840.0, 9124.0]
[2205.0, 26.0]
[223, 226]
p02629
u075304271
2,000
1,048,576
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?"
['import math\nimport collections\nimport fractions\nimport itertools\n\ndef solve():\n n=int(input())\n ans=\'\'\n check=\'abcdefghijklmnopqrstuvwxyz\'\n while n!=0:\n n-=1\n ans+=check[n%26]\n print(ans[::-1])\n return 0\n\nif __name__ == "__main__":\n solve()\n', 'def solve():\n n=int(input())\n ans=\'\'\n check=\'abcdefghijklmnopqrstuvwxyz\'\n while n!=0:\n n-=1\n ans+=check[n%26]\n print(ans[::-1])\n return 0\n\nif __name__ == "__main__":\n solve()\n', 'def solve():\n n=int(input())\n ans=\'\'\n check=\'abcdefghijklmnopqrstuvwxyz\'\n while n!=0:\n n-=1\n ans+=check[n%26]\n n //= 26\n print(ans[::-1])\n return 0\n\nif __name__ == "__main__":\n solve()\n']
['Runtime Error', 'Wrong Answer', 'Accepted']
['s234005809', 's321560842', 's749607340']
[139040.0, 42392.0, 9108.0]
[507.0, 2206.0, 26.0]
[280, 210, 227]
p02629
u077003677
2,000
1,048,576
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?"
['import sys\nimport os\nimport itertools\nimport numpy as np\nfrom collections import deque\n\ndef main():\n if os.getenv("ENV")==\'LOCAL\':\n sys.stdin = open(os.path.dirname(__file__)+\'/input.txt\', \'r\')\n\n N=int(input())\n alphabet=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]\n\n name=[]\n\n while N >= 26:\n name.append(N%26)\n N=(N-N%26)//26\n name.append(N)\n\n \n print(name)\n ans=""\n for i,n in enumerate(name):\n if i!=0 and name[i-1]==0:\n if not name[i]-1==0 or not len(name)==i+1:\n # print(i)\n ans+=alphabet[n-2]\n name[i]-=1\n else:\n ans+=alphabet[n-1]\n\n\n print(ans[::-1])\n\nif __name__ == \'__main__\':\n main()\n', 'import sys\nimport os\nimport itertools\nimport numpy as np\nfrom collections import deque\n\ndef main():\n if os.getenv("ENV")==\'LOCAL\':\n sys.stdin = open(os.path.dirname(__file__)+\'/input.txt\', \'r\')\n\n N=int(input())\n alphabet=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]\n\n name=[]\n\n while N >= 26:\n name.append(N%26)\n N//=26\n name.append(N)\n\n \n # print(name)\n ans=""\n for n in name:\n ans+=chr(ord(\'a\')+n)\n\n\n print(ans[::-1])\n\nif __name__ == \'__main__\':\n main()\n', 'import sys\nimport os\nimport itertools\nimport numpy as np\nfrom collections import deque\n\ndef main():\n if os.getenv("ENV")==\'LOCAL\':\n sys.stdin = open(os.path.dirname(__file__)+\'/input.txt\', \'r\')\n\n N=int(input())\n\n name=[]\n\n while N > 0:\n N-=1\n name.append(N%26)\n N//=26\n\n \n # print(name)\n ans=""\n for n in name:\n ans+=chr(ord(\'a\')+n)\n\n\n print(ans[::-1])\n\nif __name__ == \'__main__\':\n main()\n']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s737442523', 's790865021', 's055233442']
[27084.0, 27040.0, 27184.0]
[123.0, 127.0, 123.0]
[816, 603, 476]
p02629
u079022116
2,000
1,048,576
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?"
["import re\nn = int(input())\n\nANS = []\ndef Base_10_to_n(X, n):\n if (int(X/n)):\n ANS.append(X%n)\n return Base_10_to_n(int(X/n), n)+str(X%n)\n else:\n return ''\n############################\n\n\n\nans = Base_10_to_n(n, 26)\n\nans = [str(n) for n in ANS][::-1]\nkore = ''\nfor i in ans:\n if i == '25':\n kore += 'y'\n elif i == '24':\n kore += 'x'\n elif i == '23':\n kore += 'w'\n elif i == '22':\n kore += 'v'\n elif i == '21':\n kore += 'u'\n elif i == '20':\n kore += 't'\n elif i == '19':\n kore += 's'\n elif i == '18':\n kore += 'r'\n elif i == '17':\n kore += 'q'\n elif i == '16':\n kore += 'p'\n elif i == '15':\n kore += 'o'\n elif i == '14':\n kore += 'n'\n elif i == '13':\n kore += 'm'\n elif i == '12':\n kore += 'l'\n elif i == '11':\n kore += 'k'\n elif i == '10':\n kore += 'j'\n elif i == '9':\n kore += 'i'\n elif i == '8':\n kore += 'h'\n elif i == '7':\n kore += 'g'\n elif i == '6':\n kore += 'f'\n elif i == '5':\n kore += 'e'\n elif i == '4':\n kore += 'd'\n elif i == '3':\n kore += 'c'\n elif i == '2':\n kore += 'b'\n elif i == '1':\n kore += 'a'\n elif i == '0':\n kore += 'z'\nprint( kore )", "n = int(input())\nans = ''\nwhile n > 0:\n n -= 1\n ans += chr(97 + n%26)\n n //= 26\nprint(ans[::-1])"]
['Wrong Answer', 'Accepted']
['s337031324', 's477490418']
[9940.0, 9128.0]
[38.0, 30.0]
[1454, 105]
p02629
u082945913
2,000
1,048,576
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?"
["n = int(input())\nl = []\n\nwhile(n > 0):\n l.append((n - 1) % 26)\n n = int((n - 1) / 26)\n\nprint(l)\nl.reverse()\n\nans = []\nfor i in l:\n ans.append(chr(i + ord('a')))\n \nprint(''.join(ans))", "n = int(input())\nl = []\n\nwhile(n > 0):\n l.append((n - 1) % 26)\n n = int((n - 1) / 26)\n\nl.reverse()\n\nans = []\nfor i in l:\n ans.append(chr(i + ord('a')))\n \nprint(''.join(ans))"]
['Wrong Answer', 'Accepted']
['s392679469', 's270743090']
[9172.0, 9172.0]
[32.0, 33.0]
[194, 185]
p02629
u090406054
2,000
1,048,576
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?"
['n=int(input())\n\ndef num2alpha(num):\n if num<=26:\n return chr(64+num)\n elif num%26==0:\n return num2alpha(num//26-1)+chr(90)\n else:\n return num2alpha(num//26)+chr(64+num%26)\nnum2alpha(n)', 'n=int(input())\n\ndef num2alpha(num):\n if num<=26:\n return chr(64+num)\n elif num%26==0:\n return num2alpha(num//26-1)+chr(90)\n else:\n return num2alpha(num//26)+chr(64+num%26)\nprint(num2alpha(n).lower())\n']
['Wrong Answer', 'Accepted']
['s985845417', 's206960527']
[9036.0, 9068.0]
[29.0, 27.0]
[246, 262]
p02629
u094425865
2,000
1,048,576
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?"
["n = int(input())\n \nan =[]\ni=0\nwhile i <11:\n i+=1\n if 26**(11-i)<=n:\n wk = n//26**(11-i)\n if wk==1 and n//27**(11-i)<1:\n an.append('z')\n i+=1\n continue\n print(wk,n,i)\n an.append(chr(wk%26+96))\n n -= wk*26**(11-i)\n\nprint(''.join(an))", "import sys\nn = int(input())\n\nan =[]\n\nfor i in range(11):\n if 26**(10-i)<=n and i<=10:\n wk = n//26**(10-i)\n n=n%26**(10-i)\n an.append(chr(wk%26+96))\n else:\n an.append(chr(n+96))\nprint(''.join(an))", "n = int(input())\n\nnn=n\ni=1\nwhile nn > 26**i:\n nn-=26**i\n i+=1\n\nan=['a']*i\nj=0\nwhile n:\n n-=1\n wk=n%26\n an[j]=(chr(ord('a')+wk))\n n = n//26\n j+=1\n \nan.reverse()\nprint(''.join(an))"]
['Wrong Answer', 'Runtime Error', 'Accepted']
['s757609405', 's917087015', 's829720690']
[9120.0, 9100.0, 9100.0]
[29.0, 31.0, 29.0]
[305, 229, 202]
p02629
u094999522
2,000
1,048,576
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?"
['from collections import defaultdict\ninput()\na = [*map(int, input().split())]\ns = sum(a)\nb = [[*map(int,input().split())] for _ in range(int(input()))]\nc = defaultdict(int)\nfor i in a:\n c[i]+=1\nfor i,j in b:\n s += (j-i)*c[i]\n c[j]+=c[i]\n c[i] = 0\n print(s)\n', 'def base(n, b):\n d="abcdefghijklmnopqrstuvwxyz"\n s = []\n while True:\n s.append(d[n % b])\n n = n//b -1\n if n < 0:\n break\n return \'\'.join(reversed(s))\nprint(base(int(input())-1,26))']
['Runtime Error', 'Accepted']
['s322903556', 's260738635']
[9392.0, 9176.0]
[30.0, 29.0]
[271, 221]
p02629
u095384238
2,000
1,048,576
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?"
['N = int(input())\nfrom decimal import Decimal\nname = ""\ntempN = Decimal(N)\nwhile tempN > 0:\n name += chr(Decimal(tempN % 26) + 96)\n tempN = Decimal(tempN // 26)\nprint(name[::-1])', 'N = int(input())\nname = ""\ntempN = N\nwhile tempN > 0:\n num = tempN % 26\n if num == 0:\n num = 26\n name += chr(num + 96)\n tempN = (tempN - num)//26\n\nprint(name[::-1])']
['Wrong Answer', 'Accepted']
['s085702645', 's200675400']
[10064.0, 9080.0]
[85.0, 33.0]
[183, 183]
p02629
u095403885
2,000
1,048,576
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?"
["n = int(input())\ndef a(n):\n print(n)\n word = ''\n while n:\n a ,b = divmod(n, 26)\n print(a, b)\n if b == 0:\n word += (chr(96 + 26))\n n = a - 1\n else:\n word += (chr(96 + b))\n n = a\n print(word[::-1])\n print('---------')\n\nfor l in range(n+1):\n a(l)", "n = int(input())\nword = ''\nwhile n:\n a ,b = divmod(n, 26)\n if b == 0:\n word += (chr(96 + 26))\n n = a - 1\n else:\n word += (chr(96 + b))\n n = a\nprint(word[::-1])"]
['Wrong Answer', 'Accepted']
['s586309094', 's932087641']
[31952.0, 9172.0]
[2283.0, 34.0]
[333, 196]
p02629
u101113363
2,000
1,048,576
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?"
['N=int(input())\ndef kore(num):\n if num<=26:\n return chr(64+num)\n elif num%26==0:\n return num2alpha(num//26-1)+chr(90)\n else:\n return num2alpha(num//26)+chr(64+num%26)\ns=kore(N)\ns.lower()\nprint(s)', 'N=int(input())\ndef kore(num):\n if num<=26:\n return chr(64+num)\n elif num%26==0:\n return kore(num//26-1)+chr(90)\n else:\n return kore(num//26)+chr(64+num%26)\ns=kore(N)\ns=s.lower()\nprint(s)\n']
['Runtime Error', 'Accepted']
['s667757853', 's456542196']
[9168.0, 9104.0]
[30.0, 28.0]
[224, 217]
p02629
u101350975
2,000
1,048,576
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?"
["import string\nimport itertools\nn = int(input())\nl = list(string.ascii_lowercase)\nl.insert(0, 0)\n\namari = []\nwhile n != 0:\n amari.append(n % 26)\n n = n // 26\namari.reverse()\nanswer_list = []\nfor i in amari:\n if isinstance(i, str):\n answer_list.append(l[i])\nans = ''.join(answer_list)\nprint(ans)\n", "import string\nimport itertools\nn = int(input())\ns = n\nl = list(string.ascii_lowercase)\ncount = 1\nfor i in range(1, 100):\n s -= 26 ** i\n if s <= 0:\n break\n else:\n count += 1\nn_list = []\nanswer = []\nfor i in reversed(range(1, count+1)):\n number = min(26, n // 26 ** (i-1))\n n -= number * 26 ** (i-1)\n n_list.append(number)\nn_l = []\nfor i, x in enumerate(reversed(n_list)):\n if x <= 0:\n n_l.append(x + 26)\n n_list[-(i+2)] -= 1\n else:\n n_l.append(x)\nfor i in reversed(n_l):\n answer.append(l[i-1])\nprint(''.join(answer))\n"]
['Wrong Answer', 'Accepted']
['s640721498', 's131778227']
[9832.0, 9920.0]
[41.0, 37.0]
[310, 579]
p02629
u106181248
2,000
1,048,576
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?"
['n = int(input())\nans = ""\n\nwhile n > 0:\n n -= 1\n ans += chr(ord(\'a\') + n % 26)\n n //= 26\n print(n)\n\nprint(ans[::-1])', 'n = int(input())\nans = ""\n\nwhile n > 0:\n n -= 1\n ans += chr(ord(\'a\') + n % 26)\n n //= 26\n\nprint(ans[::-1])']
['Wrong Answer', 'Accepted']
['s377846436', 's614796009']
[9004.0, 9100.0]
[27.0, 30.0]
[128, 115]
p02629
u107494228
2,000
1,048,576
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?"
['import math\nn=int(input())\na=[]\ny=int(math.log(n,26))\nfor i in range(y+1):\n a.append(n%(26**(i+1)))\nfor i in range(y+1):\n a[i]=a[i]//(26**i)\na.reverse()\nprint(a,y)\nq=[\'a\', \'b\', \'c\', \'d\', \'e\', \'f\', \'g\', \'h\', \'i\', \'j\', \'k\', \'l\', \'m\', \'n\', \'o\', \'p\', \'q\', \'r\', \'s\', \'t\', \'u\', \'v\', \'w\', \'x\', \'y\', \'z\']\nfor i in range(y+1):\n print(q[a[i]-1],end="")', 'import math\nn=int(input())\na=[]\ny=math.log(((n*25)/26)+1,26)\n#print(y)\nif(y%1==0):\n print(\'z\'*int(y))\nelse:\n y=math.ceil(y)\n for i in range(y):\n a.append(n%(26**(i+1)))\n#print(a)\n for i in range(y):\n a[i]=a[i]//(26**(i))\n a.reverse()\n#print(a,y)\n q=[\'a\', \'b\', \'c\', \'d\', \'e\', \'f\', \'g\', \'h\', \'i\', \'j\', \'k\', \'l\', \'m\', \'n\', \'o\', \'p\', \'q\', \'r\', \'s\', \'t\', \'u\', \'v\', \'w\', \'x\', \'y\', \'z\'] \n for i in range(y):\n print(q[a[i]-1],end="")', 'import math\nn=int(input())\na=[]\ny=math.log(((n*25)/26)+1,26)\n#print(y)\nif(y%1==0):\n print(\'z\'*int(y))\nelse:\n for i in range(y):\n a.append(n%(26**(i+1)))\n#print(a)\n for i in range(y):\n a[i]=a[i]//(26**(i))\n a.reverse()\n#print(a,y)\n q=[\'a\', \'b\', \'c\', \'d\', \'e\', \'f\', \'g\', \'h\', \'i\', \'j\', \'k\', \'l\', \'m\', \'n\', \'o\', \'p\', \'q\', \'r\', \'s\', \'t\', \'u\', \'v\', \'w\', \'x\', \'y\', \'z\'] \n for i in range(y+1):\n print(q[a[i]-1],end="")', 'import math\nn=int(input())\na=[]\ny=int(math.log(n,26))\nfor i in range(y+1):\n a.append(n%(26**(i+1)))\nfor i in range(y+1):\n a[i]=a[i]//(26**i)\na.reverse()\n#print(a,y)\nq=[\'a\', \'b\', \'c\', \'d\', \'e\', \'f\', \'g\', \'h\', \'i\', \'j\', \'k\', \'l\', \'m\', \'n\', \'o\', \'p\', \'q\', \'r\', \'s\', \'t\', \'u\', \'v\', \'w\', \'x\', \'y\', \'z\']\nfor i in range(y+1):\n print(q[a[i]-1],end="")', 'import math\nn=int(input())\na=[]\ny=math.ceil(math.log(((n*25)/26)+1,26))\nfor i in range(y):\n a.append(n%(26**(i+1)))\n if(n%(26**(i+1))!=0):\n n=n-n%(26**(i+1))\n else:\n n=n-26**(i+1)\na.reverse()\n#print(a,y)\nq=[\'a\', \'b\', \'c\', \'d\', \'e\', \'f\', \'g\', \'h\', \'i\', \'j\', \'k\', \'l\', \'m\', \'n\', \'o\', \'p\', \'q\', \'r\', \'s\', \'t\', \'u\', \'v\', \'w\', \'x\', \'y\', \'z\'] \nfor i in range(y):\n print(q[a[i]-1],end="")', 'import math\nn=int(input())\na=[]\ny=math.log(((n*25)/26)+1,26)\n#print(y)\nif(y%1==0):\n print(\'z\'*int(y))\nelse:\n y=math.ceil(y)\n for i in range(y):\n a.append(n%(26**(i+1)))\n#print(a)\n for i in range(y):\n a[i]=a[i]//(26**(i))\n a.reverse()\n#print(a,y)\n q=[\'a\', \'b\', \'c\', \'d\', \'e\', \'f\', \'g\', \'h\', \'i\', \'j\', \'k\', \'l\', \'m\', \'n\', \'o\', \'p\', \'q\', \'r\', \'s\', \'t\', \'u\', \'v\', \'w\', \'x\', \'y\', \'z\'] \n for i in range(y+1):\n print(q[a[i]-1],end="")', "n=int(input())\ns='zabcdefghijklmnopqrstuvwxy'\na=''\nwhile(int(n)>0):\n t=n%26\n if t==0:\n n-=26\n a=s[t]+a\n n=n//26\nprint(a)"]
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted']
['s706352785', 's818191683', 's826804931', 's871032285', 's894325145', 's974630278', 's973401571']
[9216.0, 9176.0, 9144.0, 9188.0, 9160.0, 9288.0, 9100.0]
[28.0, 30.0, 28.0, 29.0, 30.0, 27.0, 28.0]
[351, 449, 434, 352, 409, 451, 159]
p02629
u111473084
2,000
1,048,576
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?"
['def main():\n import sys\n sys.setrecursionlimit(10**9)\n input = sys.stdin.readline\n\n a = "zabcdefghijklmnopqrstuvwxy"\n N = int(input())\n if N <= 26:\n print(a[N%26])\n\n ans = []\n d = 1\n m = 26\n while N != 0:\n tmp = (N % m)\n ans.append(a[tmp//d])\n N -= tmp if tmp != 0 else m\n d *= 26\n m *= 26\n if N <= 26:\n break\n \n ans.reverse()\n print(\'\'.join(ans))\n\nmain()', 'def main():\n import sys\n sys.setrecursionlimit(10**9)\n input = sys.stdin.readline\n\n a = "zabcdefghijklmnopqrstuvwxy"\n N = int(input())\n # if N <= 26:\n # print(a[N%26])\n # return\n\n ans = []\n d = 1\n m = 26\n while N != 0:\n tmp = (N % m)\n ans.append(a[tmp//d])\n N -= tmp if tmp != 0 else m\n d *= 26\n m *= 26\n \n ans.reverse()\n print(\'\'.join(ans))\n\nmain()']
['Wrong Answer', 'Accepted']
['s769341336', 's780423446']
[9032.0, 9148.0]
[30.0, 33.0]
[454, 437]
p02629
u111652094
2,000
1,048,576
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?"
["N=int(input())\n\n\nlista=[chr(i) for i in range(97, 97+26)]\nalphlist=[1]\nanslist=[]\nfor i in range(1,12):\n if i==1:\n a=alphlist[i-1]+26**i-1\n else:\n a=alphlist[i-1]+26**i\n alphlist.append(a)\n\nfor i in range(12):\n if N<=alphlist[i]:\n keta=i\n break\na=keta\nNi=N\nfor i in range(a):\n Ni=Ni-sum(alphlist[0:a-i-1])+1\n at=Ni//alphlist[a-i-1]-2\n Ni=Ni-(at+1)*alphlist[a-i-1]\n print(Ni,at)\n anslist.append(lista[at])\nprint(''.join(anslist))", '\nN = int(input())\n\nans = ""\nwhile N > 0:\n N-=1 \n ans += chr(ord(\'a\') + N%26) #chr: Unicode to character, ord:character to Unicode\n N//=26 #next power of 26\n\nprint(ans[::-1]) #sort reverse\n']
['Runtime Error', 'Accepted']
['s631775830', 's855523844']
[9228.0, 9160.0]
[31.0, 29.0]
[483, 269]
p02629
u112247039
2,000
1,048,576
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?"
["def conv(n):\n if (n>26):\n conv(n//26)\n print('z' if n%26==0 else chr(96+(n%26)), end='')\nconv(int(input()))", "def conv(n):\n if (n>25):\n conv(n//26)\n print(chr(96+(n%26)), end='')\nconv(int(input()))", 'n = int(input())\nstock = [chr(i) for i in range(97, 97 + 26)]\nfull, count, j = 26, 1, 1\nwhile (count + full <= n):\n count += full; j += 1; full *= 26\nq = n - count\ns = []\nfor k in range(j):\n s.append(stock[q % 26])\n q //= 26\nprint("".join(s[::-1]))']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s114580096', 's893304790', 's746279131']
[9060.0, 9044.0, 8976.0]
[29.0, 31.0, 29.0]
[120, 100, 263]
p02629
u113255362
2,000
1,048,576
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?"
['a=int(input())\nK = 0\nb = 0\nList = [27]*13\nres = ""\nfor i in range(0,12):\n K = a % 26\n b = a-K\n a = b/26\n List[i] = int(K)\nfor i in range(13):\n if List[12-i] ==27:\n pass\n elif List[12-i] ==0:\n res += chr(26+96)\n else:\n res += chr(List[12-i]+96)\nprint(res)', 'a=int(input())\nK = 0\nb = 0\nList = [27]*13\nres = ""\nfor i in range(12):\n K = a % 26\n List[i] = int(K)\n b = a-K\n if b >26:\n a = b/26\n else:\n break\nfor i in range(13):\n if List[12-i] ==27:\n pass\n elif List[12-i] ==0:\n res += chr(26+96)\n else:\n res += chr(List[12-i]+96)\nprint(List,res)', 'a=int(input())\nK = 0\nb = 0\nList = [27]*13\nres = ""\nfor i in range(12):\n K = a % 26\n if K ==0:\n K=26\n List[i] = int(K)\n b = a-K\n if b >=26:\n a = b/26\n else:\n break\nfor i in range(13):\n if List[12-i] ==27:\n pass\n else:\n res += chr(List[12-i]+96)\nprint(res)']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s123344497', 's986664077', 's655141905']
[9184.0, 9208.0, 9204.0]
[31.0, 30.0, 29.0]
[270, 305, 277]
p02629
u114954806
2,000
1,048,576
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?"
["import string\n\ndef main():\n N=int(input())\n alphabet = string.ascii_lowercase\n a = [26**(12-i) for i in range(12)]\n ans = []\n print(a)\n for i in range(12):\n if N > a[i]:\n if N // a[i] == 0:\n continue\n tmp = N // a[i]\n N -= (a[i]*tmp)\n ans.append(alphabet[tmp-1])\n ans.append(alphabet[N-1])\n print(''.join(ans))\n\nmain()", "from string import ascii_lowercase\n\ndef main():\n N=int(input())\n alphabet = ascii_lowercase\n ans = ''\n while N>0:\n N -= 1\n ans += alphabet[N%26]\n N//=26\n print(ans[::-1])\n\nmain()\n"]
['Wrong Answer', 'Accepted']
['s588726516', 's406321925']
[9980.0, 9948.0]
[38.0, 39.0]
[408, 215]
p02629
u116038906
2,000
1,048,576
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?"
['\n#url http://iatlex.com/python/base_change\ndef Base_10_to_n(X, n):\n if (int(X/n)):\n return Base_10_to_n(int(X/n), n)+" "+str(X%n)\n return str(X%n)\n############################\n\n\nimport sys\ninput = sys.stdin.readline\nN = int(input())\n\n\nx26 = Base_10_to_n(N-1, 26) \nx26_list =x26.split()\nint_str =["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]\n\n\nif x26_list[0] =="1":\n del x26_list[0]\nans =""\nfor i in range(len(x26_list)-1):\n a =x26_list[i]\n x =int_str[int(a)-1]\n ans +=x\nans +=int_str[int(x26_list[-1])]\nans_list =list(ans)\n\nprint(ans)', '\n#url http://iatlex.com/python/base_change\ndef Base_10_to_n(X, n):\n if (int((X-1)/n)):\n return Base_10_to_n(int((X-1)/n), n)+" "+str((X-1)%n)\n return str(X%n)\n############################\n\n\nimport sys\ninput = sys.stdin.readline\nN = int(input())\n\n\nx26 = Base_10_to_n(N, 26) \nx26_list =list(x26.split())\n#x26_list.remove(" ")\nint_str =["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]\n\n\nans =""\nif len(x26_list) ==1:\n ans +=int_str[int(x26_list[0])-1]\nelse:\n ans +=int_str[int(x26_list[0])-1]\n\n for i in range(1,len(x26_list)):\n a =x26_list[i]\n x =int_str[int(a)]\n ans +=x\n\nprint(ans)']
['Runtime Error', 'Accepted']
['s210883039', 's476426596']
[9072.0, 9184.0]
[32.0, 28.0]
[702, 764]
p02629
u116107171
2,000
1,048,576
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?"
["N = input()\nN = int(N)\nname = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']\n\nS = 1\ni = 0\nSum = 0\nwhile Sum<N:\n S *= 26\n Sum += S\n i = i+1\n\nans = []\nfor j in range(i):\n N -= 1\n r = N%26\n ans.insert(0, name[r])\n N = N//26\n\nans = ''.join(ans)\nprint(ans)\n\n\n", "N = input()\nN = int(N)\nname = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']\n\nS = 1\ni = 0\nSum = 0\nwhile Sum<N:\n S *= 26\n Sum += S\n i = i+1\n\nans = []\nfor j in range(i):\n \tN -= 1\n r = N%26\n ans.insert(0, name[r])\n N = N//26\n\nans = ''.join(ans)\nprint(ans)\n\n\n", "N = input()\nN = int(N)\nname = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']\n\nS = 1\ni = 0\nSum = 0\nwhile Sum<N:\n S *= 26\n Sum += S\n i = i+1\n\nans = []\nfor j in range(i):\n N = N-1\n r = N%26\n ans.insert(0, name[r])\n N = N//26\n\nans = ''.join(ans)\nprint(ans)\n\n\n", "N = input()\nN = int(N)\nname = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']\n\nS = 1\ni = 0\nSum = 0\nwhile Sum<N:\n S *= 26\n Sum += S\n i = i+1\n\nans = []\nfor j in range(i):\n \tN -= 1\n r = N%26\n ans.insert(0, name[r])\n N = N//26\n\nans = ''.join(ans)\nprint(ans)\n\n\n", "N = input()\nN = int(N)\nname = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']\n\nS = 1\ni = 0\nSum = 0\nwhile Sum<N:\n S *= 26\n Sum += S\n i = i+1\n\nans = []\nfor j in range(i):\n \tN = N-1\n r = N%26\n ans.insert(0, name[r])\n N = N//26\n\nans = ''.join(ans)\nprint(ans)\n\n\n", "N = input()\nN = int(N)\nname = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']\n\nS = 1\ni = 0\nSum = 0\nwhile Sum<N:\n S *= 26\n Sum += S\n i = i+1\n\n\nans = []\nfor j in range(i):\n N -= 1\n r = N%26\n ans.insert(0, name[r])\n N = N//26\n\nans = ''.join(ans)\nprint(ans)\n"]
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s079564509', 's107816805', 's256308558', 's304126036', 's850266459', 's246961190']
[9072.0, 8952.0, 8936.0, 9060.0, 8928.0, 9104.0]
[27.0, 25.0, 27.0, 27.0, 32.0, 30.0]
[357, 358, 358, 358, 359, 358]
p02629
u117054186
2,000
1,048,576
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?"
["ii = lambda : int(input())\nmi = lambda : map(int,input().split())\nli = lambda : list(map(int,input().split()))\n\nn = ii()\n\nal = [1]\nnc = 0\n\ndef ntow(x):\n if x == 0:\n return 'z'\n v = chr(ord('a')+x-1)\n # print(x,v)\n return v\n\nfor i in range(1,15):\n nc += 26 ** i\n al.append(nc+1)\n if nc > 1000000000000001:\n break\n\n# print(al)\n\nfor i in range(15):\n if n < al[i]:\n keta = i\n break\n\nprint('keta',keta)\nans = ''\n\nfor i in range(keta):\n tmp = 26**(i+1)\n # print('tmp',tmp)\n nk = n%tmp\n if nk == 0:\n ans = 'z' + ans\n n -= tmp\n else:\n # print(nk//(26**i))\n ans = ntow(nk//(26**i)) + ans\n n -= nk\n\nprint(ans)\n\n\n\n\n\n\n\n", "ii = lambda : int(input())\nmi = lambda : map(int,input().split())\nli = lambda : list(map(int,input().split()))\n\nn = ii()\n\nal = [1]\nnc = 0\n\ndef ntow(x):\n if x == 0:\n return 'z'\n v = chr(ord('a')+x-1)\n # print(x,v)\n return v\n\nfor i in range(1,15):\n nc += 26 ** i\n al.append(nc+1)\n if nc > 1000000000000001:\n break\n\n# print(al)\n\nfor i in range(15):\n if n < al[i]:\n keta = i\n break\n\n\nans = ''\n\nfor i in range(keta):\n tmp = 26**(i+1)\n # print('tmp',tmp)\n nk = n%tmp\n if nk == 0:\n ans = 'z' + ans\n n -= tmp\n else:\n # print(nk//(26**i))\n ans = ntow(nk//(26**i)) + ans\n n -= nk\n\nprint(ans)\n\n\n\n\n\n\n\n"]
['Wrong Answer', 'Accepted']
['s699151340', 's435407057']
[9168.0, 9040.0]
[36.0, 33.0]
[711, 713]
p02629
u119982001
2,000
1,048,576
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?"
["from math import log\n\nN = int(input())\n\nprint(ord('a'), chr(97), chr(122))\n\nbase = 96\nroop = int(log(N, 26)) + 1\nans = ['']*roop\ntmp = N\n\n\nfor i in range(roop):\n rem = tmp % 26 \n ans[i] = chr(base+rem)\n tmp //= 26\n\nans.reverse()\nprint(''.join(ans))\n", "from math import log\nN = int(input())\n\nbase = 96\nroop = 0\ntmp = 1\nwhile 1:\n roop += 1\n if 26**roop + tmp > N:\n break\n tmp += 26**roop\nans = ['']*roop\ntmp = N\n\nfor i in range(roop):\n if tmp%26 == 0:\n print(11)\n rem = tmp % 26\n print(base+rem)\n ans[i] = chr(base+rem+26)\n tmp *= 26\n else:\n print(00)\n rem = tmp % 26\n print(base+rem)\n ans[i] = chr(base+rem)\n \n tmp //= 26\nans.reverse()\nprint(''.join(ans))\n", 'n = int(input())\ns = ""\n\nwhile n > 0:\n n -= 1\n s += chr( n % 26 + ord(\'a\') )\n n //= 26\n \nprint(s[::-1])\n']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s053689383', 's875884867', 's923727663']
[9176.0, 9212.0, 9152.0]
[33.0, 32.0, 33.0]
[258, 498, 120]
p02629
u127499732
2,000
1,048,576
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?"
["def main():\n n = int(input())\n n -= 1\n res = ''\n while n:\n n, m = divmod(n, 26)\n res += chr(97 + m)\n n -= 1\n\n print(res[::-1])\n\n\nif __name__ == '__main__':\n main()\n", "def main():\n n = int(input())\n n -= 1\n res = ''\n while n >= 0:\n n, m = divmod(n, 26)\n res += chr(97 + m)\n n -= 1\n\n print(res[::-1])\n\n\nif __name__ == '__main__':\n main()\n"]
['Wrong Answer', 'Accepted']
['s549828583', 's956400240']
[20716.0, 9172.0]
[2206.0, 29.0]
[203, 208]
p02629
u129611040
2,000
1,048,576
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?"
["N = int(input())\nans = ''\nwhile N > 0:\nN -= 1\nans += chr(ord('a') + N % 26)\nN //= 26\nprint(ans[::-1])", "N = int(input())\nans = ''\nwhile N > 0:\n N -= 1\n ans += chr(ord('a') + N % 26)\n N //= 26\nprint(ans[::-1])"]
['Runtime Error', 'Accepted']
['s934194124', 's540635298']
[8888.0, 9072.0]
[24.0, 31.0]
[101, 113]
p02629
u135116520
2,000
1,048,576
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?"
['N=int(input())\nchars="Xabcdefghijklmnopqrstuvwxyz")\nres=""\nn_rem=N\nwhile True:\n x=n_rem%26\n if x==0:\n x=26\n res+=chars[x]\n n_rem-=x\n if n_rem==0:\n break\n n_rem//=26\nprint(res[::-1])\n \n ', 'N=int(input())\nchars="Xabcdefghijklmnopqrstuvwxyz")\nN_rem=N\nres=""\nwhile True:\n x=N_rem%26\n if x==0:\n x=26\n res+=chars[x]\n N_rem-=x\n if N-rem==0:\n break\n N_rem//=26\nprint(res[::-1])\n ', 'N=int(input())\nchars="Xabcdefghijklmnopqrstuvwxyz"\nres=""\nn_rem=N\nwhile True:\n x=n_rem%26\n if x==0:\n x=26\n res+=chars[x]\n n_rem-=x\n if n_rem==0:\n break\n n_rem//=26\nprint(res[::-1])']
['Runtime Error', 'Runtime Error', 'Accepted']
['s090218623', 's540786270', 's184951005']
[8748.0, 9008.0, 9180.0]
[25.0, 25.0, 28.0]
[201, 196, 192]
p02629
u135454978
2,000
1,048,576
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?"
["import sys\n\nN = int(input())\n\nalpha = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n',\n 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']\n\nans = []\nfor I in range(12):\n I = 10 - I\n k = sum([26 ** i for i in range(I + 1)])\n # print(f'k : {k}')\n if N >= k:\n # print(f'I: {I}')\n n = N // (26 ** I)\n if n == 27:\n n = 26\n N = N - (26 ** I) * n\n # print(f'n: {n}')\n # print(n)\n ans.append(alpha[int(n - 1)])\n else:\n if ans:\n ans.append('a')\nprint(''.join(ans))\n\n", "import sys\n\nN = int(input())\n\nalpha = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n',\n 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']\n\nans = []\n\nfor i in range(11):\n N -= 1\n if N < 0:\n break\n ans.append(alpha[N % 26])\n N //= 26\n\nprint(''.join(ans[::-1]))\n"]
['Wrong Answer', 'Accepted']
['s230254188', 's693552517']
[9208.0, 9164.0]
[31.0, 29.0]
[589, 318]
p02629
u136090046
2,000
1,048,576
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?"
['def Base_10_to_n(X, n):\n X_dumy = X\n out = []\n while X_dumy > 0:\n out.append(X_dumy % n)\n X_dumy = int(X_dumy / n)\n return out\n\nn = int(input())\nd = {y: x for x, y in zip("abcdefghijklmnopqrstuvwxyz", range(1, 27))}\n\nres = []\nprint(Base_10_to_n(n, 26))\narray = Base_10_to_n(n, 26)\nfor index in range(len(array)):\n a = array[index]\n if a == 0:\n res.append("z")\n array[index] = 26\n if index + 1 >= len(array):continue\n array[index+1] = 0\n\nprint("".join([d[x] for x in array[::-1]]))', 'def Base_10_to_n(X, n):\n X_dumy = X\n out = []\n while X_dumy > 0:\n X_dumy-=1\n out.append(X_dumy % n)\n X_dumy = int(X_dumy / n)\n return out\n\nn = int(input())\nd = {y: x for x, y in zip("abcdefghijklmnopqrstuvwxyz", range(26))}\n\nres = []\narray = Base_10_to_n(n, 26)\n\nprint("".join([d[x] for x in array[::-1]]))']
['Wrong Answer', 'Accepted']
['s143342397', 's793691153']
[9040.0, 9204.0]
[32.0, 31.0]
[540, 339]
p02629
u137061893
2,000
1,048,576
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?"
['def find_j(h):\n p = []\n psum = 0\n for i in range(13):\n pi = 26**i\n psum += pi\n p.append(psum)\n \n n_p = len(p)\n for i in range(n_p):\n if p[i] > h:\n return i\n return 1\n\ndef find_k(h, j):\n n_block = 26**j\n \n for i in range(1,27):\n div_fin = n_block // 26 * i\n if h <= div_fin:\n return i\n\ndef main():\n n = int(input())\n \n alp_ = "abcdefghijklmnopqrstuvwxyz"\n alp = [alp_[i] for i in range(26)]\n \n h = n\n j = find_j(h)\n h = h - (26**j - 1)//25 + 1\n k = j\n ans = ""\n #print(h,k)\n \n for _ in range(j):\n k = find_k(h, j)\n ans = ans + alp[k-1]\n h = h - 26**(j-1) * (k - 1)\n j -= 1\n #print(h,k)\n \n print(ans)', 'def find_j(h):\n p = []\n psum = 0\n for i in range(13):\n pi = 26**i\n psum += pi\n p.append(psum)\n \n n_p = len(p)\n for i in range(n_p):\n if p[i] > h:\n return i\n return 1\n\ndef find_k(h, j):\n n_block = 26**j\n \n for i in range(1,27):\n div_fin = n_block // 26 * i\n if h <= div_fin:\n return i\n\ndef main():\n n = int(input())\n \n alp_ = "abcdefghijklmnopqrstuvwxyz"\n alp = [alp_[i] for i in range(26)]\n \n h = n\n j = find_j(h)\n h = h - (26**j - 1)//25 + 1\n k = j\n ans = ""\n #print(h,k)\n \n for _ in range(j):\n k = find_k(h, j)\n ans = ans + alp[k-1]\n h = h - 26**(j-1) * (k - 1)\n j -= 1\n #print(h,k)\n \n print(ans)\n\nif __name__ == "__main__":\n main()']
['Wrong Answer', 'Accepted']
['s071447125', 's995048053']
[9096.0, 9060.0]
[27.0, 27.0]
[772, 811]
p02629
u143322814
2,000
1,048,576
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?"
['import sys\nsys.setrecursionlimit(10 ** 9)\n\nconvert = {\n 1:\'a\',\n 2:\'b\',\n 3:\'c\',\n 4:\'d\',\n 5:\'e\',\n 6:\'f\',\n 7:\'g\',\n 8:\'h\',\n 9:\'i\',\n 10:\'j\',\n 11:\'k\',\n 12:\'l\',\n 13:\'m\',\n 14:\'n\',\n 15:\'o\',\n 16:\'p\',\n 17:\'q\',\n 18:\'r\',\n 19:\'s\',\n 20:\'t\',\n 21:\'u\',\n 22:\'v\',\n 23:\'w\',\n 24:\'x\',\n 25:\'y\',\n 26:\'z\',\n}\ndef Base_n_to_10(X, n):\n if (int(X/n)):\n return Base_n_to_10(int(X/n), n)+str(X%n)\n return str(X%n)\n\ndef main():\n r = []\n n = int(input())\n print(divmod(n, 26))\n while True:\n n -= 1\n r.append(n % 26)\n n = n // 26\n if n == 0: break\n print(r)\n for i in r[::-1]:\n print(convert[i+1], end=\'\')\n print()\nif __name__ == "__main__":\n main()', 'import sys\nsys.setrecursionlimit(10 ** 9)\n\nconvert = {\n 1:\'a\',\n 2:\'b\',\n 3:\'c\',\n 4:\'d\',\n 5:\'e\',\n 6:\'f\',\n 7:\'g\',\n 8:\'h\',\n 9:\'i\',\n 10:\'j\',\n 11:\'k\',\n 12:\'l\',\n 13:\'m\',\n 14:\'n\',\n 15:\'o\',\n 16:\'p\',\n 17:\'q\',\n 18:\'r\',\n 19:\'s\',\n 20:\'t\',\n 21:\'u\',\n 22:\'v\',\n 23:\'w\',\n 24:\'x\',\n 25:\'y\',\n 26:\'z\',\n}\ndef Base_n_to_10(X, n):\n if (int(X/n)):\n return Base_n_to_10(int(X/n), n)+str(X%n)\n return str(X%n)\n\ndef main():\n r = []\n n = int(input())\n while True:\n n -= 1\n r.append(n % 26)\n n = n // 26\n if n == 0: break\n for i in r[::-1]:\n print(convert[i+1], end=\'\')\n print()\nif __name__ == "__main__":\n main()']
['Wrong Answer', 'Accepted']
['s428170002', 's451124157']
[9180.0, 9200.0]
[29.0, 28.0]
[764, 726]
p02629
u145600939
2,000
1,048,576
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?"
["import sys\nstdin = sys.stdin\nsys.setrecursionlimit(10**6)\nni = lambda: int(ns())\nna = lambda: list(map(int, stdin.readline().split()))\nnn = lambda: list(stdin.readline().split())\nns = lambda: stdin.readline().rstrip()\n\nn = ni()\n\ndef f(k):\n return chr(97+k)\n\nc = 0\ni = 1\nwhile True:\n d = c+pow(26,i)\n if c < n <= d:\n break\n c = d\n i+=1\n\nm = n-c-1\nans = ''\nfor _ in range(i)\n ans = f(m%26) + ans\n m = m//26\nans = f(m%26) + ans\n\n\n\nprint(ans)\n", "n = int(input())\ni = 1\nwhile pow(26,i) < n:\n n -= pow(26,i)\n i += 1\nans = ''\nn -= 1\nfor _ in range(i):\n ans += chr(ord('a') + n%26)\n n //= 26\nprint(ans[::-1])\n"]
['Runtime Error', 'Accepted']
['s236710074', 's755813982']
[9072.0, 9196.0]
[28.0, 30.0]
[497, 171]