0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-11-10 05:18:49 +00:00

P2956 [USACO09OCT]The Robot Plow G

R52218903
This commit is contained in:
Baoshuo Ren 2021-06-30 17:28:41 +08:00 committed by Baoshuo Ren
parent 70fa859aa8
commit f19172d756
Signed by: baoshuo
GPG Key ID: 70F90A673FB1AB68

View File

@ -0,0 +1,27 @@
#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;
}