Bombing(HDU-4022)

关于光耦隔离与SP3485E芯片一起使用无法拉高485使能引脚问题 最近在做的一个项目,定制了一块STM32F407ZG的工控板,工控板载4个485接口全部都是只能接收数据,不能对外发送数据。1.接线不正确:接线不正确导致485收发出现问题。 2.程序端口初始化问题:控制光耦隔离的输入脚IO的初始化和置位状态有问题。 3.GPIO复用问题:控制对应串口的GPIO不是正点原子默认的GPIO,而是经过复用的其他IO,复用问题。 4.程序设置与485E芯片收发模式不对应:对于使能引脚的电平要根据光耦的输出情况确定输入IO与RE的关系,可能模式没有对应。 5.光耦隔离或者SP485 阅读详情
Problem Description
It’s a cruel war which killed millions of people and ruined series of cities. In order to stop it, let’s bomb the opponent’s base.
It seems not to be a hard work in circumstances of street battles, however, you’ll be encountered a much more difficult instance: recounting exploits of the military. In the bombing action, the commander will dispatch a group of bombers with weapons having the huge destructive power to destroy all the targets in a line. Thanks to the outstanding work of our spy, the positions of all opponents’ bases had been detected and marked on the map, consequently, the bombing plan will be sent to you.
Specifically, the map is expressed as a 2D-plane with some positions of enemy’s bases marked on. The bombers are dispatched orderly and each of them will bomb a vertical or horizontal line on the map. Then your commanded wants you to report that how many bases will be destroyed by each bomber. Notice that a ruined base will not be taken into account when calculating the exploits of later bombers.
 

Input
Multiple test cases and each test cases starts with two non-negative integer N (N<=100,000) and M (M<=100,000) denoting the number of target bases and the number of scheduled bombers respectively. In the following N line, there is a pair of integers x and y separated by single space indicating the coordinate of position of each opponent’s base. The following M lines describe the bombers, each of them contains two integers c and d where c is 0 or 1 and d is an integer with absolute value no more than 109, if c = 0, then this bomber will bomb the line x = d, otherwise y = d. The input will end when N = M = 0 and the number of test cases is no more than 50.
 

Output
For each test case, output M lines, the ith line contains a single integer denoting the number of bases that were destroyed by the corresponding bomber in the input. Output a blank line after each test case.
 

Sample Input
3 2 1 2 1 3 2 3 0 1 1 3 0 0
 

Sample Output
2 1
 
题目大意:由于xxx原因,我们要炸掉敌方基地,输入n(敌方基地个数)和m(我方轰炸机的个数),然后输入n个基地的坐标(x,y),输入c,d,如果c=0,将轰炸x=d的所有坐标,c=1,将轰炸y=d的所有坐标,输出每个轰炸机轰炸的个数;

代码如下:
#include<bits/stdc++.h>
using namespace std;
#define ma map<int,multiset<int> >
#define se multiset<int>
ma a,b;
void my_solve(se &r1,ma &r2,int d)
{
    int cnt=0;
    for(set<int>::iterator it=r1.begin();it!=r1.end();it++)
    {
        r2[*it].erase(d);
        cnt++;
    }
    r1.clear();
    cout<<cnt<<endl;
}
int main()
{
    int n,m;
    while(~scanf("%d%d",&n,&m)&&(n!=0||m!=0))
    {
        int x,y;
        for(int i=1;i<=n;i++)
        {
            scanf("%d%d",&x,&y);
            a[x].insert(y);
            b[y].insert(x);
        }
        for(int i=1;i<=m;i++)
        {
            int c,d,cnt=0;
            scanf("%d%d",&c,&d);
            if(c==0)
                my_solve(a[d],b,d);
            else
                my_solve(b[d],a,d);
        }
        printf("\n");
        a.clear();
        b.clear();
    }
    return 0;
}


【Qt开发】管理OpenGL上下文QOpenGLContext类及应用实践示例代码 QOpenGLContext 提供了一个简单、高效的接口来管理 OpenGL 上下文。本文详细介绍了 QOpenGLContext 的基本功能、常用方法、信号槽机制、高级应用技巧及常见问题的解决方法。通过这些介绍,读者可以更好地掌握和利用 QOpenGLContext 进行 OpenGL 渲染和管理实验。对于有特殊需求的开发者,也可以通过探索更多高级设置和优化策略,以满足具体的应用场景。 阅读详情

相关推荐

DC综合中set_dft_signal的实战配置与优化策略

