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

哇哦~這就是我

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>
            欧美一区影院| 亚洲靠逼com| 日韩视频在线一区二区三区| 黄色成人免费网站| 狠狠噜噜久久| 亚洲欧洲另类国产综合| 99riav久久精品riav| 亚洲天天影视| 欧美一区二区三区另类| 久久久久青草大香线综合精品| 国产精品日韩在线播放| 欧美日韩亚洲一区二区三区四区| 欧美精品日韩精品| 国产精品v亚洲精品v日韩精品| 国产精品视频免费在线观看| 国产亚洲成av人片在线观看桃 | 欧美三日本三级少妇三2023| 欧美色精品天天在线观看视频| 国产精品毛片大码女人| 国产专区欧美精品| 亚洲另类在线一区| 午夜免费日韩视频| 欧美va天堂va视频va在线| 99国产精品一区| 欧美一级免费视频| 欧美伦理在线观看| 狠狠色狠狠色综合日日91app| 一本久道久久综合狠狠爱| 久久久久久亚洲精品中文字幕 | 先锋影音国产一区| 欧美精品久久一区| 狠狠88综合久久久久综合网| 一级日韩一区在线观看| 久久中文字幕一区二区三区| 9国产精品视频| 另类亚洲自拍| 国产主播精品在线| 亚洲自拍偷拍一区| 亚洲国产精品久久91精品| 亚洲一区二区三区四区五区黄 | 中文在线一区| 欧美成人小视频| 国产一区二区三区成人欧美日韩在线观看 | 久久精品成人欧美大片古装| 欧美日韩国产在线观看| 在线看片日韩| 欧美在线视频网站| 亚洲一区二区三区高清| 欧美日韩一级黄| 亚洲免费精品| 亚洲国产综合91精品麻豆| 久久精品理论片| 国产一区二区三区四区三区四| 亚洲婷婷综合色高清在线 | 国产精品呻吟| 亚洲欧洲精品一区二区精品久久久| 午夜久久一区| 亚洲中字在线| 国产精品毛片在线看| 亚洲视频综合在线| 亚洲裸体在线观看| 欧美日韩国产综合视频在线观看| 91久久久一线二线三线品牌| 欧美国内亚洲| 欧美插天视频在线播放| 亚洲国产日本| 欧美韩日一区| 欧美精品一区在线| 99在线热播精品免费| 亚洲另类在线视频| 欧美色图五月天| 香蕉久久a毛片| 欧美一区二区三区视频在线| 国产精品理论片| 午夜国产精品视频| 欧美在线999| 亚洲国产精品一区二区第一页 | 校园春色国产精品| 好看的日韩视频| 亚洲高清一区二区三区| 欧美日韩国产bt| 午夜在线播放视频欧美| 久久国产精品第一页| 亚洲电影av| 亚洲毛片一区| 国产亚洲精品久久久久动| 美女免费视频一区| 欧美精品18+| 欧美一二三区在线观看| 久久精品视频一| 中国av一区| 久久国产精品久久久久久久久久| 亚洲国产日韩欧美在线图片| 这里只有精品电影| 国内综合精品午夜久久资源| 欧美大片在线观看一区二区| 欧美视频二区36p| 久久精品日产第一区二区| 欧美不卡三区| 久久精品在线| 欧美午夜精品久久久久久孕妇| 久久久人成影片一区二区三区| 欧美精品一区二区精品网| 久久国产99| 欧美日韩成人网| 免费永久网站黄欧美| 欧美亚洲第一区| 亚洲电影网站| 一区精品久久| 亚洲在线国产日韩欧美| 9久草视频在线视频精品| 久久精品99国产精品日本| 免费黄网站欧美| 亚洲激情在线视频| 国产日韩欧美在线视频观看| 免费久久久一本精品久久区| 欧美特黄一级| 亚洲国产你懂的| 国产专区欧美精品| 亚洲一品av免费观看| 亚洲免费电影在线观看| 久久久九九九九| 久久久999| 国产精品视频免费观看www| 亚洲精品乱码久久久久久| 亚洲电影观看| 欧美在线日韩在线| 欧美在线综合视频| 国产欧美一区二区视频| 中文在线资源观看视频网站免费不卡| 亚洲国产视频一区二区| 久久精品青青大伊人av| 久久精品国产欧美激情| 国产欧美一区二区精品仙草咪| 在线综合亚洲| 亚洲欧美在线另类| 国产精品海角社区在线观看| 99视频精品| 亚洲欧美在线高清| 国产欧美精品在线播放| 亚洲一区日韩| 久久国产日本精品| 韩国av一区二区三区四区| 久久激情综合网| 免费久久99精品国产| 亚洲人成网站在线观看播放| 欧美成人免费播放| 亚洲精品在线三区| 亚洲免费视频中文字幕| 国产欧美一区二区三区久久人妖 | 久久综合999| 欧美高清你懂得| 日韩视频精品| 国产精品日韩精品欧美在线| 午夜激情综合网| 女仆av观看一区| 99精品国产福利在线观看免费| 欧美色另类天堂2015| 香蕉久久夜色精品| 欧美电影免费观看网站| 亚洲毛片在线看| 国产精品一区2区| 久久免费视频这里只有精品| 亚洲黑丝一区二区| 午夜激情久久久| 精品91在线| 欧美少妇一区| 乱码第一页成人| 亚洲视频在线观看网站| 蜜臀a∨国产成人精品| 中国亚洲黄色| 韩曰欧美视频免费观看| 欧美日本在线| 久久精品成人| 亚洲少妇在线| 欧美福利一区二区| 久久高清国产| 一本高清dvd不卡在线观看| 国产区精品在线观看| 欧美高清视频免费观看| 亚洲欧美在线aaa| 久久精品72免费观看| 亚洲福利视频网| 亚洲精品无人区| 国产农村妇女精品一二区| 久久人人97超碰人人澡爱香蕉| 亚洲美女中文字幕| 免费欧美高清视频| 亚洲欧美在线免费观看| 亚洲精品资源美女情侣酒店| 国产欧美一区二区三区在线看蜜臀 | 一本色道久久加勒比精品| 久久久久九九九| 在线天堂一区av电影| 狠狠综合久久av一区二区老牛| 欧美视频在线观看免费| 猫咪成人在线观看| 久久精品国产99精品国产亚洲性色 | 亚洲一区中文| 日韩视频免费观看高清完整版|