// Path: src/main/java/org/algohub/engine/bo/StatusCode.java
// public enum StatusCode {
//   PENDING(0),
//   RUNNING(1),
// 
//   COMPILE_ERROR(2),
//   RUNTIME_ERROR(3),
// 
//   ACCEPTED(4),
//   WRONG_ANSWER(5),
// 
//   TIME_LIMIT_EXCEEDED(6),
//   MEMORY_LIMIT_EXCEEDED(7),
//   OUTPUT_LIMIT_EXCEEDED(8),
// 
//   RESTRICTED_CALL(9),
//   TOO_LONG_CODE(10);
// 
// 
//   private final int code;
// 
//   StatusCode(int code) {
//     this.code = code;
//   }
// 
//   @JsonCreator
//   public static StatusCode fromInt(int code) {
//     for (final StatusCode v : StatusCode.values()) {
//       if (code == v.code) {
//         return v;
//       }
//     }
// 
//     throw new IllegalArgumentException("Unrecognized status code: " + code);
//   }
// 
//   @JsonValue
//   public int toInt() {
//     return this.code;
//   }
// }


import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.ArrayNode;
import org.algohub.engine.bo.StatusCode;
   * Since some fields are immutable, need to provide a method for Jackson.
   */
  @JsonCreator public JudgeResult(@JsonProperty(value = "status_code", required = true) final StatusCode statusCode,
      @JsonProperty("error_message") final String errorMessage,
      @JsonProperty("input") final ArrayNode input, @JsonProperty("output") final JsonNode output,
      @JsonProperty("expected_output") final JsonNode expectedOutput,
      @JsonProperty("testcase_passed_count") final int testcasePassedCount,
      @JsonProperty("testcase_total_count") final int testcaseTotalCount,
      @JsonProperty("elapsed_time") final long elapsedTime,
      @JsonProperty("consumed_memory") final long consumedMemory) {
    this.statusCode = statusCode;
    this.errorMessage = errorMessage;
    this.input = input;
    this.output = output;
    this.expectedOutput = expectedOutput;
    this.testcasePassedCount = testcasePassedCount;
    this.testcaseTotalCount = testcaseTotalCount;
    this.elapsedTime = elapsedTime;
    this.consumedMemory = consumedMemory;
  }

  /**
   * Constructor.
   */
  public JudgeResult(final String compileErrorMsg) {
    this.statusCode = StatusCode.COMPILE_ERROR;
    this.errorMessage = compileErrorMsg;
  }

  // PENDING or RUNNING
// Path: src/main/java/org/algohub/engine/bo/StatusCode.java
// public enum StatusCode {
//   PENDING(0),
//   RUNNING(1),
// 
//   COMPILE_ERROR(2),
//   RUNTIME_ERROR(3),
// 
//   ACCEPTED(4),
//   WRONG_ANSWER(5),
// 
//   TIME_LIMIT_EXCEEDED(6),
//   MEMORY_LIMIT_EXCEEDED(7),
//   OUTPUT_LIMIT_EXCEEDED(8),
// 
//   RESTRICTED_CALL(9),
//   TOO_LONG_CODE(10);
// 
// 
//   private final int code;
// 
//   StatusCode(int code) {
//     this.code = code;
//   }
// 
//   @JsonCreator
//   public static StatusCode fromInt(int code) {
//     for (final StatusCode v : StatusCode.values()) {
//       if (code == v.code) {
//         return v;
//       }
//     }
// 
//     throw new IllegalArgumentException("Unrecognized status code: " + code);
//   }
// 
//   @JsonValue
//   public int toInt() {
//     return this.code;
//   }
// }


// Path: src/main/java/org/algohub/engine/pojo/JudgeResult.java
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.ArrayNode;
import org.algohub.engine.bo.StatusCode;

   * Since some fields are immutable, need to provide a method for Jackson.
   */
  @JsonCreator public JudgeResult(@JsonProperty(value = "status_code", required = true) final StatusCode statusCode,
      @JsonProperty("error_message") final String errorMessage,
      @JsonProperty("input") final ArrayNode input, @JsonProperty("output") final JsonNode output,
      @JsonProperty("expected_output") final JsonNode expectedOutput,
      @JsonProperty("testcase_passed_count") final int testcasePassedCount,
      @JsonProperty("testcase_total_count") final int testcaseTotalCount,
      @JsonProperty("elapsed_time") final long elapsedTime,
      @JsonProperty("consumed_memory") final long consumedMemory) {
    this.statusCode = statusCode;
    this.errorMessage = errorMessage;
    this.input = input;
    this.output = output;
    this.expectedOutput = expectedOutput;
    this.testcasePassedCount = testcasePassedCount;
    this.testcaseTotalCount = testcaseTotalCount;
    this.elapsedTime = elapsedTime;
    this.consumedMemory = consumedMemory;
  }

  /**
   * Constructor.
   */
  public JudgeResult(final String compileErrorMsg) {
    this.statusCode = StatusCode.COMPILE_ERROR;
    this.errorMessage = compileErrorMsg;
  }

  // PENDING or RUNNING
  public JudgeResult(final StatusCode statusCode) {