#P4433. [COCI 2009/2010 #1] ALADIN
[COCI 2009/2010 #1] ALADIN
Description
You are given boxes and operations of two types:
- Type 1 operation with input format
1 L R A B: for each box with , set its number of stones to , where is the index of the box. - Type 2 operation with input format
2 L R: query the total number of stones in boxes numbered through .
Input Format
The first line contains two integers () and ().
The next lines describe the operations.
Output Format
For each type 2 operation, output the total number of stones.
6 3
2 1 6
1 1 5 1 2
2 1 6
0
3
4 5
1 1 4 3 4
2 1 1
2 2 2
2 3 3
2 4 4
3
2
1
0
4 4
1 1 4 7 9
2 1 4
1 1 4 1 1
2 1 4
16
0
Hint
- For of the testdata, .
- For of the testdata, .
- For of the testdata, .
Translated by ChatGPT 5
京公网安备 11011102002149号