Problem: 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?"

Submission attempts (in order):
N = int(input())
count = 0
ans = list()
r = 0
alp = ['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']

while N > 26**count:
    count+=1

count = count - 1

while count > 0:
    A = N % 26
    B = N // 26
    ans.append(A)
    N = B
    count = count - 1

#print(N)
A = N % 26
B = N // 26

if B == 0:
    ans.append(A-1)
    ans.append(9)
else:
    ans.append(A)
    ans.append(B-1)

#print(ans)

for i in range(0, len(ans)):
    ans[i] = alp[ans[i]]

#print(ans)

print(''.join(ans))

N = int(input())
count = 0
ans = list()
r = 0
alp = ['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']

while N > 26**count:
    count+=1

count = count - 1
#print(count)

while count > 0:
    N = N - 26**count
    count = count - 1

#print(N)

N = N - 1
A = 1
while A != 0:
    A = N // 26
    B = N % 26
    ans.append(B)
    N = A

#print(ans)

while len(ans) < count + 2:
    ans.append(0)

#print(N)
#print(ans)
ans.reverse()
#print(ans)

for i in range(0, len(ans)):
    ans[i] = alp[ans[i]]

#print(ans)

print(''.join(ans))

N = int(input())
count = 0
ans = list()
r = 0
alp = ['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']

while N > 26**count:
    count+=1

count = count - 1
#print(count)

while count != 0:
    N = N - 26**count
    count = count - 1

#print(N)

N = N - 1
A = 1
while A != 0:
    A = N // 26
    B = N % 26
    ans.append(B)
    N = A


while len(ans) == count + 1:
    ans.append(0)

#print(N)
#print(ans)
ans.reverse()
#print(ans)

for i in range(0, len(ans)):
    ans[i] = alp[ans[i]]

print(ans)

print(''.join(ans))

N = int(input())
count = 0
ans = list()
r = 0
alp = ['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']
d = -1


while N > 26**count + d:
    count+=1
    d = 26**(count-1) + d

#print(count)
count = count - 1
count2 = count

while count > 0:
    #print(N)
    N = N - 26**count
    #print(N)
    count = count - 1

#print(N)
#print(N)
N = N - 1
#print(N)
A = 1
while N > 0:
    A = N // 26
    B = N % 26
    #print(ans)
    ans.append(B)
    #print(ans)
    N = A

#print(ans)
#print(len(ans))
#print(count2+1)

while len(ans) < count2 + 1:
    ans.append(0)
    #print(len(ans))

#print(N)
#print(len(ans))
#print(ans)
ans.reverse()
#print(ans)

for i in range(0, len(ans)):
    ans[i] = alp[ans[i]]

#print(ans)

print(''.join(ans))

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted