@@ -87,7 +87,7 @@ public function updateBalloons(
8787 * @return array<array{data: array{balloonid: int, time: string, problem: string, contestproblem: ContestProblem,
8888 * team: Team, teamid: int, location: string|null, affiliation: string|null,
8989 * affiliationid: int, category: string, categoryid: int, total: array<string, ContestProblem>,
90- * awards: string, done: bool}}>
90+ * done: bool}}>
9191 */
9292 public function collectBalloonTable (Contest $ contest , bool $ todo = false ): array
9393 {
@@ -97,13 +97,6 @@ public function collectBalloonTable(Contest $contest, bool $todo = false): array
9797 $ freezetime = $ contest ->getFreezeTime ();
9898 }
9999
100- // Build a list of teams and the problems they solved first.
101- $ firstSolved = $ em ->getRepository (ScoreCache::class)->findBy (['is_first_to_solve ' => 1 ]);
102- $ firstSolvers = [];
103- foreach ($ firstSolved as $ scoreCache ) {
104- $ firstSolvers [$ scoreCache ->getTeam ()->getTeamId ()][] = $ scoreCache ->getProblem ()->getProbid ();
105- }
106-
107100 $ query = $ em ->createQueryBuilder ()
108101 ->select ('b ' , 's.submittime ' , 'p.probid ' ,
109102 't.teamid ' , 's ' , 't ' , 't.location ' ,
@@ -125,23 +118,14 @@ public function collectBalloonTable(Contest $contest, bool $todo = false): array
125118 ->addOrderBy ('s.submittime ' , 'DESC ' );
126119
127120 $ balloons = $ query ->getQuery ()->getResult ();
128- // Loop once over the results to get totals and awards .
129- $ TOTAL_BALLOONS = $ AWARD_BALLOONS = [];
121+ // Loop once over the results to get totals.
122+ $ TOTAL_BALLOONS = [];
130123 foreach ($ balloons as $ balloonsData ) {
131124 if ($ balloonsData ['color ' ] === null ) {
132125 continue ;
133126 }
134127
135128 $ TOTAL_BALLOONS [$ balloonsData ['teamid ' ]][$ balloonsData ['probshortname ' ]] = $ balloonsData [0 ]->getSubmission ()->getContestProblem ();
136-
137- // Keep a list of balloons that were first to solve this problem;
138- // can be multiple, one for each sortorder.
139- if (in_array ($ balloonsData ['probid ' ], $ firstSolvers [$ balloonsData ['teamid ' ]] ?? [], true )) {
140- $ AWARD_BALLOONS ['problem ' ][$ balloonsData ['probid ' ]][] = $ balloonsData [0 ]->getBalloonId ();
141- }
142- // Keep overwriting this - in the end it'll
143- // contain the ID of the first balloon in this contest.
144- $ AWARD_BALLOONS ['contest ' ] = $ balloonsData [0 ]->getBalloonId ();
145129 }
146130
147131 // Loop again to construct table.
@@ -182,15 +166,6 @@ public function collectBalloonTable(Contest $contest, bool $todo = false): array
182166 ksort ($ TOTAL_BALLOONS [$ balloonsData ['teamid ' ]]);
183167 $ balloondata ['total ' ] = $ TOTAL_BALLOONS [$ balloonsData ['teamid ' ]];
184168
185- $ comments = [];
186- if ($ AWARD_BALLOONS ['contest ' ] == $ balloonId ) {
187- $ comments [] = 'first in contest ' ;
188- } elseif (isset ($ AWARD_BALLOONS ['problem ' ][$ balloonsData ['probid ' ]])
189- && in_array ($ balloonId , $ AWARD_BALLOONS ['problem ' ][$ balloonsData ['probid ' ]], true )) {
190- $ comments [] = 'first for problem ' ;
191- }
192-
193- $ balloondata ['awards ' ] = implode ('; ' , $ comments );
194169 $ balloondata ['done ' ] = $ done ;
195170
196171 $ balloons_table [] = [
0 commit comments