<% this.title = '题库' %> <% include header %> <% let tagIDs = []; if (typeof tags !== 'undefined') tagIDs = tags.map(x => x.id); %>
<% if (typeof tags !== 'undefined') { %> <% tags.sort((a, b) => { return a.color > b.color ? 1 : -1; }); %> <% for (let tag of tags) { %> <% let tagListRemovedThisTag = tagIDs.filter(x => x != tag.id).sort().join(','); %> <% let url = tagListRemovedThisTag ? syzoj.utils.makeUrl(['problems', 'tag', tagListRemovedThisTag]) : syzoj.utils.makeUrl(['problems']); %> <%= tag.name %> <% } %> <% } else { %>
<% } %>
<% if (allowedManageTag) { %> <% if (typeof tags !== 'undefined' && tags.length === 1) { %> 编辑标签 <% } %> 添加标签 <% } %>
<% if (problems.length) { %>
<% include page %>
<% if (user) { %> <% } %> <% for (let problem of problems) { %> <% if (problem.is_public || problem.allowedEdit) { %> <% if (user) { %> <% } %> <% } %> <% } %>
提交状态<%- createSortableTitle('id', '编号', true) %> <%- createSortableTitle('title', '题目名称', true) %> <%- createSortableTitle('ac_num', '通过', false) %> <%- createSortableTitle('submit_num', '提交', false) %> <%- createSortableTitle('ac_rate', '通过率', false) %>
<% if (problem.judge_state) { %> <% } %> <%= problem.id %> <%= problem.title %> <% if (!problem.is_public) { %>未公开<% } %>
<% if (problem.tags) { for (let tag of problem.tags) { let tagListToggledThisTag; if (!tagIDs.includes(tag.id)) tagListToggledThisTag = tagIDs.concat([tag.id]); else tagListToggledThisTag = tagIDs.filter(x => x != tag.id); tagListToggledThisTag = tagListToggledThisTag.sort().join(','); let url = tagListToggledThisTag ? syzoj.utils.makeUrl(['problems', 'tag', tagListToggledThisTag]) : syzoj.utils.makeUrl(['problems']); %> <%= tag.name %> <% } } %>
<%= problem.ac_num %> <%= problem.submit_num %> <%= problem.submit_num != 0 ? (((problem.ac_num / problem.submit_num * 100) || 0).toFixed(2) + '%') : '-' %>

<% include page %> <% } else { %>
<% if (typeof req.query.keyword !== 'undefined') { %> 找不到符合条件的题目 <% } else { %> 暂无题目 <% } %>
<% } %>
<% include footer %>