input stringlengths 20 127k | target stringlengths 20 119k | problem_id stringlengths 6 6 |
|---|---|---|
import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)
INF = float('inf')
N = int(eval(input()))
komoji = [chr(i) for i in range(97, 97+26)]
ans = ""
# print(N)
while True:
q, mod = divmod(N, 26)
ans = ko... | import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)
INF = float('inf')
N = int(eval(input()))
komoji = [chr(i) for i in range(97, 97+26)]
ans = ""
# print(N)
while True:
N -= 1
q, mod = divmod(N, 26)
... | p02629 |
s = input()
n = int(s)
def main(n):
d = 1
n -= 1
while n - 26**d >= 0:
n -= 26**d
d += 1
ret = ''
for i in range(d):
ret += chr((n%26)+ord('a'))
n //= 26
return ret[::-1]
print(main(n))
| a = int(eval(input()))
s = []
ret = ['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', 'z',
]
while a > 0:
a -= 1
shang = int(a / 26)
yushu = int(a % 26)
# print(shang, yushu)
s.append(yushu+1)
... | p02629 |
num = int(eval(input()))
s = 'abcdefghijklmnopqrstuvwxyz'
ans = ''
while num > 26:
num, rest = divmod(num, 26)
ans += s[rest - 1]
if rest == 0:
num -= 1
#num -= 1
#print(ans, num, rest)
ans += s[num - 1]
print((ans[::-1]))
| num = int(eval(input()))
s = 'abcdefghijklmnopqrstuvwxyz'
ans = ''
while num > 0:
num, rest = divmod(num, 26)
ans += s[rest - 1]
if rest == 0:
num -= 1
print((ans[::-1])) | p02629 |
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)
n = int(eval(input()))
print((num2alpha(n).lower())) | n = int(eval(input()))
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)
print((num2alpha(n).lower())) | p02629 |
from string import ascii_lowercase
from itertools import accumulate
def solve(string):
n = int(string)
t = [0] + [len(ascii_lowercase)**i for i in range(1, 12)]
*t, = accumulate(t)
l = 0
ans = ""
while t[l] < n:
l += 1
n -= t[l - 1] + 1
for i in range(l - 1):
... | from string import ascii_lowercase
def solve(string):
n = int(string)
ans = ""
while n:
n, c = divmod(n - 1, len(ascii_lowercase))
ans = ascii_lowercase[c] + ans
return ans
if __name__ == '__main__':
import sys
print((solve(sys.stdin.read().strip())))
| p02629 |
import sys
input = sys.stdin.readline
from collections import *
N = int(eval(input()))
l = [0, 26]
for i in range(30):
l.append(l[-1]*26)
for i in range(len(l)):
if N-l[i]>0:
N -= l[i]
else:
keta = i
break
ans = []
alpha = 'abcdefghijklmnopqrstuvwxyz'
for i i... | N = int(eval(input()))
for i in range(1, 100):
if N<=26**i:
ans = ''
N -= 1
for j in range(i):
ans += chr(ord('a')+N%26)
N //= 26
break
else:
N -= 26**i
print((ans[::-1])) | p02629 |
N = int(eval(input()))
cnt = [0] + [26 ** i for i in range(1, 11)]
for i in range(10):
cnt[i + 1] += cnt[i]
ans = ""
x = N - 1
for i in reversed(list(range(1, 11))):
if x >= cnt[i]:
v = (x - cnt[i]) // 26 ** i
ans += chr(ord("a") + v)
x -= (v + 1) * (26 ** i)
ans += chr(... | x = int(eval(input()))
ans = ""
while x > 0:
x -= 1
ans += chr(ord("a") + x % 26)
x //= 26
print((ans[::-1])) | p02629 |
def colnum_string(n):
string = ""
while n > 0:
n, remainder = divmod(n - 1, 26)
string = chr(65 + remainder) + string
return string.lower()
N = int(eval(input()))
print((colnum_string(N))) | N = int(eval(input()))
name = ''
while N>0:
N, r = divmod(N-1, 26)
name = chr(65+r)+name
print((name.lower())) | p02629 |
import bisect
import copy
import heapq
import sys
import itertools
import math
import queue
from functools import lru_cache
input = sys.stdin.readline
sys.setrecursionlimit(1000000)
mod = 998244353
def read_values(): return list(map(int, input().split()))
def read_index(): return [int(x) - 1 for x in inpu... | N = int(eval(input()))
res = ""
while N > 0:
r = (N - 1) % 26
res = chr(r + 97) + res
N -= r + 1
N //= 26
print(res) | p02629 |
N = int(eval(input()))
res = ""
while N > 0:
r = (N - 1) % 26
res = chr(r + 97) + res
N -= r + 1
N //= 26
print(res) | N = int(eval(input()))
res = ""
while N > 0:
N -= 1
r = N % 26
res = chr(r + 97) + res
N //= 26
print(res) | p02629 |
from collections import deque
def main():
n = int(eval(input()))
c = deque()
while n:
n -= 1
c.appendleft(n % 26)
n = n // 26
cs = []
for ce in c:
ce += 97
cec = chr(ce)
cs.append(cec)
print(("".join(cs)))
if __name__ == '__main__':... | def main():
n = int(eval(input()))
nl = 0
yokei = 0
yokei_pre = 0
while yokei < n:
nl += 1
yokei_pre = yokei
yokei += 26 ** nl
n -= yokei_pre
n -= 1
c = [0] * nl
for i1 in range(1, nl + 1):
r = n % 26
c[-i1] = r
n = n /... | p02629 |
def to_n(x,n):
ans=[]
if x==0:
return [0]
while x>0:
x-=1
ans.append(x%n)
x//=n
return ans[::-1]
from sys import stdin
def main():
#入力
readline=stdin.readline
n=int(readline())
alp=[chr(i) for i in range(97,97+26)]
m=to_n(n,26)
... | def to_n(x,n,cnt):
ans=[]
for _ in range(cnt):
ans.append(x%n)
x//=n
return ans[::-1]
from sys import stdin
def main():
#入力
readline=stdin.readline
n=int(readline())
alp=[chr(i) for i in range(97,97+26)]
tmp=26
cnt=1
while n>tmp:
n-=tm... | p02629 |
from sys import stdin
nii=lambda:list(map(int,stdin.readline().split()))
lnii=lambda:list(map(int,stdin.readline().split()))
abc='abcdefghijklmnopqrstuvwxyz'
n=int(eval(input()))
ans=''
while n!=0:
t_ans=n%26
ans+=str(abc[t_ans-1])
if abc[t_ans-1]=='z':
n-=1
n//=26
print((ans[::-1])) | n=int(eval(input()))
abc='abcdefghijklmnopqrstuvwxyz'
ans=''
while n!=0:
q=n%26
ans+=abc[q-1]
if q==0:
n-=1
n//=26
print((ans[::-1])) | p02629 |
import sys
sys.setrecursionlimit(10 ** 8)
input = sys.stdin.readline
def main():
N = int(eval(input()))
Norg = N
ans = []
N -= 1
while N >= 26:
ans.append(N % 26)
N = N // 26 - 1
ans.append(N)
ansstr = []
for i, a in enumerate(ans[::-1]):
... | N = int(eval(input()))
ans = []
while N:
N -= 1
ans.append(chr(ord('a') + N % 26))
N = N // 26
print(("".join(map(str, ans[::-1]))))
| p02629 |
N = int(eval(input()))
ans = []
while N:
N -= 1
ans.append(chr(ord('a') + N % 26))
N = N // 26
print(("".join(map(str, ans[::-1]))))
| import sys
sys.setrecursionlimit(10 ** 8)
input = sys.stdin.readline
def main():
N = int(eval(input()))
N -= 1
ans = ""
while N >= 0:
ans = chr(ord('a') + N % 26) + ans
N = N // 26
N -= 1
print(ans)
if __name__ == '__main__':
main()
| p02629 |
def toString(n):
if n <= 26:
return chr(64 + n)
elif n % 26 == 0:
return toString(n // 26-1) + chr(90)
else:
return toString(n // 26) + chr(64 + n % 26)
N = int(eval(input()))
Alpha = toString(N)
alpha = Alpha.lower()
print(alpha)
| num = int(eval(input()))
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)
print((num2alpha(num).lower())) | p02629 |
import string
cs = string.ascii_lowercase
def factor(n):
b = 26
ds = [n % b]
n //= b
while n:
d = n % b
ds.append(d)
n //= b
return ds
n = int(eval(input()))
lst = [sum(26**i for i in range(p+1)) - 1 for p in range(1, 12)]
lst = [0] + lst
for i in range(1, l... | import string
cs = string.ascii_lowercase
def factor(n):
b = 26
ds = [n % b]
n //= b
while n:
d = n % b
ds.append(d)
n //= b
return ds
n = int(eval(input()))
lst = [sum(26**i for i in range(p+1)) - 1 for p in range(1, 12)]
lst = [0] + lst
for i in range(1, l... | p02629 |
def f(n):
alphabets = "abcdefghijklmnopqrstuvwxyz"
s = ""
while n > 0:
n, mod = divmod(n, 26)
if mod == 0:
s += 'z'
n -= 1
else:
s += alphabets[mod - 1]
return s[::-1]
print((f(int(eval(input()))))) | n = int(eval(input()))
a = "abcdefghijklmnopqrstuvwxyz"
s = ""
while n > 0:
n, m = divmod(n, 26)
if not m:
n -= 1
s = a[(m - 1) % 26] + s
print(s) | p02629 |
n = int(eval(input()))
ans = []
m = ord('a') - 1
x = 0
while 26 ** x <= n:
x += 1
while x > 0:
x -= 1
tmp = n // (26 ** x)
ans.append(tmp)
n = n - tmp * (26 ** x)
for i in range(len(ans) - 1, -1, -1):
if ans[i] == 0:
if i == 0:
ans[i] = ''
continue
... | n = int(eval(input()))
ans = ''
m = ord('a') - 1
x = 0
while n != 0:
rem = (n % (26 ** (x + 1))) // (26 ** x)
if rem == 0:
ans = 'z' + ans
n -= 26 ** (x + 1)
else:
ans = chr(m + rem) + ans
n -= rem * 26 ** x
x += 1
print(ans) | p02629 |
N = int(eval(input()))
res = []
while N:
N -= 1
N, r = divmod(N, 26)
res.append(chr(r + ord('a')))
res.reverse()
print((''.join(res)))
| N = int(eval(input()))
mapping = 'zabcdefghijklmnopqrstuvwxy'
res = []
for i in range(1, 99):
if N <= 26 ** i:
for j in range(i):
N, r = divmod(N, 26)
res.append(mapping[r])
if r:
N += 1
break
else:
N -= 26 ** i
res.reverse... | p02629 |
n = int(eval(input()))
alphabet = [chr(i) for i in range(97, 97+26)]
ans = ""
i = 0
while n - 26**i >= 0:
n -= 26**i
i += 1
# ここを抜けた時,iは桁数
for _ in range(i):
q,r = divmod(n,26)
n = q
ans += alphabet[r]
print((ans[::-1]))
| n = int(eval(input()))
alphabet = [chr(i) for i in range(97, 97+26)]
ans = ""
i = 0
# 次26**iを引いたらマイナスになるよ、というところで抜ける
while n - 26**i >= 0:
n -= 26**i
i += 1
# ここを抜けた時,iは桁数、nは「i桁の中でn番目」を表す
# したからk番目は、26**kで割った余り(に対応するアルファベット)
# 「上の桁で表現しきれなかった数」=「その桁での表現」
for _ in range(i):
q,r = divmod(n,26)
... | p02629 |
n=int(eval(input()))
x=1
X='abcdefghijklmnopqrstuvwxyz'
for i in range(1,100):
if x<=n<x+26**i:
n-=x
cnt=i
break
else:
x+=26**i
ans=''
for i in reversed(list(range(cnt))):
ans+=X[n//(26**i)]
n%=(26**i)
print(ans) | n=int(eval(input()))
x=1
X='abcdefghijklmnopqrstuvwxyz'
for i in range(1,100):
if x<=n<x+26**i:
n-=x
cnt=i
break
else:
x+=26**i
ans=''
for i in range(cnt):
ans=ans+X[n%26]
n//=26
print((ans[::-1])) | p02629 |
al = ["Q"] + [chr(ord('a') + i) for i in range(26)]
n = int(eval(input()))
s = ""
while n:
if n % 26:
a = n % 26
n //= 26
else:
a = 26
n //= 26
n -= 1
s += al[a]
print((s[::-1])) | al = [chr(ord('a') + i) for i in range(26)]
n = int(eval(input()))
s = ""
while n:
s += al[n % 26 - 1]
n = (n - 1) // 26
print((s[::-1])) | p02629 |
import string
N = int(eval(input()))
S = string.ascii_lowercase
ans = ''
if N <= 26:
ans = S[N - 1]
else:
while True:
N, b = divmod(N, 26)
ans = S[b - 1] + ans
if b == 0:
N -= 1
if N <= 26:
ans = S[N - 1] + ans
break
... | import string
N = int(eval(input()))
S = string.ascii_lowercase
ans = ''
while N > 0:
N, b = divmod(N - 1, 26)
ans = S[b] + ans
print(ans) | p02629 |
N = int(eval(input()))
ans = ""
while N > 0:
N -= 1
ans += chr(97 + N%26)
N //= 26
print((ans[::-1])) | def f(N):
if N == 0: return ""
N -= 1
return f(N//26) + chr(97 + N%26)
N = int(eval(input()))
print((f(N))) | p02629 |
N = int(eval(input()))
ans = ""
while N >= 26:
m = N % 26
if m == 0:
ans = chr(96 + 26) + ans
N //= 26
N -= 1
else:
ans = chr(96 + m) + ans
N //= 26
# print(ans, N)
if N == 0:
print(ans)
else:
print((chr(96 + N) + ans))
| N = int(eval(input()))
def solve(x):
if x == 0:
return ""
x -= 1
return solve(x // 26) + chr(97 + x % 26)
print((solve(N)))
| p02629 |
N, ans = int(eval(input())), ''
while N > 0:
N = N - 1
ans += chr(N % 26 + ord('a'))
N //= 26
print((ans[::-1]))
| N, ans = int(eval(input())), ''
while N > 0:
N -= 1
ans += chr(N % 26 + ord('a'))
N //= 26
print((ans[::-1]))
| p02629 |
n=int(input())
cnt=1##文字数
tmp=26
while n>tmp:
cnt+=1
tmp+=26**cnt
num=n-(tmp//26)
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"]
ans=["0"]*cnt
for i in range(cnt):
j=num%26
num//=26
ans[-i-1]=alp[j]
print(*ans... | n=int(input())
cnt=0
tmp=0
while n>tmp:
cnt+=1
tmp+=26**cnt
num=n-(tmp//26)
ans=["0"]*cnt
for i in range(1, cnt+1):
j=num%26
num//=26
add=chr(ord("a")+j)
ans[-i]=add
print(*ans, sep='')
| p02629 |
n = int(eval(input()))
eigo = 'abcdefghijklmnopqrstuvwxyz'
keta = 1
j = 1
while n > 26**j:
n -= 26**j
keta += 1
j += 1
n = n-1
ans =''
while keta != 0:
a = n //(26**(keta-1))
if a != 0:
n = n -(26**(keta-1)*a)
ans += eigo[a]
else:
ans+= eigo[0]
... | n = int(eval(input()))
eigo = 'abcdefghijklmnopqrstuvwxyz'
keta = 1
while n > 26**keta:
n -= 26**keta
keta += 1
ans =''
n = n-1
for i in range(keta):
a =n // 26**(keta-1-i)
ans += eigo[a]
n = n % (26**(keta-1-i))
print(ans)
| p02629 |
#!python3
import sys
iim = lambda: list(map(int, sys.stdin.readline().rstrip().split()))
def resolve():
N = int(eval(input()))
s = "abcdefghijklmnopqrstuvwxyz"
ans = ""
a = N-1
x = 26
i = 1
while True:
if a < x:
break
a -= x
x *= 26
... | #!python3
import sys
iim = lambda: list(map(int, sys.stdin.readline().rstrip().split()))
def resolve():
N = int(eval(input()))
s = "abcdefghijklmnopqrstuvwxyz"
ans = ""
a = N
while a:
a -= 1
a, b = divmod(a, 26)
ans = s[b] + ans
print(ans)
if __name... | p02629 |
# https://atcoder.jp/contests/abc171/tasks/abc171_c
import string
numbers = string.digits # [0-9] をロード
abc = string.ascii_lowercase # [a-z] をロード
ABC = string.ascii_uppercase # [A-Z] をロード
characters = numbers + abc + ABC ... | # https://atcoder.jp/contests/abc171/tasks/abc171_c
import sys
input = sys.stdin.readline
import string
numbers = string.digits # [0-9] をロード
abc = string.ascii_lowercase # [a-z] をロード
ABC = string.ascii_uppercase # [A-Z] をロード
characters... | p02629 |
import math
def main():
N = int(eval(input()))
lowercase = 'abcdefghijklmnopqrstuvwxyz'
ans = ''
for i in range(len(str(N))):
if N == 0:
break
j = N % 26
N -= 1
N = N // 26
ans = lowercase[j-1] + ans
# print(N, j-1, ans)
prin... | import math
def solve():
N = int(eval(input()))
lowercase = 'abcdefghijklmnopqrstuvwxyz'
ans = ''
for i in range(len(str(N))):
if N == 0:
break
j = N % 26
N -= 1
N = N // 26
ans = lowercase[j - 1] + ans
print(ans)
if __name__ =... | p02629 |
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections
import copy
import bisect
if __name__ == "__main__":
n = int(eval(input()))
a = [0]*18
a[0] = 26
b = 2
alpa = ["a","b","c","d","e","f","g... | import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections
import copy
def main():
n = int(eval(input()))
ans = ""
alpa = "abcdefghijklmnopqrstuvwxyz"
while n:
ans += alpa[n%26-1]
n-=1... | p02629 |
def main():
N = int(eval(input())) - 1
digits = []
while True:
a, b = N // 26, N % 26
digits.append(b)
if a == 0:
break
N = a - 1
digits.reverse()
chars = list(map(to_alphabet, digits))
print((''.join(chars)))
def to_alphabet(x: int... | def main():
N = int(eval(input()))
ans = ''
while N > 0:
N -= 1
ans += chr(ord('a') + N % 26).lower()
N = N // 26
print((ans[::-1]))
if __name__ == "__main__":
main()
| p02629 |
# C - One Quadrillion and One Dalmatians
n = int(eval(input()))
dic = dict()
import string
i = 1
for s in string.ascii_lowercase:
dic[i % 26] = s
i += 1
name = ''
i = 1
while True:
mod = n % 26
name += dic[mod]
if n > 26:
if mod == 0:
mod = 26
n = (n - mod) // 26
i += 1
... | # C - One Quadrillion and One Dalmatians
def get_alphabet(mod):
import string
lower = string.ascii_lowercase
if mod == 0 or mod == 26:
return 'z'
else:
return lower[mod - 1]
n = int(eval(input()))
ans = ''
while n > 26:
mod = n % 26
s = get_alphabet(mod)
ans = s + ans
n //= 26
... | p02629 |
N = int(eval(input())) - 1
rst = ''
for i in range(1, 10 ** 15):
if N >= 26 ** i:
N -= 26 ** i
continue
for j in range(i):
rst += chr(ord('a') + N % 26)
N //= 26
print((rst[::-1]))
break | N = int(eval(input())) - 1
result = ''
for i in range(1, 10 ** 15):
if N >= 26 ** i:
N -= 26 ** i
continue
for j in range(i):
result += chr(ord('a') + N % 26)
N //= 26
print((result[::-1]))
break | p02629 |
import sys
input = sys.stdin.readline
def slove():
n = int(eval(input()))
ans = ""
abc = "abcdefghijklmnopqrstuvwxyz"
count = 0
while n != 0:
count += 1
k = n % 26
if k == 0:
tmp = "z"
n = n - 26 ** count
ans = tmp + ans
... | import sys
input = sys.stdin.readline
def slove():
n = int(eval(input()))
ans = ""
abc = "zabcdefghijklmnopqrstuvwxy"
count = 0
while n != 0:
k = n % 26
if k == 0:
n -= 1
n = n // 26
ans = abc[k] + ans
print(ans)
if __name... | p02629 |
n=int(eval(input()))
ans=""
for l in range(1,15):
if n<=26**l:
n-=1
for j in range(l):
ans+=chr(ord('a')+n%26)
n//=26
break
else:
n-=26**l
print((ans[::-1]))
| n=int(eval(input()))
tmp=0
for ll in range(1,20):
tmp+=26**ll
if n<=tmp:
break
s=chr((n-1)%26+ord("a")) ##一文字目
for i in range(1,ll):
n-=26**i
s+=chr((n-1)//(26**i)%26+ord("a"))
print((s[::-1]))
| p02629 |
#!/usr/bin/env python3
import sys
# import time
# import math
# import numpy as np
# import scipy.sparse.csgraph as cs # csgraph_from_dense(ndarray, null_value=inf), bellman_ford(G, return_predecessors=True), dijkstra, floyd_warshall
# import random # random, uniform, r... | #!/usr/bin/env python3
import sys
# import time
# import math
# import numpy as np
# import scipy.sparse.csgraph as cs # csgraph_from_dense(ndarray, null_value=inf), bellman_ford(G, return_predecessors=True), dijkstra, floyd_warshall
# import random # random, uniform, r... | p02629 |
# -*- coding: utf-8 -*-
#############
# Libraries #
#############
import sys
input = sys.stdin.readline
import math
#from math import gcd
import bisect
import heapq
from collections import defaultdict
from collections import deque
from collections import Counter
from functools import lru_cache
#... | # -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
#############
# Libraries #
#############
import sys
input = sys.stdin.readline
import math
#from math import gcd
import bisect
import heapq
from collections import defaultdict
from collections import deque
from collections import Counter
from functool... | p02629 |
# 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)
# def main():
# alp = 'abcdefghijklmnopqrstuvwxyz'
# n = int(input())
# s = base_10_to_n(n-1,26)
# print(s)
# if __name__ == "__main__":
# main()
al... | alps = 'abcdefghijklmnopqrstuvwxyz'
n = int(eval(input()))
if n == 1:
print('a')
exit()
ansl = []
curr_n = n
for i in range(15, -1, -1):
if n <= pow(26,i):
continue
val = curr_n//pow(26,i)
ansl.append(val)
curr_n -= val*pow(26,i)
for j in range(100):
for i in ra... | p02629 |
def II(): return int(eval(input()))
N=II()
N-=1
ans=''
for l in range(1,15):
if N>=26**l:
N-=26**l
continue
for i in range(l):
d=N%26
ans+=chr(d+ord('a'))
N//=26
ans=ans[::-1]
break
print(ans) | def II(): return int(eval(input()))
def MI(): return list(map(int, input().split()))
def LI(): return list(map(int, input().split()))
ans=''
N=II()
N-=1
for l in range(1,15):
if N>=26**l:
N-=26**l
continue
for i in range(l):
d=N%26
ans+=chr(d+ord('a'))
N//=26
ans=ans[::-1]
bre... | p02629 |
def II(): return int(eval(input()))
def MI(): return list(map(int, input().split()))
def LI(): return list(map(int, input().split()))
ans=''
N=II()
N-=1
for l in range(1,15):
if N>=26**l:
N-=26**l
continue
for i in range(l):
d=N%26
ans+=chr(d+ord('a'))
N//=26
ans=ans[::-1]
bre... | def II(): return int(eval(input()))
N=II()
N-=1
i=1
while N>=(26**i):
N-=26**i
i+=1
ans=''
for j in range(i):
q,mod=divmod(N,26)
ans=ans+chr(mod+ord('a'))
N=q
ans=ans[::-1]
print(ans) | p02629 |
def II(): return int(eval(input()))
ans=''
N=II()
N-=1
i=1
while N-26**i>=0:
N-=26**i
i+=1#26のべき乗倍を引いてからインクリメント
for j in range(i):
mod=N%26
ans+=chr(mod+ord('a'))
N//=26
ans=ans[::-1]
print(ans) | def II(): return int(eval(input()))
ans=''
N=II()
N-=1
i=1
while N-26**i>=0:
N-=26**i
i+=1#26のべき乗倍を引いてからインクリメント
for j in range(i):
div,mod=divmod(N,26)
ans+=chr(mod+ord('a'))
N=div
ans=ans[::-1]
print(ans) | p02629 |
def II(): return int(eval(input()))
ans=''
N=II()
N-=1
i=1
while N-26**i>=0:
N-=26**i
i+=1#26のべき乗倍を引いてからインクリメント
for j in range(i):
div,mod=divmod(N,26)
ans+=chr(mod+ord('a'))
N=div
ans=ans[::-1]
print(ans) | def II(): return int(eval(input()))
N=II()
N-=1
i=1
ans=''
while N-26**i>=0:
N-=26**i
i+=1
for j in range(i):
div,mod=divmod(N,26)
ans+=chr(mod+ord('a'))
N=div
ans=ans[::-1]
print(ans) | p02629 |
from collections import deque
import math
def main():
n = int(input())
if n == 1:
print('a')
return
digits = deque()
alpha = ord('a') - 1
maxex = int(math.log(n-1, 26))
ex = 1
for ex in range(1, maxex + 2):
bb = pow(26, ex - 1)
aa = bb * 26
... | from collections import deque
def main():
n = int(eval(input()))
base = 26
orig = ord('a')
ans = deque()
for exp in range(1, 12):
if (tmp := pow(base, exp)) >= n:
n -= 1 # zero_indexed for ASCII mod
for digit in range(exp):
ans.appendlef... | p02629 |
from collections import deque
def main():
n = int(eval(input()))
base = 26
orig = ord('a')
ans = deque()
for exp in range(1, 12):
if (tmp := pow(base, exp)) >= n:
n -= 1 # zero_indexed for ASCII mod
for digit in range(exp):
ans.appendlef... | def main():
n = int(eval(input()))
base = 26
orig = ord('a')
ans = ''
for exp in range(1, 12):
if (tmp := pow(base, exp)) >= n:
n -= 1 # zero_indexed for ASCII mod
for digit in range(exp):
ans += (chr(orig + n % base))
n //= ... | p02629 |
N = int(eval(input()))
ans = ""
while N > 0:
N -= 1
ans += chr(ord("a") + N % 26)
N //= 26
print((ans[::-1])) | N = int(eval(input()))
s = ""
while N != 0:
N -= 1
r = N % 26
s += chr(ord('a') + r)
N //= 26
print((s[::-1])) | p02629 |
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
N = int(readline())
A = []
while(N>26):
s = N % 26
if s == 0:
A.append(26)
N = (N-26) // 26
else:
A.append(s)
N = (N-s) // 26
A.append(N)
A = A[::-1]
a... | import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
N = int(readline())
res = ''
while(N):
N -= 1
res += chr(ord('a') + N % 26)
N //= 26
print((res[::-1])) | p02629 |
n = int(eval(input()))
a = 'abcdefghijklmnopqrstuvwxyz'
ans = ''
while n > 0:
n, r = divmod(n-1, 26)
ans = a[r] + ans
print(ans)
| n = int(eval(input()))
ans = ''
while n > 0:
n, r = divmod(n-1, 26)
ans = chr(r+ord('a')) + ans
print(ans)
| p02629 |
N = int(eval(input()))
name = []
while N > 0:
name.append((N - 1) % 26)
N -= 1
N //= 26
name.reverse()
ans = "".join(chr(ord("a") + x) for x in name)
print(ans) | N = int(eval(input()))
c = []
while N > 0:
N -= 1
c.append(N % 26)
N //= 26
c.reverse()
ans = "".join(chr(ord("a") + x) for x in c)
print(ans) | p02629 |
n = int(eval(input()))
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)
print((num2alpha(n).lower())) | n = int(eval(input()))
def sinsu(num):
if num <= 26:
return chr(64+num)
elif num%26 == 0:
return sinsu(num//26-1) + chr(90)
else:
return sinsu(num//26)+chr(64+num%26)
print((sinsu(n).lower())) | p02629 |
import math
# one = 1000000000000001
dict={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"}
n=int(eval(input()))
ans = str(dict[(n-1)%26+1])
n=(n-1)//26
while n:... | import math
# one = 1000000000000001
dict={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"}
n=int(eval(input()))
ans = ""
while n:
ans = str(dict[(n-1)%26+1]) ... | p02629 |
n = int(eval(input()))
chars = "Xabcdefghijklmnopqrstuvwxyz"
n_rem = n
res = ""
while True:
x = n_rem % 26
if x == 0:
x = 26
res += chars[x]
n_rem -= x
if n_rem == 0:
break
n_rem //= 26
print((res[::-1])) | N = int(eval(input()))
chars = "Xabcdefghijklmnopqrstuvwxyz"
result = ""
n_1 = N
while True:
x = n_1 % 26
if x == 0:
x = 26
result += chars[x]
n_1 -= x
if n_1 == 0:
break
n_1 //= 26
print((result[::-1]))
| p02629 |
import sys
sys.setrecursionlimit(10000000)
MOD = 10 ** 9 + 7
INF = 10 ** 15
def main():
N = int(eval(input()))
num = []
now = 0
for i in range(12):
now += pow(26,i + 1)
num.append(now)
#print(num)
for i in range(12):
if num[i] >= N:
length = i
... | import sys
sys.setrecursionlimit(10000000)
MOD = 10 ** 9 + 7
INF = 10 ** 15
def main():
N = int(eval(input()))
ans = []
while N:
N -= 1
ans.append(chr(N%26 + 97))
N //= 26
print((''.join(map(str,ans[::-1]))))
if __name__ == '__main__':
main() | p02629 |
def main():
from string import ascii_lowercase
N = int(eval(input()))
def rec(n):
if n == 0: return ''
n -= 1
n, r = divmod(n, 26)
return rec(n) + ascii_lowercase[r]
print((rec(N)))
if __name__ == '__main__':
main()
| def main():
from string import ascii_lowercase
N = int(eval(input()))
ans = []
while N > 0:
N -= 1
N, i = divmod(N, 26)
ans.append(ascii_lowercase[i])
ans = ''.join(reversed(ans))
print(ans)
if __name__ == '__main__':
main()
| p02629 |
## necessary imports
import sys
input = sys.stdin.readline
#from math import ceil, floor, factorial;
# swap_array function
def swaparr(arr, a,b):
temp = arr[a];
arr[a] = arr[b];
arr[b] = temp
## gcd function
def gcd(a,b):
if a == 0:
return b
return gcd(b%a, a)
## nCr func... | ## necessary imports
import sys
input = sys.stdin.readline
#from math import ceil, floor, factorial;
# swap_array function
def swaparr(arr, a,b):
temp = arr[a];
arr[a] = arr[b];
arr[b] = temp
## gcd function
def gcd(a,b):
if a == 0:
return b
return gcd(b%a, a)
## nCr func... | p02629 |
## necessary imports
import sys
input = sys.stdin.readline
#from math import ceil, floor, factorial;
# swap_array function
def swaparr(arr, a,b):
temp = arr[a];
arr[a] = arr[b];
arr[b] = temp
## gcd function
def gcd(a,b):
if b == 0:
return a
return gcd(b, a % b);
## nCr f... | n = int(eval(input())); ans = '';
while(n):
x = (26 + n - 1) % 26;
ans = chr(97 + x) + ans;
n = (n - x) // 26;
print(ans); | p02629 |
alphabet='abcdefghijklmnopqrstuvwxyz'
N=int(eval(input()))
r=[]
while N>26:
x=N%26
N=N//26
if x==0:
N-=1
x=26
r.append(x)
r.append(N)
name=[alphabet[i-1] for i in r]
name.reverse()
name=''.join(name)
print(name) | alphabet='abcdefghijklmnopqrstuvwxyz'
N=int(eval(input()))
name=''
while N>0:
N-=1
name+=alphabet[N%26]
N//=26
print((name[::-1])) | p02629 |
# coding: utf-8
N = int(eval(input()))
S = "abcdefghijklmnopqrstuvwxyz"
ans = ""
while N > 0:
N -= 1
ans += chr(ord("a") + N % 26)
N //= 26
print((ans[::-1])) | # coding: utf-8
N = int(eval(input()))
S = "abcdefghijklmnopqrstuvwxyz"
ans = ""
while N > 0:
N -= 1
ans += S[N % 26]
N //= 26
print((ans[::-1])) | p02629 |
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)
def solve(n):
check = 26
cnt = 1
k = n
while True:
if n <= check:
break
check *= 26
... | def answer(n):
if n <= 26:
return chr(n-1 + 97)
r = n % 26 - 1
if r == -1:
r += 26
return answer((n-r) // 26) + chr(r + 97)
n = int(eval(input()))
print((answer(n))) | p02629 |
def main():
#input
N=int(eval(input()))
l=list("zabcdefghijklmnopqrstuvwxy")
if N<26:
print((l[N]))
else:
name=[]
n=N
while n>=26:
mod=n%26
if mod!=0:
n//=26
else:
n//=26
... | def main():#やり直し
#input
N=int(eval(input()))
l=list("abcdefghijklmnopqrstuvwxyz")
n=N
name=""
while n>=26:
n-=1
name+=l[n%26]
n//=26
if n!=0:
name+=l[n-1]
print((name[::-1]))
if __name__=="__main__":
main() | p02629 |
n=int(eval(input()))
alphabet=[None] + [chr(i) for i in range(97,97+26)]
rest=[]
while n!=0:
rest.append(n%26)
n = n // 26
rest.reverse()
for i in range(len(rest)-1):
if rest[len(rest)-1-i]<=0:
rest[len(rest)-1-i]+=26
rest[len(rest)-2-i]-=1
if rest[0]<=0:
rest=rest[1:]
... | n=int(eval(input()))
alphabet=[chr(i) for i in range(97,97+26)]
ans=''
while n>0:
n-=1
ans+=alphabet[n%26]
n //= 26
print((ans[::-1])) | p02629 |
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
def main():
N = int(readline())
ans = ''
while N:
if N % 26 == 0:
ans += "z"
N -= 1
N //= 26
else:
ans += chr((N % 26) -1 + 97)... | import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
def main():
N = int(readline())
ans = ''
while N:
N -= 1
ans += chr((N % 26) + 97)
N //= 26
print((ans[::-1]))
if __name__ == "__main__":
main()
| p02629 |
import sys, collections, bisect, itertools, heapq, math, copy, string
input = lambda: sys.stdin.readline().rstrip()
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(eval(input()))
def F(): return float(eval(input()))
def SS(): return eval(input())
def LI(): return [int(x) for x in input().spl... | import sys, collections, bisect, itertools, heapq, math, copy, string
input = lambda: sys.stdin.readline().rstrip()
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(eval(input()))
def F(): return float(eval(input()))
def SS(): return eval(input())
def LI(): return [int(x) for x in input().spl... | p02629 |
n = int(eval(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])) | n = int(eval(input()))
ans = ''
while n>0:
n -= 1
ans += chr(ord('a') + n%26)
n //= 26
print((ans[::-1])) | p02629 |
N = int(eval(input()))
lis = [0,26]
num = 26
n = 1
while lis[-1]<N:
num *= 26
lis.append(lis[-1]+num)
n += 1
c = N-lis[-2]-1
ans = ''
for i in range(n):
ans = chr(c%26+ord('a')) + ans
c //= 26
print(ans) | def solve():
N = int(eval(input()))
k = 1
while N>pow(26,k):
N -= pow(26,k)
k += 1
ans = ''
N -= 1
for i in range(k,0,-1):
if i>1:
ans += chr(ord('a')+N//pow(26,i-1))
else:
ans += chr(ord('a')+N%pow(26,i))
N%=pow(26,i-1)
return ans
print((solve())) | p02629 |
n = int(eval(input()))
ans = []
for i in range(1, 99): # 99は適当
if n <= 26**i:
n -= 1 # これが必要
for j in range(i):
ans.append(chr(ord('a') + n % 26))
n //= 26
break
else:
n -= 26**i
print((''.join(ans[::-1]))) | n = int(eval(input()))
ans = []
while n > 0:
n -= 1 # これが必要
ans.append(chr(ord('a') + n % 26))
n //= 26
print((''.join(ans[::-1]))) | p02629 |
n = int(eval(input()))
#26進数
dim = []
while n>0:
q,r = divmod(n-1, 26)
dim.append(r)
n=q
import string
dic = {i:l for i,l in enumerate(string.ascii_lowercase)}
print((''.join([dic[d] for d in reversed(dim)])))
| import string
n = int(eval(input()))
#26進数
ans = []
while n>0:
q,r = divmod(n-1, 26)
ans.append(r)
n=q
print((''.join([string.ascii_lowercase[bit] for bit in reversed(ans)])))
| p02629 |
N = int(eval(input()))
ans = ""
while N>0:
N -= 1
num = N%26
ans += chr(ord("a")+num)
N //= 26
print((ans[::-1])) | N = int(eval(input()))
ans = ""
while N > 0:
N -= 1
ans += chr(ord("a")+(N%26))
N //= 26
print((ans[::-1])) | p02629 |
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']
y = int(eval(input()))
ans = []
while y > 26:
res = y%26
if res == 0:
ans.append(25)
y = y//26 - 1
else:
ans.append(y%26 - 1)
y = y // 26
ans.append(... | N = int(eval(input()))
alp = [chr(i) for i in range(ord('a'), ord('z')+1)]
ans = []
while N > 0:
res = N % 26
ans.append(alp[res - 1])
N //= 26
if res == 0:
N -= 1
ans = ans[::-1]
print((''.join(ans))) | p02629 |
N,a=int(eval(input())),''
while 0<N:N-=1;a+=chr(ord('a')+N%26);N//=26
print((a[::-1])) | N,a=int(eval(input())),''
while 0<N:N-=1;a+=chr(97+N%26);N//=26
print((a[::-1])) | p02629 |
N = int(eval(input()))
string = ""
while N > 0:
N, remainder = divmod(N - 1, 26)
string = chr(65 + remainder) + string
print((string.lower())) | N = int(eval(input()))
string = ""
while N > 0:
N, remainder = divmod(N - 1, 26)
string = chr(97 + remainder) + string
print(string) | p02629 |
N = int(eval(input()))
# 桁数を決める
tmp = 0
digit = 1
tmp += pow(26, digit)
while N > tmp:
digit += 1
tmp += pow(26, digit)
order = N - (tmp - pow(26, digit)) - 1
X = [0] * digit
cur = digit - 1
while order > 0:
X[cur] = order % 26
order //= 26
cur -= 1
# X = list(reversed(X))
# pr... | N = int(eval(input()))
# 桁数を決める
digit = 1 # 桁数
num = pow(26, digit) # その桁数での最大番号
while num < N:
digit += 1
num += pow(26, digit)
# その桁数内でのNの順番を0-indexで求める.
# (つまり, 2桁であれば'aa' -> 0, 'zz' -> 675 となる.)
order = N - (num - pow(26, digit)) - 1
# orderを26進数表記する.
# 例えば, 3桁でorder=28のとき, X = [0, 1, 2]
... | p02629 |
def solve():
n = int(eval(input()))
a = 97
tmp = 0
index = 0
ans = []
for i in range(1, 12):
pre = tmp
tmp += 26 ** i
if n <= tmp:
index = i
n = n - pre
break
n = n - 1
for _ in range(0, index)[::-1]:
ans.... | def solve():
n = int(eval(input()))
l = 0
ans = ''
for i in range(1, 12):
if n <= 26 ** i:
l = i
break
n = n - 26 ** i
k = n - 1
for i in range(l):
ans = chr(k % 26 + 97) + ans
k = k // 26
print(ans)
... | p02629 |
n = int(eval(input()))-1
ans = []
while n >= 0:
n, y = divmod(n, 26)
ans.append(y)
n -= 1
ans.reverse()
def to_alpha(x):
return chr(x+ord('a'))
print((''.join(map(to_alpha, ans)))) | n = int(eval(input()))-1
ans = []
while n >= 0:
n, y = divmod(n, 26)
ans.append(y)
n -= 1
print((''.join([chr(x+ord('a')) for x in ans[::-1]])))
| p02629 |
n = int(eval(input()))
alph = "zabcdefghijklmnopqrstuvwxy"
ans = ""
while n >= 1:
div, mod = divmod(n, 26)
ans += alph[mod]
n = div
if mod == 0:
n -= 1
print((ans[::-1])) | n = int(eval(input()))
alph = "abcdefghijklmnopqrstuvwxyz"
ans = ""
while n >= 1:
n -= 1
div, mod = divmod(n, 26)
ans += alph[mod]
n = div
print((ans[::-1])) | p02629 |
# import sys
# import math #sqrt,gcd,pi
# import decimal
# import queue # queue
# import bisect
# import heapq # priolity-queue
# import time
# from itertools import product,permutations,\
# combinations,combinations_with_replacement
# 重複あり順列、順列、組み合わせ、重複あり組み合わせ
# import collections # deque
# from operato... | n = int(eval(input()))
s = []
while n!=0:
if n<=26:
s.append(n)
n = 0
else:
x = n % 26
if not x:
x = 26
s.append(x)
n = (n - 1) // 26
t = []
for i in range(len(s)-1,-1,-1):
t.append(chr(s[i]+96))
print((''.join(t))) | p02629 |
import sys
input = lambda: sys.stdin.readline().rstrip()
ans = ""
N = int(eval(input()))
while N > 0:
tmp = N % 26
if tmp == 0:
ans += chr(26+96)
if N == 26:
break
N //= 26
N -= 1
else:
ans += chr(tmp+96)
N //= 26
p... | N = int(eval(input()))
ans = ''
while N > 0:
N -= 1
ans += chr(ord('a') + N % 26)
N //= 26
print((ans[::-1])) | p02629 |
N = int(input())
s = []
a = 26
tmp = 1
for i in range(20):
s.append(tmp)
tmp += a
a *= 26
if tmp > 100000000000000000:
break
for i in range(len(s)):
if N >= s[i]:
continue
else:
size = i
break
b = N - s[size-1]
n2a = lambda c: chr(c+64)
... | N = int(eval(input()))
N -= 1
d = 26
for i in range(1,15):
if N >= d:
N -= d
d *= 26
else:
d //= 26
ans = ""
for j in range(i):
ans += chr(N // d + ord("a"))
N %= d
d //= 26
break
print(ans) | p02629 |
ans = []
n = int(eval(input()))
while n > 0:
i = n % 26
if i == 0:
i += 26
ans.append(chr(i + 96))
if n % 26 == 0:
n = n // 26 - 1
else:
n //= 26
ans.reverse()
print(("".join(ans))) | n = int(eval(input()))
keta = 1
end = 0
while True:
order = n - end
end += 26**keta
if n <= end:
break
keta += 1
order -= 1
ans = []
for i in range(keta):
ans.append(chr(order%26 + 97))
order //= 26
ans.reverse()
print(("".join(ans))) | p02629 |
N = int(eval(input()))
D = 26
lst = []
while N > 0:
# c = N%26
# if c == 0:
# ans += 'z'
# else:
# ans += chr(ord('a') + (N%26) - 1)
lst.append(N%D)
N //= D
# print(lst)
ans = ""
z = False
for i in range(len(lst)):
# print(i)
if i == len(lst)-1 and lst[i... | N = int(eval(input()))
ans = ""
while N > 0:
N-=1
ans += chr(ord('a') + N%26)
N//=26
print((ans[::-1])) | p02629 |
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)
n = int(eval(input()))
import string
from collections import deque
name_table = 'z' + string.ascii_lowercase
ans = deque()
while n > 0:
q = n // 26
m = n % 26
ans.appendleft(name_table[m])
if m == 0:
n = ... | import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)
n = int(eval(input()))
import string
from collections import deque
name_table = string.ascii_lowercase
ans = deque()
while n > 0:
n -= 1
m = n % 26
ans.appendleft(name_table[m])
n //= 26
print((''.join(ans)))
| p02629 |
def encode(x):
return chr(x + 97)
N = int(eval(input())) - 1
ans = []
while True:
q, r = divmod(N, 26)
ans.append(r)
if q == 0:
break
N //= 26
N -= 1
print(("".join(map(encode, ans[::-1]))))
| def encode(x):
return chr(x + 97)
def solve(N):
N -= 1
ans = []
while True:
q, r = divmod(N, 26)
ans.append(r)
if q == 0:
break
N //= 26
N -= 1
return "".join(map(encode, ans[::-1]))
print((solve(int(eval(input())))))
| p02629 |
import math
def nextString(text, p):
if text[p] != 'z':
text[p] = chr(ord(text[p])+1)
return text
else:
text[p] = 'a'
nextString(text, p - 1)
n = int(eval(input()))
base = 26
digit = math.floor(math.log(1+(base-1)*n, base))
position = int(n - (base**digit - 1... | import math
n = int(eval(input()))
base = 26
digit = math.floor(math.log(1+(base-1)*n, base))
position = int(n - (base**digit - 1) / (base - 1))
txt = 'a' * digit
txt = list(txt)
for i in range(digit):
txt[digit - i - 1] = chr(ord(txt[digit - i - 1])+(position % base))
position = position //... | p02629 |
# coding: utf-8
#import numpy as np
import re
import math
from collections import defaultdict
from collections import deque
import collections
from fractions import Fraction
import bisect
from queue import PriorityQueue
import itertools
from itertools import accumulate
from copy import deepcopy
from collec... | # coding: utf-8
#import numpy as np
import re
import math
from collections import defaultdict
from collections import deque
import collections
from fractions import Fraction
import bisect
from queue import PriorityQueue
import itertools
from itertools import accumulate
from copy import deepcopy
from collec... | p02629 |
N = int(eval(input()))
alpha = list('zabcdefghijklmnopqrstuvwxy')
ans = ''
def dfs(n):
global ans
if n <= 26:
ans += alpha[n%26]
return ans[::-1]
else:
ans += alpha[n % 26]
if n % 26 == 0:
nn = n // 26 - 1
else:
nn = n // 26
... | N = int(eval(input()))
alpha = list('zabcdefghijklmnopqrstuvwxy')
ans = ''
while N:
n = N % 26
ans += alpha[n]
N //= 26
N -= n == 0
print((ans[::-1])) | p02629 |
# -*- coding: utf-8 -*-
import sys
import math
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush
import itertools
from decimal import *
input = sys.stdin.readline
def inputInt(): return int(eval(input()))
def inputMap():... | # -*- coding: utf-8 -*-
import sys
import math
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush
import itertools
from decimal import *
input = sys.stdin.readline
def inputInt(): return int(eval(input()))
def inputMap():... | p02629 |
N = int(eval(input()))
ans = []
lst = []
n = N
while n > 26:
x = n%26
if x == 0:
n = n//26 - 1
else:
n = n//26
lst.append(x)
for i in range(len(lst)):
x = lst[i]
if x == 0:
y = chr(97+25)
else:
y = chr(97 + x-1)
ans.append(y)
an... | n = int(eval(input()))
ans = ""
while n:
n -= 1
ans += chr(n%26+ord("a"))
n //= 26
print((ans[::-1])) | p02629 |
import sys
from string import ascii_lowercase
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007
def main():
N = int(readline())
ans = []
while N:
N, r = N // 26, N % 26
if r =... | import sys
from string import ascii_lowercase
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007
def main():
N = int(readline())
ans = []
while N:
N, r = (N - 1) // 26, (N - 1) % 26
... | p02629 |
n=int(eval(input()))
a="abcdefghijklmnopqrstuvwxyz"
b=""
i=1
while n/26>0:
if n%26==0:
b="z"+b
else:
b=a[n%26-1]+b
n=n//26
print(b) | n=int(eval(input()))
a="zabcdefghijklmnopqrstuvwxy"
b=""
while n/26>0:
b=a[n%26]+b
n=(n-1)//26
print(b) | p02629 |
def actual(N, A):
return N ** 2 - A
N = int(eval(input()))
A = int(eval(input()))
print((actual(N, A))) | N = int(eval(input()))
A = int(eval(input()))
answer = (N * N) - A
print(answer)
| p03597 |
N=int(eval(input()))
print(((N*N)-int(eval(input())))) |
N=int(eval(input()))
A=int(eval(input()))
print(((N**2)-A)) | p03597 |
n = int(eval(input()))
a = int(eval(input()))
y = n * n
x = y - a
print(x) | n = int(eval(input()))
a = int(eval(input()))
print((n * n - a)) | p03597 |
N=int(eval(input()))
A=int(eval(input()))
print((N**2-A)) | n=int(eval(input()))
a=int(eval(input()))
print((n*n-a))
| p03597 |
n = int(eval(input()))
a = int(eval(input()))
print((n**2-a)) | n = int(eval(input()))
a = int(eval(input()))
print(((n**2)-a)) | p03597 |
a = int(eval(input()))
b = int(eval(input()))
print((a * a - b))
| a = int(eval(input()))
print((a * a - int(eval(input()))))
| p03597 |
n=sorted([int(eval(input())) for _ in range(int(eval(input())))],reverse=True);print((max(n)//2+sum(n[1:]))) | n=sorted([int(eval(input())) for _ in range(int(eval(input())))],reverse=True);print((sum(n)-max(n)//2)) | p03207 |
a=int(eval(input()));lis=[int(eval(input())) for i in range(a)]
print((int(max(lis)/2+sum(lis)-max(lis)))) | lis=[int(eval(input()))for i in range(int(eval(input())))];print((int(max(lis)/2+sum(lis)-max(lis)))) | p03207 |
n = int(eval(input()))
p = list(int(eval(input())) for _ in range(n))
p.append(p.pop(p.index(max(p))) // 2)
print((sum(p))) | def answer(n: int, p: []) -> int:
p.append(p.pop(p.index(max(p))) // 2)
return sum(p)
def main():
n = int(eval(input()))
p = list(int(eval(input())) for _ in range(n))
print((answer(n, p)))
if __name__ == '__main__':
main() | p03207 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.