백준_11657 타임머신 (벨만-포드)
Algorithm/Algorithm 문제2024. 2. 25. 23:20백준_11657 타임머신 (벨만-포드)

import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class BJ_11657_타임머신 { static long[] distance; static Edge[] edges; public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(br.readLine(), " "); i..

백준_1854 k번째 최단경로 찾기 (다익스트라)
Algorithm/Algorithm 문제2024. 2. 24. 23:03백준_1854 k번째 최단경로 찾기 (다익스트라)

import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.Comparator; import java.util.PriorityQueue; import java.util.StringTokenizer; public class BJ_1854_k번째최단경로찾기 { static ArrayList[] arr; static PriorityQueue[] distance; static int k; public static void main(String[] args) throws IOException { BufferedReader br ..

백준_1916 최소비용 구하기 (다익스트라)
Algorithm/Algorithm 문제2024. 2. 23. 21:27백준_1916 최소비용 구하기 (다익스트라)

import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.Comparator; import java.util.PriorityQueue; import java.util.Queue; import java.util.StringTokenizer; public class BJ_1916_최소비용구하기 { static ArrayList[] arr; static boolean[] visited; static int[] distance; public static void main(String[] args) throws IOExcept..

백준_1753 최단경로 (다익스트라)
Algorithm/Algorithm 문제2024. 2. 22. 11:12백준_1753 최단경로 (다익스트라)

import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.Comparator; import java.util.PriorityQueue; import java.util.Queue; import java.util.StringTokenizer; public class BJ_1753_최단경로 { static ArrayList[] arr; static boolean[] visited; static int[] distance; static Queue queue; public static void main(String[] args..

백준_1948 임계경로 (위상정렬, 에지 뒤집기)
Algorithm/Algorithm 문제2024. 2. 21. 11:52백준_1948 임계경로 (위상정렬, 에지 뒤집기)

import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.LinkedList; import java.util.Queue; 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..

백준_1516 게임 개발 (위상정렬)
Algorithm/Algorithm 문제2024. 2. 20. 11:37백준_1516 게임 개발 (위상정렬)

한 20분 고민하고 풀어낸 걸 보니 위상정렬을 잘 이해한거 같음 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.LinkedList; import java.util.Queue; import java.util.StringTokenizer; public class BJ_1516_게임개발 { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(Syste..

백준_2252 줄 세우기 (위상정렬)
Algorithm/Algorithm 문제2024. 2. 19. 15:02백준_2252 줄 세우기 (위상정렬)

import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.LinkedList; import java.util.Queue; import java.util.StringTokenizer; public class BJ_2252_줄세우기 { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new Str..

image