QOJ.ac

QOJ

Time Limit: 2 s Memory Limit: 1024 MB

#23941. Lettere uguali

Statistics

È data una stringa $S$ di lunghezza $N$. Ogni carattere di $S$ è una lettera minuscola dell'alfabeto inglese.

Stampa Yes se $S$ è composta interamente dallo stesso carattere, e No altrimenti.

Input

L'input è fornito nel seguente formato:

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

Output

Stampa Yes se $S$ è composta interamente dallo stesso carattere, e No altrimenti.

Non stampare nient'altro oltre alla risposta. (Non stampare frasi che richiedono l'input, ecc.)

Per il formato della risposta, puoi fare riferimento ai problemi di prova e relative soluzioni di esempio.

Vincoli

  • $2 \le N \le 100$.
  • $S$ è una stringa di lunghezza $N$.
  • Ogni carattere di $S$ è una lettera minuscola dell'alfabeto inglese.
  • $N$ è un numero intero.

Esempi

Input 1

4
bbbb

Output 1

Yes

Note 1

  • Poiché la stringa bbbb è composta interamente dallo stesso carattere b, si stampa Yes.

Input 2

7
pppdppp

Output 2

No

Note 2

  • Poiché la stringa pppdppp contiene p e d e non è composta interamente dallo stesso carattere, si stampa No.

Input 3

2
xx

Output 3

Yes

Note 3

  • Poiché la stringa xx è composta interamente dallo stesso carattere x, si stampa Yes.

Input 4

9
joijoijoi

Output 4

No

Note 4

  • Poiché la stringa joijoijoi non è composta interamente dallo stesso carattere, si stampa 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.