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

哇哦~這就是我

This is my way ~
<2025年11月>
2627282930311
2345678
9101112131415
16171819202122
23242526272829
30123456

統計

  • 隨筆 - 10
  • 文章 - 0
  • 評論 - 2
  • 引用 - 0

常用鏈接

留言簿(1)

隨筆檔案

搜索

  •  

最新評論

閱讀排行榜

評論排行榜

我恨死這道題了。。。。。。

我就是不理解這個投票規則,對這題整整困惑了12個小時,從下午5點到凌晨5點。。。。。。。
Long March Voting 

Description

Instant run-off voting is a system for selecting the most preferred candidate in an election. At the beginning of the process, each voter ranks the candidates from most preferred to least preferred. A series of automated voting rounds are then held to determine the overall winner.

In each round, each voter casts a single vote for his most preferred remaining candidate. If a candidate receives strictly more than 50% of the votes cast in that round, that candidate is declared the winner of the election. Otherwise, the candidate with the fewest votes in that round is eliminated, and another round is held. If multiple candidates are tied for the least number of votes, they are all eliminated. If all the candidates are eliminated, the election ends without a winner.

You are given the preferences of the voters in an election, and you must determine the outcome. There are M candidates numbered 0 to M-1, inclusive. The preferences are given in N lines, where each element describes the preferences of a single voter. This is a permutation of the digits 0 to M-1 in decreasing order of preference. In other words, the first digit is the voter's most preferred candidate, the second digit is his second most preferred candidate, and so on.

Input

There are several test cases,each test case begins with a integer N(1<=N<=50),means there are N voters.The next N lines,each contains a string with the same lenth M(1<=M<=10).Each element of a voter will be a permutation of the digits between 0 and M-1. There is a blank line between each test case.

Output

For each test case,output the number of the candidate who wins the election, or -1 if the election ends without a winner.

Sample Input

5
120
102
210
021
012

8
3120
3012
1032
3120
2031
2103
1230
1230
 

Sample Output

1
-1


Hint:
Case 1:
Nobody gets an absolute majority in the first round and candidate 2 is eliminated. Candidate 1 then receives 3 votes in the next round, giving an absolute majority.

Case 2:
Candidate 0 is eliminated in the first round of voting. Candidate 2 is eliminated in the second round. In the third round, candidates 1 and 3 get 4 votes each. Neither candidate receives an absolute majority, and they are both eliminated for having the least number of votes, so the election ends without a winner.


 

這題的投票,每輪都是從第一個數開始找的,找到第一個沒有被淘汰的人。
我一開始以為之前幾輪選的人,在后面不能被選了。。。。

posted on 2008-03-31 20:57 chinaeli 閱讀(311) 評論(0)  編輯 收藏 引用


只有注冊用戶登錄后才能發表評論。
網站導航: 博客園   IT新聞   BlogJava   博問   Chat2DB   管理


