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: Runtime Error

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys


def input():
    return sys.stdin.readline()

def Base_10_to_n(i10, n, ans_list:list):
    # 各桁を0-indexにするために1減らす
    i10 -= 1
    if(int(i10/n)):
        ans_list.append(Base_10_to_n(int(i10/n), n, ans_list))
        return str(i10%n)
    return str(i10%n)


def resolve():
    n = int(input().rstrip())
    n_list = []
    ans_list = []

    n_list.append(Base_10_to_n(n, 26, n_list))

    for n26 in n_list:
        string = ord("a") + n26
        ans_list.append(chr(string))

    ans_string = ""
    for st in ans_list:
        ans_string += st
    print(ans_string.rstrip())

if __name__ == "__main__":
    resolve()

Submission status: Runtime Error

Solution code:
n = int(input())
for i in range(1,11):
    if n <= pow(26,i):
        d = i
        break
    n = n - pow(26,i)
d = d - 1 
n = n - 1
ans =''
for i in range(d):
    tmp = divmod(n,pow(26,d-i))
    ans = ans+ chr(97+tmp[0])
    n = tmp[1]
print(ans + chr(97+n))

Submission status: Runtime Error

Solution code:
n = int(input())
eigo = 'abcdefghijklmnopqrstuvwxyz'

keta = 1
while n > 26**keta:
    n -= 26**keta
    keta += 1

ans =''
for i in range(keta):
    a =n // 26**(keta-1-i)
    ans += eigo[a]
    n = n % (26**(keta-1-i))

print(ans)

Submission status: Runtime Error

Solution code:
def base_k(n, k=26):
    ret = []
    ny = n
    while ny:

        ret.append(ny % k)
        ny //= k
    return ret[::-1]


def letter(i):
    return chr(i+97)


n = int(input())

check = 26
add = 26**2
cnt = 1
k = n
while True:
    if n <= check:
        break
    check += add
    cnt += 1
    add *= 26
k -= check//26 - 1

t = base_k(k-1)

ans = ""
if not t:
    ans = "a" * cnt
else:
    for i in range(len(t)-cnt, len(t)):
        ans += letter(t[i])

print(ans)

Submission status: Runtime Error

Solution code:
def xxx(n):
    ans = ""
    i = 1

    while True:
        if n <= 26 ** i:
            n -= 1
            for j in range(i):
                ans = char(ord("a") + n%26) + ans
                n //= 26
            return ans
        else:
            n -= 26 ** i
            i += 1


N = int(input())
print(xxx(N))

Submission status: Runtime Error

Solution code:
import string
import itertools
n = int(input())
s = n
l = list(string.ascii_lowercase)
count = 1
for i in range(1, 100):
    s -= 26 ** i
    if s <= 0:
        break
    else:
        count += 1
n_list = []
answer = []
for i in reversed(range(1, count+1)):
    number = n // 26 ** (i-1)
    n %= 26 ** (i-1)
    n_list.append(number)
for i in n_list:
    answer.append(l[i-1])
print(''.join(answer))

Submission status: Runtime Error

Solution code:
N = int(input())
ans = ''
    for i in range(1, 99):
	    if N <= 26 ** i:
		    N -= 1
		    for j in range(i):
			    ans += chr(ord('a') + N % 26)
			    N //= 26
			break
	else:
		N -= 26 ** i
print(ans[::-1])

Submission status: Runtime Error

Solution code:

def main():
    n = int(input())
    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']
    #print(len(alphabet))
    exponent_list = [0]
    for i in range(1, 12):
        exponent_list.append(exponent_list[i-1] + 26**i)
    #print(exponent_list)
    index = 0
    n_index = 0
    ans = ''
    

    
    while exponent_list[index] < n:
        n_index = index
        index += 1
    #print(n_index)
    r_list = []
    r = 27
    b = 0
    while r > 27:
        tmp = n - exponent_list[n_index]
        r = int(tmp/26)
        b = tmp % 26
    
    ans = alphabet[r] + alphabet[b]
    print(ans)
    
if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
#define rep(i,n)for(long long i=0;i<(long long)(n);i++)
#define all(a) a.begin(), a.end()
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
 
