전체 글 827

[알고리즘] 프로그래머스 Level5 - 중력 작용 (Java)

[문제 링크] : https://school.programmers.co.kr/learn/courses/30/lessons/77887 프로그래머스SW개발자를 위한 평가, 교육의 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.krimport java.util.*;class Solution { static int n; static int[] head; static int[] to; static int[] next; static int edges; static int[] parent; static int[] subtreeSize; static int[] heavy; static int[] chainHead; st..

알고리즘 2026.09.04

[알고리즘] 프로그래머스 Level5 - 문자열과 알파벳과 쿼리 (Java)

[문제 링크] : https://school.programmers.co.kr/learn/courses/30/lessons/389632 프로그래머스SW개발자를 위한 평가, 교육의 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.krimport java.util.*;class Solution { static class Node { int[] pos; int[] lazy; Node(int[] pos, int initialToken) { this.pos = pos; if(pos.length > 0) { lazy = new int[pos.length * 4 + ..

알고리즘 2026.09.03

[알고리즘] 프로그래머스 Level5 - 눈사람 만들기 (Java)

[문제 링크] : https://school.programmers.co.kr/learn/courses/30/lessons/389631 프로그래머스SW개발자를 위한 평가, 교육의 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.krimport java.util.*;class Solution { static final int[] dy = {1, 0, -1, 0}; static final int[] dx = {0, 1, 0, -1}; public long solution(String[] grid) { int n = grid.length; int m = grid[0].length(); int size = n * m..

알고리즘 2026.09.02

[알고리즘] 프로그래머스 Level5 - RPG와 쿼리 (Java)

[문제 링크] : https://school.programmers.co.kr/learn/courses/30/lessons/76504 프로그래머스SW개발자를 위한 평가, 교육의 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.krimport java.util.*;class Solution { public long[] solution(int n, int z, int[][] roads, long[] queries) { int limit = z * z; int[][] dp = new int[n][limit + 1]; int[] best = new int[limit + 1]; for(int i = 0; i

알고리즘 2026.09.01

[알고리즘] 프로그래머스 Level5 - 가짜 해밀토니안 (Java)

[문제 링크] : https://school.programmers.co.kr/learn/courses/30/lessons/70132 프로그래머스SW개발자를 위한 평가, 교육의 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.krimport java.util.*;class Solution { static int n; static int[] head; static int[] to; static int[] next; static int cnt; static int[] edges; static int[] order; static int[] height; static int[] open; public int solu..

알고리즘 2026.08.31

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

[문제 링크] : https://school.programmers.co.kr/learn/courses/30/lessons/1840 프로그래머스SW개발자를 위한 평가, 교육의 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.krimport java.util.*;class Solution { static int[] A; static int[] B; static int[] old; static int[] cur; static boolean[] inOld; static boolean[] inNew; static boolean[] check; static ArrayList sop; static ArrayList lop; ..

알고리즘 2026.08.29

[알고리즘] 프로그래머스 Level5 - 신비로운 유적 탐험 (Java)

[문제 링크] : https://school.programmers.co.kr/learn/courses/30/lessons/1834 프로그래머스SW개발자를 위한 평가, 교육의 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.krimport java.util.*;class Solution { static List[] tree1; static List[] tree2; static List[] child1; static List[] child2; static int[][] dp; public int solution(int n1, int[][] g1, int n2, int[][] g2) { tree1 = new ArrayLi..

알고리즘 2026.08.28

[알고리즘] 프로그래머스 Level5 - 빠른 이동 (Java)

[문제 링크] : https://school.programmers.co.kr/learn/courses/30/lessons/214294 프로그래머스SW개발자를 위한 평가, 교육의 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.krimport java.util.*;class Solution { static int n; static ArrayList[] graph; static int[] order; static int[] low; static int[] scc; static boolean[] onStack; static int[] stack; static int stackSize; static int orderCo..

알고리즘 2026.08.27

[알고리즘] 프로그래머스 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