1 //Dalian Online Race 10062 //Spit Groove: Data Compare water. The following code can be AC3 //But the positive solution seems to be: after sorting, the sum of the first I items is greater than or equal to i* (i-1)4 5#include <bits/stdc++.h>6 using namespacestd;7 #defineLL Long Long8typedef pair<int,int>PII;9 Const DoubleINF =123456789012345.0;Ten ConstLL MOD =100000000LL; One Const intN =1e4+Ten; A #defineCLC (A, B) memset (A,b,sizeof (a)) - Const DoubleEPS = 1e-7; - voidFre () {freopen ("In.txt","R", stdin);} the voidFreout () {freopen ("OUT.txt","W", stdout);} -InlineintRead () {intx=0, f=1;CharCh=getchar (); while(ch>'9'|| ch<'0') {if(ch=='-') f=-1; Ch=getchar ();} while(ch>='0'&&ch<='9') {x=x*Ten+ch-'0'; Ch=getchar ();}returnx*F;} - - intMain () { + intT; - while(~SCANF ("%d",&T)) { + while(t--){ A intN; atscanf"%d",&n); -LL sum=0; - intmaxx=-1; - for(intI=1; i<=n;i++){ - intx; -scanf"%d",&x); inmaxx=Max (maxx,x); -sum+=x; to } + if((sum==n* (n1)) &&maxx<= (n1)*2){ -Puts"T"); the } * ElsePuts"F"); $ }Panax Notoginseng } - return 0; the}
Dalian Online race 1006 Football games