일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
- 백트래킹
- VR
- 구현
- 트리
- 유니온 파인드
- c++
- ue5
- 시뮬레이션
- 그래프
- 정렬
- DFS
- 우선순위 큐
- 누적 합
- 수학
- 자료구조
- 스택
- BFS
- 다이나믹 프로그래밍
- 문자열
- XR Interaction Toolkit
- 재귀
- 알고리즘
- Team Fortress 2
- 그리디 알고리즘
- 브루트포스
- 투 포인터
- 다익스트라
- 백준
- Unreal Engine 5
- 유니티
- Today
- Total
목록플로이드-와샬 (2)
1일1알

플로이드-와샬 알고리즘을 이용해서 쉽게 풀 수 있는 문제이다. 그리고 궁금해서 다익스트라로 모든 정점을 돌면서도 답을 구해봤는데 시간은 비슷하게 나왔다. #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; using int64 = long long; vector graph; const int INF = 987654321; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int..

먼저 2중 for문으로 한 도시에서 다른 모든 도시까지 가는 거리들을 텔레포트도 고려하여서 구하고, 플로이드-와샬 알고리즘으로 최소 거리를 구했다. #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; struct city { city() {}; city(int s, int x, int y) :s(s), x(x), y(y) {}; int s; int x; int y; }; int n, t, m; vector v(1001); vector dists(1001, vector(100..