暴力。

题目只要求计算边上的点就可以了,一开始没看清题意,把内部的也算进去了。内部的计算可以延迟标记一下,但这题没有必要。

#include<map>
#include<set>
#include<ctime>
#include<cmath>
#include<queue>
#include<string>
#include<vector>
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<functional>
using namespace std; int n,xa,xb,ya,yb;
int f[][]; int main()
{
scanf("%d%d%d%d",&xa,&ya,&xb,&yb); xa=xa+, ya=ya+, xb=xb+, yb=yb+; if(xa>xb) swap(xa,xb);
if(ya>yb) swap(ya,yb); scanf("%d",&n); for(int i=;i<=n;i++)
{
int x,y,r; scanf("%d%d%d",&x,&y,&r);
x=x+, y=y+; int jiao1,jiao2;
for(int j=xa;j<=xb;j++)
{
if(j<x-r||j>x+r) continue; int tmp = (int) sqrt(1.0*r*r-1.0*(j-x)*(j-x));
jiao1 = y-tmp;
jiao2 = y+tmp; int L = max(ya,jiao1), R = min(yb,jiao2); if(L>R) continue; f[j][L]++;
f[j][R+]--;
}
} int ans=; for(int i=;i<=;i++)
{
for(int j=;j<=;j++)
{
f[i][j]=f[i][j]+f[i][j-];
}
} for(int i=xa;i<=xb;i++)
{
for(int j=ya;j<=yb;j++)
{
if(i!=xa&&i!=xb&&j!=ya&&j!=yb) continue; if(f[i][j]==) ans++;
}
} printf("%d\n",ans); return ;
}

CodeForces 144B Meeting的更多相关文章

  1. Codeforces 714A Meeting of Old Friends

    A. Meeting of Old Friends time limit per test:1 second memory limit per test:256 megabytes input:sta ...

  2. CodeForces A. Meeting of Old Friends

    2019-05-30 20:19:57 加油!!! sort(a + 1, a + 5); 卡了一会儿 #include <bits/stdc++.h> using namespace s ...

  3. codeforces 782B The Meeting Place Cannot Be Changed (三分)

    The Meeting Place Cannot Be Changed Problem Description The main road in Bytecity is a straight line ...

  4. Codeforces Round #375 (Div. 2) A. The New Year: Meeting Friends 水题

    A. The New Year: Meeting Friends 题目连接: http://codeforces.com/contest/723/problem/A Description There ...

  5. Codeforces Round #371 (Div. 2) A. Meeting of Old Friends 水题

    A. Meeting of Old Friends 题目连接: http://codeforces.com/contest/714/problem/A Description Today an out ...

  6. Codeforces Round #403 (Div. 2, based on Technocup 2017 Finals) B. The Meeting Place Cannot Be Changed

    地址:http://codeforces.com/contest/782/problem/B 题目: B. The Meeting Place Cannot Be Changed time limit ...

  7. Jury Meeting CodeForces - 854D

    Jury Meeting CodeForces - 854D 思路:暴力枚举会议开始的那一天(只需用所有向0点飞的航班的那一天+1去枚举即可),并计算所有人此情况下去0点和从0点出来的最小花费. 具体 ...

  8. Codeforces 420 B. Online Meeting

    B. Online Meeting time limit per test 1 second memory limit per test 256 megabytes input standard in ...

  9. Jury Meeting CodeForces - 854D (前缀和维护)

    Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the ...

随机推荐

  1. LightOJ 1085 - All Possible Increasing Subsequences 树状数组+离散

    http://www.lightoj.com/volume_showproblem.php?problem=1085 题意:求一个序列的递增子序列个数. 思路:找规律可以发现,某个数作为末尾数的种类数 ...

  2. PKUWC 2019 自闭记

    PKUWC 2019 自闭记 Day -1 考前天天在隔壁的物竞教室划水(雀魂,能和吉老师一起玩的游戏都是好游戏),没有做题. Day 0 早上8:16的高铁,到广州南居然要6个小时...不知道福州和 ...

  3. peepscan前期准备工作

    具有的功能 1.whoami 2.sub doamin https://dns.aizhan.com/huayi-faucet.com/ 3.dir scan 4.web server 5.port ...

  4. 【Python学习笔记】Coursera课程《Using Python to Access Web Data 》 密歇根大学 Charles Severance——Week2 Regular Expressions课堂笔记

    Coursera课程<Using Python to Access Web Data > 密歇根大学 Charles Severance Week2 Regular Expressions ...

  5. 网络知识===wireshark抓包出现“TCP segment of a reassembled PDU”的解释(载)

    网上胡说八道,众说风云,感觉这篇还算靠谱点. 原文链接:http://blog.csdn.net/dog250/article/details/51809566 为什么大家看到这个以后总是会往MSS, ...

  6. 获取file中字段,写入到TXT文件中

    一下代码省略了很多,哈哈哈 a.txt文件 uid,type,pointx,pointy,name1,9,911233763,543857286,区间测速起点3,9,906371086,5453354 ...

  7. FineReport——发送邮件

    在FR中,个用户之间可以通过邮件的形式进行通信,但是存在一个问题就是FineReport平台只能设置一个发件人账户,收件人账户可以有多个. 所以在实际的系统开发中可能需要自己开发信息交互的模块. 在系 ...

  8. javascript 实现图片放大镜功能

    淘宝上经常用到的一个功能是利用图片的放大镜功能来查看商品的细节 下面我们来实现这样一个功能吧,原理很简单: 实现一个可以随鼠标移动的虚框 在另外一个块中对应显示虚框中的内容 实现思路: 虚框用css中 ...

  9. sublime view_in_browser

    今天安装了sublime的插件view in browser,发现ctrl+alt+V用不了,在preferences看了view in browser的配置,发现browser不是我电脑上的默认浏览 ...

  10. ES6新数据结构Set让数组去重

    function unique(array){ return Array.from(new Set(array)); } var arr = ['aa','bb','cc','',1,0,'1',1, ...