問題一覧 > 通常問題

No.327 Alphabet Sequence

レベル : / AI推定難易度 : 650 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 361
作問者 : yuki2006
お気に入りにしたユーザー ProblemId : 904 / 自分の提出
問題文最終更新日: 2022-12-08 21:39:33
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
Advent Calendar Contest 2015 (順位表) の他の問題:

Problem Statement

We want to convert a number $N$, starting from 0, into its corresponding alphabet string.
An alphabet string represents a number using the $26$ uppercase letters.

Specifically, the order is as follows. (Each comma-separated item is one alphabet string.)
$A,B,C,\dots,Z,AA,AB,\dots,AZ,BA,BB,\dots,ZZ,AAA,\dots,ZZZ,AAAA,\dots$

Given an integer $N$, find the $N$-th alphabet string.

Input

N

$N$ is an integer.
$0 \le N \le 1000000000000=10^{12}$

Output

Print the corresponding uppercase alphabet string.
Print a newline at the end.

Sample

Sample 1
Input
0
Output
A

0 corresponds to "A".

Sample 2
Input
25
Output
Z

Sample 3
Input
26
Output
AA

"AA" comes after "Z".

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。