Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- 호반우 상인
- 22869
- backtracking #codetree #디버깅 #삼성코테
- 20117
- 30870
- c++ #boj #
- graph #최단경로
- c++ #입출력 #속도 #ios #sync_with_stdio #cin #cout #tie
- 백준
- 진법변환 #2to10 #10to2 #이진법 #십진법 #변환 #bitset #c++
- 레드아보
- 이분탐색 #dp #11053
- C++
- boj #백준
- graph
- hcpc
- 3343
- 쌤쌤쌤
- 백준 #다익스트라 #dijkstra #9370 #c++
- 사이클 없는 그래프
- 16202
- 최소 #공배수 #최대 #공약수 #유클리드 #호제법 #lcm #gcd #c++ #boj #3343 #백준 #장미
- LIS #가장긴증가하는부분수열 #
- 1174
- 투포인터 #백준 #boj #20922 #22862
- 코딩
- N번째큰수
- 3D #Reconstruction #computer #vision #volume #metric #tsdf #kinect #fusion
- BOJ
- 줄어드는수
Archives
- Today
- Total
목록graph #최단경로 (1)
hyunjin

문제 S - G - H - T 혹은 S - H - G - T 의 경로가 S - T로 가는 최단 경로인지 확인하면 된다. 그래서 S,G,H 각각의 정점을 시작으로 하는 최단 길이를 다익스트라로 구한다. #include #include #include #include #define INF 0x7f7f7f7f #define MAX_N 2001 using namespace std; int N; int S, G, H; int dist[MAX_N][MAX_N], mdist[MAX_N], mdist_g[MAX_N], mdist_h[MAX_N]; bool vis[MAX_N]; void dijkstra(int start, int *d) { memset(vis, 0, sizeof(vis)); d[start] = 0; fo..
알고리즘 연습/백준
2024. 4. 22. 14:42