Problem:


Score : 300 points

Problem Statement

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

Constraints

N is an integer.

 1 \leq N \leq 1000000000000001

Input

Input is given from Standard Input in the following format:

N

Output

Print the answer to Roger's question as a string consisting of lowercase English letters.

Sample Input 1

2

Sample Output 1

b

Sample Input 2

27

Sample Output 2

aa

Sample Input 3

123456789

Sample Output 3

jjddja



Sample input:
2


Sample output:
b

Submission status: Wrong Answer

Solution code:
import string
characters = "0" + string.ascii_lowercase
 
def base_cvt(value, n):
    try:
        tmp = int(value)
    except:
        raise ValueError('Invalid value:', value)
 
    if n < 2 or n > len(characters):
        raise ValueError('Invalid n:', value)
 
    result = ''
    tmp = int(value)
    while tmp >= n:
        idx = tmp%n
        result = characters[idx] + result
        tmp = int(tmp / n)
    idx = tmp%n
    result = characters[idx] + result
    return result
  
def test_base(self):
    self.assertEqual('0', n_ary.base_cvt('0'))
    self.assertEqual('1', n_ary.base_cvt('1'))
    self.assertEqual('101', n_ary.base_cvt('5'))
    self.assertEqual('1010', n_ary.base_cvt('10'))
    self.assertEqual('10000', n_ary.base_cvt('16'))
 
    value = '10000000'
 
    self.assertEqual('46113200', n_ary.base_cvt(value, 8))
    self.assertEqual('989680', n_ary.base_cvt(value, 16))
    self.assertEqual('5yc1s', n_ary.base_cvt(value, 36))
    self.assertEqual('FXsk', n_ary.base_cvt(value, 62))
     
    # エラー処理
    with self.assertRaises(ValueError):
        # 数字以外だとエラー
        v = n_ary.base_cvt('hoge')
    with self.assertRaises(ValueError):
        # 62進数以上を出そうとするとエラー
        v = n_ary.base_cvt('1000000', 63)
    with self.assertRaises(ValueError):
        # 1以下でもエラー
        v = n_ary.base_cvt('1000000', 1)
 
input = int(input())-1
#print(input)

    # 一覧出力してみる
ans = base_cvt(input, 26)

#print (ans)

anslen = len(ans)
#print(ans[anslen-1])

ans_list = list(ans)

for i in range (26):
    if(ans_list[anslen-1] == characters[i]):
        ans_list[anslen-1] = characters[i+1]
        break

ans = "".join(ans_list)        

print(ans)

Submission status: Wrong Answer

Solution code:
num_list = [0]
x = 1
y = 0
while y <= 1000000000000001:
    y += 26**x
    num_list.append(y)
    x += 1
#print(num_list)
n = int(input())
if n in num_list:
    ans = ['z']*num_list.index(n)
    print(''.join(ans))
    exit()
after = 0
while n > num_list[after]:
    after += 1

before = after - 1

check = n - num_list[before]

