QOJ.ac

QOJ

Time Limit: 2 s Memory Limit: 1024 MB

#23941. 揃った文字

Statistics

長さ $N$ の文字列 $S$ が与えられる.$S$ の各文字は英小文字である.

$S$ がすべて同じ文字からなるならば Yes を,そうでないならば No を出力せよ.

入力

入力は以下の形式で与えられる.

$$ \begin{aligned} &N \\ &S \end{aligned} $$

出力

$S$ がすべて同じ文字からなるならば Yes を,そうでないならば No を出力せよ.

答え以外は何も出力しないこと.(入力を促す文章なども出力しないこと.)

解答形式については,練習問題やその解答例 を参考にしても良い.

制約

  • $2 \le N \le 100$.
  • $S$ は長さ $N$ の文字列である.
  • $S$ の各文字は英小文字である.
  • $N$ は整数である.

入出力例

入力 1

4
bbbb

出力 1

Yes

解説 1

  • 文字列 bbbb はすべて同じ文字 b からなるので,Yes を出力する.

入力 2

7
pppdppp

出力 2

No

解説 2

  • 文字列 pppdppp には p と d が含まれ,すべて同じ文字からなるわけではないため,No を出力する.

入力 3

2
xx

出力 3

Yes

解説 3

  • 文字列 xx はすべて同じ文字 x からなるので,Yes を出力する.

入力 4

9
joijoijoi

出力 4

No

解説 4

  • 文字列 joijoijoi はすべて同じ文字からなるわけではないため,No を出力する.

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.