info; $problem_content = UOJProblem::cur()->queryContent(); if (UOJRequest::get('contest_id')) { UOJContest::init(UOJRequest::get('contest_id')) || UOJResponse::page404(); UOJProblem::upgradeToContestProblem() || UOJResponse::page404(); } UOJProblem::cur()->userCanView(Auth::user(), ['ensure' => true]); $pre_submit_check_ret = UOJProblem::cur()->preSubmitCheck(); $is_participating = false; $no_more_submission = false; $submission_warning = null; if (UOJContest::cur()) { if (UOJContest::cur()->userCanParticipateNow(Auth::user())) { if (!UOJContest::cur()->userHasMarkedParticipated(Auth::user())) { redirectTo(UOJContest::cur()->getUri("/confirm")); } $is_participating = true; $submit_time_limit = UOJContestProblem::cur()->submitTimeLimit(); $max_cnt = UOJContest::cur()->maxSubmissionCountPerProblem(); if ($submit_time_limit != -1) { $cur_contest_time = (UOJTime::$time_now->getTimestamp() - UOJContest::info('start_time')->getTimestamp()) / 60; if ($cur_contest_time > $submit_time_limit) { $no_more_submission = "本题只能在比赛的前 {$submit_time_limit} 分钟提交,没法再交咯"; } } if (!$no_more_submission) { if ($max_cnt != -1) { $cnt = UOJContestProblem::cur()->queryUserSubmissionCountInContest(Auth::user()); if ($cnt >= $max_cnt) { $no_more_submission = "提交次数已达到 {$cnt} 次,没法再交咯"; } } } if (!$no_more_submission) { if ($max_cnt != -1) { $warning1 = "已使用 {$cnt}/{$max_cnt} 次提交机会"; } else { $warning1 = null; } if ($submit_time_limit != -1) { $warning2 = "注意本题只能在比赛的前 {$submit_time_limit} 分钟提交"; } else { $warning2 = null; } if ($warning1 && $warning2) { $submission_warning = "{$warning1}({$warning2})"; } else { $submission_warning = $warning1 !== null ? $warning1 : $warning2; } } } // 比赛导航 $tabs_info = [ 'dashboard' => [ 'name' => UOJLocale::get('contests::contest dashboard'), 'url' => '/contest/' . UOJContest::info('id'), ], 'submissions' => [ 'name' => UOJLocale::get('contests::contest submissions'), 'url' => '/contest/' . UOJContest::info('id') . '/submissions', ], 'standings' => [ 'name' => UOJLocale::get('contests::contest standings'), 'url' => '/contest/' . UOJContest::info('id') . '/standings', ], ]; if (UOJContest::cur()->progress() > CONTEST_TESTING) { $tabs_info['after_contest_standings'] = [ 'name' => UOJLocale::get('contests::after contest standings'), 'url' => '/contest/' . UOJContest::info('id') . '/after_contest_standings', ]; $tabs_info['self_reviews'] = [ 'name' => UOJLocale::get('contests::contest self reviews'), 'url' => '/contest/' . UOJContest::info('id') . '/self_reviews', ]; } if (UOJContest::cur()->userCanManage(Auth::user())) { $tabs_info['backstage'] = [ 'name' => UOJLocale::get('contests::contest backstage'), 'url' => '/contest/' . UOJContest::info('id') . '/backstage', ]; } } $submission_requirement = UOJProblem::cur()->getSubmissionRequirement(); $custom_test_requirement = UOJProblem::cur()->getCustomTestRequirement(); $custom_test_enabled = $custom_test_requirement && $pre_submit_check_ret === true; function handleUpload($zip_file_name, $content, $tot_size) { global $is_participating; UOJSubmission::onUpload($zip_file_name, $content, $tot_size, $is_participating); } function handleCustomTestUpload($zip_file_name, $content, $tot_size) { UOJCustomTestSubmission::onUpload($zip_file_name, $content, $tot_size); } if ($custom_test_enabled) { UOJCustomTestSubmission::init(UOJProblem::cur(), Auth::user()); if (UOJRequest::get('get') == 'custom-test-status-details') { if (!UOJCustomTestSubmission::cur()) { echo json_encode(null); } elseif (!UOJCustomTestSubmission::cur()->hasJudged()) { echo json_encode([ 'judged' => false, 'waiting' => true, 'html' => UOJCustomTestSubmission::cur()->getStatusDetailsHTML(), ]); } else { ob_start(); $styler = new CustomTestSubmissionDetailsStyler(); if (!UOJCustomTestSubmission::cur()->userPermissionCodeCheck(Auth::user(), UOJProblem::cur()->getExtraConfig('view_details_type'))) { $styler->fade_all_details = true; } echoJudgmentDetails(UOJCustomTestSubmission::cur()->getResult('details'), $styler, 'custom_test_details'); $result = ob_get_contents(); ob_end_clean(); echo json_encode([ 'judged' => true, 'waiting' => false, 'html' => UOJCustomTestSubmission::cur()->getStatusDetailsHTML(), 'result' => $result ]); } die(); } $custom_test_form = newSubmissionForm( 'custom_test', $custom_test_requirement, 'FS::randomAvailableTmpFileName', 'handleCustomTestUpload' ); $custom_test_form->appendHTML('
'); $custom_test_form->succ_href = 'none'; $custom_test_form->extra_validator = function () { if (UOJCustomTestSubmission::cur() && !UOJCustomTestSubmission::cur()->hasJudged()) { return '上一个测评尚未结束'; } return ''; }; $custom_test_form->ctrl_enter_submit = true; $custom_test_form->setAjaxSubmit( <<submit_button_config['text'] = UOJLocale::get('problems::run'); $custom_test_form->runAtServer(); } $can_use_zip_upload = true; foreach ($submission_requirement as $req) { if ($req['type'] == 'source code') { $can_use_zip_upload = false; } } if ($pre_submit_check_ret === true && !$no_more_submission) { $submission_extra_validator = function () { if (!submission_frequency_check()) { UOJLog::warning('a user exceeds the submission frequency limit! ' . Auth::id() . ' at problem #' . UOJProblem::info('id')); return '交题交得太快啦,坐下来喝杯阿华田休息下吧?'; } return ''; }; if (UOJProblem::cur()->userCanUploadSubmissionViaZip(Auth::user())) { $zip_answer_form = newZipSubmissionForm( 'zip-answer', $submission_requirement, 'FS::randomAvailableSubmissionFileName', 'handleUpload' ); $zip_answer_form->extra_validator = $submission_extra_validator; $zip_answer_form->succ_href = $is_participating ? '/contest/' . UOJContest::info('id') . '/submissions' : '/submissions'; $zip_answer_form->runAtServer(); } $answer_form = newSubmissionForm( 'answer', $submission_requirement, 'FS::randomAvailableSubmissionFileName', 'handleUpload' ); $answer_form->extra_validator = $submission_extra_validator; $answer_form->succ_href = $is_participating ? '/contest/' . UOJContest::info('id') . '/submissions' : '/submissions'; $answer_form->runAtServer(); } $conf = UOJProblem::cur()->getProblemConf(); if (UOJContest::cur()) { $pageTitle = UOJProblem::cur()->getTitle(['with' => 'letter', 'simplify' => true]); } else { $pageTitle = UOJProblem::cur()->getTitle(['with' => 'id']); } ?>

getTitle(['with' => 'letter', 'simplify' => true]) ?> getTitle(['with' => 'id']) ?>

getVal('time_limit', 1) : null; $memory_limit = $conf instanceof UOJProblemConf ? $conf->getVal('memory_limit', 256) : null; ?>
时间限制:   空间限制:

printHTML(); ?>

printHTML(); ?>
printHTML(); ?>