You have N integers A1, A2, ... , AN. You are asked to write a program to receive and execute two kinds of instructions: 1. C a b means performing Ai = for all Ai such that a ≤ i ≤ b. 2. Q a b means query the sum of Aa, Aa+1, ..., Ab. Note that the sum is not taken modulo 2018.
You have N integers A1, A2, ... , AN. You are asked to write a program to receive and execute two kinds of instructions: 1. C a b means performing Ai = (Ai2 mod 2018) for all Ai such that a ≤ i ≤ b. 2. Q a b means query the sum of Aa, Aa+1, ..., Ab. Note that the sum is not taken modulo 2018.
(图片来源网络,侵删)