#K35952. Taco Log Report Manager

    ID: 25645 Type: Default 1000ms 256MiB

Taco Log Report Manager

Taco Log Report Manager

The Taco Log Report Manager problem involves processing a series of operations performed on a logging system. You are given an initially empty log and a set of operations. Operation type 1 is AddLog which appends a new log entry. Operation type 3 is GenerateReport that, given an integer \(t\), requires you to count the number of log entries in the first \(t\) entries of the log. Operation type 2 is provided in the input but does not affect the log.

Your task is to simulate this series of operations and output the report counts for each GenerateReport operation. Use the standard input for reading data and write results to the standard output.

inputFormat

The input begins with a line containing two integers (m) and (p), where (m) is the number of users (which you do not necessarily use) and (p) is the number of operations. Each of the following (p) lines contains two integers: the first indicates the operation type (1, 2, or 3) and the second is the parameter for that operation. For a GenerateReport operation (type 3), the parameter (t) specifies that you should count log entries among the first (t) entries.

outputFormat

For each GenerateReport operation (operation type 3), output a single integer representing the count of log entries among the first (t) log records. Each result should be printed on a new line.## sample

3 5
1 1
1 2
1 3
3 3
2 2
3

</p>