<% include util %> <% if (typeof contest === 'undefined') contest = null; if (contest) { this.title = this.alpha(pid) + '. ' + syzoj.utils.removeTitleTag(problem.title) + ' - ' + contest.title + ' - 比赛'; } else { this.title = problem.title + ' - 题目'; } %> <% include header %>

<% if (contest) { %> <%= this.alpha(pid) %>. <%= syzoj.utils.removeTitleTag(problem.title) %> <% } else { %> #<%= problem.id %>. <%= problem.title %><% if (problem.allowedEdit && !problem.is_public) { %>未公开<% } %> <% } %>

<% if (problem.type !== 'submit-answer') { %>
内存限制:<%= problem.memory_limit %> MiB 时间限制:<%= problem.time_limit %> ms <% if (problem.type === 'interaction') { %> 题目类型:交互 <% } else if (problem.file_io) { %> 输入文件: <%= problem.file_io_input_name %> 输出文件: <%= problem.file_io_output_name %> <% } else { %> 标准输入输出 <% } %>
<% } %> <% if (problem.type !== 'interaction') { %>
题目类型:<%= { 'submit-answer': '答案提交', 'interaction': '交互', 'traditional': '传统' }[problem.type] %> 评测方式:<%= (testcases && !testcases.error) ? (testcases.spj ? 'Special Judge' : '文本比较') : '无测试数据' %>
<% } %> <% if (!contest) { %>
上传者: <% if (problem.is_anonymous && !problem.allowedManage) { %> 匿名 <% } else { %> <%= problem.user.username %> <% } %> <% if (problem.allowedManage) { %> 公开者: <% if (problem.publicizer) { %> <%= problem.publicizer.username %> <% } else { %> 未知 <% } %> <% } %>
<% } %>
<% if (typeof contest !== 'undefined' && contest) { %> <% if (!contest.ended) { %> 提交 <% } else { %> 转到题库 <% } %> 提交记录 <% if (problem.additional_file) { %> 附加文件 <% } %> 返回比赛 <% } else { %> <% if (testcases && !testcases.error) { %> 提交 <% } %> 提交记录 统计 讨论 <% if (discussionCount) { %>
<%= discussionCount %>
<% } %>
测试数据 <% if (problem.additional_file) { %> 附加文件 <% } %> <% } %>
<% if (!contest) { %>
<% if (problem.allowedEdit) { %> 编辑 管理 <% } %> <% if (problem.allowedManage) { %> <% if (problem.is_public) { %> 取消公开 <% } else { %> 公开 <% } %>
删除
<% } %>
<% } %>
<% if (problem.description) { %>

题目描述

<%- problem.description %>
<% } %> <% if (problem.input_format) { %>

输入格式

<%- problem.input_format %>
<% } %> <% if (problem.output_format) { %>

输出格式

<%- problem.output_format %>
<% } %> <% if (problem.example) { %>

样例

<%- problem.example %>
<% } %> <% if (problem.limit_and_hint) { %>

数据范围与提示

<%- problem.limit_and_hint %>
<% } %> <% if (problem.tags && problem.tags.length && (typeof contest === 'undefined' || !contest)) { %>

显示分类标签

<% } %> <% let noSubmit = false; %> <% if (typeof contest !== 'undefined' && contest && contest.ended || (!testcases || testcases.error)) { noSubmit = true; } %> <% if (!noSubmit) { %>
<% const formUrl = syzoj.utils.makeUrl(['problem', problem.id, 'submit'], { contest_id: contest ? contest.id : undefined }); %>
<% if (problem.type === 'submit-answer') { %> <% let cases = []; if (testcases && !testcases.error) { for (let subtasks of testcases) { for (let testcase of subtasks.cases) { cases.push(testcase.answer); } } } %>
<% if (testcases) { %>
<% for (let i = 0; i < cases.length; i++) { %>
<% } %>
<% } %>
<% } else { %>
<% if (state) { %><%= state.code %><% } %>
<% } %>
<% } %>
<% if (problem.type !== 'submit-answer') { %> <% } else { %> <% } %> <% include footer %>