• <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 閱讀(93) 評論(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

            欧美精品一区二区久久| 久久久久免费看成人影片| 国产国产成人久久精品| 久久影院午夜理论片无码 | 久久电影网2021| 国产精品99久久久久久董美香| 久久久久亚洲?V成人无码| 午夜天堂av天堂久久久| 久久精品国产72国产精福利| 中文字幕人妻色偷偷久久| 精品久久久久国产免费| 日日噜噜夜夜狠狠久久丁香五月| 日本精品久久久中文字幕| 99精品久久精品一区二区| 88久久精品无码一区二区毛片 | 国产午夜福利精品久久| 亚洲精品无码久久千人斩| 久久精品国产一区二区三区不卡| 久久久老熟女一区二区三区| 一本久久综合亚洲鲁鲁五月天亚洲欧美一区二区 | 国产亚洲精品自在久久| 国产精品久久久久久久久久影院| 久久青青草原国产精品免费 | 狠狠狠色丁香婷婷综合久久俺| 久久人人爽人人爽人人片AV麻烦| 久久精品国产99国产精品澳门| 狠狠色狠狠色综合久久| 狠狠色丁香婷婷久久综合五月| 久久精品成人| 久久影院午夜理论片无码| 久久精品国产只有精品66| 国产精品一区二区久久精品无码| 久久精品中文騷妇女内射| 香蕉久久夜色精品国产尤物| 欧美午夜A∨大片久久 | 亚洲女久久久噜噜噜熟女| 国内精品人妻无码久久久影院导航 | 97精品依人久久久大香线蕉97| 精品国产99久久久久久麻豆| 久久午夜免费视频| 欧美一区二区三区久久综合|