Topic Portal
1 /*2 water Problem: Read the topic can do3 */4#include <cstdio>5#include <iostream>6#include <algorithm>7#include <cstring>8#include <cmath>9#include <vector>Ten#include <string> One#include <queue> A#include <map> -#include <Set> - using namespacestd; the - Const intMAXN = 1e2 +Ten; - Const intINF =0x3f3f3f3f; - intA[MAXN][MAXN]; + - intMainvoid)//codeforces Round #308 (Div. 2) A. Vanya and Table + { A //freopen ("a.in", "R", stdin); at - intN; - while(SCANF ("%d", &n) = =1) - { -Memset (A,0,sizeof(a)); - intx1, y1, x2, y2; in while(n--) - { toscanf ("%d%d%d%d", &x1, &y1, &X2, &y2); + for(intI=y1; i<=y2; ++i) - { the for(intj=x1; j<=x2; ++j) * { $a[i][j]++;Panax Notoginseng } - } the } + intAns =0; A for(intI=1; i<= -; ++i) the { + for(intj=1; j<= -; ++j) ans + =A[i][j]; - } $ $printf ("%d\n", ans); - } - the - return 0;Wuyi}
Water problem codeforces Round #308 (Div. 2) A. Vanya and Table