hiho week 166 register

Ended

Participants:289

Verdict:Accepted
Score:100 / 100
Submitted:2017-09-08 23:54: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 <iostream>
#include <vector>
#include <string>
using namespace std;
const int N = 100;
int n,m,k,a,b,c,d;
char bd[N][N+1];
char key[N][N+1] = {0};
char vis[N][N][32] = {0};
int que[32*N*N][4];
int qa,qn;
int dx[]={1,-1,0,0};
int dy[]={0,0,1,-1};
int main() {
    ios::sync_with_stdio(false); cin.tie(0);
    cin >> n >> m >> k >> a >> b >> c >> d;
    for(int i = 0; i < n; i++) cin >> bd[i];
    for(int i = 0; i < k; i++) {
        int x,y;
        cin >> x >> y;
        key[x][y] = 'A' + i;
    }
    qa = qn = 0;
    que[qn][0] = a;
    que[qn][1] = b;
    que[qn][2] = 0;
    que[qn][3] = 0;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX