問題一覧 > 通常問題

No.701 Solo Shiritori

レベル : / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / スペシャルジャッジ問題 (複数の解が存在する可能性があります)
タグ : (AC するまで非表示) / 解いたユーザー数 272
作問者 : はむこ / テスター : ixmel
お気に入りにしたユーザー ProblemId : 1506 / 自分の提出
問題文最終更新日: 2026-06-27 04:09: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
yukicoder contest 193 (順位表) の他の問題:

Problem Statement

Finish a game of shiritori in exactly $n$ turns.

The rules are as follows.
(1) A word may be any string of lowercase letters with length between 1 and 20, inclusive.
(2) If the last letter of a word is the same as the first letter of the next word, the shiritori continues.
(3) The shiritori ends when, and only when, a word ending in n is said.
(4) Any word may be used at the start.
(5) The same word must not be used two or more times.

Input

n

$1 \leq n \leq 100000$

Output

Output $n$ lines, each containing a string of lowercase letters with length between 1 and 20, inclusive.

Sample

Sample 1
Input
7
Output
kyuridenamida
anta
acrush
hec
climpet
tourist
tozangezan

Honorifics omitted.

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