-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path2563.cpp
63 lines (52 loc) · 1.03 KB
/
2563.cpp
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#include <string>
#include <stdio.h>
#include <math.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <queue>
#include <stack>
#include <climits>
#include <set>
#define p(a, b) make_pair(a, b)
#define SWAP(a, b, type) do { \
type temp; \
temp = a; \
a = b; \
b = temp; \
} while (0)
#define INF 1000000000
#define endl '\n'
#define ll long long
using namespace std;
vector<pair<int,int> > v;
bool visit[101][101];
int N;
void input() {
cin>>N;
v.resize(N);
for(int i=0;i<N;i++){
cin>>v[i].first>>v[i].second;
}
}
void solution() {
int ans = 0;
for(int a=0;a<N;a++)
for(int i=v[a].first;i<v[a].first+10;i++)
for(int j=v[a].second;j<v[a].second+10;j++)
visit[i][j]=true;
for(int i=0;i<101;i++){
for(int j=0;j<101;j++){
if(visit[i][j]) ans++;
}
}
cout<<ans;
}
int main()
{
ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
input();
solution();
return 0;
}