diff --git "a/LiiNi-coder/202510/14 BOJ \353\217\204\354\213\234 \353\266\204\355\225\240 \352\263\204\355\232\215.md" "b/LiiNi-coder/202510/14 BOJ \353\217\204\354\213\234 \353\266\204\355\225\240 \352\263\204\355\232\215.md" new file mode 100644 index 00000000..5976bd5c --- /dev/null +++ "b/LiiNi-coder/202510/14 BOJ \353\217\204\354\213\234 \353\266\204\355\225\240 \352\263\204\355\232\215.md" @@ -0,0 +1,80 @@ +```java +import java.io.*; +import java.util.*; + +public class Main { + private static int N, M; + private static int[] Parent; + private static List Edges = new ArrayList<>(); + + private static class Edge implements Comparable { + int from, to, cost; + Edge(int from, int to, int cost) { + this.from = from; + this.to = to; + this.cost = cost; + } + @Override + public int compareTo(Edge e) { + return this.cost - e.cost; + } + } + + public static void main(String[] args)throws IOException{ + BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); + StringTokenizer st = new StringTokenizer(br.readLine()); + N = Integer.parseInt(st.nextToken()); + M = Integer.parseInt(st.nextToken()); + Parent = new int[N+1]; + + + for(int i=1; i<=N; i++){ + Parent[i] = i; + } + + for(int i=0; i