ural 1020 Rope
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#define maxn 2000
using namespace std;
const double pi=acos(-1.0); double sqr(double x)
{
return x*x;
}
struct node
{
double x,y;
}p[maxn]; double dis(node a,node b)
{
return sqrt(sqr(a.x-b.x)+sqr(a.y-b.y));
}
int main()
{
int n;
double r;
scanf("%d%lf",&n,&r);
for(int i=; i<n; i++)
{
scanf("%lf%lf",&p[i].x,&p[i].y);
}
p[n]=p[];
double ans=;
for(int i=; i<=n; i++)
{
ans+=dis(p[i],p[i-]);
}
ans+=pi*r*;
printf("%.2lf\n",ans);
return ;
}
ural 1020 Rope的更多相关文章
- URAL 1145—— Rope in the Labyrinth——————【求树的直径】
Rope in the Labyrinth Time Limit:500MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64 ...
- ural 1145. Rope in the Labyrinth
1145. Rope in the Labyrinth Time limit: 0.5 secondMemory limit: 64 MB A labyrinth with rectangular f ...
- ural 1246. Tethered Dog
1246. Tethered Dog Time limit: 1.0 secondMemory limit: 64 MB A dog is tethered to a pole with a rope ...
- Ural State University Internal Contest October'2000 Junior Session
POJ 上的一套水题,哈哈~~~,最后一题很恶心,不想写了~~~ Rope Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 7 ...
- [bzoj3673][可持久化并查集 by zky] (rope(可持久化数组)+并查集=可持久化并查集)
Description n个集合 m个操作 操作: 1 a b 合并a,b所在集合 2 k 回到第k次操作之后的状态(查询算作操作) 3 a b 询问a,b是否属于同一集合,是则输出1否则输出0 0& ...
- 谈c++ pb_ds库(一)rope大法好
参考资料 1)官方说明 支持 sorry,cena不支持rope 声明 1)头文件 #include<ext/rope> 2)调用命名空间 using namespace __gnu_cx ...
- [bzoj1269][AHOI2006文本编辑器editor] (splay模版题 or pb_ds [rope]大法)
Description 这些日子,可可不和卡卡一起玩了,原来可可正废寝忘食的想做一个简单而高效的文本编辑器.你能帮助他吗?为了明确任务目标,可可对“文本编辑器”做了一个抽象的定义: 文本:由0个或 ...
- 后缀数组 POJ 3974 Palindrome && URAL 1297 Palindrome
题目链接 题意:求给定的字符串的最长回文子串 分析:做法是构造一个新的字符串是原字符串+反转后的原字符串(这样方便求两边回文的后缀的最长前缀),即newS = S + '$' + revS,枚举回文串 ...
- ural 2071. Juice Cocktails
2071. Juice Cocktails Time limit: 1.0 secondMemory limit: 64 MB Once n Denchiks come to the bar and ...
随机推荐
- 非常有利于seo的主题(红黄蓝绿)通用教程
这篇教程是帮助刚使用Wordpres的朋友们的,免得自己弄得一头雾水.大江网络来教大家了解下如何设置自定义导航菜单. 一.首先进入后台,点击“外观”,选择“菜单”按钮,如下图: 然后看到右边界面中菜单 ...
- SpringMVC 自定义拦截资料
1.springmvc学习笔记(28)——自定义拦截器 2.Spring MVC HandlerInterceptor Annotation Example with WebMvcConfigurer ...
- 一种基于重载的高效c#上图片添加文字图形图片的方法
在做图片监控显示的时候,需要在图片上添加文字,如果用graphics类绘制图片上的字体,实现图像上添加自定义标记,这种方法经验证是可行的,并且在visual c#2005 编程技巧大全上有提到,但是, ...
- Zimbra8.x邮件服务器安装及配置
官网地址:http://www.zimbra.com/downloads 下载说明: 1. 版本: zimbra有两个大版本:Open Source Edition和 Network Ed ...
- 【甘道夫】怎样在cdh5.2上执行mahout的itemcf on hadoop
环境: hadoop-2.5.0-cdh5.2.0 mahout-0.9-cdh5.2.0 步骤: 基本思路是,将mahout下的全部jar包都引入hadoop的classpath就可以,所以改动了$ ...
- Install Oracle 10g on Red Hat Linux 5.3 Step by Step
一.虚拟机配置 1. 虚拟机(VBox 4.3.12) 2. 配置虚拟机网卡网络.选择host-only.VirtualBox Host-Only Network网卡IP为设置为192.168.1.1 ...
- [Unit Testing] Node testing: Test api Get request
Using mocha: "devDependencies": { "should": "^5.2.0", "supertest& ...
- 2008年NOI全国竞赛 假面舞会
/* 分三种情况 1 有环:找环长的gcd作为max gcd的超过2的最小因子作为min 2 树:所有最长链的和作为max 3为min (最长链≥3) 3 两条相交链:找出所有的这样的两条链的差 同1 ...
- ASP.NET-FineUI开发实践-5
1.tree的右键事件和单击事件 页面就不写了,准备一个树和一个菜单控件,随便写点啥 JS:注意注释 var menuSettings = F('menuSettings'); var tree = ...
- POJ3750
#include <iostream> #include <stdio.h> #include <cstring> using namespace std; int ...