시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
1 초 (추가 시간 없음) | 128 MB | 8 | 3 | 3 | 37.500% |
Ivan is writing down numbers in his notebook. In the beginning he has a set of integers $S$ written down. Afterwards, he may write down new numbers in his notebook, by using the following operations:
Denote by $f(S)$ the minimal number Ivan can write down in his notebook for the starting set $S$.
You are given an array of length $N$ and $Q$ queries where you have to perfortm one of the following operations:
In the first line of input is the numbers $N$ ($N\leq 100000$): the length of the array.
In the second line of input is $N$ integers $a[1],a[2],\cdots,a[N]$ ($0<a[i]<2^{62}$), the elements of $a$.
In the thirst line of input is the number $Q$ ($Q\leq 100000$): the number of queries.
The following $Q$ lines describe the queires. A query can either be of the format "$1$ $x$ $y$" meaning set $a[x]$ ($1\leq x\leq N$) to $y$ ($0<y<2^{62}$), or of the format "$2$ $l$ $r$" meaning find the value of $f(\{a[L],a[L+1],\cdots,a[R]\})$ ($1\leq L\leq R\leq N$).
For every query of type two print the value of $f(\{a[L],a[L+1],\cdots,a[R]\})$ in a single line.
3 3 5 15 3 2 1 3 1 2 11 2 1 2
3 1