일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 백트래킹
- baekjoon
- 네트워크
- TDD
- LEVEL2
- 백준
- programmers
- back-end
- 모던자바
- Java8
- 프로젝트
- 코틀린
- kotlin
- java
- 자바
- OS
- DFS
- backtracking
- lambda
- 그래프
- BFS
- 운영체제
- 프로그래머스
- 알고리즘
- 자료구조
- 스프링
- Brute-force
- algorithm
- Spring
- DP
- Today
- Total
목록그래프이론 (2)
요깨비's LAB

MST가 최소비용으로 정점을 중복 없이 묶는 것이기 때문에 하나의 최소비용으로 이뤄진 덩어리와 정점 하나짜리 덩어리의 두개의 덩어리로 나누면 자동으로 최소비용으로 두 마을을 구성할 수 있는 아이디어입니다. import java.util.ArrayList; import java.util.List; import java.util.Scanner; class Vertax { Vertax parent; int id; boolean isVisited; public Vertax(int id) { parent = this; this.id = id; this.isVisited = false; } private Vertax findParent(Vertax p) { if (p.id == p.parent.id) { retur..

import java.util.ArrayList; import java.util.List; import java.util.Scanner; class Cow { int id; List preferences; public Cow(int id) { this.id = id; this.preferences = new ArrayList(); } } public class Main { public static int[] barns; public static boolean[] isProccesed; public static List cows; public static int N; public static int M; public static void main(String[] args) { Scanner scr = ne..