# anonymoose725/comp321-kattis-problem architecture

> Architecture diagram of the GitHub repository anonymoose725/comp321-kattis-problem, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/anonymoose725/comp321-kattis-problem
- Repository: https://github.com/anonymoose725/comp321-kattis-problem

## Overview

This repository packages a programming-contest problem: its statement defines the task, contestant solutions compute results from input, and supporting deliverables validate inputs and provide test cases with expected answers. The main user workflow is problem input to a correct solution to its computed output; the validator and test-data tools support problem authors separately. The sampled answer generator explicitly invokes the Python solution to create answer files. The presentation slides are a documented deliverable but are not present in the tree. Arrows are limited to relationships shown in the README or sampled source.

Main entry points: [`test_case_generator/answer_generator.py`](https://github.com/anonymoose725/comp321-kattis-problem/blob/main/test_case_generator/answer_generator.py) (Answer generator), [`submissions/correct_solutions/sol2.py`](https://github.com/anonymoose725/comp321-kattis-problem/blob/main/submissions/correct_solutions/sol2.py) (Python solution), [`submissions/correct_solutions/sol1.java`](https://github.com/anonymoose725/comp321-kattis-problem/blob/main/submissions/correct_solutions/sol1.java) (Java solution), [`submissions/wrong_answer/wa.py`](https://github.com/anonymoose725/comp321-kattis-problem/blob/main/submissions/wrong_answer/wa.py) (Non-preemptive solution)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_problem["Problem definition"]
  node_statement["Problem statement<br/>[problem.en.tex]"]
end

subgraph group_solutions["Solution implementations"]
  node_python_solution["Python solution<br/>[sol2.py]"]
  node_java_solution["Java solution<br/>[sol1.java]"]
  node_wrong_solution["Non-preemptive solution<br/>[wa.py]"]
  node_slow_solution["Slow solution<br/>[tle.py]"]
end

subgraph group_authoring["Problem authoring tools"]
  node_validator["Input validator<br/>[validate.py]"]
  node_case_generator["Case generator<br/>[generate.py]"]
  node_answer_generator["Answer generator"]
end

subgraph group_corpus["Test corpus"]
  node_test_data[("Sample and secret cases")]
end

node_contestant(("Contestant"))
node_input["Problem input"]
node_output["Computed result"]

node_contestant -->|"provides"| node_input
node_input -->|"solves"| node_python_solution
node_python_solution -->|"prints result"| node_output
node_input -->|"solves"| node_java_solution
node_java_solution -->|"prints result"| node_output
node_input -->|"attempts solve"| node_wrong_solution
node_wrong_solution -->|"prints result"| node_output
node_input -->|"attempts solve"| node_slow_solution
node_slow_solution -->|"prints result"| node_output
node_statement -.->|"specifies format"| node_input
node_input -->|"checks format"| node_validator
node_case_generator -->|"emits cases"| node_output
node_test_data -->|"reads inputs"| node_answer_generator
node_answer_generator -->|"invokes"| node_python_solution
node_answer_generator -->|"writes answers"| node_test_data

click node_statement "https://github.com/anonymoose725/comp321-kattis-problem/blob/main/problem_statement/problem.en.tex"
click node_python_solution "https://github.com/anonymoose725/comp321-kattis-problem/blob/main/submissions/correct_solutions/sol2.py"
click node_java_solution "https://github.com/anonymoose725/comp321-kattis-problem/blob/main/submissions/correct_solutions/sol1.java"
click node_wrong_solution "https://github.com/anonymoose725/comp321-kattis-problem/blob/main/submissions/wrong_answer/wa.py"
click node_slow_solution "https://github.com/anonymoose725/comp321-kattis-problem/blob/main/submissions/time_limit_exceeded/tle.py"
click node_validator "https://github.com/anonymoose725/comp321-kattis-problem/blob/main/input_format_validators/validate.py"
click node_case_generator "https://github.com/anonymoose725/comp321-kattis-problem/blob/main/test_case_generator/generate.py"
click node_answer_generator "https://github.com/anonymoose725/comp321-kattis-problem/blob/main/test_case_generator/answer_generator.py"
click node_test_data "https://github.com/anonymoose725/comp321-kattis-problem/tree/main/data"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_statement toneBlue
class node_python_solution,node_java_solution,node_wrong_solution,node_slow_solution toneAmber
class node_validator,node_case_generator,node_answer_generator toneMint
class node_test_data toneRose
class node_contestant,node_input,node_output toneIndigo
```

## Components

### Problem definition

- [Problem statement](https://github.com/anonymoose725/comp321-kattis-problem/blob/main/problem_statement/problem.en.tex): `problem_statement/problem.en.tex`

### Solution implementations

- [Python solution](https://github.com/anonymoose725/comp321-kattis-problem/blob/main/submissions/correct_solutions/sol2.py): `submissions/correct_solutions/sol2.py`
- [Java solution](https://github.com/anonymoose725/comp321-kattis-problem/blob/main/submissions/correct_solutions/sol1.java): `submissions/correct_solutions/sol1.java`
- [Non-preemptive solution](https://github.com/anonymoose725/comp321-kattis-problem/blob/main/submissions/wrong_answer/wa.py): `submissions/wrong_answer/wa.py`
- [Slow solution](https://github.com/anonymoose725/comp321-kattis-problem/blob/main/submissions/time_limit_exceeded/tle.py): `submissions/time_limit_exceeded/tle.py`

### Problem authoring tools

- [Input validator](https://github.com/anonymoose725/comp321-kattis-problem/blob/main/input_format_validators/validate.py): `input_format_validators/validate.py`
- [Case generator](https://github.com/anonymoose725/comp321-kattis-problem/blob/main/test_case_generator/generate.py): `test_case_generator/generate.py`
- [Answer generator](https://github.com/anonymoose725/comp321-kattis-problem/blob/main/test_case_generator/answer_generator.py): `test_case_generator/answer_generator.py`

### Test corpus

- [Sample and secret cases](https://github.com/anonymoose725/comp321-kattis-problem/tree/main/data): `data`

### Other components

- **Contestant**
- **Problem input**
- **Computed result**

## Connections

- Contestant → Problem input: provides (evidence: `README.md`)
- Problem input → Python solution: solves (evidence: `submissions/correct_solutions/sol2.py`)
- Python solution → Computed result: prints result (evidence: `submissions/correct_solutions/sol2.py`)
- Problem input → Java solution: solves (evidence: `submissions/correct_solutions/sol1.java`)
- Java solution → Computed result: prints result (evidence: `submissions/correct_solutions/sol1.java`)
- Problem input → Non-preemptive solution: attempts solve (evidence: `submissions/wrong_answer/wa.py`)
- Non-preemptive solution → Computed result: prints result (evidence: `submissions/wrong_answer/wa.py`)
- Problem input → Slow solution: attempts solve (evidence: `submissions/time_limit_exceeded/tle.py`)
- Slow solution → Computed result: prints result (evidence: `submissions/time_limit_exceeded/tle.py`)
- Problem statement → Problem input: specifies format (evidence: `README.md`)
- Problem input → Input validator: checks format (evidence: `input_format_validators/validate.py`)
- Case generator → Computed result: emits cases (evidence: `test_case_generator/generate.py`)
- Sample and secret cases → Answer generator: reads inputs (evidence: `test_case_generator/answer_generator.py`)
- Answer generator → Python solution: invokes (evidence: `test_case_generator/answer_generator.py`)
- Answer generator → Sample and secret cases: writes answers (evidence: `test_case_generator/answer_generator.py`)
