|
|
|
<% this.title = problem.title + ' - 题目' %>
|
|
|
|
<% include header %>
|
|
|
|
<div class="ui center aligned grid">
|
|
|
|
<div class="row">
|
|
|
|
<h1 class="ui header"><%= problem.title %><% if (problem.allowedEdit && !problem.is_public) { %><span class="ui tiny red label">未公开</span><% } %></h1>
|
|
|
|
</div>
|
|
|
|
<div class="row" style="margin-top: -15px">
|
|
|
|
<span class="ui label">内存限制: <%= problem.memory_limit %> MiB</span>
|
|
|
|
<span class="ui label">时间限制: <%= problem.time_limit %> ms</span>
|
|
|
|
</div>
|
|
|
|
<div class="row" style="margin-top: -23px">
|
|
|
|
<% if (problem.file_io) { %>
|
|
|
|
<span class="ui label">输入文件: <%= problem.file_io_input_name %></span>
|
|
|
|
<span class="ui label">输出文件: <%= problem.file_io_output_name %></span>
|
|
|
|
<% } else { %>
|
|
|
|
<span class="ui label">标准输入输出</span>
|
|
|
|
<% } %>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="ui grid">
|
|
|
|
<div class="row">
|
|
|
|
<div class="column">
|
|
|
|
<div class="ui buttons">
|
|
|
|
<a class="small ui primary button" href="<%= syzoj.utils.makeUrl(['submit', problem.id]) %>">提交</a>
|
|
|
|
<a class="small ui positive button" href="<%= syzoj.utils.makeUrl(['judge_state'], { problem_id: problem.id }) %>">提交记录</a>
|
|
|
|
<a class="small ui yellow button" href="<%= syzoj.utils.makeUrl(['problem', problem.id, 'download']) %>">下载测试数据</a>
|
|
|
|
<% if (problem.allowedEdit) { %>
|
|
|
|
<a class="small ui button" href="<%= syzoj.utils.makeUrl(['problem', problem.id, 'edit']) %>">编辑题面</a>
|
|
|
|
<a class="small ui button" href="<%= syzoj.utils.makeUrl(['problem', problem.id, 'upload']) %>">上传测试数据</a>
|
|
|
|
<% } %>
|
|
|
|
<% if (user && user.is_admin) { %>
|
|
|
|
<% if (problem.is_public) { %>
|
|
|
|
<button class="small ui button" id="dis_public">取消公开</button>
|
|
|
|
<% } else { %>
|
|
|
|
<button class="small ui button" id="public">公开</button>
|
|
|
|
<% } %>
|
|
|
|
<% } %>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="row">
|
|
|
|
<div class="column">
|
|
|
|
<h4 class="ui top attached block header">题目描述</h4>
|
|
|
|
<div class="ui bottom attached segment" id="description"><%- problem.description %></div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="row">
|
|
|
|
<div class="column">
|
|
|
|
<h4 class="ui top attached block header">输入格式</h4>
|
|
|
|
<div class="ui bottom attached segment" id="input"><%- problem.input_format %></div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="row">
|
|
|
|
<div class="column">
|
|
|
|
<h4 class="ui top attached block header">输出格式</h4>
|
|
|
|
<div class="ui bottom attached segment" id="output"><%- problem.output_format %></div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="row">
|
|
|
|
<div class="column">
|
|
|
|
<h4 class="ui top attached block header">测试样例</h4>
|
|
|
|
<div class="ui bottom attached segment" id="example"><%- problem.example %></div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="row">
|
|
|
|
<div class="column">
|
|
|
|
<h4 class="ui top attached block header">数据范围与提示</h4>
|
|
|
|
<div class="ui bottom attached segment" id="hint"><%- problem.limit_and_hint %></div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
function public_problem() {
|
|
|
|
$.ajax({
|
|
|
|
url: '<%= syzoj.utils.makeUrl(['api', 'problem', problem.id, 'public']) %>',
|
|
|
|
type: 'POST',
|
|
|
|
complete: function () { location.reload(true) },
|
|
|
|
async: true
|
|
|
|
});
|
|
|
|
}
|
|
|
|
function dis_public_problem() {
|
|
|
|
$.ajax({
|
|
|
|
url: '<%= syzoj.utils.makeUrl(['api', 'problem', problem.id, 'public']) %>',
|
|
|
|
type: 'DELETE',
|
|
|
|
complete: function () { location.reload(true) },
|
|
|
|
async: true
|
|
|
|
});
|
|
|
|
}
|
|
|
|
$(document).ready(function(){
|
|
|
|
$("#public").click(function(){
|
|
|
|
public_problem();
|
|
|
|
});
|
|
|
|
$("#dis_public").click(function(){
|
|
|
|
dis_public_problem();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
</script>
|
|
|
|
<% include footer %>
|