当前位置:网站首页>AcWing 1866. 围栏刷漆(区间求交)
AcWing 1866. 围栏刷漆(区间求交)
2022-04-21 15:22:00 【岁忧】
题目:1866. 围栏刷漆


题解:先加上两个区间的长度,然后再减去两个区间相交的长度
#include<bits/stdc++.h>
#define x first
#define y second
using namespace std;
typedef long long LL;
typedef pair<int ,string> PII;
const int N=1e5+10;
const int mod=100000007;
int main(){
int a,b,c,d;
cin>>a>>b>>c>>d;
cout<<b-a+d-c-max(0,min(b,d)-max(a,c));
return 0;
}
版权声明
本文为[岁忧]所创,转载请带上原文链接,感谢
https://blog.csdn.net/weixin_46028214/article/details/124320389
边栏推荐
- Machine learning methods create learnable chemical grammars and construct synthetic monomers and polymers
- Detailed explanation of spark SQL underlying execution process
- What is the format of e-mail? What is the corporate email address?
- OpenLayers入门(一)
- [binary search - simple] sword finger offer II 068 Find insertion location
- 【二分查找-简单】441. 排列硬币
- 客户端邮件同步到webmail如何操作,电子邮件地址怎么注册?
- 红队技术-父进程伪装(MITRE ATT&CK框架:T1134)
- 【JS】URLSearchParams 对象(以对象的形式上传参数到url)
- [introduction to machine learning] - Lesson 6 - Bayesian classifier
猜你喜欢

如何选择合适的 Neo4j 版本(2022)

Spark / Scala - read rcfile & orcfile

What is the format of e-mail? What is the corporate email address?

Glass: GNN tagging technique for subgraph representation learning

MySQL

Would like to ask how to find the software registration code from the database

IT服务管理框架要怎么落地?看这篇就够了

Page 92 group informatization planning scheme enterprise application integration solution

Installation and uninstallation of MySQL

SAP ui5 application development tutorial 70 - how to trigger page route jump using button control
随机推荐
Take it easy, just talk about the soft test
OpenHarmony3.1 H264视频播放之路
IT服务管理框架要怎么落地?看这篇就够了
【二分搜索-中等】剑指 Offer II 070. 排序数组中只出现一次的数字
智慧园区数融通-数字化赋能运营管理平台解决方案
汉诺塔游戏与递归
Login refactoring notes
干货 | 环境问题还是测试的老大难?两个步骤轻松搞定
冬天到了,给你的网站下个雪吧
How to synchronize client email to webmail and how to register email address?
客户端邮件同步到webmail如何操作,电子邮件地址怎么注册?
让阿里P8都为之着迷的分布式核心原理解析到底讲了啥?看完我惊了
【二分查找-简单】LCP 18. 早餐组合
Mysql
终极套娃 2.0|云原生 PaaS 平台的可观测性实践分享
干货 | 录制你的第一个web 自动化测试用例
[binary search - simple] LCP 18 Breakfast combination
111頁精細化工股份公司數據字轉型解决方案
Dry goods | record your first web automation test case
Page 92 group informatization planning scheme enterprise application integration solution