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

            久久人人爽人人精品视频| 久久99热这里只有精品66| 色欲久久久天天天综合网| 色偷偷久久一区二区三区| 久久99毛片免费观看不卡| 久久无码AV中文出轨人妻| 亚洲午夜久久久久久久久电影网| 国产成人精品久久免费动漫| 国产69精品久久久久9999| 99精品国产99久久久久久97 | 亚洲国产精品无码久久一区二区| 亚洲精品无码久久一线| 久久精品国产精品亚洲| 亚洲va中文字幕无码久久不卡 | 久久综合一区二区无码| 99久久无码一区人妻a黑| 日批日出水久久亚洲精品tv| 久久99国产精品久久久| 热99RE久久精品这里都是精品免费 | 欧美熟妇另类久久久久久不卡 | 久久综合九色综合网站| 久久人人青草97香蕉| 一本大道久久a久久精品综合| 久久久久免费看成人影片| 日本加勒比久久精品| 一本色道久久88加勒比—综合| 精品多毛少妇人妻AV免费久久| 久久久久综合国产欧美一区二区| 狠狠色丁香婷婷久久综合不卡| 色婷婷综合久久久中文字幕| 少妇无套内谢久久久久| 天天影视色香欲综合久久| 久久99久久无码毛片一区二区| A级毛片无码久久精品免费| 精品亚洲综合久久中文字幕| 久久99精品国产麻豆宅宅| 99久久免费国产精精品| 国产精品久久久久久吹潮| 99久久精品费精品国产一区二区 | 久久综合欧美成人| 国产激情久久久久影院老熟女|