0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-12-27 00:12:00 +00:00
OI-codes/Luogu/problem/P2956/P2956.cpp

28 lines
566 B
C++
Raw Normal View History

#include <bits/stdc++.h>
using namespace std;
bool vis[250][250];
int main() {
int x, y, p, x1, x2, y1, y2, ans = 0;
cin >> x >> y >> p;
for (int i = 0; i < p; i++) {
cin >> x1 >> y1 >> x2 >> y2;
for (int j = x1; j <= x2; j++) {
for (int k = y1; k <= y2; k++) {
vis[j][k] = true;
}
}
}
for (int i = 1; i <= x; i++) {
for (int j = 1; j <= y; j++) {
if (vis[i][j]) {
ans++;
}
}
}
cout << ans << endl;
return 0;
}