HDU 5873 Football Games【】
来源:互联网 发布:ubuntu做什么 编辑:程序博客网 时间:2024/05/22 00:47
Football Games
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1936 Accepted Submission(s): 718
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 intoM 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.
At the first phase of the championships, teams are divided into
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 integersM , which is the number of groups.
Thei -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
For each case, the first line contains a positive integers
The
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
23 0 5 12 1 1
Sample Output
FT#include<iostream>#include<cstdio>#include<cmath>#include<cstring>#include<string>#include<queue>#include<stack>#include<vector>#include<algorithm>using namespace std;#define ll long long#define ms(a,b) memset(a,b,sizeof(a))const int INF=0x3f3f3f3f;const int M=1e5+10;int i,j,k,n,m;int a[20000+10];int main(){ int T; while(~scanf("%d",&T)){ while(T--){ scanf("%d",&n); int sum=0; int flag=0; for(int i=0;i<n;i++){ scanf("%d",&a[i]); sum+=a[i]; if(a[i]==0)flag++; } if(sum!=n*(n-1)||flag>1){printf("F\n");continue;} sort(a,a+n); if(a[n-1]>(n-1)*2)printf("F\n"); else printf("T\n"); } } return 0;}
0 0
- hdu 5873 Football Games
- HDU 5873 Football Games .
- HDU 5873 Football Games 【】
- hdu-5873-Football Games
- hdu 5873 Football Games
- hdu 5873 Football Games
- HDU 5873 Football Games【】
- HDU 5873Football Games
- hdu 5873 Football Games
- hdu 5873 Football Games 思维
- hdu 5873 Football Games(思维题)
- HDU-5873-Football Games-数学推导
- HDU 5873 Football Games 大连网络赛
- HDU 5873 Football Games(Landau定理)
- Hdu 5873 Football Games 推理(XJBC
- HDU 5873 Football Games (公式题)
- Football Games HDU
- hdu 5843 ICPC Football Games
- codeforces788C The Great Mixing
- 设置分区配额,配置LVM
- hadoop自学记录(一)
- DOBRI
- hdu2588——GCD(欧拉函数)
- HDU 5873 Football Games【】
- C++11 新标准(三)
- const char*和char const*以及char*const
- 堆排序算法
- 极值二分-精度问题-floor和ceil-挑战程序设计2
- Relative Ranks
- css中单位px和em,rem的区别
- 选择排序
- Android MVP