問題一覧 > 通常問題

No.3036 Nauclhlt-Type String

レベル : / AI推定難易度 : 130 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 174
作問者 : nauclhlt / テスター : eiram Blue_S naniwazu
お気に入りにしたユーザー ProblemId : 11784 / 自分の提出
問題文最終更新日: 2025-02-09 01:31:41
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 458 (順位表) の他の問題:

Story

It is well known that nauclhlt is made from null and acht.

Problem Statement

For a pair of strings $(X, Y)$ satisfying $|X|=|Y|=L$, the corresponding Nauclhlt-type string is the string $Z$ of length $2L$ such that $Z_{2i-1}=X_i,\ Z_{2i}=Y_i$ for each $i(1\leq i\leq L)$.
For example, the Nauclhlt-type string corresponding to (bu, le) is blue.

You are given a string $S$ of length $N$. Determine whether there exists a pair of strings $(P, Q)$ of equal length whose corresponding Nauclhlt-type string equals $S$, and if it exists, find such a pair $(P, Q)$.

Notation for strings For a string $A$, $|A|$ denotes the length of $A$, and $A_i(1\leq i\leq |A|)$ denotes the $i$-th character of $A$.

Input

$N$
$S$
  • $1\leq N\leq 10^5$
  • $S$ is a string of length $N$ consisting of lowercase English letters
  • $N$ is an integer

Output

If a pair $(P, Q)$ satisfying the conditions exists, print Yes on the first line, and on the second line print $P$ and $Q$ in this order, separated by a space. If it does not exist, print only No.
Print a newline at the end.

Sample

Sample 1
Input
8
nauclhlt
Output
Yes
null acht

This is the natural result.

Sample 2
Input
5
apple
Output
No

No pair $(P, Q)$ satisfying the conditions exists. Therefore, print No.

Sample 3
Input
6
ababab
Output
Yes
aaa bbb

Pay attention to the output format.

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