本文深入解析了DC综合中set_dft_signal命令的实战配置与优化策略。文章从命令的核心作用出发,详细拆解了-view、-type、-usage等关键参数,并通过扫描使能与时钟门控的实战案例,展示了如何正确配置以实现测试模式下的功耗优化。同时,文章总结了高级优化策略、与低功耗流程的协同方法以及常见错误排查清单,旨在帮助数字芯片设计工程师构建高可测性、低功耗的稳健DFT基础。

weixin_28347369的博客 414

Bombing HDU, 4022(QQ糖的消法)

题目大意: 给你n个敌人的坐标,再给你m个炸弹和爆炸方向,每个炸弹可以炸横排或竖排的敌人,问你每个炸弹能炸死多少个人。 解题思路: 用map里面嵌套multiset , 1000多ms,还是有点长的,老师说要用list ,不知是否要快点。

Menglei Min 1510

SPSS篇—卡方检验

今天依旧跟大家分享一个在SPSS中使用率比较高的分析方法:卡方检验。 在开始做分析之前,我们需要明白两件事情:卡方检验是什么?一般用来干什么?我们只有充分了解分析方法以后才能够正确的使用它。 卡方检验在百科中的解释是:卡方检验是用途非常广的一种假设检验方法,它在分类资料统计推断中的应用,包括:两个率或两个构成比比较的卡方检验;多个率或多个构成比比较的卡方检验以及分类资料的相关分析等。它的原理是...

小白数据营的博客 20万+

hdu4022

题目大意:给你n个点(二位),坐标范围(<10^9)然后m次询问0 s 表示询问x = s这条线上有多少个点并删除1 s 表示询问y = s这条线上有多少个点并删除import java.io.BufferedInputStream; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStre

老李2009 835

07- Rossmann商店销售预测 (Xgboost集成算法) (项目七)

Rossmann在欧洲国家经营着3000多家日化用品超市。目前,Rossmann商店经理的任务是提前6周预测他们的日销售额。商店的销售受到许多因素的影响,包括促销、竞争、学校和国家假日、季节性和地域性。由于数以千计的管理者根据自己的特殊情况预测销售,结果的准确性可能会有很大的差异。 因此使用机器学习算法对销量进行预测,Rossmann要求预测德国1115家商店的6周日销售额。可靠的销售预测使商店经理能够制定有效的员工时间表,提高生产力和积极性。

March_A的博客 2469

保姆级教程:从 TLE 数据源获取到 Cesium 卫星轨迹可视化全流程(含常见报错排查)

本文提供从TLE数据源获取到Cesium卫星轨迹可视化的全流程保姆级教程,涵盖数据预处理、satellite.js计算、Cesium集成及性能优化等关键步骤,并针对常见报错提供详细排查方案,帮助开发者高效实现卫星轨迹可视化。

weixin_29002595的博客 300

HDU - 4022 Bombing (multiset)

It’s a cruel war which killed millions of people and ruined series of cities. In order to stop it, let’s bomb the opponent’s base.  It seems not to be a hard work in circumstances of street battles,

深海沧澜的博客 292

《Ventoy 制作系统安装 U 盘的具体步骤》

然后您可以在电脑的磁盘管理中对 U 盘进行快速格式化,选择 FAT32 或 NTFS 文件系统。至此,Ventoy 系统安装 U 盘就制作完成了。您可以在需要安装系统的电脑上,从 U 盘启动,然后选择相应的系统镜像进行安装。安装完成后,将您需要的操作系统镜像文件(如 Windows、Linux 等的 ISO 格式镜像)复制到 U 盘的根目录。在安装程序中,选择您插入的 U 盘设备,确保选择正确,以免误操作。2. 确认选择的 U 盘盘符正确,防止误操作导致其他磁盘数据丢失。点击“安装”按钮,等待安装完成。

jiyiwangluokeji的博客 2685

HDU 4022 Bombing c++解法

It’s a cruel war which killed millions of people and ruined series of cities. In order to stop it, let’s bomb the opponent’s base. It seems not to be a hard work in circumstances of street battles, ho...

qq_41773202的博客 549

UNet改进(52):轴向+代理注意力让UNet既轻快又精准

本文提出了一种改进的UNet架构,通过引入轴向注意力代理模块增强医学图像分割性能。该模块将二维自注意力分解为行列两个一维注意力操作,结合可学习代理节点进行全局信息聚合,在保持计算效率的同时提升模型对长距离依赖的建模能力。实验表明,该方法在多个医学图像数据集上较传统UNet提升3.2%-5.7%的Dice系数,边界质量显著改善。该方案特别适用于具有方向性结构的医学图像分割任务,如血管、器官等,在计算复杂度和分割精度之间实现了良好平衡。

