题目大意:在w*h的图上有n个点,要求找出一个正方形面积最大,且没有点落在该正方形内部。
解题思路:枚举y坐标,每次遍历所有点,判断是否有点落在矩形内,有的话维护最优解,更新下线。
#include <stdio.h>
#include <string.h>
#include <algorithm>
using namespace std;
const int N = 105;
struct point {
int x, y;
}p[N];
int n, w, h, dy[N];
bool cmp(const point& a