CF213D.Stars
提高+/省选-
通过率:0%
时间限制:2.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
Furik loves painting stars. A star is a shape that results if we take a regular pentagon and paint all diagonals in it.

Recently he decided to teach Rubik to paint stars. After many years of training Rubik could paint stars easily. But now Furik decided to test Rubik and complicated the task. Rubik must paint n stars, observing the following rules:
- all stars must be painted in a single move (i.e. it is forbidden to take the pen away from the paper);
- it is forbidden to paint the same segment of non-zero length more than once;
- the stars can intersect only in their vertexes;
- the length of a side of the regular pentagon, in which Rubik paints each star, must equal 10.
Help Rubik to cope with this hard task.
弗里克喜欢画五角星。所谓五角星,是指在一个正五边形中画出其所有对角线后所形成的图形。

最近,他决定教鲁比克画五角星。经过多年的训练,鲁比克已能轻松地画出五角星。但如今弗里克想测试鲁比克,于是加大了任务难度:鲁比克必须一次性画出 n 个五角星,并满足以下规则:
- 所有五角星必须一笔画成(即禁止将笔尖从纸上抬起);
- 禁止重复绘制长度大于零的同一线段;
- 各五角星之间仅允许在顶点处相交;
- 鲁比克所画每个五角星所在的正五边形的边长必须恰好为 10。
请帮助鲁比克完成这项艰巨的任务。
输入格式
A single line contains an integer (1 ≤ n ≤ 100) — the number of stars to paint.
一行包含一个整数(1 ≤ n ≤ 100)——需要绘制的星星数量。
输出格式
On the first line print an integer m (1 ≤ m ≤ 5·n). On the next m lines print coordinates of m distinct points with accuracy of at least 9 and at most 100 digits after decimal point. All coordinates should not exceed 5000 in their absolute value. On each of the next n lines print 5 integers — the indexes of the points that form the given star in the clockwise or counterclockwise order. On the next line print 5·n + 1 integers — the numbers of points in the order, in which Rubik paints stars. That is, if number with index i is a__i, and number with index i + 1 is a__i + 1, then points with indexes a__i and a__i + 1 will have a segment painted between them.
You can consider all m printed points indexed from 1 to m in the order, in which they occur in the output. Separate the numbers on the lines with whitespaces.
Note that the answer has an imprecise validation. Try to obtain as accurate a solution as possible. The validator performs all calculations considering that the absolute error of a participant's answer is not more than 10 - 8.
第一行输出一个整数 m(1≤m≤5⋅n)。接下来的 m 行中,每行输出一个点的坐标,要求小数点后至少保留 9 位、至多保留 100 位有效数字。所有坐标的绝对值均不得超过 5000。随后的 n 行中,每行输出 5 个整数——表示构成对应五角星的 5 个点的索引号,这些点需按顺时针或逆时针顺序排列。再下一行输出 5⋅n+1 个整数——表示 Rubik 绘制五角星时所经过的点的编号顺序。即:若该行第 i 个数为 ai,第 i+1 个数为 ai+1,则会在索引为 ai 和 ai+1 的两个点之间绘制一条线段。
你可以认为所输出的全部 m 个点按其在输出中出现的顺序被依次编号为 1 至 m。同一行中的各数字用空格分隔。
注意:本题采用精度容错校验。请尽可能提供高精度的解。校验器在所有计算中均假设参赛者答案的绝对误差不超过 10−8。
输入输出样例
输入#1
1
输出#1
5 3.830127018922193 3.366025403784439 -3.601321235851749 10.057331467373021 0.466045194906253 19.192786043799030 10.411264148588986 18.147501411122495 12.490381056766580 8.366025403784439 1 2 3 4 5 1 3 5 2 4 1
说明/提示
The initial position of points in the sample is:

The order in which Rubik can paint segments is:

样本中各点的初始位置为:

鲁比可绘制线段的顺序为:

输入解题思路,AI测评打分。不知道怎么写?