Online Judge Specification for Tank War Game Tournament


Submission Requirements

  1. Format: Submissions must be a .zip file.

  2. Contents: The .zip must directly contain the program files with no outer folder.

  3. Size: The .zip file size must not exceed 100KB.

  4. Will collect .cpp files in submission root and compile using g++ -O3 (v9.4.0)


Program Specifications

  1. Arguments:

    • -p p or --initial-life=p: Sets initial life points (default is 5 if not specified).

    • -m TOURNAMENT or --mode=TOURNAMENT: Mandatory argument to specify the tournament mode.

  2. Input:

    • At program start, the judge will input six integers via standard input

      where:

      • x0, y0: Your tank's starting coordinates.

      • x1, y1: Opponent's starting coordinates.

      • f0, f1: Facing directions (0: Up, 1: Right, 2: Down, 3: Left) of your tank and opponent's tank, respectively.

  3. Output:

    • Turn 1: Print your action (0, 1, or 2) to standard output within 1 second.

    • Subsequent Turns:

      • After each turn, the judge will input the opponent's action for that turn (0, 1, or 2) to your program.

      • Respond with your next action (0, 1, or 2) within 1 second.

  4. Actions:

    • 0: Move Straight.

    • 1: Turn Left + Move.

    • 2: Turn Right + Move.


Constraints

  1. Memory Limit: 10MB maximum during execution.

  2. Execution Time: Each move must be determined and printed within 1 second.

  3. File I/O: No file read/write operations are allowed; all interactions must occur via standard input/output.

  4. Security:

    • Programs must not perform malicious operations such as:

      • Network access.

      • Unauthorized system calls.

      • Exploiting vulnerabilities.


Example Interaction

Input (Turn 1):

Output (Your Action):

Input (Opponent’s Action for Turn 1):

Output (Your Action for Turn 2):


This ensures a standardized environment for fair tournament execution. Good luck! 🎮