constants

package
v2.2.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 2, 2023 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Accepted
	JudgeFlagAC = 0
	// Presentation Error
	JudgeFlagPE = 1
	// Time Limit Exceeded
	JudgeFlagTLE = 2
	// Memory Limit Exceeded
	JudgeFlagMLE = 3
	// Wrong Answer
	JudgeFlagWA = 4
	// ntime Error
	JudgeFlagRE = 5
	// Output Limit Exceeded
	JudgeFlagOLE = 6
	// Compile Error
	JudgeFlagCE = 7
	// System Error
	JudgeFlagSE = 8

	// Special Judge Checker Time OUT
	JudgeFlagSpecialJudgeTimeout = 10
	// Special Judge Checker ERROR
	JudgeFlagSpecialJudgeError = 11
	// Special Judge Checker Finish, Need Standard Checkup
	JudgeFlagSpecialJudgeRequireChecker = 12
)

Judge Flags

View Source
const (
	SpecialJudgeModeDisabled    = 0
	SpecialJudgeModeChecker     = 1
	SpecialJudgeModeInteractive = 2

	// unit: ms
	SpecialJudgeTimeLimit = 1 * 1000
	// unit: kb
	SpecialJudgeMemoryLimit = 256 * 1024
)

Special Judge Mode

View Source
const (
	// JudgeResultMagicCode judge result file magic number
	JudgeResultMagicCode = 0xB540
	// JudgeBodyPackageMagicCode judge result body package file magic number
	JudgeBodyPackageMagicCode = 0xF540
	// ProblemPackageMagicCode problem package file magic number
	ProblemPackageMagicCode = 0x1319
	// ZipArchiveMagicCode zip file magic number
	ZipArchiveMagicCode = 0x504B0304 // PK\x03\x04
)

Variables

View Source
var FlagMeansMap = map[int]string{
	0:  "Accepted",
	1:  "Presentation Error",
	2:  "Time Limit Exceeded",
	3:  "Memory Limit Exceeded",
	4:  "Wrong Answer",
	5:  "Runtime Error",
	6:  "Output Limit Exceeded",
	7:  "Compile Error",
	8:  "System Error",
	9:  "Special Judge Checker Time OUT",
	10: "Special Judge Checker ERROR",
	11: "Special Judge Checker Finish, Need Standard Checkup",
}

FlagMeansMap map judge flags to text

View Source
var MemorySizeForJIT = map[string]int{
	"gcc":     0,
	"g++":     0,
	"java":    393216,
	"python2": 65536,
	"python3": 65536,
	"nodejs":  262144,
	"golang":  0,
	"php":     131072,
	"ruby":    65536,
	"rust":    0,
}

MemorySizeForJIT 给动态语言、带虚拟机的语言设定虚拟机自身的初始内存大小

View Source
var SignalNumberMap = map[int][]string{
	1: {"SIGHUP", "Hangup (POSIX)."},
	2: {"SIGINT", "Interrupt (ANSI)."},
	3: {"SIGQUIT", "Quit (POSIX)."},
	4: {"SIGILL", "Illegal instruction (ANSI)."},
	5: {"SIGTRAP", "Trace trap (POSIX)."},
	6: {"SIGABRT", "Abort (ANSI)."},

	7:  {"SIGBUS", "BUS error (4.2 BSD)."},
	8:  {"SIGFPE", "Floating-point exception (ANSI)."},
	9:  {"SIGKILL", "Kill, unblockable (POSIX)."},
	10: {"SIGUSR1", "User-defined signal 1 (POSIX)."},
	11: {"SIGSEGV", "Segmentation violation (ANSI)."},
	12: {"SIGUSR2", "User-defined signal 2 (POSIX)."},
	13: {"SIGPIPE", "Broken pipe (POSIX)."},
	14: {"SIGALRM", "Alarm clock (POSIX)."},
	15: {"SIGTERM", "Termination (ANSI)."},
	16: {"SIGSTKFLT", "Stack fault."},
	17: {"SIGCHLD", "Child status has changed (POSIX)."},
	18: {"SIGCONT", "Continue (POSIX)."},
	19: {"SIGSTOP", "Stop, unblockable (POSIX)."},
	20: {"SIGTSTP", "Keyboard stop (POSIX)."},
	21: {"SIGTTIN", "Background read from tty (POSIX)."},
	22: {"SIGTTOU", "Background write to tty (POSIX)."},
	23: {"SIGURG", "Urgent condition on socket (4.2 BSD)."},
	24: {"SIGXCPU", "CPU limit exceeded (4.2 BSD)."},
	25: {"SIGXFSZ", "File size limit exceeded (4.2 BSD)."},
	26: {"SIGVTALRM", "Virtual alarm clock (4.2 BSD)."},
	27: {"SIGPROF", "Profiling alarm clock (4.2 BSD)."},
	28: {"SIGWINCH", "Window size change (4.3 BSD, Sun)."},
	29: {"SIGIO", "I/O now possible (4.2 BSD)."},
	30: {"SIGPWR", "Power failure restart (System V)."},
	31: {"SIGSYS", "Bad system call."},
}

SignalNumberMap map unix signal to text

View Source
var TestlibBinaryPrefixs = map[string]string{
	"generator":  "g_",
	"validator":  "",
	"checker":    "",
	"interactor": "",
}

TestlibBinaryPrefixs testlib program file name prefixs mapping

View Source
var TestlibExitMsgMapping = []struct {
	ErrName     string
	JudgeResult int
	WithScore   bool
}{
	{ErrName: "ok", JudgeResult: JudgeFlagAC},
	{ErrName: "wrong answer", JudgeResult: JudgeFlagWA},
	{ErrName: "wrong output format", JudgeResult: JudgeFlagPE},
	{ErrName: "FAIL", JudgeResult: JudgeFlagSpecialJudgeError},
	{ErrName: "points", JudgeResult: JudgeFlagSpecialJudgeError},
	{ErrName: "unexpected eof", JudgeResult: JudgeFlagPE},
	{ErrName: "partially correct", JudgeResult: JudgeFlagWA, WithScore: true},
	{ErrName: "What is the code", JudgeResult: JudgeFlagSpecialJudgeError},
}

TestlibExitMsgMapping testlib program exit messages mapping

View Source
var TestlibOutcomeMapping = map[string]int{
	"accepted":           JudgeFlagAC,
	"wrong-answer":       JudgeFlagWA,
	"presentation-error": JudgeFlagPE,
	"fail":               JudgeFlagSpecialJudgeError,
	"points":             JudgeFlagSpecialJudgeError,
	"relative-scoring":   JudgeFlagSpecialJudgeError,
	"unexpected-eof":     JudgeFlagPE,
	"partially-correct":  JudgeFlagWA,
	"reserved":           JudgeFlagSpecialJudgeError,
}

TestlibOutcomeMapping testlib program outcome message mapping

Functions

func PlaceMemorySizeForJIT

func PlaceMemorySizeForJIT(configFile string) error

PlaceMemorySizeForJIT 替换JIT虚拟内存表

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL