青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

posts - 74,  comments - 33,  trackbacks - 0
Perfect Service
Time Limit: 2000MS Memory Limit: 65536K
Total Submissions: 661 Accepted: 319

Description

A network is composed of N computers connected by N ? 1 communication links such that any two computers can be communicated via a unique route. Two computers are said to be adjacent if there is a communication link between them. The neighbors of a computer is the set of computers which are adjacent to it. In order to quickly access and retrieve large amounts of information, we need to select some computers acting as servers to provide resources to their neighbors. Note that a server can serve all its neighbors. A set of servers in the network forms a perfect service if every client (non-server) is served by exactly one server. The problem is to find a minimum number of servers which forms a perfect service, and we call this number perfect service number.

We assume that N (≤ 10000) is a positive integer and these N computers are numbered from 1 to N. For example, Figure 1 illustrates a network comprised of six computers, where black nodes represent servers and white nodes represent clients. In Figure 1(a), servers 3 and 5 do not form a perfect service because client 4 is adjacent to both servers 3 and 5 and thus it is served by two servers which contradicts the assumption. Conversely, servers 3 and 4 form a perfect service as shown in Figure 1(b). This set also has the minimum cardinality. Therefore, the perfect service number of this example equals two.

Your task is to write a program to compute the perfect service number.

Input

The input consists of a number of test cases. The format of each test case is as follows: The first line contains one positive integer, N, which represents the number of computers in the network. The next N ? 1 lines contain all of the communication links and one line for each link. Each line is represented by two positive integers separated by a single space. Finally, a 0 at the (N + 1)th line indicates the end of the first test case.

The next test case starts after the previous ending symbol 0. A ?1 indicates the end of the whole inputs.

Output

The output contains one line for each test case. Each line contains a positive integer, which is
the perfect service number.

Sample Input

6
1 3
2 3
3 4
4 5
4 6
0
2
1 2
-1

Sample Output

2
1
樹的最小支配集:和3659一樣。TreeDP求解:
代碼同上篇隨筆一樣:
posted on 2009-04-09 22:58 KNIGHT 閱讀(127) 評論(0)  編輯 收藏 引用
<2008年12月>
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910

常用鏈接

留言簿(8)

隨筆檔案

文章檔案

Friends

OJ

搜索

  •  

最新評論

閱讀排行榜

評論排行榜

