結果

問題 No.327 アルファベット列
コンテスト
ユーザー cologne
提出日時 2025-12-02 13:37:53
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 130 ms / 2,000 ms
+ 271µs
コード長 449 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 235 ms
コンパイル使用メモリ 96,108 KB
実行使用メモリ 85,120 KB
最終ジャッジ日時 2026-07-17 05:58:13
合計ジャッジ時間 9,445 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 50
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import string
import sys
from itertools import count


def input(): return sys.stdin.readline().rstrip('\n')


def main():
    n = int(input())
    for l in count(1):
        if n < 26 ** l:
            ans = ''
            for _ in range(l):
                ans = string.ascii_uppercase[n % 26] + ans
                n //= 26
            print(ans)
            return

        else:
            n -= 26 ** l


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