Safest Buildings ZOJ - 3993(计算几何+思维)

VLA、世界模型与端到端在智驾中的本质关系与工程落地 世界模型并非3D重建,而是对环境状态转移函数的可微分建模;VLA不是视觉+语言+动作的简单拼接,核心在于跨模态语义对齐。二者共同支撑具身智能系统实现从感知到行动的闭环推演,其技术价值体现在长尾场景泛化能力提升与决策延迟降低。在自动驾驶领域,真实量产方案均采用VLA架构作为多模态感知基础,嵌入轻量级世界模型以支持反事实轨迹推演,并通过WA硬件封装保障实时性,最终由端到端控制层完成像素到扭矩的语义贯通。这种混合架构已成L2+/L3智驾系统的工程共识。 阅读详情

Safest Buildings ZOJ - 3993

PUBG is a multiplayer online battle royale video game. In the game, up to one hundred players parachute onto an island and scavenge for weapons and equipment to kill others while avoiding getting killed themselves. BaoBao is a big fan of the game, but this time he is having some trouble selecting the safest building.

There are buildings scattering on the island in the game, and we consider these buildings as points on a two-dimensional plane. At the beginning of each round, a circular safe area whose center is located at (0, 0) with radius will be spawned on the island. After some time, the safe area will shrink down towards a random circle with radius (). The whole new safe area is entirely contained in the original safe area (may be tangent to the original safe area), and the center of the new safe area is uniformly chosen within the original safe area.

The buildings covered by the new safe area is called the safe buildings. Given the radius of the safe areas and the positions of the buildings, BaoBao wants to find all the buildings with the largest probability to become safe buildings.
Input

There are multiple test cases. The first line of input contains an integer , indicating the number of test cases. For each test case:

The first line contains three integers (), and (), indicating the number of buildings and the radius of two safe circles.

The following lines each contains 2 integers and (), indicating the coordinate of the buildings. Here we assume that the center of the original safe circle is located at , and all the buildings are inside the original circle.

It’s guaranteed that the sum of over all test cases will not exceed 5000.
Output

For each test case output two lines.

The first line contains an integer , indicating the number of buildings with the highest probability to become safe buildings.

The second line contains integers separated by a space in ascending order, indicating the indices of safest buildings.

Please, DO NOT output extra spaces at the end of each line.
Sample Input

2
3 10 5
3 4
3 5
3 6
3 10 4
-7 -6
4 5
5 4

Sample Output

1
1
2
2 3
题意:

原本有一个半径为R的圆形的圈,圈里面是安全区域,大圈内部有一些建筑物,给定这些建筑物的坐标,现在给定一个半径为r(r≤Rr\le Rr≤R)的小圈,圆心可以为大圈内的任意一点,这样小圈变成缩小后的安全区域,问缩小范围后,仍然处在安全区域的概率最大的建筑物是啥,输出个数和每个建筑物的编号

分析:

大致应该分为两种情况:

一、 当小圆的直径2r小于大圆的半径R的时候,对于一个点而言,它所处的所有可能的安全区域,应该是让这个点在小圆的边上,然后小圆绕这个点转一圈所得到的中等圆,此圆的半径为2r
如图所示
在这里插入图片描述
那么这个时候的边界条件就是图中红色圆与大圆想内切的时候,绿圈表示的是点可以在的边界范围,因为在这个范围上以及在这个范围内,任意点的所有安全区域都可以构成一个图中红色的中等圆,因此只需要比较半径和圆心距即可,设点到圆心的距离为dis,所以只需要比较如果R-dis>=2r说明这里面的点都是等可能安全的并且都是安全可能性最大,否则再灰色区域的点,一定无法构成一个完整的红色圆,安全可能性就小,如果绿色圈内没有点,就选取里圆心近的点,越近越好。

二、如果小圆直径2r大于大圆的半径R,此时如果让小圆内切着大圆转一圈,那么中心一定可以有个圆形区域,它始终包含,那么这个区域内的点,就是可能性最大的点,所以只需要判断是否在这个区域即可,判断是否在这个区域仍然是比较距离

在这里插入图片描述
图中绿色区域就是安全性最大的区域,即无论小圆怎么转始终会包括的公共区域,那么根据图可以知道只要dis+R<=2r即可,同理如果没有,就选择离圆心越近越好

code:

#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-6;
struct node{
    int x,y,id;
    double dis;
    bool operator < (const node & a)const{
        return dis < a.dis;
    }
}p[110];
vector<int> vec;

