#K13246. Task Manager
Task Manager
Task Manager
You are given n tasks and m operations to perform on these tasks. Initially, each task has a progress value of 0. There are two types of operations:
increase i x
– Increase the progress of the i-th task by x.query i
– Output the current progress of the i-th task.
Process all the operations in order and for each query
, print the queried progress.
Note: The operations are given one per line. The input begins with two integers n and m, the number of tasks and operations, respectively.
The formula for updating a task's progress can be represented as: $$progress_i = progress_i + x$$ for an increase
operation.
inputFormat
The first line contains two integers n and m, representing the number of tasks and the number of operations.
The next m lines each contain an operation in one of the following formats:
increase i x
: Increase the progress of task i by x.query i
: Query the current progress of task i.
outputFormat
For each query
operation, output the current progress of the specified task on a separate line.
5 6
increase 1 10
increase 2 5
query 1
increase 1 3
query 1
query 2
10
13
5
</p>