题目链接: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. SQL语句查询所耗时间与效能的语句

    1)SQL查询所耗时间语句 原理:记录当前时间1,执行SQL语句,记录当前时间2,显示时间2与时间1的差. 由于第一次执行的所耗时间为真实时间,之后会保存在缓存中,所以第二次之后的查询所耗时间都会比第 ...

  2. Non-Programmer's Tutorial for Python 3/File IO

    File I/O Here is a simple example of file I/O (input/output): # Write a file with open("test.tx ...

  3. 立体透视 perspective transform-style 倾斜旋转

    1.perspective 是设置镜头距离,距离越远视图越小,视图越近,视图越大.就像相机焦距一样.其只对子元素产生效果. 2.transform-style: preserve-3d 设置3d效果, ...

  4. php中遍历二维数组并以表格的形式输出

    一.索引数组 <?php //使用array()语句结构将联系人列表中所有数据声明为一个二维数组,默认下标是顺序数字索引 $contact1 = array( //定义外层数组 array(1, ...

  5. 【IOS基础知识】NSTimer定时器使用

    1.声明 NSTimer         *timer; 2.定义 timer = [NSTimerscheduledTimerWithTimeInterval:1.0ftarget:selfsele ...

  6. form表单验证2

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  7. 使用Wireshark捕捉USB通信数据

    USB,是英文Universal Serial Bus(通用串行总线)的缩写,而其中文简称为“通串线”,是一个外部总线标准,用于规范电脑与外部设备的连接和通讯.USB接口支持设备的即插即用和热插拔功能 ...

  8. 链表操作----将单链表向右旋转 K 个位置

    给定一个单链表,设计一个算法实现链表向右旋转 K 个位置. 举例: 给定 1->2->3->4->5->6->NULL, K=3 则     4->5-> ...

  9. FR #3题解

    A. 傻逼题?...前缀和什么的随便搞搞就好了. #include<iostream> #include<cstdio> #include<cstring> #in ...

  10. vijos 1776 关押罪犯

    带权并查集+贪心. #include<iostream> #include<cstdio> #include<cstring> #include<algori ...