#P8254. King Kri's Prediction Contest
King Kri's Prediction Contest
King Kri's Prediction Contest
King Kri, the wise ruler, has organized a contest to test the wit of his ministers. The contest consists of \( n \) true/false questions answered by \( m \) ministers (with \( m \) being an odd number). For the \( i \)-th question, let \( x \) be the number of ministers who answered True and \( y = m - x \) be the number who answered False. Since \( m \) is odd, we are guaranteed that \( x \neq y \). You predict that the answer for the \( i \)-th question is True if \( x > y \), and False otherwise. After the contest, the official answers are released. Your task is to determine how many of your predictions are correct.
inputFormat
The input begins with two integers \( n \) and \( m \) \( (1 \le n \le 10^5,\ m \text{ is odd}) \), representing the number of questions and the number of ministers respectively. The next \( n \) lines each contain an integer \( x \) \( (0 \le x \le m) \), where \( x \) denotes the number of ministers who answered True for that question. The final line contains a string of length \( n \) consisting solely of the characters 'T' and 'F', which represents the official answers for the questions in order.
outputFormat
Output a single integer representing the number of questions for which your prediction matches the official answer.
sample
3 5
3
5
1
TFT
1