<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                # Problem C. Spring Outing ### Source - [hihoCoder](http://hihocoder.com/contest/mstest2015april2/problem/3) ### Problem 鏃墮棿闄愬埗:20000ms 鍗曠偣鏃墮檺:1000ms 鍐呭瓨闄愬埗:256MB ### 鎻忚堪 You class are planning for a spring outing. N people are voting for adestination out of K candidate places. The voting progress is below: First the class vote for the first candidate place. If more than half of theclass agreed on the place, the place is selected. The voting ends. Otherwise they vote for the second candidate place. If more than half of theclass agreed on the place, the place is selected. The voting ends. Otherwise they vote for the third candidate place in the same way and go on. If no place is selected at last there will be no spring outing and everybodystays at home. Before the voting, the Chief Entertainment Officer did a survey, found outevery one's preference which can be represented as a permutation of 0, 1, ...K. (0 is for staying at home.) For example, when K=3, preference "1, 0, 2, 3"means that the first place is his first choice, staying at home is the secondchoice, the second place is the third choice and the third place is the lastchoice. The Chief Entertainment Officer sends the survey results to the class. Soeverybody knows the others' preferences. Everybody wants his more preferedplace to be selected. And they are very smart, they always choose the optimalstrategy in the voting progress to achieve his goal. Can you predict which place will be selected? ### 杈撳叆 The first line contains two integers, N and K, the number of people in yourclass and the number of candidate places. The next N lines each contain a permutation of 0~K, representing someone'spreference. For 40% of the data, 1 <= N, K <= 10 For 100% of the data, 1 <= N, K <= 1000 ### 杈撳嚭 Output the selected place. Or "otaku" without quotes if no place is selected. ### 鏍蜂緥鎻愮ず In the sample case, if the second peoson vote against the first place, noplace would be selected finally because the first person must vote against thesecond place for his own interest. Considering staying at home is a worsechoice than the first place, the second person's optimal strategy is votingfor the first place. So the first place will be selected. 鏍蜂緥杈撳叆 ~~~ 2 2 1 0 2 2 1 0 ~~~ 鏍蜂緥杈撳嚭 ~~~ 1 ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看