#include #include #include namespace { struct Coord { size_t x, y; explicit constexpr Coord(size_t x_, size_t y_) : x(x_), y(y_) {} bool operator == (const Coord& other) const { return std::tuple(x, y) == std::tuple(other.x, other.y); } }; struct Node : public Coord { size_t g, h; size_t f; Node* parent; explicit constexpr Node(size_t x_, size_t y_) : Coord(x_, y_) {} explicit constexpr Node(const Coord& coord) : Coord(coord.x, coord.y) {} int operator < (const Node& other) const { return f < other.f; } bool operator == (const Node& other) const { return Coord::operator==(other); } }; } class Solution3341 { public: int minTimeToReach(std::vector>& moveTime) { constexpr Coord start{0, 0}; const Coord end{moveTime.size(), moveTime[0].size()}; auto start_node = Node(start); auto end_node = Node(end); std::priority_queue open_list; open_list.push(start_node); std::set closed_set; while (open_list.size()) { Node current_node = open_list.top(); open_list.pop(); if (current_node == end_node) { std::vector path; // while (current_node) } } return 0; } };