#include //한점에서 가장 가까운점끼리 연결하는 것이 최소 스패닝 트리를 만들 수 있습니다 //한점은 x축을 기준으로 2곳, y축을 기준으로 2곳, z축을 기준으로 2곳의 가까운 점이 있다고 볼 수 있으며, //위의 모든 경우를 하나의 간선들로 만든다음, 간선들을 가중치 값으로 오름차순하여 정렬합니다 //정렬한 간선들로 최소 스패닝 트리를 위해, Krustal 알고리즘을 사용합니다. typedef struct Node { int x; int y; int z; int num; }Node; int ab(int x) { if(x=1; } } void shellY(Node in[], int n) { int i,j, gap = n/2; Node key; while(1) { if(gap%2 == 0) gap..
#include #define M 1000001 void swap(int *x, int *y) { //swap int tmp = *x; *x = *y; *y = tmp; } typedef struct Node { //node int a; int b; int c; }Node; typedef struct PriorityQueue { //우선순위큐 Node heap[M]; //a b c int cnt; }PriorityQueue; void push(PriorityQueue *q, int a, int b, int data) { //우선순위 큐 push q->heap[q->cnt].a = a; q->heap[q->cnt].b = b; q->heap[q->cnt].c = data; int child = q->cnt..
#include #define M 100001 void swap(int *x, int *y) { //swap int tmp = *x; *x = *y; *y = tmp; } typedef struct Node { //node int a; int b; int c; }Node; typedef struct PriorityQueue { //우선순위큐 Node heap[M]; //a b c int cnt; }PriorityQueue; void push(PriorityQueue *q, int a, int b, int data) { //우선순위 큐 push q->heap[q->cnt].a = a; q->heap[q->cnt].b = b; q->heap[q->cnt].c = data; int child = q->cnt;..
- Total
- Today
- Yesterday
- Mo.s
- find
- 1835번
- java
- 6198
- 스택
- 최소 스패닝 트리
- 플로이드
- 카드
- union
- 정렬
- 오프라인 쿼리
- DP
- C언어
- 1835
- 누적 합
- 그리디
- Krustal
- 트리
- C++
- 세그먼트 트리
- 누적합
- DFS
- 백준
- 최대공약수
- BFS
- 16120번
- 6198번
- 그래프
- 덱
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 31 |