World Cup

Time Limit : 2000/1000ms (Java/Other)   Memory Limit : 131072/65536K (Java/Other)
Total Submission(s) : 62   Accepted Submission(s) : 29
Problem 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
 
Source
PKU

 #include <stdio.h>
#include <stdlib.h> int main()
{
int T,n,a[],i,sign;
while(scanf("%d%d",&T,&n),T!=)
{
sign=;
while(T--)
{
scanf("%s",a);
scanf("%d",&i);
sign+=i;
}
printf("%d\n",n*-sign);
}
return ;
}

World Cup的更多相关文章

  1. java高cup占用解决方案

    项目中发现java cpu占用高达百分之四百,查看代码发现有一个线程在空转,拉高了cup while(true){ } 解决方案,循环中加入延迟:Thread.sleep(Time): 总结下排查CP ...

  2. UVALive 7147 World Cup(数学+贪心)(2014 Asia Shanghai Regional Contest)

    题目链接:https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&category=6 ...

  3. uva 6757 Cup of Cowards(中途相遇法,貌似)

    uva 6757 Cup of CowardsCup of Cowards (CoC) is a role playing game that has 5 different characters (M ...

  4. 【转】关于KDD Cup '99 数据集的警告,希望从事相关工作的伙伴注意

    Features From: Terry Brugger Date: 15 Sep 2007 Subject: KDD Cup '99 dataset (Network Intrusion) cons ...

  5. Facebook Hacker Cup 2014 Qualification Round 竞赛试题 Square Detector 解题报告

    Facebook Hacker Cup 2014 Qualification Round比赛Square Detector题的解题报告.单击这里打开题目链接(国内访问需要那个,你懂的). 原题如下: ...

  6. DP VK Cup 2012 Qualification Round D. Palindrome pairs

    题目地址:http://blog.csdn.net/shiyuankongbu/article/details/10004443 /* 题意:在i前面找回文子串,在i后面找回文子串相互配对,问有几对 ...

  7. [BZOJ 3145][Feyat cup 1.5]Str 解题报告

    [Feyat cup 1.5]Str DescriptionArcueid,白姬,真祖的公主.在和推倒贵看电影时突然对一个问题产生了兴趣:我们都知道真祖和死徒是有类似的地方.那么从现代科学的角度如何解 ...

  8. HDU 2289 CUP 二分

    Cup Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submiss ...

  9. VK Cup 2012 Round 3 (Unofficial Div. 2 Edition)

    VK Cup 2012 Round 3 (Unofficial Div. 2 Edition) 代码 VK Cup 2012 Round 3 (Unofficial Div. 2 Edition) A ...

  10. UVALive 7275 Dice Cup (水题)

    Dice Cup 题目链接: http://acm.hust.edu.cn/vjudge/contest/127406#problem/D Description In many table-top ...

随机推荐

  1. CSS预处理器 Less Sass,Scss 编译 Sourcemap调试

    sass.less和stylus的安装使用和入门实践     SASS用法指南    Sass Basics CSS预处理器 css preprocessor 预处理器即preprocessor,预处 ...

  2. jQuery EasyUI的使用入门

    jQuery EasyUI不是什么太高级的东西,就是用jQuery写了很多方法.定义了很多属性,通过调用这些方法.属性,可以达到一些特定的效果,然后我们再根据具体需求微调就好了.至少需要导入两个样式表 ...

  3. String.IsNullOrEmpty()和String.IsNullOrWhiteSpace()的区别

    string.IsNullOrEmpty 这个是判断字符串是否为:null或者string.Empty或者“”,但不包含空格 .如果是如"\t"或者“   ” 这样的字符就返回fa ...

  4. Jmeter学习笔记

    Jmeter安装 Jmeter组件介绍 Jmeter

  5. CentOS启动不显示图形界面直接进入命令行模式

    我现在用的是 CentOS 6.3 开机后进入图形化界面还是进入命令行取决于inittab文件中的配置.该文件位于etc目录下. # vi /etc/inittab 找到下面的语句: # Defaul ...

  6. 浏览器 CSS 兼容写法的测试总结

    做前端最讨厌的就是 IE6,7,8,虽然被淘汰的浏览器,但是在中国用户仍然很多,不可能像国外网站一样直接就不管它了,这样会流失很多流量啊. 现在有了IE9,IE10还好些,几乎和 Chrome,Fir ...

  7. MVC运行机制

    一,第一次程序运行时 1,第一次请求的时候 会获取配置文件,然后有个应用启动事件到global.asax.2,在Global.asax文件中,网站第一次运行会创建RouteTable对象,实现URL到 ...

  8. UITableView简单使用

    在iOS开发中UITableView可以说是使用最广泛的控件,我们平时使用的软件中到处都可以看到它的影子,类似于微信.QQ.新浪微博等软件基本上随处都是UITableView.当然它的广泛使用自然离不 ...

  9. HDU 1331 Function Run Fun(记忆化搜索)

    Problem Description We all love recursion! Don't we? Consider a three-parameter recursive function w ...

  10. HDU1789Doing Homework again(贪心)

    Problem Description Ignatius has just come back school from the 30th ACM/ICPC. Now he has a lot of h ...