标签:include enter block cstring 解析 math amp ecb lock
#include<cmath>
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#define LL long long
using namespace std;
struct matrix
{
int ax,ay,bx,by;
}mat[5];
int ares;
int main()
{
for(int i=1;i<=3;i++) scanf("%d%d%d%d",&mat[i].ax,&mat[i].ay,&mat[i].bx,&mat[i].by);
ares=(mat[1].bx-mat[1].ax)*(mat[1].by-mat[1].ay)+(mat[2].bx-mat[2].ax)*(mat[2].by-mat[2].ay);
ares-=max(0,min(mat[1].bx,mat[3].bx)-max(mat[1].ax,mat[3].ax))*max(0,min(mat[1].by,mat[3].by)-max(mat[1].ay,mat[3].ay));
ares-=max(0,min(mat[2].bx,mat[3].bx)-max(mat[2].ax,mat[3].ax))*max(0,min(mat[2].by,mat[3].by)-max(mat[2].ay,mat[3].ay));
printf("%d\n",ares);
return 0;
}
Luogu P4122 [USACO17DEC]Blocked Billboard
标签:include enter block cstring 解析 math amp ecb lock
原文地址:https://www.cnblogs.com/Hawking-llfz/p/11552425.html