AcWing 1671. 三角形
原题链接
简单
作者:
静静在Coding
,
2022-03-26 11:19:44
,
所有人可见
,
阅读 171
暴力枚举
#include<iostream>
#include<algorithm>
using namespace std;
#define x first
#define y second
typedef pair<int,int> PII;
const int N = 110;
PII a[N];
int main()
{
int n;
cin>>n;
for(int i = 1;i <= n;i++) cin>>a[i].x>>a[i].y;
int res = 0;
for(int i = 1;i <= n;i++){
for(int j = 1;j <= n;j++){
for(int k = 1;k <= n;k++){
if(i == j || j == k || i == k) continue;
if(a[i].first == a[j].first && a[k].second == a[i].second){
res = max(res,abs(a[k].first - a[i].first)*abs(a[i].second - a[j].second));
}
}
}
}
cout<<res;
return 0;
}