P10899 [Lanqiao Cup 2024 NOI Qualifier C] Audition Dance
Description
Xiao Lan has recently become addicted to a game called “Audition Dance”. Specifically, as long as you press the corresponding keys in order according to the key prompts given in the game, the character in the game can dance to the rhythm. For $K$ consecutive correct keystrokes, if the time interval between any two consecutive keystrokes is less than or equal to $1\texttt s$, then we call it a $K$ combo. Now you are given a game record file of Xiao Lan. In log.txt, there are $N$ records. Each record has three fields, in order: the correct character to be pressed, the character typed by Xiao Lan, and the millisecond timestamp corresponding to the time when the character was typed. Now please compute the maximum $K$ combo. You only need to output the value of $K$.
Input Format
For convenience of evaluation, the input data has been replaced by log.txt. On Luogu, you may read log.txt from standard input, or download it from the provided files.
Output Format
This is a result-only fill-in-the-blank problem. You only need to submit the result after computing it. The result of this problem is an integer. When submitting the answer, only fill in this integer; any extra content will make you score zero.
Explanation/Hint
Translated by ChatGPT 5