전체 글 818

[알고리즘] 프로그래머스 Level5 - 집합과 쿼리 (Java)

[문제 링크] : https://school.programmers.co.kr/learn/courses/30/lessons/214291 프로그래머스SW개발자를 위한 평가, 교육의 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.krimport java.util.*;class Solution { static int[] parent; static int[] size; static int[] ids; static int[] enter; static int[] roots; static int[] left; static int[] right; static int[] priority; static int[] key; s..

알고리즘 2026.08.26

[알고리즘] 프로그래머스 Level5 - 중요한 도로 (Java)

[문제 링크] : https://school.programmers.co.kr/learn/courses/30/lessons/214293 프로그래머스SW개발자를 위한 평가, 교육의 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.krimport java.util.*;class Solution { static class Node implements Comparable { int v; long dist; Node(int v, long dist) { this.v = v; this.dist = dist; } public int compareTo(Node o) { ..

알고리즘 2026.08.25

[알고리즘] 프로그래머스 Level5 - 직사각형의 넓이 (Java)

[문제 링크] : https://school.programmers.co.kr/learn/courses/30/lessons/12974 프로그래머스SW개발자를 위한 평가, 교육의 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.krimport java.util.*;class Solution { static class Node { long x; int y1; int y2; int type; Node(long x, int y1, int y2, int type) { this.x = x; this.y1 = y1; this.y2 = y2; ..

알고리즘 2026.08.24

[알고리즘] 프로그래머스 Level5 - 재밌는 레이싱 경기장 설계하기 (Java)

[문제 링크] : https://school.programmers.co.kr/learn/courses/30/lessons/214292 프로그래머스SW개발자를 위한 평가, 교육의 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.krimport java.util.*;class Solution { public int solution(int[] heights) { Arrays.sort(heights); int n = heights.length; int mid = n / 2; if(n % 2 == 0) { int answer = Integer.MAX_VALUE; for(int..

알고리즘 2026.08.23

[알고리즘] 프로그래머스 Level5 - 문자열의 아름다움 (Java)

[문제 링크] : https://school.programmers.co.kr/learn/courses/30/lessons/68938 프로그래머스SW개발자를 위한 평가, 교육의 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.krimport java.util.*;class Solution { static int N; static char[] crr; static int[] arr; static int cnt; static long[] ct; static long[] at; static long[] rr; static long[] bt; public long solution(String s) { N = ..

알고리즘 2026.08.22

[알고리즘] 프로그래머스 Level5 - 시험장 나누기 (Java)

[문제 링크] : https://school.programmers.co.kr/learn/courses/30/lessons/81305 프로그래머스SW개발자를 위한 평가, 교육의 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.krimport java.util.*;class Solution { static int n, root; static int[] left = new int[10001]; static int[] right = new int[10001]; static int[] parent = new int[10001]; static int[] value = new int[10001]; static int count = 0; ..

알고리즘 2026.08.21

[알고리즘] 프로그래머스 Level3 - 제곱 개수 배열 (Java)

[문제 링크] : https://school.programmers.co.kr/learn/courses/30/lessons/468380 프로그래머스SW개발자를 위한 평가, 교육의 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.krimport java.util.*;class Solution { static int N; static int[] arr; static long[] length; static long[] sum; public long[] solution(int[] arr, long l, long r) { this.arr = arr; N = arr.length; length = new lon..

알고리즘 2026.08.19

[알고리즘] 프로그래머스 Level3 - 보물 찾기 (Java)

[문제 링크] : https://school.programmers.co.kr/learn/courses/30/lessons/468378 프로그래머스SW개발자를 위한 평가, 교육의 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.krimport java.util.function.Function;class Solution { public int solution(int[] depth, int money, Function excavate) { int n = depth.length; long[][] dp = new long[n][n]; int[][] arr = new int[n][n]; for(int len = 1;..

알고리즘 2026.08.18

[알고리즘] 프로그래머스 Level4 - 격자 뒤집기 미로 (Java)

[문제 링크] : https://school.programmers.co.kr/learn/courses/30/lessons/389630 프로그래머스SW개발자를 위한 평가, 교육의 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.krimport java.util.*;class Solution { public int solution(int[][] visible, int[][] hidden, int k) { int answer = 0; double max = Math.pow(2, visible.length); boolean[] check = new boolean[visible.length]; for..

알고리즘 2026.08.17