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

            久久综合精品国产一区二区三区 | 欧美激情精品久久久久久久九九九 | 精品久久久久久国产免费了| 久久嫩草影院免费看夜色| 无码国内精品久久综合88| 国产精品久久久天天影视| 欧美激情精品久久久久久久| 亚洲AV无码1区2区久久 | 国产999精品久久久久久| 开心久久婷婷综合中文字幕| 亚洲精品白浆高清久久久久久| 成人综合伊人五月婷久久| 无码任你躁久久久久久久| 国产成人久久AV免费| 久久婷婷五月综合成人D啪 | 亚洲AV无码久久精品成人| 久久激情亚洲精品无码?V| 国产毛片欧美毛片久久久| 国内精品伊人久久久久网站| 亚洲AV日韩精品久久久久| 性做久久久久久免费观看| 99久久免费只有精品国产| 亚洲精品无码久久一线| 合区精品久久久中文字幕一区| 亚洲天堂久久精品| 国产精品久久久久久一区二区三区| 伊人久久综合无码成人网| 欧美日韩精品久久久久| 久久精品无码一区二区日韩AV | 国产精品久久久香蕉| 精品久久人人妻人人做精品| 久久99国产精品二区不卡| 亚洲精品乱码久久久久66| 国内精品久久久久影院老司| 久久久久亚洲AV无码专区网站 | 久久久久国产精品嫩草影院| 久久香综合精品久久伊人| 久久综合亚洲鲁鲁五月天| 日本加勒比久久精品| 2021国内精品久久久久久影院| 久久久久久精品成人免费图片|