Results:

These are not official rankings! This page will automatically refresh.

prepare("SELECT pid_letter FROM `contest_problems` ORDER BY pid ASC"); $st->execute(); while($data = $st->fetch()) { echo ""; } ?> prepare("SELECT results.rid rid, teams.tid tid, teams.name teamname, sites.sid sid, sites.name sitename, problems.pid pid, results.attempts attempts, results.time time, results.last_updated last_updated FROM `contest_teams` teams JOIN `contest_problems` problems LEFT JOIN `contest_results_latest` results ON (problems.pid=results.pid AND teams.tid=results.tid) LEFT JOIN `contest_sites` sites ON (teams.sid=sites.sid) ORDER BY tid ASC, pid ASC"); $st = $db->prepare("SELECT results.rid rid, teams.tid tid, teams.name teamname, sites.sid sid, sites.name sitename, problems.pid pid, results.attempts attempts, results.time time, results.last_updated last_updated, scores.solved_total_attempts solved_total_attempts, scores.total_time total_time, scores.solved solved, scores.score score FROM `contest_teams` teams JOIN `contest_problems` problems LEFT JOIN `contest_results_latest` results ON (problems.pid=results.pid AND teams.tid=results.tid) LEFT JOIN `contest_sites` sites ON (teams.sid=sites.sid) LEFT JOIN (SELECT results.tid tid, SUM(results.attempts) solved_total_attempts, SUM(results.time) total_time, COUNT(*) solved, (20*(SUM(results.attempts) - COUNT(*)) + SUM(results.time)) score FROM `contest_results_latest` results WHERE time != 0 GROUP BY tid ORDER BY solved DESC, score ASC, tid ASC) scores ON (teams.tid = scores.tid) ORDER BY solved DESC, score ASC, tid ASC, pid ASC"); $st->execute(); // Go through each result $counter = 1; while($data = $st->fetch()) { if($lastTeam != $data['tid']) { // We will need to end the row if($lastTeam != -1) { echo ""; echo "\n"; } echo ''; echo ""; $counter++; echo ""; echo ""; } if($data['attempts'] != null) { if($data['time']==0){ $data['time']='-'; } if($data['attempts']==0){ $data['attempts']='-'; } echo ""; } else { echo ""; } $lastTeam = $data['tid']; $lastTeamSolved = $data['solved']; $lastTeamScore = $data['score']; } echo ""; ?>
RankSiteTeam " . $data['pid_letter'] . "#Solv/Score
" . $lastTeamSolved . "/" . $lastTeamScore . "
" . $counter . "" . $data['sitename'] . "" . $data['teamname'] . "" . $data['attempts'] . "/" . $data['time'] . "-/-" . $lastTeamSolved . "/" . $lastTeamScore . "