• <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>

            SRM 453 div2

            Posted on 2009-11-18 15:24 rikisand 閱讀(243) 評論(0)  編輯 收藏 引用 所屬分類: TopcoderAlgorithm

            半夜12:00的比賽,開始就發現系統很慢,結果第一題沒法提交,然后退出重進退出重進·····server down·····

            想起洗的衣服還沒拿,于是跑下去取衣服,看了會dota vod ,重新登入,比賽竟然繼續·····交了500 開始看1000 沒思路,凍死了。

            challenge沒啥意思,都沒人在,250的太弱智都對的····由于中間出錯,這次srm not rated~~

            250 pt 略過

            500 pt

            John and Brus have an interest in team sports tournaments. They are currently investigating a basketball tournament. Basketball is a team sport in which two teams of five players try to score points against one another by placing a ball through a ten foot high hoop. Basketball is one of the most popular and widely viewed sports in the world.

            There are n teams in the tournament. Each pair of teams plays exactly two games against each other. In the first of these games, one of the teams is the host, and in the second, the other team is the host. Each game results in one team winning. There are no draws. After the tournament is over, the team with the highest total number of wins is crowned the winner.

            The tournament is currently in progress and the current results are described in the vector <string> table. For each pair of distinct indices, i and j, the j-th character of the i-th element of tableis the result of the game where team i hosted team j. The result is 'W' if team i won, 'L' if team i lost, and '?' if the game hasn't been played yet. Assuming that every possible outcome is possible for the games that haven't been played yet, return the minimal number of total wins the tournament winner can have at the end of the tournament.

            Definition

            Class:
            TheBasketballDivTwo

            Method:
            find

            Parameters:
            vector <string>

            Returns:
            int

            Method signature:
            int find(vector <string> table)

            (be sure your method is public)

            Constraints

            -
            table will contain between 2 and 5 elements, inclusive.

            -
            Each element of table will contain exactly n characters, where n is the number of elements in table.

            -
            The j-th character of the i-th element of table, where i and j are different, will be 'W', 'L', or '?'.

            -
            The i-th character of the i-th element of table will be 'X'.

             

            數據量很小,找到未比的比賽場次 ,然后枚舉各種輸贏情況,更新解就可以了。或者循環2^n次,或者遞歸調用

            1000 pt

            n this tournament, each game results in either a victory for one team or a draw. If a team wins a game, it gains three points and its opponent gains no points. In case of a draw, each team gains one point. The score of a team is the sum of all the points it has gained from all its games. Each pair of teams can play against each other any number of times.

            You are given a vector <int> points representing the current standings in the tournament. The i-th element of points is the score of the i-th team. You can assume that the points represent a valid state, i.e., intermediate standings that can be achieved in a tournament according to the rules described above.

            Each team will play exactly one more game in the tournament, but it is not known what the matchups will be. After the tournament is over, the teams will be ranked by score. 1st place will go to the team with the highest score, 2nd place will go to the team with the second highest score, and so on. If two teams have the same score, the team with the lower number will place higher. For example, if team 0 and team 3 each have the highest score of 100 points, then team 0 will place 1st and team 3 will place 2nd.

            John's favorite team is team 0, and he wants it to place as high as possible. Assuming that the remaining games can be scheduled arbitrarily and can end with any possible outcome, return the highest possible place for team 0 at the end of the tournament.

            Definition

            Class:
            TheSoccerDivTwo

            Method:
            find

            Parameters:
            vector <int>

            Returns:
            int

            Method signature:
            int find(vector <int> points)

            (be sure your method is public)

            Constraints

            -
            points will contain between 2 and 50 elements, inclusive.

            -
            points will contain an even number of elements.

            -
            Each element of points will be between 0 and 1,000,000, inclusive.

            -
            points will represent a valid state.

            Examples

            Code Snippet
            int find(vector <int> p )
            {
                 int E3=0,A3=0,L3=0,L=0;
                 int d=p[0];
                 for(int i=1;i<p.size();i++){
                    if(p[i]>d+3)A3++;
                    else if(p[i]==d+3)E3++;
                    else if (p[i]>d)L3++;
                    else L++;
                 }
                 if(A3+L+1>=E3)
                     return A3+1;
                 return A3+1+(E3-A3-L)/2;
            }

             

             

             

            因為每隊只剩下一場比賽,所以題目變得很簡單。0隊最后一輪肯定是取到3分,比0隊多3場以上比賽的 肯定比0隊靠前,比0隊分少或者相等的一定在0隊之后,剩下的就是我們要考慮的了。如果A3+L+1>=E3 也就是說比0隊多勝一場的隊伍,如果讓他們在最后一輪都輸,那么0隊可以獲得最好成績 A3+1;

            然而如果不行剩下的這些E3要有一半(E3+1)/2個要得到3分從而比0隊高,over~

            国产精品国色综合久久| 伊人热热久久原色播放www| 99久久99久久精品国产片果冻| 国产精品美女久久福利网站| 天天爽天天狠久久久综合麻豆| 国内精品久久久久影院免费| 久久夜色精品国产| 久久影院综合精品| 久久久久亚洲精品无码网址| 久久亚洲精精品中文字幕| 久久www免费人成精品香蕉| 亚洲香蕉网久久综合影视| 国产农村妇女毛片精品久久| 伊人久久大香线蕉av不卡| 久久久久综合中文字幕| 国产精品久久久久影院嫩草| 久久无码人妻精品一区二区三区| 久久国产免费观看精品3| 色播久久人人爽人人爽人人片aV| 久久精品国内一区二区三区 | 大蕉久久伊人中文字幕| 午夜精品久久久久久99热| 欧美午夜A∨大片久久| 日韩亚洲欧美久久久www综合网| 久久久久久精品久久久久| 天堂无码久久综合东京热| 色综合色天天久久婷婷基地| 成人久久精品一区二区三区| 久久99精品国产麻豆宅宅| 久久国产AVJUST麻豆| 欧美日韩成人精品久久久免费看| A级毛片无码久久精品免费| 国产精品一久久香蕉国产线看| 亚洲欧洲日产国码无码久久99| 久久人人爽人人爽人人片AV麻烦| 久久精品国产亚洲Aⅴ蜜臀色欲| 99久久亚洲综合精品网站| 免费观看久久精彩视频| 亚洲综合精品香蕉久久网97| 精品久久久久久亚洲| 国产成人精品久久一区二区三区av |