<% this.title = '排名 - ' + contest.title %> <% include header %>
<% if (contest.type === 'acm') { %> <% } %> <% for (let i = 0; i < problems.length; i++) { %> <% } %> <% if (contest.type === 'noi' || contest.type === 'ioi') { %> <% } %> <% for (let problem of problems) { let i = 0, min, minPos = -1; for (let item of ranklist) { i++; let condition; if (contest.type === 'acm') condition = item.player.score_details[problem.id] && item.player.score_details[problem.id].accepted && (minPos === -1 || item.player.score_details[problem.id].acceptedTime < min.player.score_details[problem.id].acceptedTime); else condition = item.player.score_details[problem.id] && item.player.score_details[problem.id].score === 100 && (minPos === -1 || item.player.score_details[problem.id].time < min.player.score_details[problem.id].time); if (condition) { min = item; minPos = i; } } problem.min = minPos; } let i = 0, rank = 0, lastItem; for (let item of ranklist) { i++; let latest = contest.start_time, timeSum = 0, unacceptedCount = 0; %> <% if (contest.type === 'noi' || contest.type === 'ioi') { console.log(i); console.log(lastItem); if (i === 1 || item.player.score !== lastItem.player.score) rank++; } else if (contest.type === 'acm') { for (let problem of problems) { if (item.player.score_details[problem.id] && item.player.score_details[problem.id].accepted) { timeSum += (item.player.score_details[problem.id].acceptedTime - contest.start_time) + (item.player.score_details[problem.id].unacceptedCount * 20 * 60); unacceptedCount += item.player.score_details[problem.id].unacceptedCount; } } item.player.timeSum = timeSum; if (i === 1 || item.player.score !== lastItem.player.score || item.player.timeSum !== lastItem.player.timeSum) rank++; } %> <% if (contest.type === 'acm') { %> <% } %> <% for (let problem of problems) { %> <% if (problem.min === i) { %> <% } else if (contest.type === 'acm') { %> <% if (item.player.score_details[problem.id].accepted) { %> <% if (item.player.score_details[problem.id].unacceptedCount) { %> +<%= item.player.score_details[problem.id].unacceptedCount %> <% } else { %> + <% } %>
<%= syzoj.utils.formatTime(item.player.score_details[problem.id].acceptedTime - contest.start_time) %>
<% } else if (item.player.score_details[problem.id].unacceptedCount) { %> -<%= item.player.score_details[problem.id].unacceptedCount %> <% } %>
<% } else if (contest.type === 'noi' || contest.type === 'ioi') { %> <%= item.player.score_details[problem.id].score %>
<%= syzoj.utils.formatTime(item.player.score_details[problem.id].judge_state.submit_time - contest.start_time) %> <% latest = Math.max(latest, item.player.score_details[problem.id].judge_state.submit_time) %>
<% } %> <% } %> <% if (contest.type === 'noi' || contest.type === 'ioi') { %> <% } %> <% lastItem = item; %> <% } %>
# 用户名通过数量 罚时 <%= syzoj.utils.removeTitleTag(problems[i].title) %> 总分
<% if (rank == 1) { %>
<% } else if (rank == 2) { %>
<% } else if (rank == 3) { %>
<% } else { %>
<% } %> <%= rank %>
<%= item.user.username %><% if (item.user.nameplate) { %><%- item.user.nameplate %><% } %> <%= item.player.score %> <%= syzoj.utils.formatTime(timeSum) %> <% } else { %> <% } %> <% if (!item.player.score_details[problem.id]) { %> <%= item.player.score %>
<%= syzoj.utils.formatTime(latest - contest.start_time) %>
<% include footer %>