int main(){
    int T;
    scanf("%d",&T);
    while(T--){
        vec.clear();
        int n,R,r;
        scanf("%d%d%d",&n,&R,&r);
        for(int i = 1; i <= n; i++){
            scanf("%d%d",&p[i].x,&p[i].y);
            p[i].dis = sqrt(1.0 * p[i].x * p[i].x + 1.0 * p[i].y * p[i].y);
            p[i].id = i;
        }
        sort(p+1,p+1+n);
        if(R > 2 * r){
            for(int i = 1; i <= n; i++){
                if(R - p[i].dis >= 2.0 * r)
                    vec.push_back(p[i].id);
            }//找范围内的点
            if(vec.size() == 0){//如果范围内没有,有找离圆心距离最近的点
                double t = p[1].dis;
                for(int i = 1; i <= n; i++){
                    if(t == p[i].dis)
                        vec.push_back(p[i].id);
                }
            }
        }
        else{
            for(int i = 1; i <= n; i++){
                if(p[i].dis + R <= 2.0 * r)
                    vec.push_back(p[i].id);
            }
            if(vec.size() == 0){
                double t = p[1].dis;
                for(int i = 1; i <= n; i++){
                    if(t == p[i].dis)
                        vec.push_back(p[i].id);
                }
            }
        }
        sort(vec.begin(),vec.end());
        printf("%d\n",vec.size());
        for(int i = 0; i < vec.size(); i++){
            printf("%d%c",vec[i],i == vec.size() - 1 ? '\n' : ' ');
        }
    }
    return 0;
}

Spring Boot集成Jasypt踩坑实录:自定义SM4加密器Bean加载失败的终极解决方案 本文深入剖析了Spring Boot集成Jasypt时自定义SM4加密器Bean加载失败的根源,即Spring Boot启动流程中Bean加载顺序与Jasypt自动配置的时序冲突。文章提供了三种从源码层面解决问题的有效方案,包括使用ApplicationContextInitializer提前注册、调整Bean依赖顺序以及自定义PropertySource处理机制,并给出了完整的国密SM4加密器实现与测试示例。 阅读详情

相关推荐

[Unity]-[UI]-[Image] 关于UI精灵图资源导入设置的详细解释

如果纹理存储了有特定含义的信息,并且您需要着色器中的确切值(例如,平滑度或金属度),请禁用此属性。此选项允许将纹理编码为特定格式(RGBM 或 dLDR,具体取决于平台)并通过后期处理步骤对纹理数据进行处理(推拉式扩张通道)。使用在3D模型的专业法线贴图。通用的纹理类型,一般在Material上的材质图片参数使用,比如漫反射、法线贴图这些。​​Compression​​:ASTC 6x6(移动端)或DXT5(PC)​​Compression​​:BC5(PC)或ASTC 6x6(移动端)

sky_smile_Allen的博客 2171

ZOJ - 3993(思维)

Safest Buildings题目传送门 题意:吃鸡游戏,给出初始圈半径以及圈内的建筑,给你下一个圈的半径r(圈被要求在初始圈内),求最大概率为安全建筑的建筑有那几个。 思路:很简单可以知道,离中心越近越有可能,但事实上在某些范围内概率是相同的当r足够大或者足够小。我们把初始圈叫做大圆,下一个圈为小圆。当2*r大于R时,小圆内切大圆转一圈,可以发现以2*r-R为半径,以原圆心为圆心的圆内的点的

siyu 1032

超声波 vs 红外 vs 激光雷达:扫地机器人避障传感器选型指南(实测对比)

本文深入对比了扫地机器人三种主流避障传感器——超声波、红外与激光雷达的核心原理与实测表现。文章基于成本、精度、环境适应性等关键指标,提供了清晰的选型决策树和典型场景配置方案,旨在帮助开发者与爱好者根据项目需求与预算,构建高效可靠的机器人避障系统。

h0i1j2k3l的博客 690

Safest Buildings(思维模拟)

ZOJ - 3993 PUBG is a multiplayer online battle royale video game. In the game, up to one hundred players parachute onto an island and scavenge for weapons and equipment to kill others while avoiding ...

蒟蒻的博客 463

Python爬虫实战:5分钟搞定Boss直聘数据抓取(附完整代理IP配置)

