QOJ.ac

QOJ

시간 제한: 5 s 메모리 제한: 1024 MB 총점: 100

#18801. Ciąg i Zapytanie 43

통계

Dany jest ciąg $A_1, A_2, \ldots, A_N$ długości $N$. Napisz program, który wykonuje następujące zapytania:

  • 1 i: Wypisz $A_i$. ($1 \le i \le N$)
  • 2 x y t: Jeśli istnieje liczba mniejsza niż $t$ wśród $A_x, A_{x+1}, \ldots, A_y$, zignoruj to zapytanie. W przeciwnym razie odejmij $t$ od każdego z $A_x, A_{x+1}, \ldots, A_y$. ($1 \le x \le y \le N$, $1 \le t \le 10^{18}$)
  • 3 x y t: Dla wszystkich $x \le i \le y$ ustaw $A_i = t + i - y$. ($1 \le x \le y \le N$, $t - y + x \ge 0$, $1 \le t \le 10^{18}$)
  • 4 x y: Dla wszystkich $x \le i \le y$ ustaw $A_i = \lfloor \sqrt A_i \rfloor$. ($1 \le x \le y \le N$)

Wejście

Pierwszy wiersz zawiera dwie liczby całkowite $N$ i $Q$, długość ciągu oraz liczbę zapytań. ($1 \le N \le 100\,000$, $1 \le Q \le 500\,000$)

Drugi wiersz zawiera $A_1, A_2, \ldots, A_N$. ($1 \le A_i \le 10^{18}$)

Kolejne $Q$ wierszy zawiera po jednym zapytaniu, jak opisano powyżej.

Wyjście

Dla każdego zapytania typu 1 i wypisz w osobnym wierszu wynik w kolejności.

Przykład

Wejście 1

```

#### Wyjście 1

```

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.