전체 글
-
[백준] 2096번 : 내려가기 - 자바(JAVA)알고리즘/백준 2022. 5. 2. 00:01
https://www.acmicpc.net/problem/2096 2096번: 내려가기 첫째 줄에 N(1 ≤ N ≤ 100,000)이 주어진다. 다음 N개의 줄에는 숫자가 세 개씩 주어진다. 숫자는 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 중의 하나가 된다. www.acmicpc.net 문제 해석 N 줄에 0 이상 9 이하의 숫자가 세 개씩 적혀 있다. 이 게임은 첫 줄에서 시작해서 마지막 줄에서 끝나게 된다. 먼저 처음 세 개의 숫자 중에서 하나를 골라서 시작한다. 다음 줄로 내려갈 떄는 바로 아래의 수로 넘어가거나, 바로 아래의 수와 붙어있는 수로만 이동할 수 있다. 숫자 표가 주어져 있을 때 얻을 수 있는 최대 점수, 최소 점수를 구하는 프로그램을 작성해라. 점수는 이동한 곳의 수의 합이..
-
1218. [S/W 문제해결 기본] 4일차 - 괄호 짝짓기알고리즘/SW Expert Academy 2022. 5. 1. 00:01
https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV14eWb6AAkCFAYD SW Expert Academy SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요! swexpertacademy.com 문제 해석 4 종류의 괄호문자들 '()', '[]', '{}', '' 로 이루어진 문자열이 주어진다. 이 문자열에 사용된 괄호들의 짝이 모두 맞는지 판별하는 프로그램을 작성한다. 예를 들어 아래와 같은 문자열은 유효하다고 판단할 수 있다. 아래와 같은 문자열은 유효하지 않은 문자열이다. 붉은색으로 표시된 괄호의 짝을 찾을 수 없기 때문이다. 아래 문자열은 열고 닫는 괄호의 개수는 유효하나 짝이 맞지..
-
@Builder 제대로 알고 사용해보기프로젝트/게시판 프로젝트 2022. 4. 30. 02:27
Lombok의 @Builder를 사용하게 되면 빌더 패턴을 매우 간단하게 적용할 수 있습니다. 빌더 패턴이란? 빌더 패턴이란 인스턴스(객체)를 생성할 때 생성자만을 통해서 생성하는데 어려움이 있기 때문에 고안된 생성 패턴입니다. 예를 들어 클래스에 생성자 인자가 많으면 각 인자들이 어떠한 값을 나타내는지 알기 어렵기 때문입니다. 빌더 패턴에 대해서 잘 모르신다면 다음 글을 보고 오시면 좋을 것 같습니다. https://junuuu.tistory.com/247?category=968252 [Java] 빌더 패턴 빌더 패턴이란? 빌더 패턴은 인스턴스를 생성할 때 생성자(Constructor)만을 통해서 생성하는데 어려움이 있어서 고안된 패턴입니다. 클래스에 생성자 인자가 많다면 어떠한 인자가 어떠한 값을 나..
-
[백준] 2515번 : 전시장 - 자바(Java)알고리즘/백준 2022. 4. 30. 00:01
https://www.acmicpc.net/problem/2515 2515번: 전시장 첫째 줄에는 그림의 개수 N (1 ≤ N ≤ 300,000)과 판매가능 그림을 정의하는 1이상의 정수 S가 빈칸을 사이에 두고 주어진다. 다음 이어지는 N개의 줄 각각에는 한 그림의 높이와 가격을 나타내는 정 www.acmicpc.net 문제 해석 그림에는 가격이 매겨져 있으며 폭은 모두 동일하지만 높이는 다를 수 있습니다. 왼쪽 그림은 C, B, A, D의 순서로 겹쳐서 배치한 상황을 보여줍니다. 오른쪽 그림은 전시된 그림들의 배치를 옆에서 본 모양입니다. 관람객은 보이는 부분의 세로 길이가 특정 정수 S이상인 그림만 구매합니다. 그림의 높이와 가격이 주어질 때 판매 가능 그림들의 가격의 합이 최대가 되도록 그림을 배..
-
[백준] 1520번 : 내리막 길 - 자바(JAVA알고리즘/백준 2022. 4. 29. 00:01
https://www.acmicpc.net/problem/1520 1520번: 내리막 길 여행을 떠난 세준이는 지도를 하나 구하였다. 이 지도는 아래 그림과 같이 직사각형 모양이며 여러 칸으로 나뉘어져 있다. 한 칸은 한 지점을 나타내는데 각 칸에는 그 지점의 높이가 쓰여 있으 www.acmicpc.net 문제 이해 지도 사이의 이동은 상하좌우 이웃한 곳끼리만 가능하다. 세준이의 출발점은 가장 왼쪽 위칸이며 목적지는 가장 오른쪽 아래입니다. 가능함 힘을 적게 들이고 싶어 항상 높이가 더 낮은 지점으로만 이동하여 목표지점으로 가고자 한다. 문제 풀이 전 설계 가장 간단하게 드는 생각은 DFS/BFS로 경로를 세주는 것입니다. N과 M의 크기는 500입니다. 항상 자신보다 적은길로 가야 하기 때문에 가지치기..
-
JPA로 CRUD 해보기 + 테스트코드프로젝트/게시판 프로젝트 2022. 4. 28. 22:15
https://junuuu.tistory.com/270?category=997278 Spring Initializr로 프로젝트 생성하기 + MySQL연동까지 https://start.spring.io/ Proejct : Gradle Project Language : Java Packaging : Jar(REST API server로 만들기 때문에 JSP필요 x) - Spring 문서에서도 JSP를 피하라고 명시 Java : 11(16으로 변경해서 사용 예.. junuuu.tistory.com 이전에 이어서 Spring Initailzr로 스프링 부트 프로젝트를 생성했으며 MySQL까지 연동된 상황입니다. 지난번에 resources/application.properties 에서 JPA에 대한 설정을 할때 ..
-
[우아한테크토크] 선착순 이벤트 서버 생존기!세미나, 영상 요약정리 2022. 4. 28. 17:16
https://www.youtube.com/watch?v=MTSn93rNPPE 해당 영상을 보고 정리해본 글입니다. 유래 선착순 만명에게 치킨을 제공하는 이벤트를 실시했었습니다. 유저의 반응 : 배민 또 장애 나겠네.. 장애가 발생한다면 사이드 이펙트 - 이벤트 참가자 : 저녁 안먹고 기다렸는데 이럴거면 왜 하는거지? - 이벤트 비참가자 : 나는 이벤트 필요없고 다른 음식 시키려고했는데 왜 안되는거지? - 업주 : 광고비 냈는데, 오늘 매출은? - 개발자 : 멘붕 목표 순간적인 대량 트래픽을 소화하자 이벤트에 영향없이 일반주문은 가능하도록 장애를 격리하자 기존의 주문시스템 장바구니 -> 주문준비(Validation 및 세션저장) -> 주문지면 -> 결제요청 -> 결제완료 즉, 하나의 프로세스에 연계된 A..
-
개발자가 질문 잘 하는 법세미나, 영상 요약정리 2022. 4. 28. 16:57
https://www.youtube.com/watch?v=L2p1mdpxD5w 해당 영상을 보고 정리해본 글입니다. 주제 내 질문에는 왜 답변이 달리지 않을까?(개발자가 질문하는 방법) 1단계 : 질문을 하기 전에 해야 할 것들 - WHY 원칙에 따라 생각해 보기 - 해결이 될 법한 다른 방법을 세 가지 시도(추후에 질문에 포함시키면 좋음) 2단계 : 이제 검색을 해 보자 내가 모르는 건 남도 모르고 내가 실수하는 건 남도 한다. Naver도 드물게 도움이 될 때도 있지만 Google을 사용하면 좋습니다. 원하는 답이 없다고 여러 페이지를 뒤지지 말고 차라리 검색 키워드를 바꿔봅니다. 대부분의 답은 사실 스택오버플로우가 알려 줍니다. http://stackoverflow.com/search Human v..