#P6521. [CEOI 2010] pin (day2)
[CEOI 2010] pin (day2)
Description
Given strings of length , you need to find how many pairs of strings have exactly positions where the corresponding characters are different.
Input Format
The first line contains two integers .
The next lines each contain a string of length .
Output Format
Output one integer on a single line, representing the number of pairs of strings that satisfy the condition.
4 1
0000
a010
0202
a0e2
0
4 2
0000
a010
0202
a0e2
3
Hint
Sample Explanation
Sample 1 Explanation
Any two strings differ in more than one position.
Sample 2 Explanation
There are three pairs of strings: 0000,a010 a010,a0e2 0000,0202.
Constraints
- For of the testdata, it is guaranteed that .
- For of the testdata, it is guaranteed that .
- For of the testdata, it is guaranteed that .
- For of the testdata, it is guaranteed that the strings contain only lowercase letters and digits, so they can be treated as hexadecimal numbers.
- For of the testdata, it is guaranteed that , , all input strings are distinct, and each character in the string is either or a digit character.
Notes
This problem is translated from CEOI 2010 day 2 T2 pin.
The copyright of this translation belongs to the problem provider
https://www.luogu.com.cn/user/45475
Translated by ChatGPT 5
京公网安备 11011102002149号