QOJ.ac

QOJ

実行時間制限: 1500 s メモリ制限: 262144 MB 満点: 100 ハック可能 ✓

#13127. 爱尔兰威士忌

統計

给定一个包含 $n$ 个整数的数组 $A$(下标从 1 开始)。你需要执行两种类型的查询:

  1. 交换 $A[l]$ 和 $A[r]$。
  2. 判断子数组 $A[l, \dots, r]$ 是否呈非递减顺序排列。

输入格式

第一行包含两个整数 $n$ 和 $q$ ($1 \le n \le 300\,000, 1 \le q \le 200\,000$),分别表示数组的长度和查询的次数。

第二行包含 $n$ 个整数:数组的元素 ($1 \le A[i] \le 10^9$),以空格分隔。

接下来的 $q$ 行包含查询的描述。每行以一个整数 $type$ 开头,该整数等于 1 或 2,指定了查询的类型。随后是两个以空格分隔的整数 $l$ 和 $r$ ($1 \le l \le r \le n$)。

输出格式

对于每个类型为 2 的查询,输出一行 “Ja” 或 “Nein”(不含引号)。

样例

输入 1

3 3
1 2 3
2 1 3
1 2 3
2 1 3

输出 1

Ja
Nein

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.