题目链接:http://acm.hdu.edu.cn/contests/contest_showproblem.php?cid=725&pid=1006

Football Games

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)
Total
Submission(s): 3505    Accepted Submission(s): 655

Problem Description
A mysterious country will hold a football world
championships---Abnormal Cup, attracting football teams and fans from all around
the world. This country is so mysterious that none of the information of the
games will be open to the public till the end of all the matches. And finally
only the score of each team will be announced.
  
  At the first phase of
the championships, teams are divided into M

groups using the single round robin rule where one and only one game will be
played between each pair of teams within each group. The winner of a game scores
2 points, the loser scores 0, when the game is tied both score 1 point. The
schedule of these games are unknown, only the scores of each team in each group
are available.
  
  When those games finished, some insider revealed that
there were some false scores in some groups. This has aroused great concern
among the pubic, so the the Association of Credit Management (ACM) asks you to
judge which groups' scores must be false.

 
Input
Multiple test cases, process till end of the
input.
  
  For each case, the first line contains a positive integers
M

, which is the number of groups.
  The i

-th of the next M

lines begins with a positive integer Bi

representing the number of teams in the i

-th group, followed by Bi

nonnegative integers representing the score of each team in this
group.


number of test cases <= 10
M<= 100
B[i]<=
20000
score of each team <= 20000

 
Output
For each test case, output M

lines. Output ``F" (without quotes) if the scores in the i-th group must be
false, output ``T" (without quotes) otherwise. See samples for detail.

 
Sample Input
2
3 0 5 1
2 1 1
 
Sample Output
F
T
 
题目大意:足球比赛  输入数据第一行为样例的个数,每个样例第一个数为球队的个数接下来为每个队的得分
     球队两两之间进行比赛赢的得2分输的得0分 平局各得1分
     由于...有些队伍的得分出现了错误
     对于每组样例判断该组样例的数据是否出现错误   错误F 正确T
解题思路:(假设有n个队员)如果数据没有出现错误则一个队员最高得分为2*(n-1),该队得分的总数一定是n*(n-1)两个条件同时满足            则说明数据没有出错。
AC代码:
  

 #include <stdio.h>
int main ()
{
int t,m,i,a;
while (~scanf("%d",&t))
{
while (t --)
{
int f = ; //f = 0表示数据出错,否则数据正确
scanf("%d",&m);
int s = *(m-);//每队中出现的最高得分
int sum = ;
for (i = ; i < m; i ++)
{
scanf("%d",&a);
if (a < s) //求每队的总得分 如果出现大于最大得分的不加
sum += a;
}
if (sum == m*(m-))
f = ;
if (f == )
printf("T\n");
else
printf("F\n");
}
}
}
 

16年大连网络赛 1006 Football Games的更多相关文章

  1. 大连网络赛 1006 Football Games

    //大连网络赛 1006 // 吐槽:数据比较水.下面代码可以AC // 但是正解好像是:排序后,前i项的和大于等于i*(i-1) #include <bits/stdc++.h> usi ...

  2. 2016大连网络赛 Football Games

    Football Games Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) P ...

  3. HDU 4004 The Frog's Games(2011年大连网络赛 D 二分+贪心)

    其实这个题呢,大白书上面有经典解法  题意是青蛙要跳过长为L的河,河上有n块石头,青蛙最多只能跳m次且只能跳到石头或者对面.问你青蛙可以跳的最远距离的最小值是多大 典型的最大值最小化问题,解法就是贪心 ...

  4. 2016 ICPC 大连网络赛 部分题解

    先讲1007,有m个人,n种石头,将n种石头分给m个人,每两个人之间要么是朋友关系,要么是敌人关系,朋友的话他们必须有一种相同颜色的石头,敌人的话他们必须所有石头的颜色都不相同.另外,一个人可以不拥有 ...

  5. HDU 5867 Sparse Graph (2016年大连网络赛 I bfs+补图)

    题意:给你n个点m条边形成一个无向图,问你求出给定点在此图的补图上到每个点距离的最小值,每条边距离为1 补图:完全图减去原图 完全图:每两个点都相连的图 其实就是一个有技巧的bfs,我们可以看到虽然点 ...

  6. HDU 5875 Function (2016年大连网络赛 H 线段树+gcd)

    很简单的一个题的,结果后台数据有误,自己又太傻卡了3个小时... 题意:给你一串数a再给你一些区间(lef,rig),求出a[lef]%a[lef+1]...%a[rig] 题解:我们可以发现数字a对 ...

  7. 16年青岛网络赛 1002 Cure

    题目链接:http://acm.hdu.edu.cn/contests/contest_showproblem.php?pid=1002&cid=723 Cure Time Limit: 30 ...

  8. 16年青岛网络赛 1001 I Count Two Three

    题目链接:http://acm.hdu.edu.cn/contests/contest_showproblem.php?pid=1001&cid=723 I Count Two ThreeTi ...

  9. hdu5442(2015长春赛区网络赛1006)后缀数组+KMP /最小表示法?

    题意:给定一个由小写字母组成的长度为 n 的字符串,首尾相连,可以从任意一个字符开始,顺时针或逆时针取这个串(长度为 n),求一个字典序最大的字符串的开始字符位置和顺时针或逆时针.如果有多个字典序最大 ...

随机推荐

  1. POJ 1083 Moving Tables 思路 难度:0

    http://poj.org/problem?id=1083 这道题题意是有若干段线段,每次要求线段不重叠地取,问最少取多少次. 因为这些线段都是必须取的,所以需要让空隙最小 思路: 循环直到线段全部 ...

  2. BAT文件执行完成后如何删除自身的解决办法

    在BAT文件的最后加上一句 del %0,就可以在处理完后,删除自己了

  3. K2采购管理解决方案在线研讨会

    会议时间: 2013-10-31  15:00-17:00 注册地址:http://k2.gensee.com/webcast/site/livelogin 采购作为现代产业链中的一个基础环节,它的管 ...

  4. JAVA之关于super的用法

    JAVA之关于super的用法   路漫漫其修远兮,吾将上下而求索.——屈原<离骚> 昨天写this用法总结的时候,突然产生了一个问题,请教别人之后,有了自己的一点认识.还是把它写下来,为 ...

  5. SharePoint开发 - 使用Session(代码修改webconfig)

    博客地址 http://blog.csdn.net/foxdave SharePoint启用Session可以使用Powershell,戳这里:可以修改webconfig. 本篇叙述的重点是通过fea ...

  6. System.Web.HttpRequestBase转HttpWebRequest

    /// <summary> /// Copies all headers and content (except the URL) from an incoming to an outgo ...

  7. MongoDB应用篇(转)

    一.高级查询 1. 查询操作符 1.1 比较操作符$gt,$lt,$gte,$lte 实例: select * from things where field<value -- 等价于db.th ...

  8. 《foreach循环示例》

    //foreach测试 public class ForEachTest { public static void main(String[] args) { String[] books = {&q ...

  9. MouseJack:利用15美元的工具和15行代码控制无线鼠标和键盘

    Bastille的研究团队发现了一种针对蓝牙键盘鼠标的攻击,攻击者可以利用漏洞控制你的电脑操作.研究团队将此攻击命名为MouseJack. 七大厂商皆中招 软件工程师马克纽林说:“利用假冒的无线电脑鼠 ...

  10. Functions

    Small The first rule of functions is that they should be small.The second rule of functions is that ...