# henry960917/zerojudge architecture

> Architecture diagram of the GitHub repository henry960917/zerojudge, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/henry960917/zerojudge
- Repository: https://github.com/henry960917/zerojudge

## Overview

##### Project type and purpose
- From the file listing and the one-line README (“zerojudge”), it is clear this repository is a collection of standalone C++ solutions for ZeroJudge problems (an online judge). Each .cpp file implements the solution to one problem ID.
- This is not a traditional multi-tier or service-oriented application but rather a toolbox of independent programs.

##### File structure
- Top-level directory contains only C++ source files (.cpp) named by problem ID (e.g., a015.cpp, b574.cpp) plus one README.
- There are no subdirectories, no configuration files (e.g., no CMakeLists.txt or build scripts), and no external dependencies declared.
- Each file is self-contained; it likely includes its own headers (iostream, algorithm, etc.), reads from stdin, writes to stdout.

##### README for additional insights
- The README only contains the title “zerojudge.” No architectural details, no dependencies or build instructions.
- We infer that the typical workflow is: you pick a problem file → compile it → run against input → submit output to the judge.

a. Main components:
1. Source Files Collection (all .cpp files)
2. Build System/Compiler (g++, clang++)
3. Executable Instances (one per problem)
4. Input/Output Interface (stdin, stdout)
5. ZeroJudge Platform (external system)

b. Relationships and interactions:
- From Build System → Executable Instances, “generates.”
- Executables → Input/Output Interface, “reads” and “writes.”
- I/O Interface → ZeroJudge Platform, “submits result.”

c. Architectural patterns or design principles:
- Monolithic, file-per-problem pattern: each program is independent.
- Single responsibility per component (each .cpp solves one problem).
- Pipeline pattern: Source → Compile → Run → Submit.

d. Technologies, frameworks, or libraries:
- C++ compiler (g++, clang++)
- Standard C++ library (iostream, STL)
- ZeroJudge online judge as the external service.

##### Additional details
- If test cases are stored separately, represent them as an input repository feeding into the I/O Interface.

##### Detail without over-splitting
- Of the five core components above.
- Clear data flow from code to judge.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Code Artifacts"
        SF["Problem Solutions (.cpp)"]:::codeArtifact
        RM["README.md"]:::codeArtifact
    end

    SF -->|"compile"| CP["Compiler (g++, clang++)"]:::process
    CP -->|"generate binary"| EX["Executable Instance"]:::codeArtifact
    EX -->|"read stdin / write stdout"| IO["I/O Interface"]:::io
    IO -->|"submit output / receive verdict"| ZJ["ZeroJudge Service"]:::external

    click SF "https://github.com/henry960917/zerojudge/tree/main/./"
    click RM "https://github.com/henry960917/zerojudge/blob/main/README.md"

    classDef codeArtifact fill:#ADD8E6,stroke:#333,stroke-width:1px
    classDef process fill:#90EE90,stroke:#333,stroke-width:1px
    classDef io fill:#FFA500,stroke:#333,stroke-width:1px
    classDef external fill:#FFD580,stroke:#333,stroke-width:1px
```
