結果

問題 No.327 アルファベット列
ユーザー sue_charo
提出日時 2017-04-14 17:30:34
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 905 bytes
コンパイル時間 71 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 11,648 KB
最終ジャッジ日時 2024-07-18 15:17:08
合計ジャッジ時間 2,687 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 29 WA * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

# coding: utf-8
import array, bisect, collections, heapq, itertools, math, random, re, string, sys, time
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
mod = 10 ** 9 + 7

def II(): return int(input())
def ILI(): return list(map(int, input().split()))
def IAI(LINE): return [ILI() for __ in range(LINE)]
def IDI(): return {key: value for key, value in ILI()}


N = II()

alph_list = [chr(i) for i in range(65, 65 + 26)]


def main():
    ans = collections.deque()
    first_char = alph_list[N % 26]
    ans.append(first_char)

    if N // 26 > 0:
        now_num = N // 26
        while True:
            next_div = now_num // 26
            next_char = alph_list[now_num % 26 - 1]
            ans.appendleft(next_char)
            
            if next_div == 0:
                break
            
            now_num = next_div

    return "".join(list(ans))


if __name__ == "__main__":
    print(main())
0