• <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
            題目大意是,給出一個無向圖,求兩點間某條路徑上的邊的容量的最大值。可以使用Floyed算法實現,用d[i][j]表示從第i個點到第j個點的全部的路徑上的容量最大值,則d[i][j]=max(d[i][j],min(d[i][k],d[k][j]))。
            以下是我的代碼:
            /*
             * Author:  lee1r
             * Created Time:  2011/8/2 16:17:25
             * File Name: poj2263.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);
            typedef 
            long long int64;
            typedef unsigned 
            long long uint64;
            const int kMaxn(207);

            int T,n,m,cnt,d[kMaxn][kMaxn];
            map
            <string,int> id;

            int main() 
            {
                
            //freopen("data.in","r",stdin);
                
                T
            =0;
                
            while(scanf("%d%d",&n,&m)==2 && (n || m))
                {
                    cnt
            =0;
                    id.clear();
                    memset(d,
            0,sizeof(d));
                    
            /*
                    for(int i=0;i<kMaxn;i++)
                        d[i][i]=kInf;
                    
            */
                    
            string a,b;
                    
            for(int i=1;i<=m;i++)
                    {
                        
            int w;
                        cin
            >>a>>b;
                        scanf(
            "%d",&w);
                        
            if(!id.count(a))
                            id[a]
            =++cnt;
                        
            if(!id.count(b))
                            id[b]
            =++cnt;
                        d[id[a]][id[b]]
            =d[id[b]][id[a]]=w;
                    }
                    
            /*
                    for(int i=1;i<=n;i++)
                    {
                        for(int j=1;j<=n;j++)
                            printf("%d ",d[i][j]);
                        printf("\n");
                    }
                    
            */
                    
            for(int k=1;k<=n;k++)
                        
            for(int i=1;i<=n;i++)
                            
            for(int j=1;j<=n;j++)
                                d[i][j]
            =max(d[i][j],min(d[i][k],d[k][j]));
                    
                    cin
            >>a>>b;
                    printf(
            "Scenario #%d\n",++T);
                    printf(
            "%d tons\n\n",d[id[a]][id[b]]);
                }
                
                
            return 0;
            }
            posted on 2011-08-02 16:37 lee1r 閱讀(262) 評論(0)  編輯 收藏 引用 所屬分類: 題目分類:圖論
            久久夜色精品国产亚洲av| 亚洲AV无码成人网站久久精品大| 国产成人精品久久二区二区| 97久久精品无码一区二区天美| 国内精品久久久人妻中文字幕| 精品久久香蕉国产线看观看亚洲| 99久久精品九九亚洲精品| 久久久久久一区国产精品| 午夜天堂av天堂久久久| 国产—久久香蕉国产线看观看 | 日韩久久无码免费毛片软件| 无码国内精品久久综合88| 99国产欧美久久久精品蜜芽| 久久久久久亚洲精品不卡 | 久久天天躁狠狠躁夜夜2020老熟妇| 久久青青草视频| 国产高清美女一级a毛片久久w | 久久免费香蕉视频| 国产精品青草久久久久婷婷 | 久久99精品久久只有精品| 国内精品久久久久久久久| 日产精品久久久久久久性色| 日韩美女18网站久久精品| 99久久精品国产毛片| 国内精品久久国产大陆| 久久久久人妻一区二区三区vr | 亚洲国产成人久久笫一页| 精品久久久噜噜噜久久久| 亚洲AV无码久久| 亚洲精品无码久久千人斩| 免费精品国产日韩热久久| 久久成人18免费网站| 青青草原综合久久| 日韩精品国产自在久久现线拍| 久久久久久久综合狠狠综合| 亚洲国产高清精品线久久| 久久亚洲中文字幕精品一区| 久久久噜噜噜久久| 久久天天躁夜夜躁狠狠| 久久精品国产亚洲av麻豆图片| 久久亚洲中文字幕精品一区|