# shrootbuck/usaco architecture

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

- Interactive diagram: https://gitdiagram.com/shrootbuck/usaco
- Repository: https://github.com/shrootbuck/usaco

## Overview

##### Project Type and Purpose
- This is a personal “algorithm‐solutions” repository, not a running service or full‐stack app.
- It holds:
- USACO problem solutions, organized by year and division (e.g., 2016/Bronze)
- Solutions for other online judges (CSES, Codeforces)
- Whiteboard PNGs (with embedded Excalidraw data, though not shown in the provided file tree)
- The README explains how to browse code and import whiteboards into Excalidraw for editing.

##### Top‐Level File Structure
- Root
- README.md
- 2016/ (USACO Bronze, Silver, …)
- 2018/ (USACO Bronze, …)
- CSES/ (various problem .cpp files)
- Codeforces/ (subfolders per problem ID)
- Each year or judge folder contains one subfolder per contest/division or problem ID, with .cpp solution files (and sometimes .png whiteboards).

a. Developer (you)
b. Version Control Host (GitHub remote)
c. Local Clone (your machine’s filesystem)
d. Solution Directories (2016, 2018, CSES, Codeforces)
e. Excalidraw (external editing service for PNG whiteboards)
f. Optional Online Judges (USACO site, CSES grader, Codeforces judge)

##### Relationships and Data Flows
- Developer ↔ GitHub: git clone, pull, commit, push
- Developer ↔ Local Clone: browse code, edit .cpp, add whiteboards
- Local Clone → Online Judges: compile & submit .cpp (to USACO/CSES/CF)
- Local Clone ↔ Excalidraw: import/export of PNG whiteboards

##### Architectural Patterns and Principles
- Simple layered structure:
Layer 1 – Versioning (Git/GitHub)
Layer 2 – Storage (Local directory tree)
Layer 3 – Tools (Compiler, Editor, Excalidraw)
Layer 4 – External Services (Online judges)
- Modular directories: each problem self‐contained

##### Technologies, Frameworks, Libraries
- Git/GitHub for VCS
- C++ compiler (g++, clang++)
- Excalidraw (for editing embedded whiteboard data)
- Any text editor or IDE

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Developer and External Services
    Dev["Developer"]:::dev
    GitHub["GitHub Remote"]:::external
    Excalidraw["Excalidraw"]:::external
    Judges["Online Judges"]:::external

    %% Tools Layer
    subgraph "Tools" 
        Git["Git"]:::process
        Editor["Editor/IDE"]:::process
        Compiler["C++ Compiler"]:::process
    end

    %% Local Filesystem
    subgraph "Local Filesystem" 
        direction TB
        README["README.md"]:::local
        subgraph "USACO 2016 Solutions" 
            direction TB
            D2016["2016/"]:::local
            promote["promote.cpp"]:::local
        end
        subgraph "USACO 2018 Solutions" 
            direction TB
            D2018["2018/"]:::local
            teleport["teleport.cpp"]:::local
        end
        subgraph "CSES Solutions" 
            direction TB
            CSESdir["CSES/"]:::local
            bitstrings["bit-strings.cpp"]:::local
        end
        subgraph "Codeforces Solutions" 
            direction TB
            CFdir["Codeforces/"]:::local
            team["team.cpp"]:::local
            watermelon["watermelon.cpp"]:::local
            soldier["soldier-and-bananas.cpp"]:::local
        end
    end

    %% Relationships
    Dev -->|git clone / pull / push| Git
    Git -->|sync repo| GitHub
    Dev -->|browse & edit| Editor
    Editor -->|read/write files| README
    Editor -->|read/write files| D2016
    Editor -->|read/write files| D2018
    Editor -->|read/write files| CSESdir
    Editor -->|read/write files| CFdir
    Dev -->|invoke compiler| Compiler
    Compiler -->|compile .cpp| D2016
    Compiler -->|compile .cpp| D2018
    Compiler -->|compile .cpp| CSESdir
    Compiler -->|compile .cpp| CFdir
    D2016 -->|submit .cpp| Judges
    D2018 -->|submit .cpp| Judges
    CSESdir -->|submit .cpp| Judges
    CFdir -->|submit .cpp| Judges
    D2016 <-->|"import/export .png"| Excalidraw
    D2018 <-->|"import/export .png"| Excalidraw
    CSESdir <-->|"import/export .png"| Excalidraw
    CFdir <-->|"import/export .png"| Excalidraw

    %% Click Events
    click D2016 "https://github.com/shrootbuck/usaco/tree/main/2016/"
    click promote "https://github.com/shrootbuck/usaco/blob/main/2016/Bronze/promote.cpp"
    click D2018 "https://github.com/shrootbuck/usaco/tree/main/2018/"
    click teleport "https://github.com/shrootbuck/usaco/blob/main/2018/Bronze/teleport.cpp"
    click CSESdir "https://github.com/shrootbuck/usaco/tree/main/CSES/"
    click bitstrings "https://github.com/shrootbuck/usaco/blob/main/CSES/bit-strings.cpp"
    click CFdir "https://github.com/shrootbuck/usaco/tree/main/Codeforces/"
    click team "https://github.com/shrootbuck/usaco/blob/main/Codeforces/231/team.cpp"
    click watermelon "https://github.com/shrootbuck/usaco/blob/main/Codeforces/4/watermelon.cpp"
    click soldier "https://github.com/shrootbuck/usaco/blob/main/Codeforces/546/soldier-and-bananas.cpp"
    click README "https://github.com/shrootbuck/usaco/blob/main/README.md"

    %% Styles
    classDef local fill:#bbdefb,stroke:#1e88e5,color:#0d47a1;
    classDef external fill:#c8e6c9,stroke:#388e3c,color:#1b5e20;
    classDef process fill:#e0e0e0,stroke:#757575,color:#212121;
    classDef dev fill:#fff9c4,stroke:#fbc02d,color:#f57f17;
```
