hiho week 219 register

Ended

Participants:164

Verdict:Accepted
Score:100 / 100
Submitted:2018-09-10 21:08:29

Lang:G++

Edit
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
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const LL INF = 1LL << 62;
const int MAXN = 1e3+10;
int N;
map<int, map<int, bool> > dict;
vector<pair<int, int> > vec;
int main()
{
    cin >> N;
    for( int i = 1; i <= N; i++ )
    {
        int x, y;  cin >> x >> y;
        vec.push_back({x, y});
        dict[x][y] = 1;
    }
    LL ans = INF;
    for( int i = 0; i < vec.size(); i++ )
    {
        for( int j = i+1; j < vec.size(); j++ )
        {
            auto& p1 = vec[i], &p2 = vec[j];
            int x1 = p1.first, x2 = p2.first;
            int y1 = p1.second, y2 = p2.second;
            if( x1 == x2 || y1 == y2) continue;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX