QOJ.ac

QOJ

时间限制: 7 s 内存限制: 2048 MB 总分: 100

#6258. 寻找我的家人

统计

你正在寻找一张特定的家庭合影,照片里有你以及你最喜欢的亲戚 Alice 和 Bob。每张家庭合影都包含一排 $n$ 个人。在你要找的那张照片里,你记得 Alice 比你高,且从摄影师的角度来看,她在你的左侧。此外,Bob 比你和 Alice 都高,他站在你的右侧。

CC-BY 2.0 By Ivan on Flickr

由于你有大量的家庭合影,你希望利用计算机来辅助寻找照片。许多照片非常模糊,因此人脸识别效果不佳。幸运的是,“Batch Apex 照片分类器”可以检测照片中的每个人,并输出他们(各不相同)的身高序列(以像素为单位),效果非常出色。给定 $k$ 张照片的身高序列,请确定哪些照片可能是你要找的那张。

输入格式

  • 第一行包含一个整数 $1 \le k \le 1000$,表示你需要处理的照片数量。
  • 接下来对于每张照片,有两行输入:
    • 第一行包含一个整数 $3 \le n \le 3 \cdot 10^5$,表示照片中的人数。
    • 第二行包含 $n$ 个各不相同的整数 $1 \le h_1, \dots, h_n \le 10^9$,表示从左到右照片中每个人的身高。

保证所有照片中的总人数不超过 $3 \cdot 10^5$。

输出格式

  • 第一行输出需要进一步调查的照片数量。
  • 随后输出该数量的行,每行包含一个整数 $1 \le a_i \le n$,表示你需要查看的照片的索引(按升序排列)。

样例

样例输入 1

1
3
2 1 3

样例输出 1

1
1

样例输入 2

4
4
140 157 160 193
5
15 24 38 9 30
6
36 12 24 29 23 15
6
170 230 320 180 250 210

样例输出 2

2
2
4

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.