Algorithm/BOJ
-
[BOJ - Gold IV] 곡예 비행 / ⭕Algorithm/BOJ 2024. 8. 18. 19:03
곡예 비행 1. 제출코드 (3시간 32분 43초 / DP)import java.io.BufferedReader;import java.io.IOException;import java.io.InputStreamReader;import java.util.ArrayDeque;import java.util.StringTokenizer;public class Main { static int N, M; static int[][] map; public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); S..
-
[BOJ - Gold V] 토마토 / ⭕Algorithm/BOJ 2024. 8. 17. 15:46
토마토1. 제출 코드 (31분 26초 / BFS)import java.io.BufferedReader;import java.io.IOException;import java.io.InputStreamReader;import java.util.ArrayDeque;import java.util.ArrayList;import java.util.StringTokenizer;public class Main { static class Pos { int x, y; public Pos(int x, int y) { this.x = x; this.y = y; } } static int N, M; static int[][] to..
-
[BOJ - Silver V] 무한 문자열 / ⭕Algorithm/BOJ 2024. 8. 17. 12:01
무한 문자열 1. 제출 코드 (27분 55초 / 구현)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)); String s = br.readLine(); String t = br.readLine(); int answer = 1; String ts = s.conc..
-
[BOJ - Silver IV] 오셀로 재배치 / ⭕Algorithm/BOJ 2024. 8. 17. 11:26
오셀로 재배치1. 제출 코드 (12분 32초 / 그리디)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)); int T = Integer.parseInt(br.readLine()); for(int i = 0; i b ? w : b); } }} 2. 구현 로직오셀로 말..