'commit'
This commit is contained in:
24
TangDou/LanQiaoBei/LanQiaoBei13ShengSai_ZJ_I/Test.cpp
Normal file
24
TangDou/LanQiaoBei/LanQiaoBei13ShengSai_ZJ_I/Test.cpp
Normal file
@@ -0,0 +1,24 @@
|
||||
#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;
|
||||
}
|
||||
Reference in New Issue
Block a user