青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <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>
            亚洲国产成人精品久久| 欧美成人在线影院| 亚洲第一区色| 久久国产乱子精品免费女| 欧美一级理论性理论a| 免费毛片一区二区三区久久久| 国产视频精品免费播放| 国产欧美一级| 国产亚洲精品高潮| 韩日精品中文字幕| 亚洲日本aⅴ片在线观看香蕉| 亚洲精品一区二区三区99| 日韩一级黄色片| 亚洲一区二区三区色| 久久精品国产在热久久 | 亚洲精品在线三区| 欧美亚洲免费高清在线观看| 午夜精品国产更新| 欧美xxxx在线观看| 99国内精品| 欧美一区二区免费视频| 米奇777在线欧美播放| 欧美日韩四区| 狠狠色狠狠色综合日日小说| 一区二区三区四区五区精品视频 | 亚洲三级免费观看| 午夜精品久久久久久久白皮肤| 久久久久久午夜| 亚洲精品五月天| 久久精品国产999大香线蕉| 免费亚洲一区| 国产精品综合视频| 99视频一区二区| 免费av成人在线| 亚洲一级黄色av| 榴莲视频成人在线观看| 一区二区三区高清在线 | 欧美色视频日本高清在线观看| 国产伦精品一区二区三区高清版| 在线观看中文字幕不卡| 亚洲免费视频一区二区| 亚洲国产成人在线| 老司机精品福利视频| 国产欧美一区二区三区另类精品 | 欧美中文在线观看| 一区二区三区波多野结衣在线观看| 久久亚洲私人国产精品va媚药| 国产精品美女久久久久久久| 亚洲天堂男人| 91久久午夜| 久久久水蜜桃| 欧美1区2区| 在线欧美一区| 久久中文精品| 欧美伊人久久久久久午夜久久久久 | 欧美日韩亚洲高清| 亚洲精品一二区| 欧美激情视频一区二区三区在线播放 | 免费在线亚洲欧美| 亚洲高清不卡一区| 欧美一区91| 亚洲一区二区三| 国产精品一级| 国产欧美日韩在线 | 久久久欧美一区二区| 久久久久久有精品国产| 欧美一区免费| 国产精品久久一卡二卡| 亚洲欧洲另类国产综合| 欧美另类极品videosbest最新版本 | 久久久久久免费| 136国产福利精品导航| 亚洲国产精品久久人人爱蜜臀| 欧美日韩在线视频一区| 欧美精品自拍| 久久综合99re88久久爱| 久久一区二区三区四区| 久久影院午夜片一区| 一区二区三区在线免费视频| 国产综合亚洲精品一区二| 欧美影院久久久| 国产亚洲a∨片在线观看| 亚洲成色精品| 亚洲国产成人久久综合| 欧美精品一区二区三区蜜桃| 中文成人激情娱乐网| 亚洲综合首页| 尤物九九久久国产精品的分类| 麻豆乱码国产一区二区三区| 欧美不卡一区| 免费观看一区| 男人插女人欧美| 国产精品久久777777毛茸茸| 久久九九精品| 欧美**字幕| 亚洲欧美一区二区三区极速播放| 欧美中文字幕在线观看| 亚洲国产日韩一区二区| 99精品热视频只有精品10| 国产一区二区精品丝袜| 亚洲国产精品美女| 国产午夜精品一区二区三区视频 | 亚洲国内精品| 国产九九精品| 欧美激情综合| 亚洲国产视频一区二区| 国产精品久久久久久久久久免费| 欧美激情成人在线| 久久免费视频在线观看| 在线视频欧美日韩| 99pao成人国产永久免费视频| 国产精品揄拍500视频| 欧美三日本三级少妇三2023| 六月婷婷一区| 久久久精品日韩| 久久综合福利| 久久综合色天天久久综合图片| 亚洲女人av| 亚洲资源在线观看| 亚洲小说区图片区| 久久久久一区二区三区| 日韩亚洲视频在线| 欧美a级一区二区| 欧美激情视频在线播放| 最新国产成人在线观看| 久久av二区| 狠狠色综合网| 欧美在线视频播放| 欧美日韩亚洲精品内裤| 欧美成人免费视频| 一色屋精品视频在线看| 亚洲欧美影音先锋| 亚洲专区一区二区三区| 欧美日韩一区视频| 日韩午夜精品| 亚洲一区二区在线播放| 欧美色图麻豆| 一区二区三区www| 亚洲在线一区| 国产精品久久久爽爽爽麻豆色哟哟| 久久国产直播| 久久精品伊人| 欧美系列电影免费观看| 日韩网站在线观看| 在线亚洲观看| 国产精品免费福利| 欧美伊人久久久久久午夜久久久久 | 黄色免费成人| 久久在线视频在线| 欧美电影免费| 亚洲乱码国产乱码精品精天堂| 欧美国产91| 一区二区三区欧美激情| 午夜国产一区| 狠狠色狠狠色综合日日tαg| 乱中年女人伦av一区二区| 国产一区二区三区日韩| 国产精品乱码久久久久久| 99精品国产福利在线观看免费| 中文精品一区二区三区 | 午夜在线一区| 黑人极品videos精品欧美裸| 免费一级欧美在线大片| 亚洲精品偷拍| 久久精品国产精品亚洲精品| 亚洲国产美女| 国产精品免费在线| 久久激情视频免费观看| 亚洲国产美女精品久久久久∴| 中日韩午夜理伦电影免费| 国产精品综合视频| 免费91麻豆精品国产自产在线观看| 亚洲国产精品一区二区www在线| 亚洲视频999| 狠狠色丁香久久婷婷综合_中| 欧美超级免费视 在线| 亚洲一区在线免费观看| 欧美成人精品三级在线观看| 亚洲线精品一区二区三区八戒| 国产丝袜一区二区三区| 欧美精品成人91久久久久久久| 午夜精品一区二区三区在线视| 欧美成人按摩| 欧美一区二区视频在线| 最新亚洲一区| 国产一区999| 国产精品国产精品| 亚洲人成艺术| 亚洲狼人综合| 亚洲欧美国产精品桃花| 久久综合一区二区三区| 中文精品99久久国产香蕉| 国产精品综合网站| 欧美另类69精品久久久久9999| 欧美一区二区三区在线| 一本色道久久99精品综合| 欧美成人国产va精品日本一级| 亚洲一区三区视频在线观看| 亚洲精品欧美在线| 狠狠v欧美v日韩v亚洲ⅴ|