• <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)  編輯 收藏 引用 所屬分類: 題目分類:圖論
            久久久久亚洲AV成人网| 久久久精品久久久久影院| 成人午夜精品无码区久久| 久久久久国产精品熟女影院 | 熟妇人妻久久中文字幕| 97久久精品人妻人人搡人人玩| 婷婷综合久久中文字幕| 婷婷国产天堂久久综合五月| 国产三级久久久精品麻豆三级| 久久99久久无码毛片一区二区| 久久久久久伊人高潮影院| 97久久久精品综合88久久| 久久久久久久综合狠狠综合| 久久九九全国免费| 亚洲а∨天堂久久精品| 狠狠色丁香婷婷久久综合不卡| 午夜肉伦伦影院久久精品免费看国产一区二区三区 | 久久久国产精品亚洲一区| 日日狠狠久久偷偷色综合96蜜桃| 国产精品99精品久久免费| yy6080久久| 精品久久久久久久久久久久久久久| 97久久国产综合精品女不卡| 久久久99精品成人片中文字幕| 色妞色综合久久夜夜| 久久久久久久免费视频| 欧美激情精品久久久久久久| 亚洲乱亚洲乱淫久久| 国产精品久久久久久| 久久香综合精品久久伊人| 午夜精品久久久久久久久| 国内精品伊人久久久久777| 久久免费视频1| 99久久做夜夜爱天天做精品| 国产精品久久久久a影院| 香港aa三级久久三级老师2021国产三级精品三级在 | 久久久久久极精品久久久 | 99久久婷婷国产一区二区| 久久99热狠狠色精品一区| 国产精品99久久精品| 国内精品人妻无码久久久影院|