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

            国内精品久久久久久久影视麻豆| 国内精品人妻无码久久久影院导航| 久久国产亚洲精品麻豆| 青青草国产成人久久91网| 久久久青草青青国产亚洲免观| 99久久精品免费看国产一区二区三区 | 久久国产精品免费一区| 国产精品久久久久久五月尺| 久久w5ww成w人免费| 久久久WWW成人免费毛片| 久久久无码精品亚洲日韩蜜臀浪潮 | 久久久久亚洲av成人网人人软件 | A级毛片无码久久精品免费 | 久久国产色AV免费看| 欧美激情精品久久久久久久| 久久99国产综合精品| 亚洲精品乱码久久久久久不卡| 久久免费精品一区二区| 亚洲精品午夜国产VA久久成人 | 色婷婷狠狠久久综合五月| 久久精品aⅴ无码中文字字幕重口 久久精品a亚洲国产v高清不卡 | 精品久久久无码21p发布| 久久伊人五月天论坛| 99久久国产综合精品五月天喷水 | 久久人人爽人人爽人人爽| 久久久精品人妻无码专区不卡| 国产午夜精品理论片久久影视 | 精品欧美一区二区三区久久久| 老色鬼久久亚洲AV综合| 亚洲午夜久久久久久久久久| 亚洲va久久久久| 久久久无码精品亚洲日韩京东传媒| 久久93精品国产91久久综合| 国产精品女同一区二区久久| 91精品国产高清久久久久久91| 国产精品无码久久久久久| AV色综合久久天堂AV色综合在| 国产成人精品免费久久久久| 久久精品国产亚洲av麻豆小说 | 久久精品无码一区二区无码| 蜜臀av性久久久久蜜臀aⅴ麻豆 |