문제 설명 https://www.acmicpc.net/problem/11657 소스 코드 #include #include #define INF 10000000000 using namespace std; long long int typedef lli; struct edge { int from; int to; lli dis; }; vector map; vector dist; int n, m; bool canRelax(const int i) { int f = map[i].from; int t = map[i].to; return dist[f] != INF && (dist[f] + map[i].dis) < dist[t]; } bool bellmanFord(const int start) { dist[start] = 0; for (int i=1; i
원문 링크 : 타임머신