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