This program was developed as a project for the Algoritmi e Principi dell'Informatica (API) course @ Milan Polytechnic.
The project was graded based on running time and memory usage, with lower values in both categories resulting in higher scores.
Professor: Davide Martinenghi
Final Grade: 30/30 with honors
Score | Memory | Time | Status |
---|---|---|---|
18 | < 128 MiB | < 19 s | ✅ |
21 | < 118 MiB | < 15 s | ✅ |
24 | < 108 MiB | < 10 s | ✅ |
27 | < 98 MiB | < 6 s | ✅ |
30 | < 88 MiB | < 4 s | ✅ |
30 with honors | < 78 MiB | < 1 s | ✅ |
Given a highway with charging stations at various distances, each with a fleet of electric vehicles of different ranges, the program must:
- Add/remove charging stations along the highway
- Manage electric vehicles at each station (add/scrap)
- Find the route with the fewest stops between any two stations
- When multiple routes have the same number of stops, prefer the one with earlier stops
The full specification of the project (in Italian) can be found here.
Type | Name |
---|---|
IDE | Visual Studio Code |
Compiler | gcc |
Profiling | KCachegrind |
Compile the code using the following command:
make main
Run a simulation with one of the provided tests:
main.exe < tests/open_1.txt > open_1_result.txt