📄 judge.h
字号:
/* * $File: judge.h * $Author: Jiakai -- gy_jk2126.com * $Date: Thu Mar 26 19:29:17 2009 *//*Copyright (C) (2008) (Jiakai) <gy_jk@126.com>This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or any later version.This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See theGNU General Public License for more details.You should have received a copy of the GNU General Public Licensealong with this program; if not, write to the Free SoftwareFoundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.*/#ifndef HEADER_JUDGE#define HEADER_JUDGE#include "conf.h"#include <string>#include <vector>struct Problem{ std::string input, output, source_file, name; std::vector<std::string> standard_input, standard_output; std::vector<unsigned long> time_limit; // measured by seconds std::vector<double> score; typedef double (*File_compare)(double fullmark, const char *standard, const char *contestant); File_compare fc; enum Msg_color{MC_BLACK, MC_RED, MC_GREEN, MC_YELLOW, MC_BLUE, MC_MAGENTA, MC_CYAN, MC_WHITE}; typedef void (*Print_message)(const char *msg, Msg_color front_color); Print_message pm; // if not necessay to print message, assign NULL to pm. bool *stop_flag;};struct Judge_result{ std::vector<double> score; bool compile_successful, source_found; std::string compiler_output; std::vector<unsigned long> time, memory; // @time : 1e-6 seconds ; @memory : kb ; time = memory = 0 if failed to execute. std::vector<bool> overtime;};bool judge_contestant(const Problem &probconf, const Conf &conf, Judge_result &result, const char *sfile_dir); void write_judge_result(const Judge_result &jr, Conf &conf, const char *section, const char *item);bool read_judge_result(Judge_result &jr, const Conf &conf, const char *section, const char *item);#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -