hiho week 82 register

Ended

Participants:100

Verdict:Accepted
Score:100 / 100
Submitted:2016-01-29 20:08:49

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 <vector>
#include <fstream>
#include <iostream>
#include <queue>
#include <algorithm>
using namespace std;
struct node
{
    int x,y,num;
};
vector<node> nodes;
vector<vector<pair<int,int>>> graph;
int n;
bool cmp(node a,node b)
{
    return a.x<b.x;
}
void build()
{
    sort(nodes.begin(),nodes.end(),cmp);
    for(int i=0;i<n;i++)
    {
        int nex=i+1;
        while(nex<n && nodes[nex].x==nodes[i].x)
        {
            int a=nodes[i].num,b=nodes[nex].num;
            graph[a].push_back(make_pair(b,0));
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX