結果
問題 |
No.327 アルファベット列
|
ユーザー |
![]() |
提出日時 | 2020-02-02 00:17:57 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 28 ms / 2,000 ms |
コード長 | 447 bytes |
コンパイル時間 | 77 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-09-18 20:25:37 |
合計ジャッジ時間 | 2,632 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 50 |
ソースコード
import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines N = int(read()) full = [26 ** n for n in range(10)] full[0] = 0 n = 0 while True: if sum(full[:n+1]) < N+1: n += 1 continue break N = N - sum(full[:n]) # n桁のN番目 A = [] for _ in range(n): N,r = divmod(N,26) A.append(r) answer = ''.join(chr(x + ord('A')) for x in A[::-1]) print(answer)