QOJ.ac

QOJ

Límite de tiempo: 2.0 s Límite de memoria: 1024 MB Puntuación total: 100 Hackeable ✓

#18411. 整洁的羽衣甘蓝

Estadísticas

Nežmah 先生开办了一个羽衣甘蓝农场。他想在接下来的 $2n$ 天内种植总共 $n$ 棵羽衣甘蓝。

在第 $i$ 天,Nežmah 可以选择:

  • 种植一棵美味度为 $a_i$ 的羽衣甘蓝;
  • 收获一棵羽衣甘蓝。

当然,每次 Nežmah 决定收获一棵羽衣甘蓝时,必须至少存在一棵在之前某天种植且尚未被收获的羽衣甘蓝。

总美味度等于 Nežmah 收获的所有羽衣甘蓝的美味度之和。请帮助 Nežmah 制定一个计划,以最大化总美味度!

输入格式

第一行包含一个整数 $t$ ($1 \le t \le 2 \cdot 10^4$) —— 测试用例的数量。

每个测试用例的第一行包含一个整数 $n$ ($1 \le n \le 2 \cdot 10^5$)。

每个测试用例的第二行包含数组 $a$ ($1 \le a_i \le 10^9$)。

保证所有测试用例中 $n$ 的总和不超过 $2 \cdot 10^5$。

输出格式

对于每个测试用例,输出 $n$ 个整数,表示 Nežmah 应该种植羽衣甘蓝的日期(天数序号)。如果存在多个解,你可以输出其中任意一个。

样例

输入样例 1

3
1
4 3
3
1 2 4 9 6 3
2
5 100 100 200

输出样例 1

1
1 3 4
1 3

说明

在第 1 个测试用例中,最大美味度为 $4$。

在第 2 个测试用例中,最大美味度为 $1 + 4 + 9 = 14$。

在第 3 个测试用例中,最大美味度为 $5 + 100 = 105$。注意,输出 1 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.