| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 3 초 | 512 MB | 595 | 204 | 176 | 35.484% |
You are given an array $a$ of size $n$ and you need to perform $m$ queries on it. There are three types of queries:
& $l$ $r$ $x$": change $a_i$ to ($a_i$ AND $x$) for all $i$ = $l,ドル $l+1,ドル $\ldots,ドル $r$;| $l$ $r$ $x$": change $a_i$ to ($a_i$ OR $x$) for all $i$ = $l,ドル $l+1,ドル $\ldots,ドル $r$;? $l$ $r$": find the minimal value among $a_l,ドル $a_{l+1},ドル $\ldots,ドル $a_r$.Output the answers for all queries of the third type.
The first line contains one integer $n$ (1ドル \le n \le 5 \cdot 10^5$) --- the size of the array.
The second line contains $n$ space-separated integers $a_i$ (0ドル \le a_i < 2^{30}$) --- the elements of the array.
The third line contains one integer $m$ (1ドル \le m \le 2 \cdot 10^5$) --- the number of queries.
Next $m$ lines contain descriptions of queries in the format described above. For all queries 1ドル \le l \le r \le n,ドル for queries of the first and second types 0ドル \le x < 2^{30}$.
For each query of the third type, print the answer on a separate line.
5 1 2 3 4 5 4 & 1 2 6 | 3 5 4 ? 1 2 ? 3 5
0 4