青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <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>
            亚洲精品视频在线观看网站| 欧美韩日精品| 久久综合成人精品亚洲另类欧美| 亚洲欧美日韩在线播放| 欧美黄色免费网站| 欧美电影打屁股sp| 欧美精品一区二| 欧美手机在线| 激情欧美国产欧美| 99视频精品| 欧美一二区视频| 欧美大片va欧美在线播放| 亚洲精品视频二区| 亚洲欧美视频一区二区三区| 久久久久一区二区| 欧美日韩福利| 国模私拍视频一区| 一区二区三区高清| 久久亚洲综合色| 亚洲精品中文字幕女同| 欧美一区二区三区四区夜夜大片 | 亚洲国产一区在线| 亚洲在线一区二区| 欧美激情欧美狂野欧美精品| 亚洲第一黄网| 在线日本成人| 99re6热在线精品视频播放速度| 国产九色精品成人porny| 欧美极品在线观看| 夜夜爽99久久国产综合精品女不卡 | 一区二区三区欧美在线| 国产日产亚洲精品| 禁久久精品乱码| 影音欧美亚洲| 中文欧美在线视频| 国产日韩欧美黄色| 亚洲国产精品第一区二区| 中国成人亚色综合网站| 狠狠色丁香婷婷综合| 国产一区91精品张津瑜| 一本大道久久a久久精二百| 亚洲欧美文学| 欧美一区2区三区4区公司二百| 久久久免费精品视频| 国产精品视频观看| 亚洲精品一区在线观看| 欧美在线免费看| 欧美激情一区二区| 日韩视频精品在线| 欧美成ee人免费视频| 国产无遮挡一区二区三区毛片日本| 夜夜精品视频一区二区| 亚洲国产精品女人久久久| 久久成人综合网| 国产区二精品视| 欧美中文在线观看| 先锋影音网一区二区| 国产精品视频在线观看| 亚洲欧美日韩精品久久| 宅男精品导航| 国产精品欧美一区二区三区奶水| 中国成人黄色视屏| 一区二区高清| 国产精品福利在线观看| 午夜精品久久久久久久男人的天堂| 99在线热播精品免费| 欧美性做爰猛烈叫床潮| 欧美一级理论性理论a| 欧美一区二区三区免费大片| 国产一区二区按摩在线观看| 久久久综合网站| 久久一区二区三区超碰国产精品| 在线观看日韩专区| 亚洲国产成人porn| 欧美午夜精品久久久久免费视| 亚洲一区三区电影在线观看| 正在播放欧美视频| 国产一二三精品| 欧美大香线蕉线伊人久久国产精品| 久久亚洲私人国产精品va| 亚洲激情图片小说视频| 99国产精品久久| 国产专区欧美精品| 亚洲欧洲精品一区| 国产精品羞羞答答xxdd| 久久综合精品一区| 欧美精品在线一区二区三区| 午夜免费日韩视频| 鲁大师成人一区二区三区| 一区二区三区欧美日韩| 亚洲丝袜av一区| 久久九九精品| 中日韩男男gay无套| 欧美一区二区三区成人| 亚洲免费观看视频| 欧美一区综合| 一区二区精品| 久久精品成人欧美大片古装| 99re这里只有精品6| 亚洲精品在线视频观看| 亚洲一区二区在线免费观看视频| 狠狠色噜噜狠狠狠狠色吗综合| 亚洲欧洲精品一区二区三区波多野1战4| 欧美色大人视频| 久久综合狠狠综合久久综合88| 欧美另类高清视频在线| 久久久久久亚洲精品不卡4k岛国| 欧美精品成人91久久久久久久| 欧美一激情一区二区三区| 牛牛国产精品| 噜噜爱69成人精品| 国产乱码精品一区二区三| 99精品国产在热久久下载| 亚洲国产老妈| 久久精品一区二区三区不卡| 亚洲欧美另类中文字幕| 欧美精品国产一区二区| 欧美+亚洲+精品+三区| 国产精品免费网站| 亚洲另类黄色| 亚洲六月丁香色婷婷综合久久| 久久精品99久久香蕉国产色戒 | 亚洲高清资源综合久久精品| 亚洲一区二区av电影| 日韩亚洲不卡在线| 欧美mv日韩mv亚洲| 欧美激情精品久久久| 亚洲高清在线| 欧美成人四级电影| 欧美激情在线有限公司| 精品动漫3d一区二区三区免费版 | 国产精品欧美一区二区三区奶水| 亚洲激情在线观看| 亚洲国产另类久久精品| 免费观看一区| 亚洲国产精品久久久久| 久久综合电影一区| 久久爱www.| 午夜精品久久久久| 亚洲欧美日韩系列| 久久久久.com| 久热re这里精品视频在线6| 欧美一级理论片| 亚洲免费中文| 欧美在线亚洲在线| 久久久美女艺术照精彩视频福利播放| 99re热这里只有精品视频| 亚洲大片在线观看| 亚洲黄色在线观看| 欧美国产日韩亚洲一区| 99精品视频一区| 久久久国产91| 久久免费视频在线| 亚洲欧美一区二区激情| 欧美一区二区福利在线| 洋洋av久久久久久久一区| 亚洲精品乱码久久久久久久久| 亚洲精品少妇| 久久成人精品无人区| 女人色偷偷aa久久天堂| 亚洲图片自拍偷拍| 午夜精彩国产免费不卡不顿大片| 欧美日精品一区视频| 日韩一区二区电影网| 亚洲综合色丁香婷婷六月图片| 亚洲大胆在线| 欧美国产日韩a欧美在线观看| 国产一区二区三区黄视频| 久久五月激情| 99精品欧美一区二区三区综合在线| 亚洲欧美激情一区| 激情综合中文娱乐网| 欧美激情精品久久久久久久变态| 亚洲午夜女主播在线直播| 美女爽到呻吟久久久久| 亚洲午夜一区| 在线欧美视频| 国产农村妇女精品一区二区| 女同一区二区| 欧美在线观看视频在线| 亚洲伦伦在线| 欧美r片在线| 久久国产视频网站| 亚洲一区二区精品视频| 亚洲高清久久网| 国产日本亚洲高清| 欧美日韩另类一区| 免费久久99精品国产| 欧美在线观看网址综合| 一区二区日韩免费看| 欧美韩日一区| 久久久久免费视频| 亚洲欧美偷拍卡通变态| 亚洲免费av电影| 在线看成人片| 激情亚洲一区二区三区四区| 国产精品午夜电影| 国产精品成人播放| 欧美日韩视频不卡| 欧美精品三级|