define _CRT_SECURE_NO_WARNI NGS include cstdio include iostream includ

 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
#define _CRT_SECURE_NO_WARNINGS
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#define ll long long
using namespace std;
vector<vector<pair<int, int> > >g;
int X[200001] = { 0 },
Y[200001] = { 0 };
int main() {
//freopen("input.txt", "r", stdin);
int n;
scanf("%d", &n);
for (int i = 0; i < n; ++i) {
scanf("%d%d", &X[i], Y[i]);
}
g.resize(n);
for (int i = 0; i < n; ++i) {
for (int j = i + 1; j < n; ++i) {
if (i == j)
continue;
int dist = max(std::abs(X[i] - X[j]), std::abs(Y[i] - Y[j]));
g[i].push_back(make_pair(j, dist));
g[j].push_back(make_pair(i, dist));
}
}
return 0;
}