本文详细介绍了如何使用Python爬虫高效抓取Boss直聘的招聘数据,包括环境配置、反爬策略、数据采集与存储、数据分析等完整流程。通过实战案例,帮助开发者快速掌握招聘市场数据抓取技术,为职业决策提供数据支持。

weixin_30832143的博客 346

FPGA+CMV4000实战:从零搭建20fps成像系统的5个关键步骤(附避坑指南)

本文详细介绍了如何从零搭建基于FPGA和CMV4000传感器的20fps成像系统,涵盖硬件选型、SPI通信优化、LVDS数据采集、DDR2内存管理及系统集成等5个关键步骤。特别针对CMV4000传感器的SPI配置和高速数据处理的常见问题提供实用解决方案,帮助开发者避免常见陷阱,提升成像系统性能。

weixin_42628688的博客 427

CCPC秦皇岛 ZOJ3993 Safest Buildings(半径比较/圆的相交面积)

PUBG is a multiplayer online battle royale video game. In the game, up to one hundred players parachute onto an island and scavenge for weapons and equipment to kill others while avoiding getting killed themselves. BaoBao is a big fan of the game, but this

nka_kun的博客 1437

OSG程序如何适配在无显卡的Ubuntu系统中

osg踩坑,希望遇到同样问题的人,可以尽快出坑,完美开发

大侠的后花园 459

ZOJ - 3993 - Safest Buildings(概率,分类讨论)

Safest Buildings Time Limit: 1 Second      Memory Limit: 65536 KB PUBG is a multiplayer online battle royale video game. In the game, up to one hundred players parachute onto an island and sca

vloai 635

基于四旋翼模型的火箭型无人机视线角保持控制仿真设计

本文针对火箭型无人机的视线角保持控制问题展开研究。基于四旋翼动力学模型,通过改造设计了一种摄像头朝上安装的特殊无人机系统,用于追踪空中目标。文章详细推导了坐标系定义、运动学和动力学方程,重点分析了摄像头安装与视线几何关系,建立了目标运动模型和视线向量计算方法。通过解算期望姿态角,实现了使机体Z轴始终对准目标的控制目标。仿真结果表明,该系统能有效完成视线角保持任务,为空对空监视等应用场景提供了可行方案。~~~~~

huanghm88的专栏 140

【系统架构设计师-2026上半年真题】案例分析-参考答案及详解(回忆版)

架构评估与设计:通过入侵检测系统的案例分析,阐述质量属性(性能/可用性/安全性/可修改性)的匹配方法,推荐管道-过滤器风格处理实时数据流,并设计8个核心构件实现数据采集到告警的全流程处理。 高并发优化方案: 分析悲观锁(排他锁/共享锁)与乐观锁的特性差异,提出乐观锁通过版本号/CAS实现,悲观锁适用于强一致性场景。 给出Redis优化三手段:分布式锁控制临界资源、Lua脚本保证原子操作、热点数据多级缓存,结合消息队列削峰填谷。 分层架构实践: 智

数据知道的博客 1675

ZOJ-3993 Safest Buildings

题意:在一个半径为R的大圈里会随机的刷出半径为r的安全区,这个小圆(半径r)一定在大圆内(半径R),给n个建筑物,要求输出安全率最高的建筑的数目和编号 思路:  第一点:以每一个建筑为圆心,以r为半径作一个圆O1,这个圆O1内或者圆上的点都可以它本身为圆心,以r为半径作一个圆O2使这个建筑在这个圆O2内(安全区内),所以题目可以转化为 看哪个建筑的圆O1的面积大。如图A,B两个建筑物,明显A的圆...

Cworld2017的博客 331

第4章-07-将WebDriver获取的Cookie传递给Requests

在使用Selenium WebDriver获取了浏览器的Cookies之后,你可以将这些Cookies传递给requests库,以便在后续的HTTP请求中使用这些Cookies。这样做可以让你模拟浏览器会话,使得请求看起来像是从之前使用Selenium WebDriver控制的浏览器发出的。

黑夜开发者的博客 692

2017 秦皇岛CCPC M题 Safest Buildings(概率+思维+计算几何)

题意: 题目说的是一个叫“吃鸡”的游戏。 给出两个半径R,r,R表示第一次的大圈半径,r表示第二次的小圈半径。第一次大圈的圆心位于(0,0),第二次小圈的圆心未知,但在大圈内,给你一个n,然后给出n个屋子的位置,问这些屋子中,第二次在小圈的概率最大的屋子有几个,都是哪些。 思路: 首先分析到如果小圈是一个很小很小的圈,那么靠近原点的区域的这些点的概率是一样的,因为都可以使小圈360度绕着这

