I think:

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
struct port
{
long long x,y,l,r;
};
int cmp(const void *a,const void *b)
{
struct port *x=(struct port *)a;
struct port *y=(struct port *)b;
return x->l - y->l; }
struct port p[1000000];
int main(void)
{
long long wayLen,d,i,v,sum;
long long c,tem;
while(scanf("%lld%lld%lld",&wayLen,&d,&v)!=EOF)
{
sum=1;
for(i=0; i<v; i++)
{
scanf("%lld%lld",&p[i].x,&p[i].y);
c=sqrt(d*d-p[i].y*p[i].y);
p[i].r=c+p[i].x;
p[i].l=p[i].x-c;
}
qsort(p,v,sizeof(p[0]),cmp);
tem=p[0].r;
for(i=1; i<v; i++)
{
if(p[i].l<=tem)
continue;
else
{
tem=p[i].r;
++sum;
}
}
printf("%lld\n",sum);
}
return 0;
}

  

高速公路(Highway,ACM/ICPC SEERC 2005,UVa1615)的更多相关文章

  1. [C++]最小生成元 (Digit Generator, ACM/ICPC Seoul 2005, UVa1583)

    Question 例题3-5 最小生成元 (Digit Generator, ACM/ICPC Seoul 2005, UVa1583) 如果x+x的各个数字之和得到y,就是说x是y的生成元.给出n( ...

  2. 分子量 (Molar Mass,ACM/ICPC Seoul 2005,UVa1586)

    习题 3-3 分子量 (Molar Mass,ACM/ICPC Seoul 2005,UVa1586) 给出一种物质的分子式(不带括号),求分子量.本题中的分子式只包含4种原子,分别为C,H,O,N, ...

  3. 生成元(Digit Generator, ACM/ICPC Seoul 2005, UVa1583)

    如果x加上x的各个数字之和得到y,就说x是y的生成元.给出n(1≤n≤100000),求最小 生成元.无解输出0.例如,n=216,121,2005时的解分别为198,0,1979. [分析] 本题看 ...

  4. 得分(Score,ACM/ICPC Seoul 2005,UVa 1585)

    #include<stdio.h> int main(void) { char b; int t,cou,sum; scanf("%d",&t); getcha ...

  5. 生成元(Digit Generator ,ACM/ICPC Seoul 2005 ,UVa 1583)

    生成元:如果 x 加上 x 各个数字之和得到y,则说x是y的生成元. n(1<=n<=100000),求最小生成元,无解输出0. 例如:n=216 , 解是:198 198+1+9+8=2 ...

  6. 得分(Score, ACM/ICPC Seoul 2005,UVa 1585)

    #include<cstdio>#include<cstdlib>#include<cstring>int main(){ char s[80];//输入OOXXO ...

  7. 生成元(Digit Generator,ACM/ICPC Seoul 2005,UVa 1583)

    #include<cstdio>#include<cstdlib>#include<cstring>using namespace std;int t, n, a, ...

  8. UVa 1585 - Score - ACM/ICPC Seoul 2005 解题报告 - C语言

    1.题目大意 给出一个由O和X组成的字符串(长度为80以内),每个O的得分为目前连续出现的O的数量,X得分为0,统计得分. 2.思路 实在说不出了,这题没过脑AC的.直接贴代码吧.=_= 3.代码 # ...

  9. hduoj 4706 Herding 2013 ACM/ICPC Asia Regional Online —— Warmup

    hduoj 4706 Children's Day 2013 ACM/ICPC Asia Regional Online —— Warmup Herding Time Limit: 2000/1000 ...

随机推荐

  1. 爱奇艺招聘uwp开发

    招聘链接:https://job.cnblogs.com/offer/53380/ 工作地点:北京-海淀 工作年限:1年 学历要求:本科 招聘分类:移动开发工程师 工资范围:面议 职位要求 1.扎实的 ...

  2. [转]Hive/Beeline 使用笔记

    FROM : http://www.7mdm.com/1407.html Hive: 利用squirrel-sql 连接hive add driver -> name&example u ...

  3. 蒙古人交友网站 www.mengguren.com

    蒙古人交友http://www.mengguren.com/ 经过一个多月的努力,终于上线了,虽然长得丑陋一些.功能简单一些,欢迎大家注册,方便别人能找到您.吉日嘎拉<252056973@qq. ...

  4. salt-ssh

    1.生产---测试--开发 salt-runners salt-run manage.status#显示当前up或down的minion salt-run manage.down salt-run m ...

  5. hp_jetdirect 9100漏洞检测

    #-*-coding=utf8-*- import socket import sys def main(): if len(sys.argv)<=1: print('Parameters er ...

  6. php基础33:正则匹配-perl

    <?php //1.搜索数组中的相匹配的字符串 //preg_grep() 返回一个数组 $language = array("php","asp",&q ...

  7. 【超详细教程】使用Windows Live Writer 2012和Office Word 2013 发布

    去年就知道有这个功能,不过没去深究总结过,最近有写网络博客的欲望了,于是又重新拾起这玩意儿. 具体到底是用Windows Live Writer 2012还是用Word 2013,个人觉得看个人,因为 ...

  8. 在opencv3中利用SVM进行图像目标检测和分类

    采用鼠标事件,手动选择样本点,包括目标样本和背景样本.组成训练数据进行训练 1.主函数 #include "stdafx.h" #include "opencv2/ope ...

  9. Random()方法的使用

    import java.util.*;public class RandomTest { public static void main(String[] args) {  double i = Ma ...

  10. [CareerCup] 11.7 Tower of People in Circus 马戏团的人塔

    11.7 A circus is designing a tower routine consisting of people standing atop one another's shoulder ...