問題一覧 > 通常問題

No.3623 2-Letter Shiritori 2

レベル : / AI推定難易度 : 1250 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 1024 MB / スペシャルジャッジ問題 (複数の解が存在する可能性があります)
タグ : (AC するまで非表示) / 解いたユーザー数 62
作問者 : 👑 loop0919 / テスター : ぽえ
お気に入りにしたユーザー ProblemId : 13665 / 自分の提出
問題文最終更新日: 2026-08-17 21:44:39
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
yukicoder contest 509 (順位表) の他の問題:

Problem Statement

This problem is output-only. No input is given.

A sequence $X = (X_1, X_2, \cdots, X_n)$ of length $n$ consisting of strings of uppercase English letters is called a shiritori sequence if it satisfies the following condition.

  • For each $i = 1, 2, \cdots, n$, the last character of $X_i$ is equal to the first character of $X_{i + 1}$, where $X_{n + 1} = X_1$.

There are $26^2$ possible strings of length $2$ consisting of uppercase English letters.
Among the sequences $S = (S_1, S_2, \cdots, S_{26^2})$ that list all of these strings without duplication, present one that is a shiritori sequence.

Input

No input is given in this problem.

Output

Output a sequence $S$ satisfying the conditions of the problem statement in the following format. Here, at least $1$ such $S$ exists.

$S_1$
$S_2$
$\vdots$
$S_{26^2}$

Sample

Sample 1

An example of output that does not satisfy the conditions of the problem statement is shown below.

Input

Output
AA
AB
BC
CA

This sample output does not satisfy the conditions of the problem statement, for the following reason.

  • For $i = 1, 2, 3, 4$, the last character of $S_i$ is equal to the first character of $S_{i+1}$, but this $S$ is not a sequence listing all strings of length $2$ consisting of uppercase English letters in the first place.

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