水题 Codeforces Round #308 (Div. 2) A. Vanya and Table

时间:2023-03-09 14:31:14
水题 Codeforces Round #308 (Div. 2) A. Vanya and Table

题目传送门

 /*
水题:读懂题目就能做
*/
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <vector>
#include <string>
#include <queue>
#include <map>
#include <set>
using namespace std; const int MAXN = 1e2 + ;
const int INF = 0x3f3f3f3f;
int a[MAXN][MAXN]; int main(void) //Codeforces Round #308 (Div. 2) A. Vanya and Table
{
// freopen ("A.in", "r", stdin); int n;
while (scanf ("%d", &n) == )
{
memset (a, , sizeof (a));
int x1, y1, x2, y2;
while (n--)
{
scanf ("%d%d%d%d", &x1, &y1, &x2, &y2);
for (int i=y1; i<=y2; ++i)
{
for (int j=x1; j<=x2; ++j)
{
a[i][j]++;
}
}
}
int ans = ;
for (int i=; i<=; ++i)
{
for (int j=; j<=; ++j) ans += a[i][j];
} printf ("%d\n", ans);
} return ;
}