hdu 3622 Bomb Game(2-sat,二分,4级)

从零开始开发AI Agent:基于大模型的智能体实战指南 ### 摘要 本文介绍了AI Agent的开发全流程,从基础概念到实际部署,涵盖大模型集成、工具调用和记忆系统构建等核心技术。通过电商客服案例展示实战应用,并提供调试优化与部署方案,最后展望了AI Agent的未来发展方向,帮助开发者快速掌握智能体开发技能。 阅读详情

Bomb Game

Time Limit: 10000/3000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 2696    Accepted Submission(s): 894


Problem Description
Robbie is playing an interesting computer game. The game field is an unbounded 2-dimensional region. There are N rounds in the game. At each round, the computer will give Robbie two places, and Robbie should choose one of them to put a bomb. The explosion area of the bomb is a circle whose center is just the chosen place. Robbie can control the power of the bomb, that is, he can control the radius of each circle. A strange requirement is that there should be no common area for any two circles. The final score is the minimum radius of all the N circles.
Robbie has cracked the game, and he has known all the candidate places of each round before the game starts. Now he wants to know the maximum score he can get with the optimal strategy.
 

Input
The first line of each test case is an integer N (2 <= N <= 100), indicating the number of rounds. Then N lines follow. The i-th line contains four integers x 1i, y 1i, x 2i, y 2i, indicating that the coordinates of the two candidate places of the i-th round are (x 1i, y 1i) and (x 2i, y 2i). All the coordinates are in the range [-10000, 10000].
 

Output
Output one float number for each test case, indicating the best possible score. The result should be rounded to two decimal places.
 

Sample Input
  
2 1 1 1 -1 -1 -1 -1 1 2 1 1 -1 -1 1 -1 -1 1
 

Sample Output
  
1.41 1.00
 

Source
 

Recommend
lcy

思路:二分最小距离-2-sat 判断可行性,强连通缩点,判断a,a^1不矛盾就行了。

           (a,b)矛盾则(a,b^1),(b,a^1)加边,不可盲目加双向边。

这题坑了我近7个小时,两个问题。

1:加了双向边

2:tarjan()有错 instack忘给退了。


#include<iostream>
#include<cstring>
#include<cstdio>
#include<cmath>
using namespace std;
const int mm=200+9;
const double eps=1e-6;
class node
{
public:
    double x,y;
} f[mm];
int n;
double dis[mm][mm];
int head[mm],stack[mm],top,cnt,edge,dex,dfn[mm],low[mm],e_to[mm];
int ver[mm*mm],next[mm*mm];
bool instack[mm];
void data()
{
    memset(head,-1,sizeof(head));
    memset(dfn,0,sizeof(dfn));
    memset(instack,0,sizeof(instack));
    dex=top=cnt=edge=0;
}
void add(int u,int v)
{   if(u==v)return;
    ver[edge]=v;
    next[edge]=head[u];
    head[u]=edge++;
   // ver[edge]=u;
    //next[edge]=head[v];
    //head[v]=edge++;
}
double get_dis(node a,node b)
{
    return sqrt((a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y));
}
void tarjan(int u)
{
    dfn[u]=low[u]=++dex;
    stack[top++]=u;
    instack[u]=1;
    int v;
    for(int i=head[u]; ~i; i=next[i])
    {
        v=ver[i];
        if(!dfn[v])
        {
            tarjan(v);
            low[u]=low[u]<low[v]?low[u]:low[v];
        }
        else if(instack[v])
        {
            low[u]=low[u]<dfn[v]?low[u]:dfn[v];
        }
    }
    if(dfn[u]==low[u])
    {
        ++cnt;
        do
        {
            v=stack[--top];
            instack[v]=0;
            e_to[v]=cnt;
        }
        while(v^u);
    }
}
bool two_sat(double x)
{
    for(int i=0; i<n; ++i)
        for(int j=i+1; j<n; ++j)
            if(j^i&&dis[i][j]<x)
            {
               add(i,j^1),add(j,i^1);
              // add(j^1,i);add(i^1,j);
              // printf("dis=%lf  %d -> %d\n",dis[i][j],i,j);
              //printf("%d %d\n %d %d\n",i,j^1,j,i^1);
            }
    for(int i=0; i<n; ++i)
        if(!dfn[i])
            tarjan(i);

           // for(int i=0;i<n;++i)
          //  cout<<i<<" "<<e_to[i]<<endl;
    for(int i=0; i<n; ++i)
        if(e_to[i]==e_to[i^1])return 0;
    return 1;
}
int main()
{  ///freopen("data.in","r",stdin);
    while(~scanf("%d",&n))
    {
        for(int i=0; i<n; ++i)
            scanf("%lf%lf%lf%lf",&f[i+i].x,&f[i+i].y,&f[i+i+1].x,&f[i+i+1].y);
        n+=n;
        for(int i=0; i<n; ++i)
            for(int j=i+1; j<n; ++j)
                dis[i][j]=get_dis(f[i],f[j]);
        double l=0.0,r=1e9,mid;

        while(r-l>eps)
        {
        data();
        mid=(l+r)/2.0;
      //  mid=3.80;
      //  puts("......................................................");
       // printf("%lf----\n",mid);
        if(two_sat(mid*2.0))
        {l=mid;}
        else {r=mid;}
        }
        printf("%.2lf\n",(l+r)/2.0);
    }
}





