#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <queue>
#include <map>
#include <vector>
#include <set>
#include <string>
#include <cmath>
using namespace std;
;
const double PI=acos(-1.0);
,):x(x),y(y) {};    };
typedef Point Vector;
Vector operator - (Point  A, Point  B){ return Vector(A.x-B.x, A.y-B.y); } // 向量生成
double dis(Point A,Point B) { return sqrt( (A.x-B.x)*(A.x-B.x)+(A.y-B.y)*(A.y-B.y) );  }
double Cross(Vector B, Vector A) { return A.x*B.y-A.y*B.x;   }  // 叉积
Point pa[maxn];
Point pt[maxn];
bool up(Point a,Point b)
{
    if(a.x!=b.x) return a.x<b.x;
    return a.y<b.y;
}
int main()
{
    int n,r; scanf("%d %d",&n,&r);
    ;i<n;i++) scanf("%lf %lf",&pa[i].x,&pa[i].y);
    sort(pa,pa+n,up);
    ;
    ;i<n;i++)
    {
         && Cross(pt[m-]-pt[m-],pa[i]-pt[m-])<=) m--;
        pt[m++]=pa[i];
    }
    int k=m;
    ;i>=;i--)
    {
        ]-pt[m-],pa[i]-pt[m-])<=) m--;
        pt[m++]=pa[i];
    }
    ) m--;
    ;
    ;i<m;i++) ans+=dis(pt[i],pt[i+]); ans+=dis(pt[m],pt[]);
    //cout<<ans<<"  "<<PI<<endl;
    ans+=PI*r*;
    printf("%.0f\n",ans);
    ;
}

poj 1113 凸包的更多相关文章

  1. poj 1113 凸包周长

    Wall Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 33888   Accepted: 11544 Descriptio ...

  2. POJ 1113 凸包模板题

    上模板. #include <cstdio> #include <cstring> #include <iostream> #include <algorit ...

  3. 计算几何--求凸包模板--Graham算法--poj 1113

    Wall Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 28157   Accepted: 9401 Description ...

  4. POJ 1113 Wall 凸包 裸

    LINK 题意:给出一个简单几何,问与其边距离长为L的几何图形的周长. 思路:求一个几何图形的最小外接几何,就是求凸包,距离为L相当于再多增加上一个圆的周长(因为只有四个角).看了黑书使用graham ...

  5. poj 1113 Wall 凸包的应用

    题目链接:poj 1113   单调链凸包小结 题解:本题用到的依然是凸包来求,最短的周长,只是多加了一个圆的长度而已,套用模板,就能搞定: AC代码: #include<iostream> ...

  6. poj 1873 凸包+枚举

    The Fortified Forest Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 6198   Accepted: 1 ...

  7. Poj 2187 凸包模板求解

    Poj 2187 凸包模板求解 传送门 由于整个点数是50000,而求凸包后的点也不会很多,因此直接套凸包之后两重循环即可求解 #include <queue> #include < ...

  8. POJ 1113 Wall(凸包)

    [题目链接] http://poj.org/problem?id=1113 [题目大意] 给出一个城堡,要求求出距城堡距离大于L的地方建围墙将城堡围起来求所要围墙的长度 [题解] 画图易得答案为凸包的 ...

  9. POJ 1113 Wall【凸包周长】

    题目: http://poj.org/problem?id=1113 http://acm.hust.edu.cn/vjudge/contest/view.action?cid=22013#probl ...

随机推荐

  1. vim常用指令

    命令历史 以:和/开头的命令都有历史纪录,可以首先键入:或/然后按上下箭头来选择某个历史命令. 启动vim 在命令行窗口中输入以下命令即可 vim 直接启动vim vim filename 打开vim ...

  2. 26. Remove Duplicates from Sorted Array★

    题目内容: Given a sorted array, remove the duplicates in place such that each element appear only once a ...

  3. java线程入门一

    线程优先级: 在JAVA线程中,通过一个int型变量priority来控制线程优先级,线程的有限机为1-10,默认为5,优先级高的线程获得的运行时间要高于优先级低的线程.但这只是一个提示,操作系统和J ...

  4. JAVA 第1课

    JAVA第一课 电脑识别的进制:二进制,八进制,十六进制 二进制来表示高低电压,类似于抗战时期的发报机.2进制的存储 8进制和16进制:计算器,在计算的时候有一定的临时存储,8位或者16位禁止的存储 ...

  5. shell练习题3

    需求如下: 请按照这样的日期格式(xxxx-xx-xx)每天生成一个文件,例如今天生成的文件为2018-10-19.log, 并把磁盘的使用情况入到这个文件,(不需要写cron,写脚本即可) 参考解答 ...

  6. Unity Canvas vs Panel

    Unity guys specifically gave a performance talk about UI Canvases on some of the past Unite(s). You ...

  7. python中的lambda表达式

    lambda是python中匿名函数的写法  我们可以在不定义函数名的情况下一边定义并调用这个函数 例子: 普通方法定义函数:def  plus(a,b): return a+b lambda方法  ...

  8. 配置Nim的默认编译参数 release build并运行

    配置Nim的默认编译参数 release build并运行 默认情况下nim编译是debug build,如果需要release build, 需要加上-d:release , release编译的命 ...

  9. .Net Core+Angular6 学习 第一部分(创建web api)

    . 创建.net core web api 1.1 选择一个empty 模式,里面只有简单的2个class 1.2 配置web api 的路由. 1.2.1 打开Startup.cs,首先引用conf ...

  10. nginx——配置 Nginx 防盗链

    什么是防盗链:简单地说,就是某些不法网站未经许可,通过在其自身网站程序里非法调用其他网站的资源,然后在自己的网站上显示这些调用的资源,使得被盗链的那一端消耗带宽资源 (1) 根据 HTTP refer ...