uva 539

#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
using namespace std;
bool map[30][30];
int m,n,route[30],total=0,max_=0;//n is nodes,m is edges
void dps(int cen){
    bool exi = false;
    for(int i =0;imax_){max_=cen;}
    }
}
int main() {
    //ifstream cin("ha.txt");
    int node1,node2;
    while(cin>>n>>m&&n&&m){
        memset(map,0,sizeof(map));
        for(int i=0;i>node1>>node2;
            map[node1][node2] = 1;
            map[node2][node1] = 1;
        }
        total = 0;
        max_ = 0;
        for(int i=0;i


 
 

你可能感兴趣的:(算法)