#K37462. Perform List Operations
Perform List Operations
Perform List Operations
You are given an initially empty list of size n (all elements are 0). You need to perform a sequence of operations on this list. Each operation is given in one of the following two forms:
- insert i v: Set the element at index i to value v.
- remove i: Reset the element at index i back to 0.
It is guaranteed that the index satisfies the condition \(0 \leq i < n\). After performing all the operations in the given order, output the final state of the list.
inputFormat
The input is read from standard input (stdin) and has the following format:
- The first line contains an integer n, the size of the list.
- The second line contains an integer m, the number of operations.
- Each of the following m lines contains an operation in one of the two formats:
- insert i v
- remove i
Note that \(0 \leq i < n\).
outputFormat
Output the final list after performing all operations. The list elements should be printed in order in a single line, separated by a single space. The output should be sent to standard output (stdout).
## sample5
1
insert 1 10
0 10 0 0 0