const ll MOD=1e9+7;
const ll INF=1e18;
const int MAX=510000;
const double pi=acos(-1);
int dx[8] = {1,0,-1,0,1,1,-1,-1};
int dy[8] = {0,1,0,-1,-1,1,1,-1};
// int d[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};


int main(){
  cin.tie(0);
  ios::sync_with_stdio(false); 
  
  ll n;
  cin >> n;
  string s;
  while(n){
    n--;
    s.push_back('a'+n%26);
    n/=26;
  }
  reverse(s.begin(),s.end());
  cout << s << endl;
  return 0;
}

Submission status: Runtime Error

Solution code:
def xxx(n):
    alpha = "abcdefghijklmnopqrstuvwxyz"
    ans = ""
    i = 0

    while True:
        if n <= 26 ** i:
            n -= 1
            while N > 0:
                ans = alpha[N%26-1] + ans
                N //= 26
            return ans
        else:
            n -= 26 ** i

            
N = int(input())
print(xxx(N))

Submission status: Runtime Error

Solution code:
"""
処理内容（例：「731」が渡された時）：
- １． 731 % 26 = 3 ←「C」で確定
- ２． 731 / 26 = 28 ←「26」より大きいので次の処理に使う
- ３． 28 % 26 = 2 ←「B」で確定
- ４． 28 / 26 = 1 ←「26」より小さいので「A」で確定
- ５． 確定したモノを逆順で出力する ←「ABC」
"""

import sys
import math

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

def alphabet_decimal(v):
    quotient = math.floor(v / len(ALPHABET))
    surplus = v % len(ALPHABET)
    quotient -= 1 if surplus == 0 else 0
    surplus = len(ALPHABET) if surplus == 0 else surplus
    result.append(surplus)
    if len(ALPHABET) < quotient:
        alphabet_decimal(quotient)
    elif len(ALPHABET) < v:
        result.append(quotient)
    return "".join([ALPHABET[i - 1] for i in reversed(result)])

print(alphabet_decimal(int(sys.argv[1])))

Submission status: Runtime Error

Solution code:
import string
import itertools
n = int(input())
l = list(string.ascii_lowercase)
count = 1
for i in range(1, 100):
    n -= 26 ** i
    if n <= 0:
        break
    else:
        count += 1
n_list = []
answer = []
for i in reversed(range(count)):
    number = n // 26 ** i
    n %= 26 ** i
    n_list.append(number)
for i in n_list:
    answer.append(l[i-1])
print(''.join(answer))

Submission status: Runtime Error

Solution code:
n = int(input())
s = ''
while n > 0:
  n-=1
  ans += chr(ord('a') + n%26)
  n//=26
 
print(ans[::-1])

Submission status: Runtime Error

Solution code:
N= int(input())
ans = ''
while N > 0:
N -= 1
ans += chr(ord('a') + N % 26)
N //= 26
print(ans[::-1])

Submission status: Runtime Error

Solution code:
n= int(input())
s="abcdefghijklmnopqrstuvwxyz"
def fn(n):
  if(n<=26):
    return s[n-1]
  return f(n-1)//26+s[f(n-1)%26]
  
print(f(n))

Submission status: Runtime Error

Solution code:
#######関数部分##############
#url http://iatlex.com/python/base_change
def Base_10_to_n(X, n):
    if (int(X/n)):
        return Base_10_to_n(int(X/n), n)+" "+str(X%n)
    return str(X%n)
############################

# 初期入力
import sys
input = sys.stdin.readline
N = int(input())

#26進数に変換
x26 = Base_10_to_n(N-1, 26) 
x26_list =x26.split()
int_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"]

#26進数⇒文字
if x26_list[0] =="1":
    del x26_list[0]
ans =""
for i in range(len(x26_list)-1):
    a =x26_list[i]
    x =int_str[int(a)-1]
    ans +=x
ans +=int_str[int(x26_list[-1])]
ans_list =list(ans)

print(ans)

Submission status: Runtime Error

