QOJ.ac

QOJ

実行時間制限: 0.3 s メモリ制限: 256 MB 満点: 100

#15567. 酒吧巡游

統計

Al 刚刚到达都柏林。他打算把钱花在都柏林著名的活动——酒吧巡游(pub crawl)上。他的目标是在城市中尽可能多不同的酒吧里喝一杯健力士(Guinness)啤酒,且不重复访问任何一家酒吧。都柏林有 $n$ 个酒吧。Al 很快就喝醉了,所以他把酒吧看作平面上的点,而他从一个酒吧到下一个酒吧的路径则是连接 these 点的直线,尽管实际的路径可能包括沿着不同的街道走、绕过建筑物,甚至为了寻找下一个酒吧而兜圈子。Al 并不关心这些细节。他唯一关心的是,他的每一次转弯都必须是左转,他喜欢向左转。这意味着,对于他路线中任意连续的三个酒吧,第三个酒吧必须位于从第一个酒吧到第二个酒吧的有向直线的左半平面内。已知都柏林的建筑工人也喜欢酒吧巡游,因此他们从未在同一条直线上建造过三个或更多的酒吧(即任意三点不共线)。请帮助 Al 找出他最多可以访问多少个酒吧,并为他规划路线。

输入格式

第一行包含一个整数 $n$ ($1 \le n \le 5000$) —— 酒吧的数量。

接下来的 $n$ 行,每行包含两个整数 $x$ 和 $y$ ($-10^9 \le x, y \le 10^9$) —— 酒吧的坐标。不同的酒吧位于不同的点。

输出格式

第一行应包含一个整数 $m$ —— Al 最多可以访问的酒吧数量。

第二行应包含 $m$ 个整数,表示 Al 访问酒吧的顺序(按酒吧的编号)。酒吧按照在输入中出现的顺序从 $1$ 到 $n$ 进行编号。

样例

输入格式 1

5
0 4
3 0
7 11
9 1
13 8

输出格式 1

5
5 1 4 3 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.