시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
2 초 | 512 MB | 1213 | 138 | 83 | 9.618% |
We all love problems without a story, who doesn’t?! Here’s one more.
In this problem you are given an array of N integers a1, a2, · · · , aN. Followed by Q queries, each query will be in one of the following types:
Your program will be tested on one or more test cases. The first line of the input will be a single integer T (1 ≤ T ≤ 100) representing the number of test cases. Followed by T test cases.
Each test case starts with a line containing 2 integers separated by a space, N (1 ≤ N ≤ 105)
representing the number of integers in the array and Q (1 ≤ Q ≤ 20, 000) representing the number of queries.
Followed by a line containing N integers separated by a space, which are the initial integers in the array a1, a2, . . . , aN (1 ≤ ai ≤ 106).
Followed by Q lines, each line will be in one of the following formats (1 ≤ L ≤ R ≤ N) and (1 ≤ x ≤ 106):
For each query of the second type, print the corresponding answer in a single line.
1 10 7 1 5 123 53 12 2901 12 1234 657 3419 2 3 7 3 5 8 1 1 2 4 3 1 6 1000 2 1 10 2 2 8 1 3 5
3101 14260 9183
ICPC > Regionals > Africa and Arab > Arab Collegiate Programming Contest > 2017 Arab Collegiate Programming Contest J번