hiho week 185 register

Ended

Participants:167

Verdict:Accepted
Score:100 / 100
Submitted:2018-01-19 16:32:32

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
/*
201811813:53:04
2018-1-19 16:27:37
bfs
*/
#include<iostream>
#include<vector>
#include<queue>
using namespace std;
int bb[550];
int aa[550];
int dirc[4][2]{ {-1,0},{1,0},{0,-1},{0,1} };
int k;
int n, m;
int q;
int map[550][550];
int dis[550][550];
int len(int x, int y, int i)
{
    if (i == 0)
        return bb[x - 1];
    if (i == 1)
        return bb[x];
    if (i == 2)
        return aa[y - 1];
    return aa[y];
}
struct node
{
    int x, y;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX