QOJ.ac

QOJ

実行時間制限: 10 s メモリ制限: 512 MB 満点: 100

#18790. Последовательность и запрос 32

統計

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

  • 1 x v: Изменить $A_x$ на $v$.
  • 2 k b_1 ... b_k: Если последовательность $A$ можно разбить на отрезки, удовлетворяющие следующим условиям, выведите "TAK", иначе выведите "NIE".

    • Каждый элемент принадлежит ровно одному отрезку.
    • Отрезки не должны пересекаться.
    • Побитовое исключающее ИЛИ всех чисел в каждом отрезке должно быть равно одному из $b_1, \ldots, b_k$.

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

Первая строка содержит длину $N$ последовательности ($1 \le N \le 100{,}000$).

Вторая строка содержит $A_1, A_2, \ldots, A_N$ ($0 \le A_i < 2^{20}$).

Третья строка содержит количество запросов $M$ ($1 \le M$).

Следующие $M$ строк описывают каждый запрос ($1 \le x \le N$, $0 \le v, b_i < 2^{20}$, $1 \le k \le 5$).

Количество запросов типа 1 не превышает $400{,}000$, а сумма $k$ по всем запросам типа 2 не превышает $100{,}000$.

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

Выведите результаты запросов типа 2.

Примеры

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

5
1 2 0 3 0
10
2 1 3
2 1 0
1 3 5
2 2 6 3
1 1 8
1 2 5
1 3 3
1 4 1
1 5 1
2 3 2 4 8

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

TAK
TAK
TAK
NIE

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.