Documentation
¶
Overview ¶
Deer executor * (C) 2019 LanceLRQ * * This code is licenced under the GPLv3.
Deer executor * (C) 2019 LanceLRQ * * This code is licenced under the GPLv3.
Deer executor * (C) 2019 LanceLRQ * * This code is licenced under the GPLv3.
Deer executor * (C) 2019 LanceLRQ * * This code is licenced under the GPLv3.
Deer executor * (C) 2019 LanceLRQ * * This code is licenced under the GPLv3.
Index ¶
- Constants
- func CharDiffIoUtil(useroutBuffer, answerBuffer []byte, useroutLen, answerLen int64) (rel int, logtext string)
- func CustomChecker(options JudgeOption, result *JudgeResult, msg chan string) error
- func DiffText(options JudgeOption, result *JudgeResult) (err error, logtext string)
- func InteractiveChecker(options JudgeOption, result *JudgeResult, msg chan string) error
- func Max(x, y int64) int64
- func RunProgram(options JudgeOption, result *JudgeResult, msg chan string) error
- func StrictDiff(useroutBuffer, answerBuffer []byte, useroutLen, answerLen int64) bool
- type ITimerVal
- type JudgeOption
- type JudgeResult
- type TimeVal
Constants ¶
View Source
const ( JudgeFlagAC int = 0 // 0 Accepted JudgeFlagPE int = 1 // 1 Presentation Error JudgeFlagTLE int = 2 // 2 Time Limit Exceeded JudgeFlagMLE int = 3 // 3 Memory Limit Exceeded JudgeFlagWA int = 4 // 4 Wrong Answer JudgeFlagRE int = 5 // 5 Runtime Error JudgeFlagOLE int = 6 // 6 Output Limit Exceeded JudgeFlagCE int = 7 // 7 Compile Error JudgeFlagSE int = 8 // 8 System Error JudgeFlagSpecialJudgeTimeout int = 10 // 10 Special Judger Time OUT JudgeFlagSpecialJudgeError int = 11 // 11 Special Judger ERROR JudgeFlagSpecialJudgeRequireChecker int = 12 // 12 Special Judger Finish, Need Standard Checkup )
View Source
const ( JudgeFileSizeLimit = 200 * 1024 * 1024 // 200MB SpecialJudgeModeDisabled = 0 SpecialJudgeModeChecker = 1 SpecialJudgeModeInteractive = 2 SpecialJudgeTimeLimit = 10 * 1000 // ms SpecialJudgeMemoryLimit = 256 * 1024 // kb )
View Source
const ( ITIMER_REAL = 0 ITIMER_VIRTUAL = 1 ITIMER_PROF = 2 )
Variables ¶
This section is empty.
Functions ¶
func CharDiffIoUtil ¶ added in v1.3.1
func CharDiffIoUtil(useroutBuffer, answerBuffer []byte, useroutLen, answerLen int64) (rel int, logtext string)
字符比较(忽略空白)
func CustomChecker ¶
func CustomChecker(options JudgeOption, result *JudgeResult, msg chan string) error
func DiffText ¶
func DiffText(options JudgeOption, result *JudgeResult) (err error, logtext string)
func InteractiveChecker ¶
func InteractiveChecker(options JudgeOption, result *JudgeResult, msg chan string) error
func RunProgram ¶
func RunProgram(options JudgeOption, result *JudgeResult, msg chan string) error
func StrictDiff ¶ added in v1.3.7
字符比较(严格比对)
Types ¶
type JudgeOption ¶
type JudgeOption struct { Commands []string // Executable program commands TestCaseIn string TestCaseOut string ProgramOut string ProgramError string TimeLimit int // Time limit (ms) MemoryLimit int // Memory limit (kb) FileSizeLimit int // File Size Limit (kb) Uid int // User id (optional) SpecialJudge struct { Mode int // Mode Checker string // Checker file path RedirectStd bool // Redirect target program's Stdout to checker's Stdin TimeLimit int // Time limit (ms) MemoryLimit int // Memory limit (kb) Stdout string // checker's stdout Stderr string // checker's stderr } }
type JudgeResult ¶
type JudgeResult struct { JudgeResult int // Judge result flag number TimeUsed int // Maximum time used MemoryUsed int // Maximum memory used ReSignum int // Runtime error signal number SameLines int // sameLines when WA TotalLines int // totalLines when WA SeInfo string // SeInfo When System Error CeInfo string // CeInfo When CeInfo }
func Judge ¶
func Judge(options JudgeOption) (*JudgeResult, error)
这个函数实现了判题的基本用法,考虑到实际情况不一定会使用这个函数,你可以模仿这个函数的写法来调用自己需要的功能
func (*JudgeResult) String ¶
func (conf *JudgeResult) String() string
Click to show internal directories.
Click to hide internal directories.