protecteyesight的博客 2470

精雕软件(JDpaint) 5.5 绿色版

精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版

efm32 入门.pdf

本PDF共计22页,介绍的是操作驱动API,下载与否自己斟酌。

ccpc秦皇岛zoj3993 -比较圆内点覆盖概率

PUBG is a multiplayer online battle royale video game. In the game, up to one hundred players parachute onto an island and scavenge for weapons and equipment to kill others while avoiding getting kille

mystical_curve的博客 462

迈瑞BS系列全自动生化分析仪LIS协议接口手册(内含HL7和ASTM)

迈瑞BS系列全自动生化分析仪LIS协议接口手册,内含HL7和ASTM)

ZOJ - 3993 Safest Buildings (2017CCPC秦皇岛站 简单题)

Safest Buildings Time Limit: 1 Second      Memory Limit: 65536 KB PUBG is a multiplayer online battle royale video game. In the game, up to one hundred players parachute onto an island and sca

LP_Cong 829

假人有限元模型

假人模型,车辆碰撞假人有限元模型,适合做乘员安全的研究者利用

ZOJ 3993 && 2017CCPC秦皇岛 M:Safest Buildings

题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3993 题意: 给你一个圆心为(0, 0),半径为R的大圈,里面有n个点 之后在大圈中随机生成一个半径为r的小圈,满足r 问哪些点在小圈中的概率最高 思路: 三种情况: ①2*r>=R,有些点一定会在小圈中,概率为100%,如果这个范围

加载中... 711

Safest Buildings (思维)

链接:https://ac.nowcoder.com/acm/problem/14377 来源:牛客网 PUBG is a multiplayer online battle royale video game. In the game, up to one hundred players parachute onto an island and scavenge for weapons ...

weixin_44757834的博客 433

ZOJ-Safest Buildings

Safest Buildings PUBG is a multiplayer online battle royale video game. In the game, up to one hundred players parachute onto an island and scavenge for...

1479

ZOJ 3993(2017CCPC秦皇岛站M题)Safest Buildings

题目连接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3993 题目大意:        最初的防御战是以(0,0)为圆形R为半径的一个圆O1,问你当防御战缩小为最初的圆O1内的一个半径为r的小圆(小圆的圆心随意位置)时,各点的能在小圆内的概率最大的是哪个。 题目思路:       AC代码: #inclu

syz201558503103的博客 500

ZOJ-3993(概率转化为面积问题)

**题目:**PUBG is a multiplayer online battle royale video game. In the game, up to one hundred players parachute onto an island and scavenge for weapons and equipment to kill others while avoiding gettin

行云出岫 809

ZOJ 3993 Safest Buildings(概率 数学)

DescriptionPUBG is a multiplayer online battle royale video game. In the game, up to one hundred players parachute onto an island and scavenge for weapons and equipment to kill others while avoiding ge

so_so_y的博客 534

G - Safest Buildings(数学几何题)

PUBG is a multiplayer online battle royale video game. In the game, up to one hundred players parachute onto an island and scavenge for weapons and equipment to kill others while avoiding getting kill...

zhiyeegao的博客 1万+

2017CCPC秦皇岛现场赛 - M - Safest Buildings 【几何 + 思维】

Safest BuildingsTime Limit: 1 Second Memory Limit: 65536 KBPUBG is a multiplayer online battle royale video game. In the game, up to one hundred players parachute onto an island and scavenge for w

nobleman 1463

ZOJ3993 半径比较/圆的相交面积

Safest BuildingsTime Limit: 1 Second      Memory Limit: 65536 KBPUBG is a multiplayer online battle royale video game. In the game, up to one hundred players parachute onto an island and scavenge for ...

qq_36876305的博客 240

Safest Buildings ZOJ - 3993 (几何问题)

PUBG is a multiplayer online battle royale video game. In the game, up to one hundred players parachute onto an island and scavenge for weapons and equipment to kill others while avoiding getting kill...

zx93的博客 393
上一篇: Numbers ZOJ - 3987(二进制思维+贪心)
下一篇: Balloon Robot ZOJ - 3981(思维)
Guuuuuu老师儿
博客等级 码龄9年 259粉丝 718原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值