hiho week 99 register

Ended

Participants:253

Verdict:Accepted
Score:100 / 100
Submitted:2016-05-26 20:50:11

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>
#define FILEIN freopen("in.txt", "r", stdin)
#define FILEOUT freopen("out.txt", "w", stdout)
#define CLOSEIO ios::sync_with_stdio(false)
#define PI acos(-1)
#define mod 1000000007
#define eps 1e-11
#define PB(x) push_back(x)
#define MP(x, y) make_pair(x, y)
using namespace std;
const int maxn = 19+10;
typedef long long LL;
const LL inf = (1LL<<30-1);
bool vis[3][maxn][maxn];
int dp[3][maxn][maxn];
int dir[8][2] = {-2, 1, -1, 2, 1, 2, 2, 1, 2, -1, 1, -2, -1, -2, -2, -1};
void init()
{
    memset(vis, false, sizeof(vis));
    memset(dp, 0, sizeof(vis));
}
void bfs(int x0, int y0, int s)
{
    queue<int> qx, qy;
    vis[s][x0][y0] = true;
    dp[s][x0][y0] = 0;
    qx.push(x0);qy.push(y0);
    while(!qx.empty()){
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX