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

 

题目传送门

 1 /*
 2     水题:读懂题目就能做
 3 */
 4 #include <cstdio>
 5 #include <iostream>
 6 #include <algorithm>
 7 #include <cstring>
 8 #include <cmath>
 9 #include <vector>
10 #include <string>
11 #include <queue>
12 #include <map>
13 #include <set>
14 using namespace std;
15 
16 const int MAXN = 1e2 + 10;
17 const int INF = 0x3f3f3f3f;
18 int a[MAXN][MAXN];
19 
20 int main(void)      //Codeforces Round #308 (Div. 2) A. Vanya and Table
21 {
22     // freopen ("A.in", "r", stdin);
23 
24     int n;
25     while (scanf ("%d", &n) == 1)
26     {
27         memset (a, 0, sizeof (a));
28         int x1, y1, x2, y2;
29         while (n--)
30         {
31             scanf ("%d%d%d%d", &x1, &y1, &x2, &y2);
32             for (int i=y1; i<=y2; ++i)
33             {
34                 for (int j=x1; j<=x2; ++j)
35                 {
36                     a[i][j]++;
37                 }
38             }
39         }
40         int ans = 0;
41         for (int i=1; i<=100; ++i)
42         {
43             for (int j=1; j<=100; ++j)    ans += a[i][j];
44         }
45 
46         printf ("%d\n", ans);
47     }
48 
49 
50     return 0;
51 }

 

转载于:https://www.cnblogs.com/Running-Time/p/4588220.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值