CCF认证真题-(201409-2)-画图(暴力)

 1 #include <iostream>
 2 #include <algorithm>
 3 #include <set>
 4 using namespace std;
 5 
 6 bool vis[105][105]{false};
 7 int main()
 8 {
 9     ios::sync_with_stdio(false);
10     cin.tie(0);
11     int n;
12     cin >> n;
13     int x1, y1, x2, y2, s = 0;
14     for (int i = 1; i <= n; i++) {
15         cin >> x1 >> y1 >> x2 >> y2;
16         for (int x = x1; x < x2; x++) {
17             for (int y = y1; y < y2; y++) {
18                 if (!vis[x][y]) {
19                     s++;
20                     vis[x][y] = true;
21                 }
22             }
23         }
24     }
25     cout << s << endl;
26     return 0;
27 }

 

posted @ 2019-07-10 14:28  域Anton  阅读(208)  评论(0)    收藏  举报