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.