Universal Cup Judging System

Universal Cup

実行時間制限: 1.0 s メモリ制限: 512 MB 満点: 100 ハック可能 ✓
統計

一個好的問題應該要有簡潔的敘述。

你被給予一個長度為 $n$ 的陣列 $a$,初始時全為零,以及另一個長度為 $n$ 的陣列 $b$。你的目標是將陣列 $a$ 轉換為陣列 $b$。你可以執行以下兩種操作:

  • $1\ x$:將陣列 $a$ 中所有等於 $x$ 的元素加 $1$。
  • $2\ x$:將陣列 $a$ 中索引為 $x$ 的元素加 $1$。

你最多可以執行 $20\,000$ 次操作。

輸入格式

第一行包含一個正整數 $n$ ($1 \le n \le 1000$)。 第二行包含 $n$ 個非負整數,代表陣列 $b$ ($0 \le b_i \le n$)。

輸出格式

第一行應包含一個整數 $k$,代表操作次數。 接下來的 $k$ 行,每行應包含兩個整數 $1\ x$ 或 $2\ x$,代表一次操作。對於類型 $1\ x$ 的操作,你必須確保 $0 \le x \le n$。對於類型 $2\ x$ 的操作,你必須確保 $1 \le x \le n$。

範例

輸入 1

4
2 4 3 1

輸出 1

8
2 1
2 2
2 3
1 1
2 4
2 2
2 3
2 2

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.