题目地址:http://acm.hdu.edu.cn/showproblem.php?pid=5873
只要判断最大值和分数总和就好了,因为赢或输还有平局分数总和都是2
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>
#include<vector>
#include<queue>
#include<set>
using namespace std;
const int maxn=20000+5;
const int INF=0x3f3f3f3f;
int B[maxn];
int main()
{int T,n,s;while(scanf("%d",&T)!=EOF){while(T--){scanf("%d",&n);int sum=0,Max=0; bool ok=true;for(int i=0;i<n;i++){scanf("%d",&B[i]);sum+=B[i]; Max=max(B[i],Max);}if(sum!=n*(n-1)||Max>2*(n-1)) ok=false;printf("%c\n",ok?'T':'F');}}return 0;
}