当前位置:网站首页>AcWing 1812. Square pasture (enumeration)
AcWing 1812. Square pasture (enumeration)
2022-04-21 15:25:00 【Old worry】
subject :1812. Square pasture


Answer key : Map these two rectangles to x Axis and y On the shaft , Find the maximum interval , Then multiply the length of the two intervals .
#include<bits/stdc++.h>
#define x first
#define y second
using namespace std;
typedef long long LL;
typedef pair<int ,int> PII;
const int N=1e5+10;
const int mod=100000007;
int main(){
int a[2][4];
int b,c,d,e;
b=20,c=0,d=20,e=0;
for(int i=0;i<2;i++){
cin>>a[i][0]>>a[i][1]>>a[i][2]>>a[i][3];
b=min(a[i][0],b);
b=min(a[i][2],b);
c=max(a[i][0],c);
c=max(a[i][2],c);
d=min(a[i][1],d);
d=min(a[i][3],d);
e=max(a[i][1],e);
e=max(a[i][3],e);
}
int t=max(0,c-b);
t=max(t,max(0,e-d));
cout<<t*t;
return 0;
}
版权声明
本文为[Old worry]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204211522326139.html
边栏推荐
- 【C语言进阶】自定义类型:结构体,位段,枚举,联合
- 78页数字孪生+智慧楼宇解决方案
- 万有导航:简洁实用的综合导航网站
- 【JS】URLSearchParams 对象(以对象的形式上传参数到url)
- SAP ui5 application development tutorial 70 - how to use button controls to trigger page routing jump trial version
- JUC concurrent learning notes
- 冬天到了,给你的网站下个雪吧
- OpenHarmony相机用户态驱动框架
- Detailed explanation of basic knowledge of database 5: index and its two engines in mysql, master-slave replication and relational / non relational database
- 企业邮箱如何申请?如何用手机号注册邮箱?
猜你喜欢

Ultimate doll 2.0 | observable practice sharing of cloud native PAAS platform
![[Unity] error CS0433: The type ‘Task‘ exists in both Unity.Tasks,....](/img/17/3a0b2e52336bc702ff3b38420e9e6a.png)
[Unity] error CS0433: The type ‘Task‘ exists in both Unity.Tasks,....

使用konvajs三步实现一个小球游戏

【unity笔记】L3Unity Shader学习开始

Introduction to openlayers (II)

Site intelligent solution

Design and implementation of public welfare website based on JSP

Take it easy, just talk about the soft test

107页企业数字化转型规划设计

红队技术-父进程伪装(MITRE ATT&CK框架:T1134)
随机推荐
Reading breaks ten thousand "volumes": National Reading insight 2022
Design and implementation of public welfare website based on JSP
Smart public security QR code positioning alarm system development of mobile police app
JDBC和数据库连接池
[binary search - simple] 374 Guess the size of the number
BetterScroll源码阅读顺便学习TypeScript
[binary search - simple] 441 Arrange coins
Can station B be called YouTube in China?
JUC学习记录
APP评测的网站有哪些?
107页企业数字化转型规划设计
SQL服务器如何设置起始日期查询语句
让阿里P8都为之着迷的分布式核心原理解析到底讲了啥?看完我惊了
【二分搜索-中等】540. 有序数组中的单一元素
What is an email address? Easy to use email registration application
产业园区数字孪生规划方案
最佳实践 | 疫情之下,了解 eolink 如何助力远程办公!
智慧工地综合解决方案
JUC并发学习笔记
Jetpack Compose使用自定义操作符实现绘制五角星效果