count = []
for j in range(before,0,-1):
    #print(check//(26**j))
    count.append(check//(26**j))
    check = check%(26**j)
count.append(check-1)
#print(count)
alphabet = [chr(i) for i in range(97, 97+26)]
ans = []
for i in range(len(count)):
    #print(i)
    #print(ans)
    #print(count[i])
    if i == len(count)-1 and count[i] == -1:
        ans.append('z')
    elif i == len(count)-1 and count[i] != -1:
        ans.append(alphabet[count[i]])
    else:
        ans.append(alphabet[count[i]])
print(''.join(ans))

Submission status: Wrong Answer

Solution code:
n = int(input())-1

ans = []
while n >= 0:
    n, y = divmod(n, 26)
    ans.append(y)
    n -= 1
ans.reverse()
print(ans)


def to_alpha(x):
    return chr(x+ord('a'))


print(''.join(map(to_alpha, ans)))

Submission status: Wrong Answer

Solution code:
arr = [[1, 26], [27, 702], [703, 18278], [18279, 475254], [475255, 12356630], [12356631, 321272406], [321272407, 8353082582], [8353082583, 217180147158], [217180147159, 5646683826134], [5646683826135, 146813779479510], [146813779479511, 3817158266467286]]
alphabets = ['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 = int(input())

def solve(n):
    if n <= 26:
        return alphabets[n-1]
    
    x = n % 26
    return alphabets[x-1] + solve(n // 26)

print(solve(n)[::-1])

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
#-------------------------------------

n = int(input())-1
result = ""
v = 10

while(v>0):
    if n // (26**v) > 0:
        result += chr( n // (26**v) +96)
    n = n % (26**v)
    v -=1
result += chr(n+97)
print(result)

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(100000)

def base10_to_n(a, n):
    if a < n :
        return [a]
    rem = a % n
    div = int((a - rem) / n)
    return [rem] + base10_to_n(div, n)


N = int(input())

ans = base10_to_n(N, 26)
ans.reverse()
for c in ans:
    print(chr(ord('a') + int(c) - 1), end='')
print()

Submission status: Wrong Answer

Solution code:
N = int(input())

name = []
X = N
i = 1

while N > (26 ** i):
    i += 1

for j in range(i):
    char = chr(( X % 26 ) + 96)
    name.append(char)
    X = X // 26

name.reverse()


[print(i, end ='') for i in name]

Submission status: Wrong Answer

Solution code:
import math
a=[chr(i) for i in range(97, 97+26)]
N=int(input())
if N<=26:
    print(a[N-1])
elif 26<N<=26**2-26:
    print(a[math.floor(N/26)-1]+a[(N-1)%26])
elif 26**2-26<N<=26**3-26**2-26:
    print(a[math.floor(N/(26**2))-1]+a[math.floor(N/26-1)%26]+a[(N-1)%26])
elif 26**3-26**2-26<N<=26**4-26**3-26**2-26:
    print(a[math.floor(N/(26**3))-1]+a[math.floor(N/(26**2)-1)%26]+a[math.floor(N/26-1)%26]+a[(N-1)%26])
elif 26**4-26**3-26**2-26<N<=26**5-26**4-26**3-26**2-26:
     print(a[math.floor(N/(26**4))-1]+a[math.floor(N/(26**3)-1)%26]+a[math.floor(N/(26**2)-1)%26]+a[math.floor(N/26-1)%26]+a[(N-1)%26])
elif 26**5-26**4-26**3-26**2-26<N<=26**6-26**5-26**4-26**3-26**2-26:
     print(a[math.floor(N/(26**5))-1]+a[math.floor(N/(26**4)-1)%26]+a[math.floor(N/(26**3)-1)%26]+a[math.floor(N/(26**2)-1)%26]+a[math.floor(N/26-1)%26]+a[(N-1)%26])
elif 26**6-26**5-26**4-26**3-26**2-26<N<=26**7-26**6-26**5-26**4-26**3-26**2-26:
     print(a[math.floor(N/(26**6))-1]+a[math.floor(N/(26**5)-1)%26]+a[math.floor(N/(26**4)-1)%26]+a[math.floor(N/(26**3)-1)%26]+a[math.floor(N/(26**2)-1)%26]+a[math.floor(N/26-1)%26]+a[(N-1)%26])
elif 26**7-26**6-26**5-26**4-26**3-26**2-26<N<=26**8-26**7-26**6-26**5-26**4-26**3-26**2-26:
    print(a[math.floor(N/(26**7))-1]+a[math.floor(N/(26**6)-1)%26]+a[math.floor(N/(26**5)-1)%26]+a[math.floor(N/(26**4)-1)%26]+a[math.floor(N/(26**3)-1)%26]+a[math.floor(N/(26**2)-1)%26]+a[math.floor(N/26-1)%26]+a[(N-1)%26])
elif 26**8-26**7-26**6-26**5-26**4-26**3-26**2-26<N<=26**9-26**8-26**7-26**6-26**5-26**4-26**3-26**2-26:
    print(a[math.floor(N/(26**8))-1]+a[math.floor(N/(26**7)-1)%26]+a[math.floor(N/(26**6)-1)%26]+a[math.floor(N/(26**5)-1)%26]+a[math.floor(N/(26**4)-1)%26]+a[math.floor(N/(26**3)-1)%26]+a[math.floor(N/(26**2)-1)%26]+a[math.floor(N/26-1)%26]+a[(N-1)%26])
elif 26**9-26**8-26**7-26**6-26**5-26**4-26**3-26**2-26<N<=26**10-26**9-26**8-26**7-26**6-26**5-26**4-26**3-26**2-26:
    print(a[math.floor(N/(26**9))-1]+a[math.floor(N/(26**8)-1)%26]+a[math.floor(N/(26**7)-1)%26]+a[math.floor(N/(26**6)-1)%26]+a[math.floor(N/(26**5)-1)%26]+a[math.floor(N/(26**4)-1)%26]+a[math.floor(N/(26**3)-1)%26]+a[math.floor(N/(26**2)-1)%26]+a[math.floor(N/26-1)%26]+a[(N-1)%26])
else:
    if N<=1000000000000001:
         print(a[math.floor(N/(26**10))-1]+a[math.floor(N/(26**9)-1)%26]+a[math.floor(N/(26**8)-1)%26]+a[math.floor(N/(26**7)-1)%26]+a[math.floor(N/(26**6)-1)%26]+a[math.floor(N/(26**5)-1)%26]+a[math.floor(N/(26**4)-1)%26]+a[math.floor(N/(26**3)-1)%26]+a[math.floor(N/(26**2)-1)%26]+a[math.floor(N/26-1)%26]+a[(N-1)%26])

Submission status: Wrong Answer

Solution code:
n = int(input())
count = []
temp = 0

while True:
  if n <= 26:
    break
  
  temp = n % 26
  count.append(int(temp))
  n = int((n - temp) / 26)
  


count.append(int(n))

count =[n + 96 for n in count]
count =[chr(n) for n in count]
count.reverse()

print(''.join(count))

Submission status: Wrong Answer

Solution code:
import string
characters = "0" + string.ascii_lowercase
 
def base_cvt(value, n):
    try:
        tmp = int(value)
    except:
        raise ValueError('Invalid value:', value)
 
    if n < 2 or n > len(characters):
        raise ValueError('Invalid n:', value)
 
    result = ''
    tmp = int(value)
    while tmp >= n:
        idx = tmp%n
        result = characters[idx] + result
        tmp = int(tmp / n)
    idx = tmp%n
    result = characters[idx] + result
    return result
  
def test_base(self):
    self.assertEqual('0', n_ary.base_cvt('0'))
    self.assertEqual('1', n_ary.base_cvt('1'))
    self.assertEqual('101', n_ary.base_cvt('5'))
    self.assertEqual('1010', n_ary.base_cvt('10'))
    self.assertEqual('10000', n_ary.base_cvt('16'))
 
    value = '10000000'
 
    self.assertEqual('46113200', n_ary.base_cvt(value, 8))
    self.assertEqual('989680', n_ary.base_cvt(value, 16))
    self.assertEqual('5yc1s', n_ary.base_cvt(value, 36))
    self.assertEqual('FXsk', n_ary.base_cvt(value, 62))
     
    # エラー処理
    with self.assertRaises(ValueError):
        # 数字以外だとエラー
        v = n_ary.base_cvt('hoge')
    with self.assertRaises(ValueError):
        # 62進数以上を出そうとするとエラー
        v = n_ary.base_cvt('1000000', 63)
    with self.assertRaises(ValueError):
        # 1以下でもエラー
        v = n_ary.base_cvt('1000000', 1)
 
input = int(input())-1
#print(input)

    # 一覧出力してみる
ans = base_cvt(input, 26)

print (ans)

anslen = len(ans)
print(ans[anslen-1])

ans_list = list(ans)

for i in range (26):
    if(ans_list[anslen-1] == characters[i]):
        ans_list[anslen-1] = characters[i+1]
        break

ans = "".join(ans_list)        

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
name = []
S = ''
num = 26
for i in range(20):
    amari = int(N % num) + 96
    N = int(N / num)
    amari = chr(amari)    
    name.insert(0, amari)
    if N / num == 0:
        break

for l in name:
    S = S + l
print(str(S))

Submission status: Wrong Answer

Solution code:
from collections import deque
import math


def main():
    n = int(input())
    digits = deque()
    alpha = ord('a') - 1
    maxex = int(math.log(n, 26))
    ex = 1
    for ex in range(1, maxex + 2):
        bb = pow(26, ex - 1)
        aa = bb * 26
        rem = n % aa // bb
        n -= bb * rem
        digits.appendleft(chr(alpha + rem))

    [print(d, end='') for d in digits]
    print()


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import math

N = int(input())

ALPHA_ARRAY = [chr(i) for i in range(97, 97+26)]

ALPHABET = 26

count = 0

flg = True

while flg:
    if N < ALPHABET ** count:
        flg = False
    else:
        count += 1
if count == 1:
    tmp = N
else:
    tmp = N - ALPHABET ** (count - 1)

# print("文字列数:" + str(count))
# print("そこから何番目か：" + str(tmp))

flg_2 = True
result_array = []
while flg_2:
    amari = math.floor(tmp % ALPHABET)
    syo = math.floor(tmp / ALPHABET)
    result_array.append(amari)
    # print('index：' + str(amari))
    if syo < ALPHABET:
        if len(result_array) != count:
            result_array.append(syo + 1)
        flg_2 = False
    tmp = syo

result = ''
result_array.reverse()
# print(result_array)
for index in result_array:
    result += ALPHA_ARRAY[index - 1]

print(result)

Submission status: Wrong Answer

Solution code:
x = int(input())

list=[]
while True:
    if x<26:
        list.append(x)
        break
    list.append(x%26)
    x=x//26

#print(list)

list2=[]
for k in range(len(list)):
    if k==len(list)-1 and list[k]==0:
        break

    if list[k]<=0:
        list2.insert(0,26+list[k])
        if list[k+1]!=0:
            list[k+1]-=1
    else:
        list2.insert(0,list[k])

#print(list2)



ans_list=[]
for k, i in enumerate(list2):
    ans_list.append(chr(96+i))


#print(ans_list)

ans = ''.join(ans_list)
print(ans)

Submission status: Wrong Answer

Solution code:
N=int(input())
a=['z','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']

name=[]

for i in range (20):
    if N>26:
        _=N%26
        name.insert(0,a[_])
        N=N//26
        if N==0:
            break
        else:
            pass
    elif 0<N<=26:
        _=N%26
        name.insert(0,a[_])
        break
    else:
        break

print(''.join(name))

Submission status: Wrong Answer

Solution code:
N = int(input())
risuto = []
while N != 0:
    if N%26 == 0:
        risuto = [26] + risuto
    else:
        risuto = [N%26] + risuto
    if N % 26 == 0 and N // 26 == 1:
        break
    N //= 26
ans = ""
for i in risuto:
    ans += "abcdefghijklmnopqrstuvwxyz"[i-1]
print(ans)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
import sys
import re
from collections import deque, defaultdict
from itertools import combinations, combinations_with_replacement
import bisect
from math import factorial, sqrt, log, ceil, floor
sys.setrecursionlimit(1000000)


def main():
    #N, M = map(int, input().split())
    #N, K = map(int, input().split())
    #ps = list(map(int, input().split()))

    N = int(input())

    ds = []
    for n in range(12):
        k = 11 - n
        threshold = sum([26 ** i for i in range(k+1)])
        d = 0
        if N >= threshold:
            d = N // (26 ** k)
            if d > 26:
                d = 26
            N -= d * (26 ** k)
        ds.append(d)

    chars = 'abcdefghijklmnopqrstuvwxyz'
    result = ''
    for n in range(12):
        if ds[n] > 0:
            result += chars[ds[n]-1]

    print(result)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(4100000)
import math
INF = 10**9

def main():
    n = int(input())

    a = int(math.log(n,26))
    a2 = n - 26**a
    ans = ''
    b = n
    for i in range(a+1):
        if b % 26:
            ans += chr(ord('a')+int(b//(26**(a-i))))
        else:
            ans += chr(ord('a')-1+int(b//(26**(a-i))))
        b -= 26**(a-i)*(b//(26**(a-i)))
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = ''
alf = ['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' ]
order = 0
def func(m):
    return int(26 * (26**m-1) / 25 + 0.5)
# print(func(12))
for i in range(11, 0, -1):
    if n > func(i):
        n = n-func(i)
        order = i
        break
for i in range(order, 0, -1):
    m = n//(26**i)
    if m == 26:
        ans += 'z'
        n -= 26**i*25
    # print(n)
    # print(m)
    else:

        n %= 26**i
        ans += alf[m]
ans += alf[n-1]
print(ans)

Submission status: Wrong Answer

Solution code:
MAX = 50
def Excel(n): 
    string = ["\0"] * MAX
    i = 0
    while n > 0: 
        rem = n % 26
        if rem == 0: 
            string[i] = 'z'
            i += 1
            n = (n //26) - 1
        else: 
            string[i] = chr(int(rem - 1 + 97))
            i += 1
            n = n // 26
    string[i] = '\0'
    string = string[::-1] 
    return "".join(string) 
n=int(input())
print(Excel(n))

Submission status: Wrong Answer

Solution code:
import string
from decimal import Decimal, getcontext

getcontext().prec = 99
characters = '_' + string.ascii_lowercase
base_number = 26


def convert_base_number(tmp, result):
    idx = (Decimal(tmp) % base_number)
    return characters[int(idx)] + result


def resolve():
    tmp = Decimal(input())

    result = ''
    while tmp >= base_number:
        result = convert_base_number(tmp, result)
        tmp = Decimal(tmp) / base_number

    print(convert_base_number(tmp, result))


resolve()

Submission status: Wrong Answer

Solution code:
def num2alpha(num):
    if num<=26:
        return chr(96+num)
    elif num%26==0:
        return num2alpha(num//26-1)+chr(90)
    else:
        return num2alpha(num//26)+chr(96+num%26)
N=int(input())
print(num2alpha(N))

Submission status: Wrong Answer

Solution code:
N = int(input())
risuto = []
while N != 0:
    if N%26 == 0:
        risuto = [26] + risuto
    else:
        risuto = [N%26] + risuto
    if N % 26 == 0 and N // 26 == 1:
        break
    N //= 26
ans = ""
print(risuto)
for i in risuto:
    ans += "abcdefghijklmnopqrstuvwxyz"[i-1]
print(ans)

Submission status: Wrong Answer

Solution code:
MAX = 50
def Excel(n): 
    string = ["-1"] * MAX
    i = 0
    while n : 
        rem = n % 26
        if not rem: 
            string[i] = 'z'
            i += 1
            n = (n //26) - 1
        else: 
            string[i] = chr(int(rem - 1 + 97))
            i += 1
            n = n // 26
    string[i] = '\0'
    string = string[::-1] 
    return "".join(string) 
n=int(input())
print(Excel(n))

Submission status: Wrong Answer

Solution code:
import string

N = int(input())

rem = []
while N > 0:
    q, r = divmod(N, 26)
    rem.append(r)
    N = q
print("".join([string.ascii_lowercase[r - 1] for r in reversed(rem)]))

Submission status: Wrong Answer

Solution code:
n = int(input())
res = ''

alphabet = lambda c: chr(c+96)
while n > 0:
    res = alphabet(n%26)+res
    n = int(n/26)
print(res)

Submission status: Wrong Answer

Solution code:
n = int(input())

ascii = 'abcdefghijklmnopqrstuvwxyz'

i = 1
name = ""
while 1:
    if n - (26 ** i) > 0:
        n -= 26 ** i
    else:
        break
    i += 1
# print(i)
# print(n)
while i != 0:
    if i == 1:
        name += ascii[int(n % (26**i))-1]
    else:
        if int(n/(26**(i-1))) != 26:
            name += ascii[int(n/(26**(i-1)))]
        else:
            name += ascii[int(n/(26**(i-1)))-1]
    if (26**(i-1)) != 0:
        n = n % (26**(i-1))
    else:
        n = 26**(i-1)
    i -= 1
print(name)

Submission status: Wrong Answer

Solution code:
a=int(input())

ei=[chr(i) for i in range(ord('a'), ord('z')+1)]

name_list=[]

name=""
q=int(a/27)
r=int(a%26)

if q==0:
	name_list.append(r)

while q>0:
	q=int(a/26)
	r=int(a%26)
	a=q
	name_list.append(r)

for i in range(len(name_list)):
	name+=ei[name_list[-(i+1)]-1]

print(name)

Submission status: Wrong Answer

Solution code:
n = int(input().strip())
dic = {
    1:  'a',
    2:  'b',
    3:  'c',
    4:  'd',
    5:  'e',
    6:  'f',
    7:  'g',
    8:  'h',
    9:  'i',
    10: 'j',
    11: 'k',
    12: 'l',
    13: 'm',
    14: 'n',
    15: 'o',
    16: 'p',
    17: 'q',
    18: 'r',
    19: 's',
    20: 't',
    21: 'u',
    22: 'v',
    23: 'w',
    24: 'x',
    25: 'y',
    26: 'z'
       }

ans = ''

keta = 15

while True:
    if (26 ** keta) <= n:
        break
    keta -= 1

for i in range(keta, -1, -1):
    sho = n // (26 ** i)
    amari = n % (26 ** i)
    if sho == 1 and amari == 0:
        if i == 0:
            ans += 'a'
        else:
            continue
    else:
        if sho == 0:
            continue
        else:
            ans += dic[sho]
            n %= 26 ** i
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

tmp = 0
i = -1
tmp_list= []
while tmp<=n:
  i+=1
  tmp+=26**i
  tmp_list.append(26**i)
n-=tmp-tmp_list[-1]

tmp = []
while 1:
  if n<=26:
    tmp.append(n%26)
    break
  tmp.append(n%26)
  n = int(n/26)

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"]

result = ""
for arg in reversed(tmp):
  result += alphabet[arg]

for _ in range(i-len(result)):
  result = "a"+result
print(result)

Submission status: Wrong Answer

Solution code:
import math

alphabets = [chr(i) for i in range(97, 97+26)]

N = int(input())

def run(n):
    a = 0
    for i in range(1, 12):
        if math.pow(26, i) >= n:
            break
        n -= int(math.pow(26, i))

    ans = ''
    for j in range(i-1):
        b = n // int(math.pow(26, i-j-1))
        if b == 26:
            return ans + 'z' * (i-j)
        ans += alphabets[b]
        n = n % int(math.pow(26, i-j-1))
    ans += alphabets[n-1]
    return ans
    
print(run(N))

Submission status: Wrong Answer

Solution code:
import string
numbers = "0123456789"
alphabets = string.ascii_letters # a-z+A-Zをロード
characters = numbers + alphabets
 
def base_cvt(value, n=2):
    try:
        tmp = int(value)
    except:
        raise ValueError('Invalid value:', value)
 
    if n < 2 or n > len(characters):
        raise ValueError('Invalid n:', value)
 
    result = ''
    tmp = int(value)
    while tmp >= n:
        idx = tmp%n
        result = characters[idx] + result
        tmp = int(tmp / n)
    idx = tmp%n
    result = characters[idx] + result
    return result

n = int(input())

ans = base_cvt(n,26)
#print(ans)
li = []
for i in range(len(ans)):
    if ans[i].isnumeric():
        #if int(ans[i]) == 0:
        #    continue
        li.append(chr(int(ans[i])-1+ord('a')))
    else:
        li.append(chr(ord(ans[i])-ord('a')+8+1+ord('a')))
    #print(chr(int(ans[i])+1+ord('a')))
print(*li,sep='')

Submission status: Wrong Answer

Solution code:
# N, K = map(int, input().split())
#
# fruit = list(map(int, input().split()))
# fruit.sort()
#
# sumz = 0
# for i in range(K):
#     sumz += fruit[i]
#
# print(sumz)

# charz = input().rstrip(('\n'))
#
# if ord(charz) < ord('a'):
#     print('A')
# else:
#     print('a')

N = int(input())
charz = "aabcdefghijklmnopqrstuvwxyz"

rem = N
modz = 0
res = ""
while rem > 0:
    modz = rem % 26
    rem = int(rem/26)
    res = charz[modz] + res

print(res)

Submission status: Wrong Answer

Solution code:
z = int(input())

a = z

txt = ""
num2alpha = lambda c: chr(c+64)

# for i in reversed(range(1,10)):
#     print("a 次数 割る数")
#     print(a,i,26**i)
#     a = (z // (26**i))
#     a0 = (z % (26**i))
    
#     print(a,a0)
#     z = a0
#     if not a ==0:
#         txt += num2alpha(a)
    
#     print(txt)

clip = 0

for i in range(1,10):
    a -= 26**i
    clip += 1
    if a <= 0 :
        break

for i in reversed(range(clip)):
    # print(z)
    st = ((z-1) // (26**(i)))
    po = ((z-1) % (26**(i))+1)
    z = po
    # print(st,po)
    if i == 0 and po == 1:
        st += po
    if not st == 0:
        txt += num2alpha(st)


print(str.lower(txt))

Submission status: Wrong Answer

Solution code:
N = int(input())
M = N - 1
count = 0
alpha = "abcdefghijklmnopqrstuvwxyz"
output = ""
if N == 26:
    count += 1
while N >= 27:
    N = N / 26
    count += 1
for i in range(1,count+1):
    M = M - 26 ** i
mod = M % 26
for i in range(count):
    M = M // 26
for j in range(count):
    output += alpha[M]
if mod != 25:
    output += alpha[mod]
print(output)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

import numpy as np

s = input()

x = np.base_repr(int(s) - 1, 26)

strings = {
"0": "a",
"1": "b",
"2": "c",
"3": "d",
"4": "e",
"5": "f",
"6": "g",
"7": "h",
"8": "i",
"9": "j",
"A": "k",
"B": "l",
"C": "m",
"D": "n",
"E": "o",
"F": "p",
"G": "q",
"H": "r",
"I": "s",
"J": "t",
"K": "u",
"L": "v",
"M": "w",
"N": "x",
"O": "y",
"P": "z",
}

r = ''
for i in list(x):
    r += strings[i]

print(r)

Submission status: Wrong Answer

Solution code:
n = int(input())
i = 1
a = []
b = pow(26,i)
c = []
d = 0
j = 1
ans = ""
while d < 1000000000000001:
    d = d + pow(26, j)
    j += 1
    c.append(d)

ex =[]
exmoji= 'z'
for k in range(len(c)):
    ex.append(exmoji)
    exmoji += 'z'

if n in c:
    for k in range(len(ex)):
        if n == c[k]:
            ans = ex[k]
    
else:
    while n // b > 0:
        a.append(n % b)
        n = n // b 
        i += 1
    a.append(n)
    a = list(reversed(a))
    for i in range(len(a)):
        if a[i] == 0:
            ans += chr(a[i] + 26 + 96)
        else:
            ans+= chr(a[i]+96)
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
s = [chr(ord("a")+i) for i in range(26)]
num = [26**i for i in range(1, 12)]
num, i = 26, 1
while n - num > 0:
    i += 1
    num += pow(26, i)
print(num)
ans = ""
while i > 0:
    tmp = 0
    for j in range(1, 27):
        if n - j*pow(26, i-1) < 0:
            break
        tmp = j
    ans += s[tmp- 1]
    n -= tmp*pow(26, i-1)
    i -= 1
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

ch = ['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']

ls = []
c = 0
while(N//26!=0):
    ls.append((N%26))
    N = N//26

ls.append(N)
ls.reverse()
s = ""
for i in range(0,len(ls)):
    s = s + ch[ls[i]-1]

print(s)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = 26
c = 1
res =""
t = ""
n2 = n

num2alpha = lambda c: chr(c+64)

while True:
    if n2 == a:
        t = num2alpha(int(n2 % a))
    else:
        t = num2alpha(int(n % 26))

    if t == "@":
        t = "z"
    res = t + res
    n = int(n / 26)
    if n2 <= a:
        break
    c += 1
    a = a + (26**c)

print(str.lower(res))

Submission status: Wrong Answer

Solution code:
n = int(input())
k = n
l = []
ans = str()

def num2alpha(num):
    if num<=26:
        return chr(96+num)

while k > 26:
    rest = k % 26
    l.append(rest)
    k //= 26

for i in reversed(range(len(l))):
    add = num2alpha(l[i])
    ans = ans + add

print(num2alpha(k) + ans)

Submission status: Wrong Answer

Solution code:
import sys
import itertools
# import numpy as np
import time
import math
 
sys.setrecursionlimit(10 ** 7)
 
from collections import defaultdict
 
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

# map(int, input().split())
# list(map(int, input().split()))

alphas = 'abcdefghijklmnopqrstuvwxyz'
N = int(input())

ans = []
while N > 0:
    ans.append(alphas[N % 26 - 1])
    N //= 26
print("".join(reversed(ans)))

Submission status: Wrong Answer

Solution code:
#! /usr/bin/env python3

import sys
import numpy as np
int1 = lambda x: int(x) - 1
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

N = int(readline())
acc = 1
cnt = 1
while acc * 26 < N:
    acc *= 26
    cnt += 1
ans = ""
for i in range(cnt):
    if cnt - 1 != 0:
        m = N // pow(26, cnt - 1)
    else:
        m = N
    if m == 0:
        ans += chr(122)
    else:
        ans += chr(96 + m)
    N -= N // pow(26, cnt - 1) * pow(26, cnt - 1)
    cnt -= 1

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

G = list()
g = 0
for i in range(1, 15):
    g += 26**i
    G.append(g)
F = N in G

ALPHABET = "abcdefghijklmnopqrstuvwxyz"
S = ""
while N > 0:
    Q, M = divmod(N, 26)
    S = ALPHABET[M - 1] + S
    N = Q

if F:
    S = S[1:]

print(S)

Submission status: Wrong Answer

Solution code:
N = int(input())
s=1
while pow(26,s)<N:
    N-=pow(26,s)
    s+=1


ans=["a"]*s
N-=1
for i in range(s):
    r = N%26
    ans[-i] = chr(ord(ans[-i])+r)
    N//=26

#if ans[0]=="a":
#    ans[0]="z"
#else:
#    ans[0] = chr(ord(ans[0])+1)
print("".join(reversed(ans)))

Submission status: Wrong Answer

Solution code:
import string

n = int(input())

imanoatai = n 
buf = []
for i in range(20):
    atai = 26**(19 - i)
    syou = imanoatai // atai
    amari = imanoatai % atai
    buf.append(syou)
    imanoatai = amari


while True:
    if buf[0] != 0:
        break
    if buf[0] == 0:
        buf.pop(0)
    

flag = False
for i in range(len(buf)):
    
    j = len(buf) - i - 1

    if buf[j] == 0:
        buf [j] = 26
        flag = True
    
    if buf[j] != 26 and flag:
        buf[j] = buf[j] - 1
        flag = False

while True:
    if buf[0] != 0:
        break
    if buf[0] == 0:
        buf.pop(0)

for i in range(len(buf)):
    print(string.ascii_letters[buf[i]-1], end='')

Submission status: Wrong Answer

Solution code:
import math

N = int(input())

ALPHA_ARRAY = [chr(i) for i in range(97, 97+26)]

ALPHABET = 26

count = 0

flg = True

while flg:
    if N < ALPHABET ** count:
        flg = False
    else:
        count += 1
if count == 1:
    tmp = N
else:
    tmp = N - ALPHABET ** (count - 1)

# print("文字列数:" + str(count))
# print("そこから何番目か：" + str(tmp))

flg_2 = True
result_array = []
while flg_2:
    amari = int(tmp % ALPHABET)
    syo = math.floor(tmp / ALPHABET)
    result_array.append(amari)
    # print('index：' + str(amari))
    if syo < ALPHABET:
        if len(result_array) != count:
            result_array.append(syo + 1)
        flg_2 = False
    tmp = syo

result = ''
result_array.reverse()
# print(result_array)
for index in result_array:
    result += ALPHA_ARRAY[index - 1]

print(result)

Submission status: Wrong Answer

Solution code:
def main():
    n = int(input())
    num = n
    name = []
    cap = [chr(i) for i in range(97, 97+26)]
    cap.insert(0, 'z')
    del cap[-1]

    while n >= 27:
        last = n % 26 
        n = n // 26
        name.insert(0, cap[last])
    if n == 0:
        ans = "".join(name)
        return name
    if num % 26 == 0:
        last = (n % 26)-1
    else:
        last = n % 26
    if last == -1:
        last = 0
    name.insert(0, cap[last])
    ans = "".join(name)
    return ans
print(main())

Submission status: Wrong Answer

Solution code:
alp=[i for i in "abcdefghijklmnopqrstuvwxyz"]

n=int(input())
moji=""
while(n!=0):
  ind=n%26
  moji=alp[ind-1]+moji
  n=n//26
print(moji)

Submission status: Wrong Answer

Solution code:
def resolve():
    n = int(input())
    flag = 0
    name = []
    while n > 0:
        c = n % 26
        name.append(c)
        n //= 26
        if n == 1:
            flag = 1

    name.reverse()
    for i in range(len(name) - 1, 0, -1):
        if name[i] == 0:
            name[i] = 26
            name[i - 1] -= 1
        if name[0] == 0:
            name.pop(0)

    ans = ''.join([chr(i + 96) for i in name])
    print(ans)

resolve()