Files
python/TangDou/LanQiaoBei/LanQiaoBei13ShengSai_ZJ_I/Test.cpp

24 lines
558 B
C++
Raw Normal View History

2025-08-30 18:35:01 +08:00
#include <bits/stdc++.h>
using namespace std;
const int N = 1e4 + 10;
int n, sum;
bool p[N][N];
void paint(int x1, int y1, int x2, int y2) {
for (int i = x1; i < x2; i++)
for (int j = y1; j < y2; j++)
p[i][j] = 1;
}
int main() {
cin >> n;
for (int i = 1; i <= n; i++) {
int x1, y1, x2, y2;
cin >> x1 >> y1 >> x2 >> y2;
paint(x1, y1, x2, y2);
}
for (int i = 0; i < N; i++)
for (int j = 0; j < N; j++)
if (p[i][j]) sum++;
printf("%d\n", sum);
return 0;
}