2501_91516851的博客 333

TriCore架构-如何将系统刷成HSM

本文介绍了芯片刷写操作流程:首先加载project_Merge.s19文件,进入UCB界面展开BMHD0_ORIG和BMHD1_ORIG。重点说明需要将STAD地址从原始值A0000000修改为0XA00A0000,并详细描述了编辑、更新和写入芯片的步骤。最后提示在HSM刷写过程中如遇错误可能需要输入密码。该操作涉及关键地址修改,需谨慎执行。

xiandang8023的博客 103

hdu 4022 map的一对多实现 map和set的结合应用

Bombing Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 65768/65768 K (Java/Others) Total Submission(s): 1471    Accepted Submission(s): 551 Problem Description It’s a cruel war which

hnust_xiehonghao的专栏 1098

YOLO12涨点改进| 损失函数改进篇 |AAAI 2025| 一种小目标检测SDLoss损失函数,解决现有损失函数对不同目标尺度敏感度不足的局限,提高了网络检测不同尺度目标的敏感能力,助力高效涨点

本文提出了一种改进的小目标检测方法SDLoss,通过动态调整尺度损失与位置损失的权重,优化了YOLOv12模型的性能。针对红外小目标检测中存在的两个主要问题:1)标准卷积难以捕捉目标的高斯空间分布特性;2)现有损失函数对不同尺度目标的敏感度不足,研究团队开发了Pinwheel-shaped卷积(PConv)和Scale-based Dynamic损失函数(SDLoss)。PConv通过不对称卷积核设计显著提升感受野,SDLoss则根据目标大小动态平衡尺度与位置损失的影响。

Ai缝合怪、助力小伙伴高效发论文 248

HDU 4022 Bombing

HDU 4022 Bombing

爪哇D来客 612

精雕软件(JDpaint) 5.5 绿色版

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

廖雪峰Python教程[完整版]

廖雪峰的python教程整理的,已经排好版了,而且还是完整的,适合小白

hdu 4022 Bombing

1002 Bombing  The 36th ACM/ICPC Asia Regional Shanghai Site —— Online Contest 本题的思路就是将点映射一下,一次加入map,坐标值变成映射值,这样在利用静态链表进行处理,因为有可能横着炸或者竖着炸,

凌风 3802

RU DOS版、EFI版32bit/64bit BIOS常用工具

DOS版、EFI版的RU工具,可用来查看IO、MEM、PCI、SMBIOS等资源。亲测在EFI SHELL下可用。

HDU_4022_Bombing

HDU_5022_Bombing It’s a cruel war which killed millions of people and ruined series of cities. In order to stop it, let’s bomb the opponent’s base. It seems not to be a hard work in circumstances of street

Sothan 507

VB摄像头监控

该VB模块可对摄像头捕获的画面进行录像等,可在创建的窗口进行控制

Bombing HDU - 4022

Bombing HDU - 4022 题意:给出n个目标,m个炸弹,每个炸弹可以炸一行或者一列,问每一个炸弹摧毁了多少目标。 可以用STL做,也可以二分做。 这是kuangbin的代码~ 用STL很简洁,但是慢 1 /* 2 HDU 4022 3 G++ 1296ms 4 5 6 */ 7 8 9 #include<st...

weixin_30292843的博客 167

HDU -4022 Bombing

传送门 问题描述: It’s a cruel war which killed millions of people and ruined series of cities. In order to stop it, let’s bomb the opponent’s base. It seems not to be a hard work in circumstances of street battles, however, you’ll be encountered a much more diff

m0_51727949的博客 175

hdu4022 bombing map+multiset

It’s a cruel war which killed millions of people and ruined series of cities. In order to stop it, let’s bomb the opponent’s base. It seems not to be a hard work in circumstances of street battles, ho...

mayuqing98的博客 258

HDU 4022 Bombing STL 模拟题

手动模拟。。 #include #include #include #include #include #include #include #include using namespace std; #define N 10100 #define inf 1000000010 mapx,y; struct X{ int x,y; bool operator<(const X&a)const{

九野的博客 1741

【STL】hdu 4022 Bombing

multiset 容器

Gzbgreat的博客 374
上一篇: The kth great number(HDU -4006)
下一篇: sort(HDU-3293)
绿蚁.r
博客等级 码龄10年 4粉丝 37原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值