2016大连网络赛 Football Games
Football Games
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)
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.
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.
3 0 5 1
2 1 1
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <climits>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <vector>
#include <list>
#define rep(i,m,n) for(i=m;i<=n;i++)
#define rsp(it,s) for(set<int>::iterator it=s.begin();it!=s.end();it++)
#define mod 1000000007
#define inf 0x3f3f3f3f
#define vi vector<int>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define ll long long
#define pi acos(-1.0)
#define pii pair<int,int>
#define Lson L, mid, rt<<1
#define Rson mid+1, R, rt<<1|1
const int maxn=2e4+;
using namespace std;
ll gcd(ll p,ll q){return q==?p:gcd(q,p%q);}
ll qpow(ll p,ll q){ll f=;while(q){if(q&)f=f*p;p=p*p;q>>=;}return f;}
int n,m,k,t,a[maxn];
ll sum;
int main()
{
int i,j;
while(~scanf("%d",&t))
{
while(t--)
{
sum=;
scanf("%d",&n);
rep(i,,n)scanf("%d",&a[i]);
sort(a+,a+n+);
rep(i,,n)
{
sum+=a[i];
if(sum<(ll)i*(i-))break;
}
if(i<=n||sum!=(ll)n*(n-))puts("F");
else puts("T");
}
}
//system("Pause");
return ;
}
2016大连网络赛 Football Games的更多相关文章
- 2016大连网络赛 Different GCD Subarray Query
Different GCD Subarray Query Time Limit: 6000/3000 MS (Java/Others) Memory Limit: 65536/65536 K ( ...
- 2016大连网络赛 Function
Function Time Limit: 7000/3500 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others) Probl ...
- 2016大连网络赛 Sparse Graph
Sparse Graph Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others) P ...
- 2016大连网络赛 Weak Pair
Weak Pair Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others) Prob ...
- HDU 5877 2016大连网络赛 Weak Pair(树状数组,线段树,动态开点,启发式合并,可持久化线段树)
Weak Pair Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others) Tota ...
- HDU 5869 Different GCD Subarray Query(2016大连网络赛 B 树状数组+技巧)
还是想不到,真的觉得难,思路太巧妙 题意:给你一串数和一些区间,对于每个区间求出区间内每段连续值的不同gcd个数(该区间任一点可做起点,此点及之后的点都可做终点) 首先我们可以知道每次添加一个值时gc ...
- 大连网络赛 1006 Football Games
//大连网络赛 1006 // 吐槽:数据比较水.下面代码可以AC // 但是正解好像是:排序后,前i项的和大于等于i*(i-1) #include <bits/stdc++.h> usi ...
- HDU 5880 Family View (2016 青岛网络赛 C题,AC自动机)
题目链接 2016 青岛网络赛 Problem C 题意 给出一些敏感词,和一篇文章.现在要屏蔽这篇文章中所有出现过的敏感词,屏蔽掉的用$'*'$表示. 建立$AC$自动机,查询的时候沿着$fa ...
- 16年大连网络赛 1006 Football Games
题目链接:http://acm.hdu.edu.cn/contests/contest_showproblem.php?cid=725&pid=1006 Football Games Time ...
随机推荐
- android 获取系统硬件信息
一,首先设置权限访问: <uses-permission android:name="android.permission.READ_PHONE_STATE" /> ...
- aspx中如何加入javascript
Response.Write("<script>window.location ='aaa.aspx';</script>"); Response.Writ ...
- YII2 小部件(widgets)
小部件基本上在views中使用,在视图中可调用 yii\base\Widget::widget() 方法使用小部件. 该方法使用 配置 数组初始化小部件并返回小部件渲染后的结果. 例如如下代码插入一个 ...
- CSS3秘笈:第二章
1.一个样式由两个元素组成:浏览器对其设置格式的网页元素(选择器,selector)和实际的格式化指令(声明块,declaration block). 2.简单的样式也包含了以下几个元素: (1)Se ...
- Nginx 和 IIS 实现动静分离【转载】
前段时间,搞Nginx+IIS的负载均衡,想了解的朋友,可以看这篇文章:<nginx 和 IIS 实现负载均衡>,然后也就顺便研究了Nginx + IIS 实现动静分离.所以,一起总结出来 ...
- Cowrie蜜罐部署教程【转载】
0.蜜罐分类: 低交互:模拟服务和漏洞以便收集信息和恶意软件,但是攻击者无法和该系统进行交互: 中等交互:在一个特有的控制环境中模拟一个生产服务,允许攻击者的部分交互: 高交互:攻击者可以几乎自由的访 ...
- 二维 ST POJ 2019
题目大意:给你一个n*n的矩阵,每次给你一个点(x,y),以其为左上角,宽度为b的矩阵中最小的数值和最大数值的差是多少? 一共k个询问. 思路:简单的二维st. 定义dp(i,j,k,L)表示以(i ...
- Inno Setup入门(二)——修改安装过程中的图片
修改安装过程中的图片 一般编译之后,安装过程中出现在左边图片是是下图这个样子的: 其实也可以修改它,只需要在setup段中作一点稍微的修改,加一行代码即可: [setup] AppName=Test ...
- Drupal7的theme函数执行顺序
theme('name') 执行顺序: 1.当前主题_name(),这个函数一般在主题的template.php文件中 2.所在模块_name() 3.theme_name() 4.name.tpl. ...
- MyBatis SQL配置文件中使用#{}取值为null时却不报错的解决方案。
原因是因为#{kh_id} 这个参数名为小写,我之前写成了大写{#KH_ID}所以取不到值