#P8524. [Ynoi2078] 《A theory of consciousness from a theoretical computer scienceperspective: Insights from the Conscious Turing Machine》阅读报告(更新中...)

[Ynoi2078] 《A theory of consciousness from a theoretical computer scienceperspective: Insights from the Conscious Turing Machine》阅读报告(更新中...)

Problem Description

Given a sequence a1,,ana_1,\dots,a_n of length nn, you need to perform mm operations. There are three types of operations:

Operation 1: Given l,r,xl,r,x, first create a new array bb such that bi=aib_i=a_i. Then simultaneously modify ax,,ax+rla_x,\dots,a_{x+r-l} to bl,,brb_l,\dots,b_r.

Operation 2: Given l,rl,r, simultaneously modify al,,ara_l,\dots,a_r to the value obtained by dividing by 22 and taking the floor.

Operation 3: Given l,rl,r, compute the sum of al,,ara_l,\dots,a_r.

Input Format

The first line contains an integer nn.

The next line contains nn integers representing the sequence a1,,ana_1,\dots,a_n.

The next line contains an integer mm.

The next mm lines each describe one operation:

1 l r x means Operation 1.

2 l r means Operation 2.

3 l r means Operation 3.

Output Format

For each Operation 3, output one line containing one integer, which is the answer.

10
1 81 93 81 16 97 63 26 66 13
10
1 1 5 3
3 5 6
3 9 9
3 1 3
3 1 7
2 1 3
3 3 9
1 5 6 6
3 1 4
3 3 9
174
66
83
354
363
121
440
10
61 53 17 97 81 17 1 91 38 93
10
2 3 6
2 1 8
3 1 5
3 1 1
3 1 7
3 3 5
3 1 4
2 2 10
2 1 5
3 5 5
104
30
108
48
84
5

Hint

Warning: Misusing this problem will result in your account being banned.

For 100%100\% of the data, 1n31061\le n\le 3\cdot 10^6 and 1m31061\le m\le 3\cdot 10^6.

The initial values of the sequence satisfy 1ai1091\le a_i\le 10^9.

For each operation, 1lrn1\le l\le r\le n.

For each Operation 1, 1xx+rl+1n1\le x\le x+r-l+1\le n.

All values above are integers.

Translated by ChatGPT 5