結果

問題 No.327 アルファベット列
ユーザー Theta
提出日時 2022-10-24 15:56:06
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 448 bytes
コンパイル時間 122 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-07-02 18:13:10
合計ジャッジ時間 3,303 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 1 WA * 49
権限があれば一括ダウンロードができます

ソースコード

diff #

def num2ALPHABET(num: int) -> str:
    return chr(65+num)


def main():
    N = int(input())
    if not N:
        print("A")
        return
    base26 = []
    while N:
        base26.append(N % 26)
        N //= 26
    base26.reverse()
    if len(base26) == 1:
        print(num2ALPHABET(base26[0]))
    else:
        print(num2ALPHABET(base26[0]-1) +
              "".join(map(num2ALPHABET, base26[1:])))


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