본문 바로가기

Java459

[백준/Java] 11660번 구간 합 구하기 5 -Codeimport java.io.*;import java.util.*;public class BOJ11660 { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(br.readLine()); int size = Integer.parseInt(st.nextToken()); int testCase = Integer.parseInt(st.nextToken()); .. 2026. 1. 11.
[백준/Java] 15990번 1, 2, 3 더하기 5 -Codeimport java.io.*;import java.util.*;public class BOJ15990 { // dp 셋팅 static long[][] dp = new long[100001][3]; static long MOD = 1000000009; static { dp[1][0] = 1; dp[2][1] = 1; dp[3][0] = 1; dp[3][1] = 1; dp[3][2] = 1; // dp의 상태를 끝나는 수 1 2 3으로 나눠서 계산 for (int row = 4; row 처음 보고 문제를 푸는데 이것도 익숙하지 않아서 2차원 배열을 생각하지 못했습니다. 그래서 1차원 배열로.. 2026. 1. 11.
[백준/Java] 1890번 점프 -Codeimport java.io.*;import java.util.*;public class BOJ1890 { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); int[][] map = new int[n][n]; for (int row = 0; row 0) { int moveVal = map[row][col]; .. 2026. 1. 11.
[백준/Java] 24246번 Junior price robot -Codeimport java.util.*;import java.io.*;public class BOJ24246 { 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()); int[] nums = new int[n]; for (int i = 0; i 2026. 1. 11.
[프로그래머스/Java] 퍼즐 조각 채우기 -Codeimport java.util.*;class Solution { static class PosInfo { int row, col; public PosInfo (int row, int col) { this.row = row; this.col = col; } } public int solution(int[][] game_board, int[][] table) { int answer = 0; int length = game_board.length; ArrayList> peices = getPiecesPos(table); boolean[] .. 2026. 1. 10.
[프로그래머스/Java] 아이템 줍기 -Codeimport java.util.*;class Solution { static int[][] map = new int[101][101]; static boolean[][] visited = new boolean[101][101]; static class PosInfo { int row, col, dist; public PosInfo(int row, int col, int dist) { this.row = row; this.col = col; this.dist = dist; } } public int solution(int[][] rectangle,.. 2026. 1. 10.