#C3533. Count Urgent Feedbacks
Count Urgent Feedbacks
Count Urgent Feedbacks
Given a current timestamp in the format YYYY-MM-DD HH:MM:SS
and a list of feedbacks, each consisting of a severity level and a timestamp, your task is to count the number of feedbacks with severity "urgent" that were submitted in the past 24 hours.
A feedback is counted if its timestamp \( t \) satisfies \( cutoff < t \le current\_time \), where \( cutoff = current\_time - 24 \text{ hours} \).
inputFormat
The input is given via standard input (stdin) and has the following format:
- The first line contains a timestamp
current_time
in the formatYYYY-MM-DD HH:MM:SS
. - The second line contains an integer
N
representing the number of feedback entries. - The following
N
lines each contain a feedback entry. Each entry is a string in the format:severity timestamp
, whereseverity
is a string andtimestamp
is in the same format as above.
outputFormat
Output a single integer via standard output (stdout) representing the number of urgent feedbacks submitted in the last 24 hours.
## sample2023-10-03 14:00:00
6
urgent 2023-10-02 14:01:00
low 2023-10-02 13:59:59
urgent 2023-10-02 13:00:00
medium 2023-10-02 15:00:00
urgent 2023-10-03 13:59:59
urgent 2023-10-03 14:00:00
3