• <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>

            Farm Tour poj 2135 最小費用流

            Posted on 2012-05-01 16:37 lenohoo 閱讀(97) 評論(0)  編輯 收藏 引用
            Farm Tour

            Description

            When FJ's friends visit him on the farm, he likes to show them around. His farm comprises N (1 <= N <= 1000) fields numbered 1..N, the first of which contains his house and the Nth of which contains the big barn. A total M (1 <= M <= 10000) paths that connect the fields in various ways. Each path connects two different fields and has a nonzero length smaller than 35,000.

            To show off his farm in the best way, he walks a tour that starts at his house, potentially travels through some fields, and ends at the barn. Later, he returns (potentially through some fields) back to his house again.

            He wants his tour to be as short as possible, however he doesn't want to walk on any given path more than once. Calculate the shortest tour possible. FJ is sure that some tour exists for any given farm.

            Input

            * Line 1: Two space-separated integers: N and M.

            * Lines 2..M+1: Three space-separated integers that define a path: The starting field, the end field, and the path's length.

            Output

            A single line containing the length of the shortest tour.

            Sample Input

            4 5
            1 2 1
            2 3 1
            3 4 1
            1 3 2
            2 4 2

            Sample Output

            6 

            Source


            MCF

            posts - 3, comments - 1, trackbacks - 0, articles - 16

            Copyright © lenohoo

            97久久天天综合色天天综合色hd | 国产国产成人久久精品| 亚洲精品无码久久一线| 人妻精品久久无码区| 久久91精品国产91久久麻豆| 91久久精品国产成人久久| 久久精品中文字幕第23页| 亚洲人成精品久久久久| 国产精品欧美久久久天天影视 | 日本欧美国产精品第一页久久| 亚洲欧美一区二区三区久久| 国内精品九九久久久精品| 久久综合伊人77777| 国内精品九九久久精品| 国产成人香蕉久久久久| 亚洲精品国精品久久99热一| 国产精品成人久久久久三级午夜电影| 久久人人爽人人爽人人片AV不| 夜夜亚洲天天久久| 亚洲av日韩精品久久久久久a| 国产毛片久久久久久国产毛片| 伊人久久五月天| 色99久久久久高潮综合影院| …久久精品99久久香蕉国产| 久久婷婷是五月综合色狠狠| a级毛片无码兔费真人久久| 久久精品国产亚洲av高清漫画| 欧美精品福利视频一区二区三区久久久精品 | 久久er国产精品免费观看8| 伊人久久大香线蕉AV一区二区| 精品久久人人做人人爽综合| 好久久免费视频高清| 久久久久久久亚洲Av无码| 久久99久久99精品免视看动漫| 久久综合视频网站| 久久亚洲国产精品123区| 亚洲狠狠久久综合一区77777| 97久久综合精品久久久综合| 久久九九精品99国产精品| 热re99久久6国产精品免费| 久久人人爽人人爽人人片av麻烦 |