問題一覧 > 通常問題

No.1362 [Zelkova 8th Tune] Black Sheep

レベル : / AI推定難易度 : 115 / 実行時間制限 : 1ケース 1.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (解説公開後に AC するまで非表示) / 解いたユーザー数 232
作問者 : 👑 Kazun / テスター : Kanten4205
お気に入りにしたユーザー ProblemId : 5137 / 自分の提出
問題文最終更新日: 2021-01-22 20:13:36
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 279 (Zelkova and Cherry) (順位表) の他の問題:

Note

The problems of yukicoder contest 279 (Zelkova and Cherry) are not arranged in order of difficulty. Therefore, you are strongly encouraged to choose which problems to attempt based on publicly available information such as the problem statements, the number of stars indicating difficulty, and the number of accepted solvers.

Problem Statement

The given string $S$ consists of two kinds of characters, and all of its characters are the same except for one. At which position, counting from the left, is that one different character? Also, what is that character?

Input

The input is given from standard input in the following format.
$S$

  • $S$ is a string.
  • $3 \leq |S| \leq 5 \times 10^5 \quad$ Here, $|S|$ denotes the length of the string $S$.
  • Each character of $S$ is an uppercase English letter (A-Z), a lowercase English letter (a-z), or a digit (0-9).
  • $S$ consists of two kinds of characters.
  • All characters of $S$ are the same except for one.

Output

If the one different character in the given string $S$ is the $k$-th character from the left and that character is $\alpha$, output as follows.

$k\ \alpha$

The values must be separated by a space, and do not forget the newline at the end.

Sample

Sample 1
Input
WWWWBW
Output
5 B

In the given string, only the 5th character from the left is B, so output as above.

Sample 2
Input
PPPPPP3PPP
Output
7 3

Sample 3
Input
aaAa
Output
3 A

Note that uppercase and lowercase letters are distinguished.

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