2025-03-02 05:39:31 +00:00
|
|
|
// Result type definitions
|
|
|
|
export enum ExitCode {
|
2025-03-02 18:12:23 +00:00
|
|
|
SE = 0, // System Error
|
|
|
|
CS = 1, // Compilation Success
|
|
|
|
CE = 2, // Compilation Error
|
|
|
|
TLE = 3, // Time Limit Exceeded
|
|
|
|
MLE = 4, // Memory Limit Exceeded
|
|
|
|
RE = 5, // Runtime Error
|
|
|
|
AC = 6, // Accepted
|
|
|
|
WA = 7, // Wrong Answer
|
2025-03-02 05:39:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export type JudgeResult = {
|
|
|
|
output: string;
|
|
|
|
exitCode: ExitCode;
|
|
|
|
executionTime?: number;
|
|
|
|
memoryUsage?: number;
|
|
|
|
};
|
|
|
|
|
2025-03-01 08:29:26 +00:00
|
|
|
export interface LanguageConfig {
|
|
|
|
id: string;
|
|
|
|
label: string;
|
|
|
|
fileName: string;
|
2025-03-02 18:12:23 +00:00
|
|
|
fileExtension: string;
|
2025-03-01 08:29:26 +00:00
|
|
|
image: string;
|
|
|
|
tag: string;
|
|
|
|
workingDir: string;
|
2025-03-02 18:12:23 +00:00
|
|
|
timeLimit: number;
|
2025-03-01 17:19:16 +00:00
|
|
|
memoryLimit: number;
|
2025-03-02 18:12:23 +00:00
|
|
|
compileOutputLimit: number;
|
|
|
|
runOutputLimit: number;
|
2025-03-01 08:29:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export const LanguageConfigs: Record<string, LanguageConfig> = {
|
|
|
|
c: {
|
|
|
|
id: "c",
|
|
|
|
label: "C",
|
|
|
|
fileName: "main",
|
2025-03-02 18:12:23 +00:00
|
|
|
fileExtension: "c",
|
2025-03-01 08:29:26 +00:00
|
|
|
image: "gcc",
|
|
|
|
tag: "latest",
|
|
|
|
workingDir: "/src",
|
2025-03-02 18:13:48 +00:00
|
|
|
timeLimit: 1000,
|
2025-03-01 17:19:16 +00:00
|
|
|
memoryLimit: 128,
|
2025-03-02 18:12:23 +00:00
|
|
|
compileOutputLimit: 1 * 1024 * 1024,
|
|
|
|
runOutputLimit: 1 * 1024 * 1024,
|
2025-03-01 08:29:26 +00:00
|
|
|
},
|
|
|
|
cpp: {
|
|
|
|
id: "cpp",
|
|
|
|
label: "C++",
|
|
|
|
fileName: "main",
|
2025-03-02 18:12:23 +00:00
|
|
|
fileExtension: "cpp",
|
2025-03-01 08:29:26 +00:00
|
|
|
image: "gcc",
|
|
|
|
tag: "latest",
|
|
|
|
workingDir: "/src",
|
2025-03-02 18:13:48 +00:00
|
|
|
timeLimit: 1000,
|
2025-03-01 17:19:16 +00:00
|
|
|
memoryLimit: 128,
|
2025-03-02 18:12:23 +00:00
|
|
|
compileOutputLimit: 1 * 1024 * 1024,
|
|
|
|
runOutputLimit: 1 * 1024 * 1024,
|
2025-03-01 08:29:26 +00:00
|
|
|
},
|
|
|
|
};
|