#pragma once #include #include 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;