#P6215. 函数求值
函数求值
Description
There are two weighted sequences of length , constants , and two functions:
There are operations, of the following three types:
-
: modify to .
-
: modify to .
-
: query the value of .
Input Format
The first line contains four integers .
The second line contains integers, representing the sequence .
The third line contains integers, representing the sequence .
The next lines each describe one operation.
Output Format
For each operation of the form , output the answer.
10 10 1 1
0 1 8 8 5 6 6 8 0 1
9 2 8 8 6 2 5 0 1 8
3 9
1 2 3
3 10
3 5
2 10 0
3 10
1 5 9
2 9 7
3 9
3 4
610
1034
390
674
1018
246
10 10 873892251 2
393158301 365328187 234823508 38818450 963771276 826653462 358628534 626503513 239326879 647251399
1 1 1 1 1 1 1 1 1 1
1 6 861625956
1 2 300158647
1 2 84103073
3 8
1 1 942644245
1 9 883742604
1 2 974963615
3 5
1 8 710319943
3 1
35415628
483475596
154061492
10 10 480345252 3
494173949 364489100 93066339 249297520 207335443 117096873 864460454 113006173 214332928 582507765
5658914 222040024 221653308 296560771 594076100 151232714 410372721 23331041 374481229 184401699
3 6
3 8
1 1 931776921
1 6 44943479
1 6 946828878
1 4 9046748
3 3
1 7 692410213
1 10 483672045
3 10
214010503
321766325
894782746
274293582
Hint
Sample Explanation
This is the result after the 4th operation in Sample 1:
Constraints
-
For of the testdata:
.
.
, .
.
-
Detailed constraints:
Test point ID Special property None A B None A: At any time, all .
B: There is no operation of type 2.
Hint
Sample 2 satisfies property A, and Sample 3 satisfies property B.
Translated by ChatGPT 5
京公网安备 11011102002149号