RK3588 Weston 下面是使用 weston -B=vnc-backend.so --width=1280 --height=720 ,使用vnc的客户端来远程访问weston桌面。Wayland是一套display server(Wayland compositor)与client间的。,而Weston是Wayland compositor的参考实现。7:在基于wayland 运行Qt 程序。根据不同版本,支持的后端也不相同。2:当前weston支持的后端。4:weston的配置文件。3:weston中的录屏。 阅读详情

相关推荐

从零开始理解二极管限幅:5种典型电路设计及实际应用场景解析

本文系统解析了二极管限幅电路的五大经典拓扑,包括串联与并联型上下限幅及双向限幅。通过剖析其核心原理与二极管的单向导电性、正向压降特性,结合ADC输入保护、电源管理、音频处理等实际应用场景,提供了从器件选型到设计陷阱规避的完整实战指南,帮助工程师为信号构建可靠的“安全笼”。

2y3u4i5o6p的博客 1034

HDU 3622 Bomb Game (二分+2-sat,4级 )

E - Bomb Game Crawling in process... Crawling failed Time Limit:3000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status Appoint description: System Crawler (20

nealgavin的专栏 747

YOLOv8【第十一章:视频追踪与流处理篇·第6节】BoT-SORT 改进:结合相机运动补偿(CMC)提升追踪稳定性!

🏆 本文收录于 《YOLOv8实战:从入门到深度优化》 专栏。该专栏系统复现并梳理全网各类 YOLOv8 改进与实战案例(当前已覆盖分类 / 检测 / 分割 / 追踪 / 关键点 / OBB 检测等方向),坚持持续更新 + 深度解析,质量分长期稳定在 97 分以上,可视为当前市面上 覆盖较全、更新较快、实战导向极强 的 YOLO 改进系列内容之一。

**My Coding Family** 718

HDU 3622 Bomb Game 2-sat 模板题

                                           HDU 3622 Bomb Game Robbie is playing an interesting computer game. The game field is an unbounded 2-dimensional region. There are N rounds in the game. At e...

点滴 400

labelImg使用教程

Anaconda环境 安装 Anaconda 之后,在开始菜单下找到 Anaconda 文件夹 找到 Anaconda Prompt 点击运行 安装 labelImg pip install labelImg #直接命令行输入 启动 labelImg labelImg #直接命令行输入名称即可 labelImg界面 开始标注 快捷键:W(创建方框),A(上一张),D(下一张) XML文件示例 <annotation> <folder>夜读</folder>

G果的博客 3万+

3 ATK2(AUTOSAR OS)代码移植-目标硬件及编译环境简介

该部分介绍ATK2代码移植的目标硬件以及编译环境

xiaoduanduansad的博客 717

HDU-3622-Bomb Game(2-SAT+二分)

Bomb Game Time Limit: 10000/3000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 4897    Accepted Submission(s): 1750 Problem Description Robbie is playing a

不会吃鱼的喵 841

Odoo17商城微信支付模块,快速一个实现可在线支付的商城

通过集成微信支付APIv3,Odoo 系统实现了高效、安全的支付流程。Native扫码支付和Jsapi微信浏览器内直接拉起支付为用户提供了更加便捷的支付方式。同时,通过发送下单及支付消息给管理员,商家可以实时了解订单状态并进行相应处理。通过集成微信支付 结合 Odoo 系统内置的商城模块,可以为商家快速实现功能完善、高效的电商解决方案。

AaronZZH 的博客 2268

Hdu 3622 Bomb Game 2-SAT+二分

Bomb Game Time Limit: 10000/3000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 5672    Accepted Submission(s): 2048 Problem Description Robbie is playi

J. Cole 361

压缩包密码破解工具ZIP Cracker2.0.1.2 正式版

一款多功能文件密码破解工具,支持ZIP、RAR、Office等主流加密格式,提供CPU/GPU双模式破解。该软件采用黑客风格界面,具备环境自检修复功能,支持实时监控硬件使用率。内置hashcat等专业破解工具,通过拖拽文件即可快速破解,GPU模式速度可达CPU的10-100倍。最新版本优化了中文路径支持,并提升了启动速度。

bfq05234214的博客 481

Dify 第 13 篇 Dify 工作流 详解

工作流通过将复杂任务分解为节点降低复杂度,提升LLM应用的性能和稳定性。Dify工作流分为两类:Chatflow面向对话场景(如客服),支持多轮对话;Workflow面向批处理场景(如翻译),提供逻辑节点实现自动化。核心概念包括节点、变量(系统/会话/环境变量)及应用类型差异:Chatflow支持中间输出和对话历史,Workflow仅支持结束节点输出。系统变量以"sys"开头,用于全局数据传递,不同应用类型变量不同,如Chatflow的sys.query存储用户输入,Workflow的s

甘蓝的专栏 3246

hdu 3622 Bomb Game (二分+2-sat)

Bomb Game Time Limit: 10000/3000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 5716    Accepted Submission(s): 2069 Problem Description Robbie is playi

K键盘里的青春K 544

资产会计 Transaction Type 与业务交易的 Post to Affiliated Company 不一致导致的 AAPO176:成因剖析与修复指引

本文解析了SAP资产会计中常见的"AAPO176"错误提示,指出当交易类型(TType)与业务交易(Business Transaction)的"关联公司过账"(Post to Affiliated Company)标志不一致时,系统会拒绝过账。作者详细说明了该标志的作用机制,并提供了四种解决方案:修正交易类型使用、匹配正确的业务交易、调整系统配置或建立映射关系。文章还通过实际案例展示了配置错误对集团合并报表的影响,并附带了用于检查配置一致性的ABAP脚本。该错误通常

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 394

hdu——3622Bomb Game

Problem Description Robbie is playing an interesting computer game. The game field is an unbounded 2-dimensional region. There are N rounds in the game. At each round, the computer will give Robbie t

Alex 655

NTscan扫描工具

ntscan是一个扫描器,可以扫描没有密码和弱密码的共享,先到配置文件中填写猜测的用户名和密码,扫描过程中右侧出现的是扫描日志。

visio安装包

Microsoft Office Visio 是一款专业的制图软件。利用经过更新的形状、协作工具和数据链接图表,创建专业级图表以简化复杂的信息。

hdu 3622 Bomb Game(二分+2-sat)

Bomb GameTime Limit: 10000/3000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 5985    Accepted Submission(s): 2167Problem DescriptionRobbie is playing an interestin...

albertluf的博客 346

老版QQ原生表情gif动态

这是老版的QQ表情,不过全是动态的的,Windows照片查看器是不会动的,可以右击用浏览器打开查看,再说一遍是老版的,只是分享给宁愿用老版也要动态的人。

HDU 3622 Bomb Game 【二分+2-SAT】

传送门:HDU 3622 Bomb Game Time Limit: 10000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Problem Description Robbie is playing an interesting computer game. The game field is an...

Waiting For You 585

efm32 入门.pdf

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

HDU 3622 Bomb Game( 二分查找+2-SAT )

题目大意: 在一个平面上,放炸弹。每次给出两个位置,在这两个位置里面选择一个放炸弹。一共给出n组位置,如前面所述,每组有个两个位置。然后,对于每个炸弹,都有一个power,即爆炸时的破坏的半径,这个半径是可以控制的,几就是说,以所选的位置为圆心的半径可以控制的圆。要求圆和圆之间不能有交集,可以相切。求解,满足n个圆无交集的最大的半径是多少? 题目分析: 首先,是这个半径应该是多少,其实要求n

AClion的专栏 1123

【HDU 3622】 Bomb Game(2-SAT)

题意: 一个游戏有nnn轮,每轮提供给你两个坐标,你选择其中一个放置炸弹,到最后会放置nnn个炸弹,要保证任意两个炸弹的爆炸区域不会相交,每个炸弹的爆炸半径由你来决定,你的目的是使最小的半径最大。 题解: 考虑二分半径,对于半径rrr,O(n2)O(n^2)O(n2)的建立约束关系,利用2−SAT2-SAT2−SAT判断可行性。时间复杂度O(n2log(n))O(n^2log(n))O(n2log...

duanghaha的博客 263

HDU 3622 Bomb Game(2-sat)

HDU 3622 Bomb Game 题目链接 题意:求一个最大半径,使得每个二元组的点任选一个,可以得到所有圆两两不相交 思路:显然的二分半径,然后2-sat去判定即可 代码: #include #include #include #include #include #include using namespace std; const int MAX

Remilia's 1066

hdu 3622 Bomb Game(2-SAT,二分)

题意: Robbie is playing an interesting computer game. The game field is an unbounded 2-dimensional region. There are N rounds in the game. At each round, the computer will give Robbie two places, and R...

AAAAAAAC的博客 197

HDU 3622 Bomb Game 二分+2-SAT

二分爆炸半径R,判断是否可行,如果可行,半径可以继续增加。 之前建图有误,结果一直不对。 #include <cstdio> #include <cstring> #include <cstdlib> #include <cmath> #include <algorithm> #include <v...

aegt43853的博客 193

hdu3622Bomb Game

链接:http://acm.hdu.edu.cn/showproblem.php?pid=3622 题意:给定n对点,每对点需要选择其中之一放一个炸弹,炸弹的半径随意,但是两个炸弹的爆炸覆盖面积不允许重叠。求使得所有炸弹半径中最小值最大的那个最大值。 分析:最小值最大很经典就是二分答案,然后怎么判断呢?我们根据两两之间的互斥关系建立一些表达式然后就是一个2-sat问题啦。 代码: #inc

Fsss 701

HDU3622 Bomb Game(二分+2-SAT)

题意 给n对炸弹可以放置的位置(每个位置为一个二维平面上的点), 每次放置炸弹是时只能选择这一对中的其中一个点,每个炸弹爆炸 的范围半径都一样,控制爆炸的半径使得所有的爆炸范围都不相 交(可以相切),求解这个最大半径. 题解 首先二分最大半径值,然后2-sat构图判断其可行性,对于每 两队位置(u,uu)和(v,vv),如果u和v之间的距离小于2*id,也就是说位置u和位置v...

airen6935的博客 324

HDU Bomb Game 3622 (2-Sat)

Bomb Game Time Limit: 10000/3000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2754    Accepted Submission(s): 918 Problem Description Robbie is playing an inter...

weixin_34355881的博客 162

HDU 3622 Bomb Game

Description \(n\) 个炸弹,每个炸弹有两个放置点,可以任选一个,问你最大的半径是多少. Sol 二分+2-SAT+Tarjan. 首先二分一下答案.然后就成了一个2-SAT问题. 建模就是, \(i\) 如果和 \(j\) 的距离超过 \(x*2\),那么 \(i\) 只能选择 \(j\) ^ \(1\) 连边,同时 \(j\) 只能选择 \(i\) ^ \(1...

aisen1985的博客 153
上一篇: hdu 3836 Equivalent Sets(强连通,tarjan,4级)
下一篇: hdu 3062 Party(2-sat,3级)
剑不飞
博客等级 码龄15年 86粉丝 505原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值