2022-2023 ICPC Brazil Subregional Programming Contest
C. Cutting with Lasers
思路:模拟和广搜,用vis(i, j)表示( i , j )位置的方格是否已经被裁剪,然后遍历每个点,对没裁过的点扫描线算面积,最后取最大值
#include <bits/stdc++.h>
#define int long long
#define endl '\n'
using namespace std;
const int N = 1e6 + 10, MOD = 1e9 + 7;
struct point
{
int x, y;
} p[N];
struct line
{
point st, ed;
} l[N];
int col[1010][1010], row[1010][1010];
bool check(int x, int y)
{
return (1 <= x) && (1000 >= x) && (1 <= y) && (1000 >= y);
}
bool vis[1010][1010];
int cal[N];
int getpos(int x, int y)
{
return x * 1001 + y;
}
int find(int x, int y)
{
if (vis[x][y])
return 0;
vis[x][y] = 1, cal[1] = x * 1001 + y;
int cnt = 1;
for (int st =