Dalian Online race 1006 Football games

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.