寒假集训.Rope

F - Rope

Time Limit:1000MS     Memory Limit:65536KB     64bit IO Format:%I64d
& %I64u

Submit Status

Description

Plotters have barbarously hammered N nails into an innocent plane shape, so that one can see now only heads. Moreover, pursuing their mean object, they have hammered all the nails into the vertices of a convex polygon.
After that they…it is awful… have roped off the nails, so that the shape felt upset (the rope was very thin). They’ve done it as it is shown in the figure.

Your task is to find out a length of the rope.

Input

There two numbers in the first line of the standard input: N — a number of nails (1 ≤ N ≤ 100), and a real number R — a radius of heads of nails. All the heads have the same radius. Further there are N lines,
each of them contains a pair of real coordinates (separated by a space) of centers of nails. An absolute value of the coordinates doesn’t exceed 100. The nails are described either in a clockwise or in a counterclockwise order starting from an arbitrary nail.
Heads of different nails don’t overlap.

Output

Output a real number with two digits precision (after a decimal point) — a length of the rope.

Sample Input

input output
4 1
0.0 0.0
2.0 0.0
2.0 2.0
0.0 2.0
14.28
时间: 2024-08-08 18:17:15

寒假集训.Rope的相关文章

CSU-ACM寒假集训选拔-入门题

CSU-ACM寒假集训选拔-入门题 仅选择部分有价值的题 J(2165): 时间旅行 Description 假设 Bobo 位于时间轴(数轴)上 t0 点,他要使用时间机器回到区间 (0,?h] 中. 当 Bobo 位于时间轴上 t 点,同时时间机器有 c 单位燃料时,他可以选择一个满足 \(\lceil\frac{x}{h}\rceil\leq c\) 的非负整数 x, 那么时间机器会在 [0,?x]中随机整数 y,使 Bobo 回到 (t???y) 点,同时消耗 y 单位燃料. (其中 ?

寒假集训总结

这个寒假的集训吧,缺少了总结. 首先去了秦皇岛的几天还是挺不错的,但是人还是很懒散,没有每日做总结,导致以前会做的题目不会做.COME OJ上的视频也没有看完.秦皇岛开阔了眼界吧. 放寒假前的几天吧,都在聊天,唉,真的有时候会感到孤独... 只写了两场CF的所有题题解对的.(还缺178场) 之后回学校吧一个人在寝室就看看游戏直播的视频,嗯,挺荒废的. 寒假的收货吧,会了时间线段树,一些些STL,dp做了总结,分块+暴力的方法. 之后应该干什么呢,3月17校赛,3月底天梯,4月初浙大校赛,4月底浙

高一寒假集训总结

集训的一天 早读改前一天晚上没过的题. 上午学新课,开新的一套题,学模版优化模版.前半段总是没睡醒,将近中午时效率是一天中最高的.一般不大讨论. 下午继续做题,效率也比较高.讨论比上午多. 晚上思路很乱,而且一般都是做到一套题的后几道,进程缓慢,有些错误往往要到第二天早上才能想通. 集训之最 最有感触的一道题:家谱树.为了存人名现学关联式容器,发现大家课下确实学了不少东西,开学之后要拿更多时间读奥赛书,自学一些内容. 最佩服的一种解法:王超星的挖水井.这道题我做了很久,还是没能解决.请教王超星的

寒假集训日志(二)——最小生成树,拓扑排序,欧拉回路,连通路

今天学的内容挺多的. (一)首先说最小生成树,两种算法: 1.Kruskal算法( 将边排序,然后再选,关键在于检查是否连通,使用并查集) 2.Prim算法(使用点集,有点类似与最短路的算法) 第一题是并查集算法的使用: A - The Suspects Time Limit:1000MS     Memory Limit:20000KB     64bit IO Format:%I64d & %I64u Submit Status Description 严重急性呼吸系统综合症( SARS),

(寒假集训)Roadblock(最短路)

Roadblock 时间限制: 1 Sec  内存限制: 64 MB提交: 9  解决: 5[提交][状态][讨论版] 题目描述 Every morning, FJ wakes up and walks across the farm from his house to the barn.  The farm is a collection of N fields (1 <= N <= 250) connected by M bidirectional pathways (1 <= M

(寒假集训)Mooo Moo (完全背包)

Mooo Moo 时间限制: 1 Sec  内存限制: 64 MB提交: 5  解决: 4[提交][状态][讨论版] 题目描述 Farmer John has completely forgotten how many cows he owns!  He is too embarrassed to go to his fields to count the cows, since he doesn't want the cows to realize his mental lapse.  Ins

(寒假集训)Watering the Fields (最小生成树)

Watering the Fields 时间限制: 1 Sec  内存限制: 64 MB提交: 26  解决: 10[提交][状态][讨论版] 题目描述 Due to a lack of rain, Farmer John wants to build an irrigation system to send water between his N fields (1 <= N <= 2000). Each field i is described by a distinct point (x

(寒假集训) 卡片(离散化)

卡片 时间限制: 1 Sec  内存限制: 128 MB提交: 22  解决: 13[提交][状态][讨论版] 题目描述 每个卡片的开头和结尾都有标记,把每张卡片看成数轴上的一条线段,开头和结尾的标记A,B为数轴上的两个点.每张卡片的颜色都不同.将卡片按照标记贴到数轴上,请问贴完卡片以后的数轴上一共有多少种不同的颜色. 输入 第1行:一个整数N,表示卡片的数量. 第2行至第N+1行:第i+1行给出了第i张卡片的头尾两个标记Ai,Bi,贴卡片的顺序与输入文件中出现的先后顺序一致. 输出 一个整数,

寒假集训.Skew Binary

Skew Binary Time Limit:3000MS     Memory Limit:0KB     64bit IO Format:%lld & %llu Submit Status Practice UVA 575 Description When a number is expressed in decimal, the k-th digit represents a multiple of 10k. (Digits are numbered from right to left,