hiho week 99 register

Ended

Participants:253

Verdict:Accepted
Score:100 / 100
Submitted:2016-05-21 20:53:51

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 <iostream>
#include <cstring>
#include <string>
#include <deque>
#include <algorithm>
using namespace std;
class node
{
public:
    int x;
    int y;
    node(int one, int two){x = one; y = two;}
};
int num[3][8][8];
int substract[8][2] = {{-1, -2}, {-2, -1}, {-2, 1}, {-1, 2}, {1, 2}, {2, 1}, {2, -1}, {1, -2}};
void bfs(int index, int x0, int y0)
{
    num[index][x0][y0] = 0;
    deque<node> q;
    int x1, y1, x2, y2;
    q.push_back(node(x0, y0));
    while(!q.empty())
    {
        x1 = q.front().x;
        y1 = q.front().y;
        q.pop_front();
        for(int i = 0; i < 8; i++)
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX