diff options
[SDP/P/exb] Solved exercise B
1 files changed, 30 insertions, 0 deletions
| -rw-r--r-- | Year 2/Structures and data algorithms/Project/exb/CityVisit.h | 30 |
diff --git a/Year 2/Structures and data algorithms/Project/exb/CityVisit.h b/Year 2/Structures and data algorithms/Project/exb/CityVisit.h new file mode 100644 index 0000000..c513542 --- /dev/null +++ b/Year 2/Structures and data algorithms/Project/exb/CityVisit.h @@ -0,0 +1,30 @@ +#ifndef CITY +#define CITY + +#include <string> +#include <deque> +#include <utility> // използвам само pair +#include <fstream> + +class CityVisit { + struct Landmark { + std::string name; + std::deque<std::pair<Landmark*, unsigned>> visitable; + + Landmark(const std::string& name) : name(name), visitable() {} + }; + + std::deque<Landmark*> landmarks; + unsigned availableTime; + + Landmark* find(const std::string& name); + void visitTheMostInTimeRec(Landmark* currentLandmark, std::deque<Landmark*> currPath, std::deque<Landmark*> unique, int timeLeft, std::deque<Landmark*>& bestPath, unsigned& uniqueCount); + +public: + void pushLandmarks(const std::string& from, const std::string& to, unsigned time); + + void parse(std::ifstream& inFile); + std::deque<std::string> visitTheMostInTime(std::ifstream& inFile); +}; + +#endif |
