QOJ.ac

QOJ

Limite de temps : 10 s Limite de mémoire : 512 MB Points totaux : 100

#18790. Dãy số và Truy vấn 32

Statistiques

Cho dãy $A_1, A_2, \ldots, A_N$ độ dài $N$. Hãy viết chương trình xử lý các truy vấn sau:

  • 1 x v: Thay đổi $A_x$ thành $v$.
  • 2 k b_1 ... b_k: Nếu dãy $A$ có thể được chia thành các đoạn thỏa mãn các điều kiện sau, xuất ra "TAK", nếu không xuất ra "NIE".

    • Mỗi số thuộc về đúng một đoạn.
    • Các đoạn không được chồng chéo lên nhau.
    • XOR của tất cả các số trong mỗi đoạn phải bằng một trong các giá trị $b_1, \ldots, b_k$.

Dữ liệu vào

Dòng đầu tiên chứa độ dài $N$ của dãy. ($1 \le N \le 100{,}000$)

Dòng thứ hai chứa $A_1, A_2, \ldots, A_N$. ($0 \le A_i < 2^{20}$)

Dòng thứ ba chứa số lượng truy vấn $M$. ($1 \le M$)

$M$ dòng tiếp theo mỗi dòng mô tả một truy vấn. ($1 \le x \le N$, $0 \le v, b_i < 2^{20}$, $1 \le k \le 5$)

Số lượng truy vấn loại 1 không vượt quá $400{,}000$, và tổng các $k$ trên tất cả các truy vấn loại 2 không vượt quá $100{,}000$.

Dữ liệu ra

Xuất ra kết quả của các truy vấn loại 2.

Ví dụ

Dữ liệu vào 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

Dữ liệu ra 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.