• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            心如止水
            Je n'ai pas le temps
            posts - 400,comments - 130,trackbacks - 0
            求最短路的最大值。
            以下是我的代碼:
            /*
             * Author:  lee1r
             * Created Time:  2011/8/2 19:13:45
             * File Name: poj1125.cpp
             
            */
            #include
            <iostream>
            #include
            <sstream>
            #include
            <fstream>
            #include
            <vector>
            #include
            <list>
            #include
            <deque>
            #include
            <queue>
            #include
            <stack>
            #include
            <map>
            #include
            <set>
            #include
            <bitset>
            #include
            <algorithm>
            #include
            <cstdio>
            #include
            <cstdlib>
            #include
            <cstring>
            #include
            <cctype>
            #include
            <cmath>
            #include
            <ctime>
            #define L(x) ((x)<<1)
            #define R(x) (((x)<<1)+1)
            #define Half(x) ((x)>>1)
            #define lowbit(x) ((x)&(-(x)))
            using namespace std;
            const int kInf(0x7f7f7f7f);
            const double kEps(1e-11);
            typedef 
            long long int64;
            typedef unsigned 
            long long uint64;

            const int kMaxn(107);

            int n,ans,pos,g[kMaxn][kMaxn];

            int main()
            {
                
            //freopen("data.in","r",stdin);
                
                
            while(scanf("%d",&n)==1 && n)
                {
                    memset(g,
            0x7f,sizeof(g));
                    
                    
            for(int i=1;i<=n;i++)
                    {
                        
            int m;
                        scanf(
            "%d",&m);
                        
            for(int j=1;j<=m;j++)
                        {
                            
            int a,t;
                            scanf(
            "%d%d",&a,&t);
                            g[i][a]
            =t;
                        }
                    }
                    
                    
            for(int k=1;k<=n;k++)
                        
            for(int i=1;i<=n;i++)
                            
            for(int j=1;j<=n;j++)
                                
            if(g[i][k]<kInf && g[k][j]<kInf && g[i][j]>g[i][k]+g[k][j])
                                    g[i][j]
            =g[i][k]+g[k][j];
                    
                    ans
            =kInf;
                    
            for(int i=1;i<=n;i++)
                    {
                        
            int t(0);
                        
            for(int j=1;j<=n;j++)
                            
            if(i!=j)
                            t
            =max(t,g[i][j]);
                        
            if(ans>t)
                        {
                            ans
            =t;
                            pos
            =i;
                        }
                    }
                    
                    
            if(ans<kInf)
                        printf(
            "%d %d\n",pos,ans);
                    
            else
                        printf(
            "disjoint\n");
                }
                
                
            return 0;
            }
            posted on 2011-08-02 19:25 lee1r 閱讀(245) 評論(0)  編輯 收藏 引用 所屬分類: 題目分類:圖論
            午夜精品久久久久久| 国产精品亚洲综合久久| 欧洲成人午夜精品无码区久久| 免费无码国产欧美久久18| 亚洲成色WWW久久网站| 91精品国产91久久综合| 久久久噜噜噜久久| 久久精品水蜜桃av综合天堂 | 久久天天躁狠狠躁夜夜2020老熟妇| 久久影视综合亚洲| 久久精品无码一区二区无码| 四虎久久影院| 一级做a爰片久久毛片16| 亚洲中文字幕无码一久久区| 久久免费视频观看| 婷婷五月深深久久精品| 亚洲精品WWW久久久久久| 97久久超碰国产精品旧版| 亚洲伊人久久成综合人影院 | 久久久婷婷五月亚洲97号色| 久久免费99精品国产自在现线| 日韩精品久久久久久免费| 亚洲人成无码www久久久| 99久久精品国产毛片| 久久精品国产半推半就| 麻豆亚洲AV永久无码精品久久| 97视频久久久| 思思久久99热只有频精品66| 久久久精品日本一区二区三区| 亚洲嫩草影院久久精品| 99久久超碰中文字幕伊人 | 伊人久久综在合线亚洲2019 | MM131亚洲国产美女久久| 久久影院综合精品| 亚洲综合日韩久久成人AV| 99久久精品免费看国产一区二区三区| 久久se这里只有精品| 久久99精品国产麻豆蜜芽| 精品国产综合区久久久久久| 久久国产V一级毛多内射| 色综合久久久久综合99|