当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

2968:Necklace

Special Judge 特殊评判
题目描述

There are N points marked on a surface, pair (xi, yi) is coordinates of a point number i. Let’s call a necklace a set of N figures which fulfills the following rules.

  • The figure #i consists of all such points (x, y) that (xxi)2 + (yyi)2ri2, where ri ≥ 0.
  • Figures #i and #(i + 1) intersect (1 ≤ i < N)
  • Figures #1 and #N intersect
  • All the rest pairs of figures do not intersect.

Write a program which takes points and constructs a necklace.

输入解释

The first line of the input contains one integer number N (2 ≤ N ≤ 100). Each of the next N lines contains two real numbers xi, yi (1 000 ≤ xi, yi ≤ 1 000), separated by one space. It is guaranteed that at least one necklace exists.

输出解释

The output has to contain N lines. A line #i contains real number ri, (0 ≤ ri < 10 000). To avoid potential accuracy problems, a checking program uses the following rules.

  • Figures #i and #j definitely do not intersect if (ri + rj) ≤ dij − 10−5
  • Figures #i and #j definitely intersect if (dij + 10−5) ≤ (ri + rj).
  • The case when dij − 10−5 < (ri + rj) < dij + 10−5 is decided in favour of a contestant.
  • dij equals sqrt((xi − xj)2 + (yi − yj)2) in the rules above.
输入样例
4
0 0
10 0
10 10
0 10
输出样例
7
7
7
7

该题目是Virtual Judge题目,来自 北京大学POJ

源链接: POJ-2968

最后修改于 2020-10-29T06:48:44+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
1000 65536