16年大连网络赛 1006 Football Games
题目链接: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
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.
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
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.
#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的更多相关文章
- 大连网络赛 1006 Football Games
//大连网络赛 1006 // 吐槽:数据比较水.下面代码可以AC // 但是正解好像是:排序后,前i项的和大于等于i*(i-1) #include <bits/stdc++.h> usi ...
- 2016大连网络赛 Football Games
Football Games Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) P ...
- HDU 4004 The Frog's Games(2011年大连网络赛 D 二分+贪心)
其实这个题呢,大白书上面有经典解法 题意是青蛙要跳过长为L的河,河上有n块石头,青蛙最多只能跳m次且只能跳到石头或者对面.问你青蛙可以跳的最远距离的最小值是多大 典型的最大值最小化问题,解法就是贪心 ...
- 2016 ICPC 大连网络赛 部分题解
先讲1007,有m个人,n种石头,将n种石头分给m个人,每两个人之间要么是朋友关系,要么是敌人关系,朋友的话他们必须有一种相同颜色的石头,敌人的话他们必须所有石头的颜色都不相同.另外,一个人可以不拥有 ...
- HDU 5867 Sparse Graph (2016年大连网络赛 I bfs+补图)
题意:给你n个点m条边形成一个无向图,问你求出给定点在此图的补图上到每个点距离的最小值,每条边距离为1 补图:完全图减去原图 完全图:每两个点都相连的图 其实就是一个有技巧的bfs,我们可以看到虽然点 ...
- HDU 5875 Function (2016年大连网络赛 H 线段树+gcd)
很简单的一个题的,结果后台数据有误,自己又太傻卡了3个小时... 题意:给你一串数a再给你一些区间(lef,rig),求出a[lef]%a[lef+1]...%a[rig] 题解:我们可以发现数字a对 ...
- 16年青岛网络赛 1002 Cure
题目链接:http://acm.hdu.edu.cn/contests/contest_showproblem.php?pid=1002&cid=723 Cure Time Limit: 30 ...
- 16年青岛网络赛 1001 I Count Two Three
题目链接:http://acm.hdu.edu.cn/contests/contest_showproblem.php?pid=1001&cid=723 I Count Two ThreeTi ...
- hdu5442(2015长春赛区网络赛1006)后缀数组+KMP /最小表示法?
题意:给定一个由小写字母组成的长度为 n 的字符串,首尾相连,可以从任意一个字符开始,顺时针或逆时针取这个串(长度为 n),求一个字典序最大的字符串的开始字符位置和顺时针或逆时针.如果有多个字典序最大 ...
随机推荐
- bitmap格式分析
位图(Bitmap)当然是最简单的,它Windows显示图片的基本格式,其文件扩展名为*.BMP.在Windows下,任何各式的图片文件(包括视频播放)都要转化为位图个时候才能显示出来,各种格式的图片 ...
- LibSVM使用指南
LibSVM使用指南 一. SVM简介 在进行下面的内容时我们认为你已经具备了数据挖掘的基础知识. SVM是新近出现的强大的数据挖掘工具,它在文本分类.手写文字识别.图像分类.生物序列分析等实 ...
- Flux Demo解析
最近学习了阮一峰老师的博文 "Flux入门教程",博文中详细介绍了Flux框架和Controller view模式,并提供了Demo,受益匪浅. 现特参考阮老师的Demo,绘制了一 ...
- ubuntu安装多个qt版本--不同qt版本编译同一个程序时出现错误--解决方案
方法: 在ubuntu终端: # make clean //有Makefile文件的情况 # rm Makefile *.pro.user # qmake //有多个qt版本,最好指定qmake ...
- 我们都遇到过的 Replace Blank Space
题目描述: 请实现一个函数,将一个字符串中的空格替换成“%20”.例如,当字符串为We Are Happy.则经过替换之后的字符串为We%20Are%20Happy. 分析: 看到这个题目,我们都会有 ...
- GoldenGate中使用strcat和strext进行数据转换
在OGG中可以对源字段的内容进行合并或拆分,从而实现类似于“ETL”的功能.strcat(s1,s2,s3,,,):用于合并字串:strext(str, start, end):用于获取指定位置的字串 ...
- goldengate 12c 针对oracle 12c配置的主要变化
由于oracle 12c已经是多租户架构,在使用OGG同步的时候,需要考虑下面一些情况 一个 CDB包含多个PDB,源端部署的一个extract可访问所有pdb redo,理论上不需要每个pdb单独配 ...
- 更改layout的布局
创建了一个layout,缺省都是LinearLayout,原来都在xml把他改成其他布局,习惯了拖放的方式觉得挺麻烦. 其实vs2013有这个功能,就是在设计界面单机右键可以删除布局,然后拖一个布局进 ...
- XML元素和结点的区别
1.区别介绍 Element是Node的扩展,所以也更实用一些.例如,用Element可以方便的获得Node的属性getAttribute(String attrName)如果用Node,可以得到一个 ...
- win10下安装centOS 7 U盘
前段时间我把朋友帮忙装的ubuntu15.10给玩坏了=.=虽然后来自己在另一台电脑上成功装了ubuntu16.04和win7双系统,但是...这台电脑也要装个别的系统才比较..不空.所以决定装个ce ...