Solution code:
moji="abcdefghijklmnopqrstuvwxyz"
N=int(input())
def f(N):
    if N<=26:
        return moji[n-1]
    return f(N//26)+moji[N%26-1]

print(f(N))

Submission status: Runtime Error

Solution code:
N = int(input())

a=26
num=0
alphabet=["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"]

for i in range(1,11):
    num += a**i
    if N <= num:
        # max=num
        # min = num-a**i+1
        index = i-1
        break
li=[]
for i in range(index+1):
    for j in range(26):
        if N<a**index:break
        else :
            N = N - a**index
    li.append(alphabet[j])
    index -= 1

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

Submission status: Runtime Error

Solution code:
moji="abcdefghijklmnopqrstuvwxyz"
N=int(input())
def f(n):
    if N<=26:
        return moji[n-1]
    return f(N//26)+moji[N%26-1]

print(f(N))

Submission status: Runtime Error

Solution code:
N = int(input())
alphabets = list('zabcdefghijklmnopqrstuvwxy')

v = []
# 26進数
while True:
    N, mod = divmod(N, 26)
    if mod == 0:
        mod = 26
        N -= 1
    v.append(alphabets[mod])
    if N < 26:
        if N != 0:
            v.append(alphabets[N])
        break
v = v[::-1]
ans = ''.join(v)
print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())

a=26
num=0
alphabet=["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"]

for i in range(1,11):
    num += a**i
    if N <= num:
        max=num
        min = num-a**i+1
        index = i-1
        break
li=[]
for i in range(index+1):
    for j in range(26):
        if N<a**index:break
        else :
            N = N - a**index
    li.append(alphabet[j])
    index -= 1
print(li)
ans = ''.join(li)
print(ans)

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys


def input():
    return sys.stdin.readline()

def Base_10_to_n(i10, n, ans_list:list):
    if(int(i10/n)):
        ans_list.append(Base_10_to_n(int(i10/n), n, ans_list))
        return str(i10%n)
    return str(i10%n)


def resolve():
    n = int(input().rstrip())
    n_list = []

    ans_list = []

    n_list.append(Base_10_to_n(n, 26, n_list))
    cnt = 0

    #print(n_list)
    for i in range(len(n_list)):
        #print(ans_list)
        if n_list[i] == "0":
            cnt = 1
            while n_list[i - cnt] == "1":
                #print(ans_list,cnt, i-cnt)
                ans_list.pop(i-cnt)
                ans_list.append("z")
                #print(ans_list)
                if i-cnt == 0:
                    break
                cnt += 1
            #print(i, cnt)
            if n_list[i-cnt] != "1":
                #print(ans_list)
                ord_s = ord(ans_list.pop(i-cnt-1)) -1
                #print(ans_list)
                ans_list.append(chr(ord_s))
                ans_list.append("z")


        else:
            string = ord('a') + int(n_list[i]) -1
            ans_list.append(chr(string))

    ans_string = ""
    for st in ans_list:
        ans_string += st
    print(ans_string.rstrip())

if __name__ == "__main__":
    resolve()

Submission status: Runtime Error

Solution code:
N = int(input())
ans = ''
while N > 0:
    N -= 1
    ans += chr(ord('a' + N % 26))
    N //= 26
print(ans[::-1])

Submission status: Runtime Error

Solution code:
import bisect

alpha_dict = {}
for i,c in enumerate(range(ord('A'),ord('Z')+1)):
  alpha_dict[i+1] = chr(c)

alpha_dict[0] = 'z'
N = int(input())
n = N
l = []
now = 0
i = 1
while now <= 101000000000001000:
  now = 26**i
  l += [now]
  i += 1

cl = l[:]
for i in range(len(l)-1):
  cl[i+1] += cl[i]
i = 0
idx = bisect.bisect_left(cl, N)
ans = ""

if idx < 1:
  print((alpha_dict[N]).lower())
  exit()

N -= l[idx-1]
while True:
  a, b = divmod(N, 26)
  ans = (alpha_dict[b]).lower() + ans
  N = a 
  if N <= 26:
    if b == 0:
      ans = (alpha_dict[N]).lower() + ans
    else:
      ans = (alpha_dict[N+1]).lower() + ans
    print(ans)
    break

Submission status: Runtime Error

Solution code:
import sys
stdin = sys.stdin
sys.setrecursionlimit(10**6)
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

n = ni()

def f(k):
    return chr(97+k)

c = 0
i = 1
while True:
    d = c+pow(26,i)
    if c < n <= d:
        break
    c = d
    i+=1

m = n-c-1
ans = ''
for _ in range(i)
    ans = f(m%26) + ans
    m = m//26
ans = f(m%26) + ans

# ans = 'a'*(i-len(ans)) + ans

print(ans)

Submission status: Runtime Error

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

S = 1
i = 0
Sum = 0
while Sum<N:
    S *= 26
    Sum += S
    i = i+1

ans = []
for j in range(i):
  N = N-1
    r = N%26
    ans.insert(0, name[r])
    N = N//26

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

Submission status: Runtime Error

Solution code:
n = int(input())
f = []

if n > 26:
	while n:
		n -= 1
		n, r = divmod(n, 26)
		f += [r]
else:
	f += [n]

g = ''
s = string. ascii_lowercase
f.reverse()
for i in f:
	g += s[i]

print(g)

Submission status: Runtime Error

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

S = 1
i = 0
Sum = 0
while Sum<N:
    S *= 26
    Sum += S
    i = i+1

ans = []
for j in range(i):
  	N = N-1
    r = N%26
    ans.insert(0, name[r])
    N = N//26

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

Submission status: Runtime Error

Solution code:
def main():
    n = int(input())
    ans = []
    A = [26, 702, 18278, 475254, 12356630, 321272406, 8353082582, 217180147158, 5646683826134, 146813779479510]
    for i in range(9, 0, -1):
        if n > A[i-1]:
            a = n // 26**i
            if a <= 26:
                ans.append(chr(96+a))
                n = n - (26**i*a)
            else:
                a = 26
                ans.append(chr(96+a))
                n = n - (26**i*a)
    ans.append(chr(96+n))
    print(*ans, sep='')
 
if __name__ == '__main__':
    main()

Submission status: Runtime Error

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

S = 1
i = 0
Sum = 0
while Sum<N:
    S *= 26
    Sum += S
    i = i+1

ans = []
for j in range(i):
  	N -= 1
    r = N%26
    ans.insert(0, name[r])
    N = N//26

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

Submission status: Runtime Error

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

S = 1
i = 0
Sum = 0
while Sum<N:
    S *= 26
    Sum += S
    i = i+1

ans = []
for j in range(i):
  N -= 1
    r = N%26
    ans.insert(0, name[r])
    N = N//26

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

Submission status: Runtime Error

Solution code:
def main():
    n = int(input())
    ans = []
    A = [26, 702, 18278, 475254, 12356630, 321272406, 8353082582, 217180147158, 5646683826134, 146813779479510]
    for i in range(9, 0, -1):
        if n > A[i-1]:
            a = n // 26**i
            if a <= 26:
                ans.append(chr(96+a))
                n = n - (26**i*a)
            else:
                a = 26
                ans.append(chr(96+a))
                n = n - (26**i*a)
    ans.append(chr(96+n))
    print(*ans, sep='')

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
n = int(input())
import math 

a_list = ["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","0"]
output = ""
k = 0
while n > 26**k:
  k += 1
for i in range(1,k):
  output += a_list[n%(26**(k-i))-1]
  n -= (n//(26**(k-i))) * (26**(k-i))
output += a_list[(n%26)-1]
if output[0] == "0":
  print("z"*(len(output)-1))
else:
  print(output)

Submission status: Runtime Error

Solution code:
N=int(input())
alpha=list("abcdefghijklmnopqrstuvwxyz")
k=26
l=1
while N-k>0:
  N-=k
  k*=26
  l+=1
ans=""
N-=1
while N>26:
  a=N%26
  N=N//26
  ans=alpha[a]+ans
ans=alpha[N]+ans
k=len(ans)
for i in range(k,l):
  ans="a"+ans
print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())
import math 

a_list = ["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","0"]
output = ""
k = 0
while n > 26**k:
  k += 1

for i in range(1,k):
  print(n%(26**(k-i)))
  output += a_list[n%(26**(k-i))]
  n -= (n//(26**(k-i))) * (26**(k-i))
output += a_list[(n%26)]
if output[0] == "0":
  print("z"*(len(output)-1))
else:
  print(output)

Submission status: Runtime Error

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

for i in range(1,99):
    if n <= 26**i:
        n -= 1
        for j in range(i):
            ans += chr(ord('a')+N%26)
            n //= 26
        break
    else:
        n -= 26**i

print(ans[::-1])

Submission status: Runtime Error

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

for i in range(100):
    if n <= 26**i:
        n -= 1
        for j in range(i)
            ans += chr(ord('a')+N%26)
            n //= 26
        break
    else:
        n -= 26**i

print(ans[::-1])

Submission status: Runtime Error

Solution code:
al = [chr(ord('a') + i) for i in range(26)]
n = int(input())
s = ""
while n:
    s += al[a % 26 - 1]
    n = (n - 1) // 26
print(s[::-1])

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(10 ** 5 + 10)
def input(): return sys.stdin.readline().strip()

def resolve():
    
    n=int(input())
    
    while n>0:
        n-=1
        a,b=divmod(n,26)
        n//=26
        ans+=chr(ord('a')+b)
    for i in ans[::-1]:
        print(i,end='')
    print()
        

    
resolve()

Submission status: Runtime Error

Solution code:
#%%
N = int(input())

dic = {}
for i in range(1, 27):
    dic[i] = chr(97 + i -1)
del dic[26]
dic[0] = "z"
temp = N 
ans = ""

while temp // 26 != 0:
    aa = temp % 26
    ans += dic[aa]
    temp = temp // 26
    if temp <= 26:
        break
ans += dic[temp]
ans = ans[::-1]
print(ans)

Submission status: Runtime Error

Solution code:
N = int(input()) 
ans='' 
while N>0:
    N -= 1
    ans += chr(ord('a') + N % 26) N //= 26
print(ans[::-1])

Submission status: Runtime Error

Solution code:
N = int(input())
alph = [chr(i) for i in range(97,97+26)]
if N <= 26:
    print(alph[N-1])
    exit()

tmp = []
if N%26 == 0:
    while N > 26:
        tmp.append(0)
        N //= 26
    break
else:
    while N > 26:
        tmp.append(N % 26)
        N //= 26
    tmp.append(N)

tmp.reverse()
ans = []

for i in range(len(tmp)):
    ans += alph[tmp[i]-1]
print(''.join(ans))

Submission status: Runtime Error

Solution code:
N = int(input())
ans = ''

while True:
    if N <= 26**i:
        N -= 1
        for j i in range(N):
            ans += chr(ord('a') + N%26)
            N //= 26
        break
    else:
        N -= 26 ** i
print(ans[::-1])

Submission status: Runtime Error

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

a = 141167095653376
b = 0
ans = []
c = 11
flag = False
flag2 = False
while True:
    # print(a)
    if a == 1:
        flag = True
    b = N//a
    if b != 0 and flag2 == False:
        d = c
        flag2 = True
    if a != 1:
        ans.append(b-1)
    else:
        ans.append(b)
    N -= a*b
    
    if flag == True:
        break
    a //=26
    c +=  -1
ans2 = []
list1 = "abcdefghijklmnopqrstuvwxyz"
for i in ans:
    ans2.append(list1[i])
# print(ans)
print("".join(ans2[-d:]))

Submission status: Runtime Error

Solution code:
N = int(input()) 

ans='' 

while N>0:
	N -= 1
	ans += chr(ord('a') + N % 26) 
    N  = N//26
    
print(ans[::-1])

Submission status: Runtime Error

Solution code:
N = int(input()) 

ans='' 

while N>0:
	N -= 1
	ans += chr(ord('a') + N % 26) 
    N //= 26
    
print(ans[::-1])

Submission status: Runtime Error

Solution code:
N = int(input()) 

ans='' 

while N>0:
	N -= 1
	ans += chr(ord('a') + N % 26) 
    N //= 26
    
print(ans[::-1])

Submission status: Runtime Error

Solution code:
n = int(input())
def B(X, n):
    X_dumy = X
    ln = []
    while X_dumy>0:
        ln.append(int(X_dumy%n))
        X_dumy = int(X_dumy/n)
    ln.reverse()
    return ln
ln = B(n, 26)
a = ['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']
q = []
print(ln)
for i in range(len(ln)):
    if ln[i] == 1 and ln[i] < ln.index(0):
        q.append('z')
    elif ln[i] != 0:
        q.append(a[ln[i] - 1])
print(''.join(q))

Submission status: Runtime Error

Solution code:
N=int(input())
alphabet="abcdefghijklmnopqrstuvwsyz"

n=N
ans_num=[]
while n/26 >= 0:
    ans_num.append((n%26)-1)
    if n/26 == 0:
        n=-1
    else:
        n=n/26
    
ans_num.reverse()
ans = "".join([alphabet[a] for a in ans_num])
print(ans)

Submission status: Runtime Error

Solution code:

def main():
    import collections

    N = int(input())
    A_s = list(map(int, input().split()))
    Q = int(input())

    summ = sum(A_s)
    CNT_A = collections.Counter(A_s)


    for i in range(Q):
        before, after = map(int, input().split())
        
        tmp_cnt = CNT_A[before]
        
        if (tmp_cnt > 0):
            tmp_before = CNT_A[before] * (after - before)
            summ += tmp_before

            N_before=CNT_A[before]

            del CNT_A[before]
            N_after = CNT_A[after]
            
            if (N_after > 0):
                CNT_A[after] = N_after + N_before
            else:
                CNT_A[after] = N_before
            
        
        print(summ)


if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
N=int(input())
strlist=[chr(ord('a') + i) for i in range(26)]
import itertools
 
if N<=26:
  size=1
  N-=1
elif 26<N<=26**2:
  size=2
  N-=26+1
elif 26**2<N<=26**3:
  size=3
  N-=26**2+1
elif 26**3<N<=26**4:
  size=4
  N-=26**3+1
elif 26**4<N<=26**5:
  size=5
  N-=26**4+1
elif 26**5<N<=26**6:
  size=6
  N-=26**5+1
elif 26**6<N<=26**7:
  size=7
  N-=26**6+1
  
plist=[]
for i in itertools.combinations_with_replacement(strlist, size):
  plist.append(i)
  
  
ans=''
for i in plist[N]:
  ans+=i
print(ans)

Submission status: Runtime Error

Solution code:
n=int(input())
a=[chr(ord('a') + i) for i in range(26)]
l=[]
cnt=0
inc=1
while True:
  cnt+=26**inc
  if cnt>=n:
    #print(inc)
    break
  inc+=1
s=0
if n<=26:
  l.append(n)
for i in range(inc-1,0,-1):
  #print('i',i)
  x=n//26**(i)
  #print("x",x,n)
  if n%(x*26**(i))==0:
    x-=1
  l.append(x)
  n=n-x*26**i
  #print("n",n,x)
  if n<=26:
    l.append(n)

ans=""
#print(l)
for li in l:
  if li==0:
    li=26
  ans+=chr(ord('a') + li-1)
print(ans)

Submission status: Runtime Error

Solution code:
import sys
n = int(sys.stdin.readline().rstrip("\n"))
a = [26]
p = 2
while a[-1] <= 1000000000000001:
    a.append(26**p)
    p += 1
l = 0
a_sum = a[0]
while n > a_sum:
    l += 1
    a_sum += a[l]
s = [chr(i) for i in range(97, 97+26)]
ans = ''
while l > 0:
    b = n // a[l-1]
    c = n % a[l-1]
    if c == 0:
        b -= 1
        c = 26
        ans = ans + s[b-1]
        n = c
    else:
        ans = ans + s[b-1]
        n = c
    l -= 1
ans = ans + s[n-1]
print(ans)

Submission status: Runtime Error

Solution code:
import sys
import math
MAX = 50
  
# Function to print Excel column name  
# for a given column number 
def printString(n): 
  
    # To store result (Excel column name) 
    string = [""] * MAX
  
    # To store current index in str which is result 
    i = 0
  
    while n > 0: 
        # Find remainder 
        rem = n % 26
  
        # if remainder is 0, then a  
        # 'Z' must be there in output 
        if rem == 0: 
            string[i] = 'Z'
            i += 1
            n = (n / 26) - 1
        else: 
            string[i] = chr((rem - 1) + ord('A')) 
            i += 1
            n = n // 26
    string[i] = ''
  
    # Reverse the string and print result 
    string = string[::-1] 
    print("".join(string)) 
n=int(input())
printString(n)

Submission status: Runtime Error

Solution code:
N=int(input())
alphabet="abcdefghijklmnopqrstuvwsyz"

n=N
ans_num=[]
while n/26 >= 0:
    ans_num.append((n%26)-1)
    if n/26 == 0:
        n=-1
    else:
        n=n/26
    
ans_num.reverse()

print("".join([alphabet[a] for a in ans_num]))

Submission status: Runtime Error

Solution code:
n = int(input())
ans=num2alpha(n)
print(ans.lower())
def num2alpha(num):
    if num<=26:
        return chr(64+num)
    elif num%26==0:
        return num2alpha(num//26-1)+chr(90)
    else:
        return num2alpha(num//26)+chr(64+num%26)

Submission status: Runtime Error

Solution code:
def Base_10_to_n(X, n, d):
    if (int(X/n)):
        return Base_10_to_n(int(X/n), n, d)+str(d[str(X%n)])
    return str(d[str(X%n)])

d = {'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'}
str = Base_10_to_n(int(input()),26,d)

print(str)

Submission status: Runtime Error

Solution code:
import os
import sys
from io import BytesIO, IOBase
# region fastio

BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

# ------------------------------

from math import factorial
from collections import Counter, defaultdict, deque
from heapq import heapify, heappop, heappush

def RL(): return map(int, sys.stdin.readline().rstrip().split())
def RLL(): return list(map(int, sys.stdin.readline().rstrip().split()))
def N(): return int(input())
def comb(n, m): return factorial(n) / (factorial(m) * factorial(n - m)) if n >= m else 0
def perm(n, m): return factorial(n) // (factorial(n - m)) if n >= m else 0
def mdis(x1, y1, x2, y2): return abs(x1 - x2) + abs(y1 - y2)
mod = 998244353
INF = float('inf')

# ------------------------------
# f = open('../input.txt')
# sys.stdin = f

def c(n):
    res = []
    while n>0:
        n-=1
        now = n%26
        res.append(chr(ord('a')+now))
        n = n//26
    if res[-1]=='z':
        for i in range(len(res)-1, -1, -1):
            res[i] = chr(ord(res[i]-1))
    print("".join(res[::-1]))


def main():
    n = N()
    res = c(n)
    tag = False
    ret = ''



if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
# 幅優先探索（行きがけ）
import collections
import sys
import copy
import re


def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())


def main():
    N = I()
    ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
    name_roop = []

    level = 1

    ans = ""
    n = 26
    for i in range(30):
        if N > n:
            n += 26**(i+2)
            level += 1
        else:
            break

    for i in range(level, 1, -1):
        count = 0
        a = 26**(i-1)
        for _ in range(27):
            if N-a > 0:
                N -= a
                count += 1
            if N <= a:
                name_roop.append(count)
                break

    for i in name_roop:
        ans += ascii_lowercase[i-1]
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(10**6)

n = int(input())

d = {(i-97+1):chr(i)%26 for i in range(97,97+26)}
#d[0] = 'z'

l = []

while n > 0:
    tmp = n%26
    l.append(tmp)
    if tmp == 0:
        n = n//26-1
    else:
        n //= 26

ans = ''

for i in l[::-1]:
    ans += d[i]
    
print(ans)

Submission status: Runtime Error

Solution code:
N=int(input())
strlist=[chr(ord('a') + i) for i in range(26)]
import itertools
 
if N<=26:
  size=1
elif 26<N<=26**2:
  size=2
  N-=26+1
elif 26**2<N<=26**3:
  size=3
  N-=26**2+1
elif 26**3<N<=26**4:
  size=4
  N-=26**3+1
elif 26**4<N<=26**5:
  size=5
  N-=26**4+1
elif 26**5<N<=26**6:
  size=6
  N-=26**5+1
elif 26**6<N<=26**7:
  size=7
  N-=26**6+1
  
plist=[]
for i in itertools.combinations_with_replacement(strlist, size):
  plist.append(i)
  
  
ans=''
for i in plist[N]:
  ans+=i
print(ans)

Submission status: Runtime Error

Solution code:
def ans(n):
    s=0
    c=1
    s1=0
    l=[]
    for i in range(11):
        k=pow(26,c)
        s+=k
        l.append(k)
        if(s>=n):
            break
        c+=1
    ans=''
    c1=0
    for i in range(c-1,0,-1):
        if(n//l[i-1]==0):
            ans+='a'
        else:
            ans+=chr((n//l[i-1])+96)
        n=n%l[i-1]
    if(n==0):
        return ans(n-1)
    else:
        ans+=chr((n%26)+96)
        return ans
n=int(input())
print(ans(n))