-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathneps530.cpp
More file actions
38 lines (28 loc) · 726 Bytes
/
Copy pathneps530.cpp
File metadata and controls
38 lines (28 loc) · 726 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
/*
* Contest : Neps
* Problem : 530 - O Mar não está para Peixe
* Link : https://neps.academy/br/exercise/530
*/
#include <iostream>
using namespace std;
#define fastio ios::sync_with_stdio(0); cin.tie(0);
const int TAM=101;
int main() {
fastio
int mar[TAM][TAM];
for (int i = 0; i < TAM; i++)
for (int j = 0; j < TAM; j++) mar[i][j] = 0;
int num_redes; cin >> num_redes;
while (num_redes--) {
int xi, xf, yi, yf;
cin >> xi >> xf >> yi >> yf;
for (int i = xi; i < xf; ++i)
for (int j = yi; j < yf; ++j) mar[i][j] = 1;
}
int area = 0;
for (int i = 0; i < TAM; i++)
for (int j = 0; j < TAM; j++)
if (mar[i][j] == 1) area++;
cout << area << endl;
return 0;
}