Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
8194 | admin | 矩形面积交 | C++ | 通过 | 100 | 1 MS | 276 KB | 553 | 2025-03-28 18:46:16 |
#include<bits/stdc++.h> using namespace std; int main(){ double x1,y1,x2,y2; double x3,y3,x4,y4; double m1,n1; //交集左上角坐标. double m2,n2; //交集右下角坐标. cin>>x1>>y1>>x2>>y2; cin>>x3>>y3>>x4>>y4; m1 = max(min(x1,x2),min(x3,x4)); n1 = max(min(y1,y2),min(y3,y4)); m2 = min(max(x1,x2),max(x3,x4)); n2 = min(max(y1,y2),max(y3,y4)); cout<<fixed<<setprecision(2); if(m2>m1 && n2>n1) cout<<(m2 - m1)*(n2 - n1); else cout<<0.0; return 0; }