Java635 [프로그래머스/Java] 124 나라의 숫자 -Codeimport java.util.*;class Solution { public String solution(int n) { StringBuilder answer = new StringBuilder(); // 변환 while (n > 0) { // 나머지 구하기 int remain = n % 3; if (remain == 0) { answer.append(4); // 값 보정 n = (n / 3) - 1; } else { answer.append(remain); .. 2026. 4. 30. [프로그래머스/Java] 테이블 해시 함수 -Codeimport java.util.*;class Solution { public int solution(int[][] data, int col, int row_begin, int row_end) { // 조건에 따른 정렬 Arrays.sort(data, (o1, o2) -> { // col-1 번째 값이 다르면 오름차순 정렬 if (o1[col - 1] != o2[col - 1]) { return o1[col - 1] - o2[col - 1]; } // 값이 같으면 0번째 컬럼을 기준으로 내림차순 정렬 return o2[0] - o1[0]; .. 2026. 4. 29. [백준/Java] 5107번 마니또 -Codeimport java.io.*;import java.util.*;public class BOJ5107 { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int testNum = 1; while (true) { int cnt = Integer.parseInt(br.readLine()); // 0이면 탈출 if (cnt == 0) break; // 각 마니또 정보.. 2026. 4. 28. [백준/Java] 9294번 Even More Dice -Codeimport java.io.*;import java.util.*;public class BOJ9294 { static Deque deq = new ArrayDeque(); public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int testCase = Integer.parseInt(br.readLine()); for (int test = 0; test StringJoiner를 몰라서 이상하게 출력하기도 했고 마지막 수를 따로 받아야 하는데.. 2026. 4. 27. [백준/Java] 12629번 Crazy Rows (Small) -Codeimport java.io.*;public class BOJ12629 { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int testCase = Integer.parseInt(br.readLine()); for (int test = 0; test r; idx--) { int temp = lastOneIdx[idx]; lastOneIdx[idx] = lastOneIdx.. 2026. 4. 26. [백준/Java] 26168번 배열 전체 탐색하기 -Codeimport java.io.*;import java.util.*;public class BOJ26168 { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(br.readLine()); int numsCnt = Integer.parseInt(st.nextToken()); int commCnt = Integer.parseInt(st.nextToken()); .. 2026. 4. 25. 이전 1 2 3 4 ··· 106 다음