전체 글 133

[BAEKJOON] 11657번 : 타임머신

문 제 소 스 코 드 // 벨만 - 포드 알고리즘 #include #include #include constexpr int INF{ 0x7fff'0000 }; struct Edge { int nVector; int mWeight; }; class Graph { public: Graph() = delete; Graph(const int v) { mGraph.resize(v + 1); mDist.resize(v + 1); } void AddEdge(const int& a, const int b, const int c) { mGraph[a].emplace_back(Edge{ b, c }); // mGraph[b].emplace_back(Edge{ a, c }); } bool cycle{ false }; voi..