본문 바로가기

CODING/BAEKJOON74

[BAEKJOON] 트리의 지름 import java.io.BufferedReader;import java.io.IOException;import java.io.InputStreamReader;import java.util.ArrayList;import java.util.PriorityQueue;import java.util.StringTokenizer;public class Main { static int V, answer, second; static ArrayList[] list; public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String.. 2024. 12. 13.
[BAEKJOON] 뱀과 사다리 게임 import java.io.BufferedReader;import java.io.IOException;import java.io.InputStreamReader;import java.util.HashMap;import java.util.PriorityQueue;import java.util.StringTokenizer;public class Main { private static int N, M, min=Integer.MAX_VALUE; private static HashMap map; public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(S.. 2024. 11. 13.
[BAEKJOON] 알고스팟 import java.io.BufferedReader;import java.io.IOException;import java.io.InputStreamReader;import java.util.Arrays;import java.util.PriorityQueue;import java.util.StringTokenizer;public class Main { static int N, M; static boolean visit[][]; // 비용 static int[][] arr, dir = {{0,1},{0,-1},{1,0},{-1,0}}; // 방 정보 public static void main(String[] args) throws IOException { BufferedReader br = new Buf.. 2024. 10. 4.
[BAEKJOON] 트리 import java.io.BufferedReader;import java.io.BufferedWriter;import java.io.IOException;import java.io.InputStreamReader;import java.io.OutputStreamWriter;import java.util.ArrayDeque;import java.util.ArrayList;import java.util.Queue;import java.util.StringTokenizer;public class Main { static ArrayList[] graph; static boolean[] visit; public static void main(String[] args) throws IOException { .. 2024. 4. 29.
[BAEKJOON] 카드 구매하기 2 import java.io.BufferedReader;import java.io.IOException;import java.io.InputStreamReader;import java.util.Arrays;import java.util.StringTokenizer;public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); StringTokenizer st = new StringTokenizer(br.readLine(.. 2024. 4. 17.
[BAEKJOON] LCS import java.io.BufferedReader;import java.io.IOException;import java.io.InputStreamReader;public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); char[] string1 = br.readLine().toCharArray(); char[] string2 = br.readLine().toCharArray(); int[][] dp = new int[string1.length+1][string2.length+1]; .. 2024. 4. 10.