HDU 5873 Football Game

来源:互联网 发布:华师大网络教育 编辑:程序博客网 时间:2024/06/11 04:11
////  main.cpp//  Richard////  Created by 邵金杰 on 16/9/10.//  Copyright © 2016年 邵金杰. All rights reserved.//#include<iostream>#include<cstdio>#include<cstring>#include<algorithm>using namespace std;const int maxn=100000+10;typedef long long ll;ll score[maxn];int main(){    int t;    while(~scanf("%d",&t))    {        while(t--)        {            int n;            scanf("%d",&n);            int odd=0,c=0;            bool ok=true;            ll sum=(ll)n*(n-1);            for(int i=1;i<=n;i++)            {                scanf("%I64d",&score[i]);                if(score[i]>2*(n-1)) ok=false;                if(score[i]==0) c++;                odd+=score[i]&1;                sum-=score[i];            }            if(c>1||sum!=0||odd&1) ok=false;            if(!ok) cout<<"F"<<endl;            else cout<<"T"<<endl;        }    }    return 0;}

0 0
原创粉丝点击