[Offer收割]编程练习赛7 register

Ended

Participants:506

Verdict:Time Limit Exceeded
Score:0 / 100
Submitted:2016-08-28 13:19:15

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 <algorithm>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <queue>
using namespace std;
const int maxn = 200010;
typedef long long ll;
const int inf =0x3f3f3f3f;
int maze[1005][1005],d[1005][1005],nn[1005],b[1005],n,m;
struct node{
    int d,x,y;
    //node (int dd,int xx,int yy):x(xx), y(yy), d(dd) {}
    bool operator < (const node& a) const {
        return d>a.d;
    }
};
int dx[4]={0,1,0,-1},dy[4]={1,0,-1,0};
int dis(int x,int y,int i){
    if(i==0)return b[y];
    if(i==1)return nn[x];
    if(i==2)return b[y-1];
    return nn[x-1];
}
void bfs(int s,int t){
    priority_queue<node> que;
    que.push(node{0,s,t});
    d[s][t]=0;
    while(!que.empty()){
        node q= que.top(); que.pop();
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX