#CCBCHBAHAI0000115. Q lệnh GET/SET trên mảng tĩnh
Q lệnh GET/SET trên mảng tĩnh
Q GET/SET Operations on a Static Array
Source: Phước Hưng OJ
Version: Phuoc Hung OJ Extended
Problem
Maintain a fixed-size array under operations. GET p prints the current ; SET p x assigns and prints nothing. Every is valid and operations are processed in order.
Input
The first line contains , the second line the initial array, followed by command lines.
Output
Print one line for each GET command.
Subtask
Subtask 1 (20 points): .
Subtask 2 (30 points): .
Subtask 3 (50 points): , values within in magnitude.
Example
Input
4 5
10 20 30 40
GET 1
SET 1 99
GET 1
SET 3 -5
GET 3
Output
20
99
-5
Explanation
Each GET observes all earlier SET operations.