GOJ-Runtime/structs.h
Joseph Umana da34a7b62e
init
Signed-off-by: Joseph Umana <joseph@josephumana.com>
2025-07-25 16:32:30 -04:00

70 lines
1.5 KiB
C

#pragma once
#include <time.h>
#include <stdint.h>
enum ResultFlags {
/// Execution Result ///
// No other error occured, output may be graded
// OK
Ok = 1 << 0,
// At least one error occured
// See "Error" for all of them
// ERR
Err = 1 << 1,
/// Grader Result ///
// The program gave correct output with no errors
// AC
Accepted = 1 << 2,
// The program got Err OR Wrong Answer
// RJ
Rejected = 1 << 3,
/// Errors ///
// Set if memory limit is exceeded
// MLE
MemoryLimitExceeded = 1 << 4,
// Set if timelimit triggered termination
// TLE
TimeLimitExceeded = 1 << 5,
// Code gave the wrong result
// WA
WrongAnswer = 1 << 6,
// Given if program tampers with the runtime (unused)
// TD
TamperingDetected = 1 << 7,
// Set if program retuns non-zero exit code
// PE
ProgramError = 1 << 8,
// Occurs if a non-listed error occurs
// (Details given in comment)
// OE
OtherError = 1 << 9,
/// Status ///
// Set if the run result is final (all flags set)
Final = 1 << 10,
// If all Execution flags are set
ExecutionFinal = 1 << 11,
/// Misc. ///
// Nice!
// NIC
Nice = 1 << 31,
};
struct {
// Specifies extra feedback
char feedback[256];
time_t runtime;
int maxRss;
int flags;
int exitCode;
} typedef RunResult;
typedef struct {
uint8_t* data;
uint64_t size;
} SerializationResult;