103420: [Atcoder]ABC342 A - Yay!
Memory Limit:256 MB
Time Limit:2 S
Judge Style:Text Compare
Creator:
Submit:15
Solved:0
Description
Score: $150$ points
Problem Statement
You are given a string $S$ consisting of lowercase English letters. The length of $S$ is between $3$ and $100$, inclusive.
All characters but one of $S$ are the same.
Find $x$ such that the $x$-th character of $S$ differs from all other characters.
Constraints
- $S$ is a string of length between $3$ and $100$, inclusive, consisting of two different lowercase English letters.
- All characters but one of $S$ are the same.
Input
The input is given from Standard Input in the following format:
$S$
Output
Print the answer.
Sample Input 1
yay
Sample Output 1
2
The second character of yay
differs from the first and third characters.
Sample Input 2
egg
Sample Output 2
1
Sample Input 3
zzzzzwz
Sample Output 3
6
Input
Output
分数:150分
问题描述
给你一个由小写英文字母组成的字符串$S$。$S$的长度在3到100之间,包括3和100。
$S$中除了一个字符外,其他字符都相同。
找到这样的$x$,使得$S$的第$x$个字符与其他字符不同。
约束条件
- $S$是一个长度在3到100之间的字符串,由两种不同的小写英文字母组成。
- $S$中除了一个字符外,其他字符都相同。
输入
输入数据通过标准输入给出,如下所示:
$S$
输出
输出答案。
样例输入1
yay
样例输出1
2
yay
的第二个字符与其他字符不同。
样例输入2
egg
样例输出2
1
样例输入3
zzzzzwz
样例输出3
6