본문 바로가기

분류 전체보기127

[프로그래머스] Lv.3 징검다리 건너기 https://school.programmers.co.kr/learn/courses/30/lessons/64062 프로그래머스코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.programmers.co.kr  풀이 유형이분탐색슬라이딩 윈도우 풀이import java.util.*;class Solution { public int solution(int[] stones, int k) { int answer = 0; int st = 1, en = 200000000; while(st   회고 처음엔 매 시간이 지날때마다 돌의 값을 1씩 줄여주고, 이 때 .. 2024. 9. 26.
[백준] Silver I. 스타트와 링크 https://www.acmicpc.net/problem/14889 문제 유형브루트 포스 백트래킹 풀이public class boj14889 { static int n; static int [][] board; static boolean [] visited; static int res = Integer.MAX_VALUE; public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); n = Integer.parseInt(br.readLine()); board = ne.. 2024. 9. 26.
[백준] Gold IV. 즐거운 단어 https://www.acmicpc.net/problem/2922 문제 유형브루트 포스백트래킹 풀이public class boj2922 { static long res = 0; public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String input = br.readLine(); dfs(0, 0, 0, input.contains("L"), input, 1); System.out.println(res); } public static void dfs(.. 2024. 9. 26.
[백준] Silver II. 꽃길 https://www.acmicpc.net/problem/14620 문제 유형브루트포스백트래킹 코드 import java.io.BufferedReader;import java.io.IOException;import java.io.InputStreamReader;import java.util.StringTokenizer;public class boj14620 { static int n; static int [][] board; static boolean[][] visited; static int[] dx = {1, 0, -1, 0, 0}; static int[] dy = {0, 1, 0, -1, 0}; static int res = Integer.MAX_VALUE; p.. 2024. 9. 26.