#5230. Unvarnished Report
0
Unvarnished Report
Unvarnished Report
题目描述
KEYENCE 有一种如实报告事物的文化,无论好坏。You are given two strings $S$ and $T$, consisting of lowercase English letters.
所以我们想检查所报告的内容是否与原文完全相同。
If $S$ and $T$ are equal, print $0$; otherwise, print the position of the first character where they differ.
Here, if the $i$-th character exists in only one of $S$ and $T$, consider that the $i$-th characters are different. More precisely, if $S$ and $T$ are not equal, print the smallest integer $i$ satisfying one of the following conditions:
, , and . |S| < i \leq |T|. |T| < i \leq |S|.
Here, and denote the lengths of and , respectively, and and denote the -th characters of and , respectively.
输入格式
The input is given from Standard Input in the following format:
输出格式
If and are equal, print ; otherwise, print the position of the first character where they differ.
abcde
abedc
3
abcde
abcdefg
6
keyence
keyence
0
提示
and are strings of length between and , inclusive, consisting of lowercase English letters.We have and .
and have the same first and second characters, but differ at the third character, so print .
We have and .
and are equal up to the fifth character, but only has a sixth character, so print .
and are equal, so print .
标签: AtCoder|abc374B
来源
AtCoder|abc374B