码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2015-06-19 13:22:27      阅读:102      评论:0      收藏:0      [点我收藏+]

标签:

 

题目传送门

 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 }

 

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

标签:

原文地址:http://www.cnblogs.com/Running-Time/p/4588220.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!