목록플로이드-워셜 (1)
레야몬
[C++] 11404번 플로이드 - 플로이드-워셜
#include #include #define MAX_N 101 #define INF 987654321 using namespace std; int n, m; //도시의 개수 n, 버스의 개수 m int map[MAX_N][MAX_N]; //각 도시에서 도시로 가는 최소 비용 int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); cin >> n >> m; for(int i=1; i> v >> w; map[u][v]=min(map[u][v], w); } for(int k=1; k
알고리즘/백준
2022. 9. 5. 00:10