Contest Leaderboard

  • + 0 comments

    with maxscore as ( select s.hacker_id, max(s.score) as max_score from submissions s group by s.hacker_id,s.challenge_id ), totalscore as( select m.hacker_id, sum(m.max_score)as totalscore from maxscore m group by m.hacker_id ) select h.hacker_id,h.name,ts.totalscore from hackers h join totalscore ts on h.hacker_id=ts.hacker_id where ts.totalscore > 0 order by ts.totalscore desc, h.hacker_id asc;