hiho week 117 register

Ended

Participants:659

Verdict:Accepted
Score:100 / 100
Submitted:2016-09-25 21:27:40

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 <cstdio>
#include <cstdlib>
#include <cstring>
#include <queue>
#include <cmath>
#include <algorithm>
using namespace std;
int a[205];
int b[205];
int mn[205];
int stm[205][205];
int dis[205];
int n,m;
bool bfs(){
    int i,j;
    memset(dis,0xff,sizeof(dis));
    queue<int> q;
    dis[0]=0;
    q.push(0);
    while(!q.empty()){
        i=q.front();
        q.pop();
        for(j=0;j<=n+m+1;j++)
            if(stm[i][j]>0&&dis[j]<0){
                dis[j]=dis[i]+1;
                q.push(j);
            }
    }
    if(dis[n+m+1]>0)
        return true;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX