結果

問題 No.327 アルファベット列
ユーザー brthyyjpbrthyyjp
提出日時 2021-04-22 11:06:52
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 36 ms / 2,000 ms
コード長 258 bytes
コンパイル時間 216 ms
コンパイル使用メモリ 82,116 KB
実行使用メモリ 54,024 KB
最終ジャッジ日時 2024-07-04 06:17:42
合計ジャッジ時間 3,322 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 50
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())

i = 1
temp = 0
while temp <= n:
    temp += pow(26, i)
    i += 1
temp -= pow(26, i-1)
R = n-temp

res = []
for k in range(i-1):
    q, r = divmod(R, 26)
    res.append(chr(r+ord('A')))
    R = q
res.reverse()
res = ''.join(res)
print(res)
0