Java456 [백준/Java] 1904번 01타일 -Codeimport java.util.*;public class BOJ1904 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); System.out.println(getCount(n)); } private static int getCount(int n) { if (n 2026. 1. 7. [백준/Java] 1753번 최단경로 -Codeimport java.io.*;import java.util.*;public class BOJ1753 { static class Node { int val, weight; public Node(int row, int weight) { this.val = row; this.weight = weight; } } static int[] visited; public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(.. 2026. 1. 7. [프로그래머스/Java] 숫자 변환하기 -Codeimport java.util.*;class Solution { public int solution(int x, int y, int n) { return BFS(x, y, n); } private static int BFS (int start, int target, int num) { boolean[] visited = new boolean[target + 1]; int answer = 0; Deque deque = new ArrayDeque(); deque.addLast(start); while (!deque.isEmpty()) { // 3개 연산중 하나를 선택해.. 2026. 1. 7. [백준/Java] 35097번 2025 -Codeimport java.util.Scanner;public class BOJ35097 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while (true) { int n = sc.nextInt(); if (n == 0) break; int sum = 0; for (int i = 1; i 2026. 1. 7. [백준/Java] 2468번 안전 영역 -Codeimport java.io.*;import java.util.*;public class BOJ2468 { static boolean[][] visited; static class Pos { int row, col; public Pos(int row, int col) { this.row = row; this.col = col; } } public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.i.. 2026. 1. 6. [프로그래머스/Java] 피로도 -Codeimport java.util.*;class Solution { static boolean[] visited; static int answer = 0; public int solution(int k, int[][] dungeons) { visited = new boolean[dungeons.length]; DFS(0, k, dungeons); return answer; } private static void DFS(int depth, int now, int[][] dungeons) { // 최대 돌수 있는 던전의 수이므로 계속 검사 answer = Math.max(answer, depth); .. 2026. 1. 6. 이전 1 ··· 17 18 19 20 21 22 23 ··· 76 다음