QOJ.ac

QOJ

حد الوقت: 5 s حد الذاكرة: 1024 MB مجموع النقاط: 100

#18801. Последовательность и Запрос 43

الإحصائيات

Дана последовательность $A_1, A_2, \ldots, A_N$ длины $N$. Напишите программу, которая выполняет следующие запросы:

  • 1 i: Вывести $A_i$. ($1 \le i \le N$)
  • 2 x y t: Если среди $A_x, A_{x+1}, \ldots, A_y$ существует число, меньшее $t$, то игнорировать этот запрос. В противном случае вычесть $t$ из каждого $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: Для всех $x \le i \le y$ установить $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: Для всех $x \le i \le y$ установить $A_i = \lfloor \sqrt A_i \rfloor$. ($1 \le x \le y \le N$)

Входные данные

Первая строка содержит два целых числа $N$ и $Q$ — длина последовательности и количество запросов. ($1 \le N \le 100\,000$, $1 \le Q \le 500\,000$)

Вторая строка содержит $A_1, A_2, \ldots, A_N$. ($1 \le A_i \le 10^{18}$)

Следующие $Q$ строк содержат по одному запросу, как описано выше.

Выходные данные

Для каждого запроса типа 1 i выведите одну строку с результатом в порядке выполнения запросов.

Примеры

Входные данные 1

Выходные данные 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.