• <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>
            posts - 74,  comments - 33,  trackbacks - 0
            World Cup
            Time Limit: 1000MS Memory Limit: 65536K
            Total Submissions: 3257 Accepted: 1710

            Description

            A World Cup of association football is being held with teams from around the world. The standing is based on the number of points won by the teams, and the distribution of points is done the usual way. That is, when a teams wins a match, it receives 3 points; if the match ends in a draw, both teams receive 1 point; and the loser doesn’t receive any points.

            Given the current standing of the teams and the number of teams participating in the World Cup, your task is to determine how many matches ended in a draw till the moment.

            Input

            The input contains several test cases. The first line of a test case contains two integers T and N, indicating respectively the number of participating teams (0 ≤ T ≤ 200) and the number of played matches (0 ≤ N ≤ 10000). Each one of the T lines below contains the name of the team (a string of at most 10 letter and digits), followed by a whitespace, then the number of points that the team obtained till the moment. The end of input is indicated by T = 0.

            Output

            For each one of the test cases, your program should print a single line containing an integer, representing the quantity of matches that ended in a draw till the moment.

            Sample Input

            3 3
            Brasil 3
            Australia 3
            Croacia 3
            3 3
            Brasil 5
            Japao 1
            Australia 1
            0 0

            Sample Output

            0
            2
            貪心,沒技術(shù)含量的一個(gè)題
            代碼如下
            #include<stdio.h>
            #include
            <string.h>
            int?main(){
            ????
            int?n,m,i,j;
            ????
            char?str[20];
            ????
            int?goal,sum;
            ????
            while(scanf("%d%d",&n,&m)!=EOF){
            ????????
            if(n==0&&m==0)break;
            ????????sum
            =0;
            ????????
            for(i=0;i<n;i++){
            ????????????getchar();
            ????????????scanf(
            "%s?%d",str,&goal);
            ????????????sum
            +=goal;
            ????????}

            ????????
            while(1){
            ????????????
            if(sum==2*m)break;
            ????????????sum
            -=3;
            ????????????m
            --;????
            ????????}

            ????????printf(
            "%d\n",m);????
            ????}
            ????
            }

            posted on 2009-02-20 11:00 KNIGHT 閱讀(134) 評(píng)論(0)  編輯 收藏 引用

            只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。
            網(wǎng)站導(dǎo)航: 博客園   IT新聞   BlogJava   博問   Chat2DB   管理


            <2025年5月>
            27282930123
            45678910
            11121314151617
            18192021222324
            25262728293031
            1234567

            常用鏈接

            留言簿(8)

            隨筆檔案

            文章檔案

            Friends

            OJ

            搜索

            •  

            最新評(píng)論

            閱讀排行榜

            評(píng)論排行榜

            国产精品美女久久久网AV| 午夜不卡久久精品无码免费| 久久国产免费观看精品| 久久久精品午夜免费不卡| 国产精品欧美久久久久无广告| 久久国产精品偷99| 久久99精品久久久久久9蜜桃 | 国产叼嘿久久精品久久| 一级女性全黄久久生活片免费 | 久久综合亚洲鲁鲁五月天| 无码精品久久久久久人妻中字| 日本精品久久久中文字幕| 欧美一级久久久久久久大| 欧美噜噜久久久XXX| 久久精品国产色蜜蜜麻豆| 色偷偷久久一区二区三区| 久久久久亚洲AV成人网人人软件 | 亚洲AV无码1区2区久久| 青青青青久久精品国产h| 国内精品综合久久久40p| 久久国产美女免费观看精品| 国产成人无码久久久精品一| 2021国产精品午夜久久| 精品99久久aaa一级毛片| 99久久这里只有精品| 国产色综合久久无码有码| 日韩欧美亚洲国产精品字幕久久久 | 亚洲国产精品无码久久久蜜芽 | 国产激情久久久久影院小草| 亚洲精品无码久久久久久| 色婷婷狠狠久久综合五月| 精品久久久久久久久久久久久久久| 精品国产VA久久久久久久冰| 中文字幕乱码久久午夜| 精品久久久久久无码不卡| 欧美日韩成人精品久久久免费看| 久久综合狠狠色综合伊人| 久久精品国产久精国产| 久久er国产精品免费观看2| 国产午夜免费高清久久影院| 亚洲国产精品高清久久久|