Hdu 5873 Football Games

Source: Internet
Author: User

Problem Descriptiona Mysterious country would hold a football world championships---Abnormal Cup, attracting football teams And fans from all around the world. This country are so mysterious that none of the information of the Games would be open to the public till the end of all the Matches.       And finally only the score of each team would be announced. At the first phase of the championships, teams is divided into M groups using the single round robin rule where one and only one game would be played between each pair of Te AMS within each group. The winner of a game scores 2 points, the loser scores 0, when the game was tied both score 1 point.      The schedule of these games is unknown, only the scores of all team in each group is available. When those games finished, some insider revealed the There were some false scores in some groups. This have aroused great concern among the pubic, so the the Association of Credits Management (ACM) asks you to judge which Groups ' scores must be false.Test instructions: Give the score of N team 22 mutually determined (win 2 points, flat 1 points, lose no points), judge whether the score is reasonable. Simulation problems, according to the score from the big to the small sort, assuming the Daquan win, not enough points on the back to supplement.
#include <cstdio>#include<cstring>#include<algorithm>using namespacestd;intnum[1000000],tmp[1000000];intMain () {intT,n;  while(SCANF ("%d", &t)! =EOF) {         while(t--) {scanf ("%d",&N);  for(intI=1; i<=n;i++) scanf ("%d",&Num[i]); Sort (num+1, num+1+N); BOOLpan=true; intsum=0;  for(intI=1; i<=n;i++) sum+=Num[i]; if(Sum!= (n1) *n) pan=false; intDelta=2* (n1)-Num[n]; if(delta<0) pan=false; Num[n]=0;  for(inti=n-1; i>=1; i--) {Num[i]-=Delta; Delta=2* (I-1)-Num[i]; if(delta<0) pan=false; Num[i]=0; }                        if(delta!=0) pan=false; if(PAN) puts ("T"); if(!pan) puts ("F"); }    }        return 0;} 

Spit trough data, a lot of people are judged <= (n-1) * * and the total score on a

Hdu 5873 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.