# rif-x43/competitive-programming-solutions architecture

> Architecture diagram of the GitHub repository rif-x43/competitive-programming-solutions, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rif-x43/competitive-programming-solutions
- Repository: https://github.com/rif-x43/competitive-programming-solutions

## Overview

This repository is an archive of independent competitive-programming solutions, not a single application. The workflow is to choose a problem’s C++ file, provide its expected input on standard input, and read the computed answer from standard output. The graph highlights sampled examples across graph algorithms, sequence/string problems, and mathematics; these programs do not call one another. The README provides no further product description, and unsampled solutions are not mapped as though their implementation had been inspected.

Main entry points: [`CSES/1666 - Building Roads/Building Roads.cpp`](https://github.com/rif-x43/competitive-programming-solutions/blob/main/CSES/1666%20-%20Building%20Roads/Building%20Roads.cpp) (Building Roads), [`CSES/1667 - Message Route/Message Route.cpp`](https://github.com/rif-x43/competitive-programming-solutions/blob/main/CSES/1667%20-%20Message%20Route/Message%20Route.cpp) (Message Route), [`CSES/1668 - Building Teams/Building Teams.cpp`](https://github.com/rif-x43/competitive-programming-solutions/blob/main/CSES/1668%20-%20Building%20Teams/Building%20Teams.cpp) (Building Teams), [`CSES/1669 - Round Trip/Round Trip.cpp`](https://github.com/rif-x43/competitive-programming-solutions/blob/main/CSES/1669%20-%20Round%20Trip/Round%20Trip.cpp) (Round Trip)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_graphs["Graph Problems"]
  node_building_roads["Building Roads<br/>[Building Roads.cpp]"]
  node_message_route["Message Route<br/>[Message Route.cpp]"]
  node_building_teams["Building Teams<br/>[Building Teams.cpp]"]
  node_round_trip["Round Trip<br/>[Round Trip.cpp]"]
end

subgraph group_sequences["Sequences and Strings"]
  node_tasks_deadlines["Tasks and Deadlines"]
  node_traffic_lights["Traffic Lights<br/>[Traffic Lights.cpp]"]
  node_palindrome_reorder["Palindrome Reorder"]
  node_beautiful_average["Beautiful Average"]
end

subgraph group_math["Mathematics"]
  node_number_spiral["Number Spiral<br/>[Number Spiral.cpp]"]
  node_two_knights["Two Knights<br/>[Two Knights.cpp]"]
  node_two_sets["Two Sets<br/>[Two Sets.cpp]"]
end

node_participant(("Problem Solver"))

node_participant -->|"provides input"| node_building_roads
node_building_roads -->|"prints answer"| node_participant
node_participant -->|"provides input"| node_message_route
node_message_route -->|"prints answer"| node_participant
node_participant -->|"provides input"| node_building_teams
node_building_teams -->|"prints answer"| node_participant
node_participant -->|"provides input"| node_round_trip
node_round_trip -->|"prints answer"| node_participant
node_participant -->|"provides input"| node_tasks_deadlines
node_tasks_deadlines -->|"prints answer"| node_participant
node_participant -->|"provides input"| node_traffic_lights
node_traffic_lights -->|"prints answer"| node_participant
node_participant -->|"provides input"| node_palindrome_reorder
node_palindrome_reorder -->|"prints answer"| node_participant
node_participant -->|"provides input"| node_beautiful_average
node_beautiful_average -->|"prints answer"| node_participant
node_participant -->|"provides input"| node_number_spiral
node_number_spiral -->|"prints answer"| node_participant
node_participant -->|"provides input"| node_two_knights
node_two_knights -->|"prints answer"| node_participant
node_participant -->|"provides input"| node_two_sets
node_two_sets -->|"prints answer"| node_participant

click node_building_roads "https://github.com/rif-x43/competitive-programming-solutions/blob/main/CSES/1666%20-%20Building%20Roads/Building%20Roads.cpp"
click node_message_route "https://github.com/rif-x43/competitive-programming-solutions/blob/main/CSES/1667%20-%20Message%20Route/Message%20Route.cpp"
click node_building_teams "https://github.com/rif-x43/competitive-programming-solutions/blob/main/CSES/1668%20-%20Building%20Teams/Building%20Teams.cpp"
click node_round_trip "https://github.com/rif-x43/competitive-programming-solutions/blob/main/CSES/1669%20-%20Round%20Trip/Round%20Trip.cpp"
click node_tasks_deadlines "https://github.com/rif-x43/competitive-programming-solutions/blob/main/CSES/1630%20-%20Tasks%20and%20Deadlines/Tasks%20and%20Deadlines.cpp"
click node_traffic_lights "https://github.com/rif-x43/competitive-programming-solutions/blob/main/CSES/1163%20-%20Traffic%20Lights/Traffic%20Lights.cpp"
click node_palindrome_reorder "https://github.com/rif-x43/competitive-programming-solutions/blob/main/CSES/1755%20-%20Palindrome%20Reorder/Palindrome%20Reorder.cpp"
click node_beautiful_average "https://github.com/rif-x43/competitive-programming-solutions/blob/main/Codeforces/Div.%203/2162A%20-%20Beautiful%20Average/2162A%20-%20Beautiful%20Average.cpp"
click node_number_spiral "https://github.com/rif-x43/competitive-programming-solutions/blob/main/CSES/1071%20-%20Number%20Spiral/Number%20Spiral.cpp"
click node_two_knights "https://github.com/rif-x43/competitive-programming-solutions/blob/main/CSES/1072%20-%20Two%20Knights/Two%20Knights.cpp"
click node_two_sets "https://github.com/rif-x43/competitive-programming-solutions/blob/main/CSES/1092%20-%20Two%20Sets/Two%20Sets.cpp"

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_building_roads,node_message_route,node_building_teams,node_round_trip toneBlue
class node_tasks_deadlines,node_traffic_lights,node_palindrome_reorder,node_beautiful_average toneAmber
class node_number_spiral,node_two_knights,node_two_sets toneMint
class node_participant toneIndigo
```

## Components

### Graph Problems

- [Building Roads](https://github.com/rif-x43/competitive-programming-solutions/blob/main/CSES/1666%20-%20Building%20Roads/Building%20Roads.cpp): `CSES/1666 - Building Roads/Building Roads.cpp`
- [Message Route](https://github.com/rif-x43/competitive-programming-solutions/blob/main/CSES/1667%20-%20Message%20Route/Message%20Route.cpp): `CSES/1667 - Message Route/Message Route.cpp`
- [Building Teams](https://github.com/rif-x43/competitive-programming-solutions/blob/main/CSES/1668%20-%20Building%20Teams/Building%20Teams.cpp): `CSES/1668 - Building Teams/Building Teams.cpp`
- [Round Trip](https://github.com/rif-x43/competitive-programming-solutions/blob/main/CSES/1669%20-%20Round%20Trip/Round%20Trip.cpp): `CSES/1669 - Round Trip/Round Trip.cpp`

### Sequences and Strings

- [Tasks and Deadlines](https://github.com/rif-x43/competitive-programming-solutions/blob/main/CSES/1630%20-%20Tasks%20and%20Deadlines/Tasks%20and%20Deadlines.cpp): `CSES/1630 - Tasks and Deadlines/Tasks and Deadlines.cpp`
- [Traffic Lights](https://github.com/rif-x43/competitive-programming-solutions/blob/main/CSES/1163%20-%20Traffic%20Lights/Traffic%20Lights.cpp): `CSES/1163 - Traffic Lights/Traffic Lights.cpp`
- [Palindrome Reorder](https://github.com/rif-x43/competitive-programming-solutions/blob/main/CSES/1755%20-%20Palindrome%20Reorder/Palindrome%20Reorder.cpp): `CSES/1755 - Palindrome Reorder/Palindrome Reorder.cpp`
- [Beautiful Average](https://github.com/rif-x43/competitive-programming-solutions/blob/main/Codeforces/Div.%203/2162A%20-%20Beautiful%20Average/2162A%20-%20Beautiful%20Average.cpp): `Codeforces/Div. 3/2162A - Beautiful Average/2162A - Beautiful Average.cpp`

### Mathematics

- [Number Spiral](https://github.com/rif-x43/competitive-programming-solutions/blob/main/CSES/1071%20-%20Number%20Spiral/Number%20Spiral.cpp): `CSES/1071 - Number Spiral/Number Spiral.cpp`
- [Two Knights](https://github.com/rif-x43/competitive-programming-solutions/blob/main/CSES/1072%20-%20Two%20Knights/Two%20Knights.cpp): `CSES/1072 - Two Knights/Two Knights.cpp`
- [Two Sets](https://github.com/rif-x43/competitive-programming-solutions/blob/main/CSES/1092%20-%20Two%20Sets/Two%20Sets.cpp): `CSES/1092 - Two Sets/Two Sets.cpp`

### Other components

- **Problem Solver**

## Connections

- Problem Solver → Building Roads: provides input (evidence: `CSES/1666 - Building Roads/Building Roads.cpp`)
- Building Roads → Problem Solver: prints answer (evidence: `CSES/1666 - Building Roads/Building Roads.cpp`)
- Problem Solver → Message Route: provides input (evidence: `CSES/1667 - Message Route/Message Route.cpp`)
- Message Route → Problem Solver: prints answer (evidence: `CSES/1667 - Message Route/Message Route.cpp`)
- Problem Solver → Building Teams: provides input (evidence: `CSES/1668 - Building Teams/Building Teams.cpp`)
- Building Teams → Problem Solver: prints answer (evidence: `CSES/1668 - Building Teams/Building Teams.cpp`)
- Problem Solver → Round Trip: provides input (evidence: `CSES/1669 - Round Trip/Round Trip.cpp`)
- Round Trip → Problem Solver: prints answer (evidence: `CSES/1669 - Round Trip/Round Trip.cpp`)
- Problem Solver → Tasks and Deadlines: provides input (evidence: `CSES/1630 - Tasks and Deadlines/Tasks and Deadlines.cpp`)
- Tasks and Deadlines → Problem Solver: prints answer (evidence: `CSES/1630 - Tasks and Deadlines/Tasks and Deadlines.cpp`)
- Problem Solver → Traffic Lights: provides input (evidence: `CSES/1163 - Traffic Lights/Traffic Lights.cpp`)
- Traffic Lights → Problem Solver: prints answer (evidence: `CSES/1163 - Traffic Lights/Traffic Lights.cpp`)
- Problem Solver → Palindrome Reorder: provides input (evidence: `CSES/1755 - Palindrome Reorder/Palindrome Reorder.cpp`)
- Palindrome Reorder → Problem Solver: prints answer (evidence: `CSES/1755 - Palindrome Reorder/Palindrome Reorder.cpp`)
- Problem Solver → Beautiful Average: provides input (evidence: `Codeforces/Div. 3/2162A - Beautiful Average/2162A - Beautiful Average.cpp`)
- Beautiful Average → Problem Solver: prints answer (evidence: `Codeforces/Div. 3/2162A - Beautiful Average/2162A - Beautiful Average.cpp`)
- Problem Solver → Number Spiral: provides input (evidence: `CSES/1071 - Number Spiral/Number Spiral.cpp`)
- Number Spiral → Problem Solver: prints answer (evidence: `CSES/1071 - Number Spiral/Number Spiral.cpp`)
- Problem Solver → Two Knights: provides input (evidence: `CSES/1072 - Two Knights/Two Knights.cpp`)
- Two Knights → Problem Solver: prints answer (evidence: `CSES/1072 - Two Knights/Two Knights.cpp`)
- Problem Solver → Two Sets: provides input (evidence: `CSES/1092 - Two Sets/Two Sets.cpp`)
- Two Sets → Problem Solver: prints answer (evidence: `CSES/1092 - Two Sets/Two Sets.cpp`)
