-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1531.cpp
More file actions
41 lines (36 loc) · 681 Bytes
/
1531.cpp
File metadata and controls
41 lines (36 loc) · 681 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// 1531. 투명
// 2022.03.19
// 시뮬레이션
#include<iostream>
using namespace std;
int drawing[101][101];
int main()
{
int n, m;
cin >> n >> m;
int x1, y1, x2, y2;
int ans = 0;
for (int i = 0; i < n; i++)
{
cin >> x1 >> y1 >> x2 >> y2;
for (int x = x1; x <= x2; x++)
{
for (int y = y1; y <= y2; y++)
{
drawing[x][y]++;
}
}
}
for (int i = 1; i <= 100; i++)
{
for (int j = 1; j <= 100; j++)
{
if (drawing[i][j] > m)
{
ans++;
}
}
}
cout << ans << endl;
return 0;
}