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

哇哦~這就是我

This is my way ~
<2008年3月>
2425262728291
2345678
9101112131415
16171819202122
23242526272829
303112345

統計

  • 隨筆 - 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>
            久久精品亚洲一区二区| 久久天堂成人| 欧美成人精品不卡视频在线观看 | 亚洲免费在线观看| 欧美精品精品一区| 国产伦理精品不卡| 99精品欧美一区二区三区综合在线 | 亚洲激情在线视频| 亚洲一区二区影院| 欧美精品1区| 欧美制服第一页| 欧美日韩成人一区| 91久久线看在观草草青青| 亚洲国产色一区| 一区二区三区日韩精品视频| 亚洲一区二区三区在线| 久久久999精品| 欧美大片免费观看| 国产精品系列在线| 亚洲人成7777| 欧美一区久久| 亚洲日本国产| 久久精品99国产精品酒店日本| 美腿丝袜亚洲色图| 国产精品看片你懂得| 亚洲国产毛片完整版 | 欧美成人首页| 国产精品入口日韩视频大尺度| 亚洲大胆人体视频| 亚洲网址在线| 亚洲高清精品中出| 篠田优中文在线播放第一区| 欧美精品一区二区蜜臀亚洲 | 国产精品一区二区欧美| 亚洲国产天堂久久综合网| 亚洲欧洲av一区二区| 亚洲福利免费| 久久精品视频在线观看| 国产精品久久久久9999| 亚洲日产国产精品| 噜噜噜噜噜久久久久久91| 亚洲午夜91| 欧美日韩综合精品| 亚洲最新视频在线| 韩国一区二区三区美女美女秀| 亚洲美女区一区| 久久精品99无色码中文字幕 | 亚洲一区欧美激情| 亚洲国产精品久久久| 久久久久久久网站| 国产日韩欧美成人| 午夜一区二区三区在线观看| 亚洲精品国产系列| 免费成人av| 亚洲电影成人| 免费欧美在线视频| 久久久亚洲国产天美传媒修理工| 国产亚洲成精品久久| 欧美一区二区在线免费播放| 在线视频你懂得一区二区三区| 欧美日韩精品高清| 宅男精品视频| 亚洲视频在线观看| 国产精品乱码人人做人人爱| 亚洲午夜成aⅴ人片| 99国产精品久久久久久久| 欧美日韩在线播放一区| 亚洲一卡二卡三卡四卡五卡| 一本久道久久久| 国产精品卡一卡二| 久久国产精品99国产| 久久精品官网| 亚洲国产精品国自产拍av秋霞 | 亚洲高清网站| 欧美精品三区| 亚洲一区二区三区在线播放| 亚洲色图在线视频| 国产一区二区三区高清播放| 麻豆精品在线播放| 欧美黄色片免费观看| 亚洲无限乱码一二三四麻| 亚洲一区二区不卡免费| 国产午夜精品全部视频播放| 美女视频黄a大片欧美| 男女激情视频一区| 亚洲资源在线观看| 欧美一区二区成人| 亚洲精品久久嫩草网站秘色| 一区二区三区欧美在线| 黄色日韩网站视频| 亚洲精品资源| 国内精品福利| 99国产精品久久久| 亚洲二区在线视频| 亚洲视频在线二区| 亚洲日韩第九十九页| 亚洲欧美日韩视频一区| 亚洲国产精品尤物yw在线观看| 99re66热这里只有精品3直播 | 亚洲深夜影院| 久久精品国产清高在天天线 | 亚洲综合精品一区二区| 欧美夜福利tv在线| 亚洲精品免费一二三区| 亚洲一区二区三区午夜| 亚洲国产综合视频在线观看| 在线一区欧美| 亚洲国产小视频在线观看| 亚洲一区二区三区国产| 亚洲人成亚洲人成在线观看图片| 亚洲影院免费观看| 日韩午夜视频在线观看| 久久精品国产99国产精品| 亚洲在线视频| 欧美精品一区在线发布| 久久婷婷丁香| 国产伦一区二区三区色一情| 亚洲人成在线播放网站岛国| 一色屋精品视频在线观看网站| 亚洲午夜精品久久久久久app| 亚洲国产精品va在线观看黑人| 亚洲欧美日韩高清| 亚洲无亚洲人成网站77777| 欧美mv日韩mv国产网站| 久久综合图片| 国产尤物精品| 欧美影视一区| 欧美与黑人午夜性猛交久久久| 欧美色图麻豆| 日韩一级视频免费观看在线| 亚洲精品一区二区三区四区高清| 久久精品国产99国产精品| 久久精品国产亚洲aⅴ| 国产精品一区免费视频| 亚洲视频观看| 亚洲欧美变态国产另类| 欧美日韩精品在线| 亚洲精品国产无天堂网2021| 亚洲精品在线一区二区| 欧美不卡在线| 亚洲第一偷拍| 99视频一区| 欧美日韩在线精品| 在线亚洲欧美视频| 久久福利一区| 黑人巨大精品欧美一区二区| 久久av一区二区三区漫画| 久久久久久久97| 又紧又大又爽精品一区二区| 久久一综合视频| 亚洲黄色av一区| 亚洲一区二区三区中文字幕| 国产精品视频1区| 欧美一级日韩一级| 欧美77777| aaa亚洲精品一二三区| 国产精品国产三级国产aⅴ无密码 国产精品国产三级国产aⅴ入口 | 亚洲福利视频二区| 欧美精品不卡| 亚洲图色在线| 久久久青草婷婷精品综合日韩| 伊人久久成人| 欧美黄色影院| 国产精品99久久久久久宅男| 久久精品亚洲一区| 亚洲国产精品一区制服丝袜 | 国产伦精品一区二区三区在线观看 | 久久在线免费观看视频| 亚洲国产三级| 欧美一级成年大片在线观看| 狠狠色综合色区| 欧美人体xx| 久久aⅴ国产紧身牛仔裤| 亚洲第一页自拍| 午夜影视日本亚洲欧洲精品| 亚洲国产导航| 国产精品五区| 欧美福利一区二区| 性色av一区二区三区红粉影视| 亚洲大片免费看| 久久精品国产亚洲一区二区三区| 亚洲精选一区| 国产一区二区毛片| 欧美日韩免费高清| 久久深夜福利免费观看| 中文一区字幕| 亚洲欧洲另类国产综合| 久久久久久噜噜噜久久久精品| 国产精品99久久久久久有的能看| 国产有码在线一区二区视频| 欧美三级特黄| 欧美精品v日韩精品v韩国精品v| 久久精品国产精品| 亚洲一区二区三区精品视频| 亚洲全部视频| 亚洲成色www8888| 噜噜噜躁狠狠躁狠狠精品视频| 午夜日韩av| 亚洲一区二区三区中文字幕在线| 91久久精品国产91性色|