전체 글
-
[백준]12865번 : 평범한 배낭 - 자바(JAVA)알고리즘/백준 2022. 4. 28. 00:01
https://www.acmicpc.net/problem/12865 12865번: 평범한 배낭 첫 줄에 물품의 수 N(1 ≤ N ≤ 100)과 준서가 버틸 수 있는 무게 K(1 ≤ K ≤ 100,000)가 주어진다. 두 번째 줄부터 N개의 줄에 거쳐 각 물건의 무게 W(1 ≤ W ≤ 100,000)와 해당 물건의 가치 V(0 ≤ V ≤ 1,000) www.acmicpc.net 문제 해석 필요한 물건의 개수 : N개 각 물건의 무게 : W 각 물건의 가치 : V 배낭에 물건을 넣고자하는데 최대 K만큼의 무게를 넣을 수 있다. 이 때 물건의 가치가 최대가 되도록 물건을 넣어보자. 문제 풀이 전 설계 입력값 받기 물품의 개수 N과 최대 무게 K를 입력받고 N번에 걸쳐 물건의 무게(W)와 물건의 가치(V)를 입..
-
[백준] 1175번 : 배달 - 자바(JAVA)알고리즘/백준 2022. 4. 27. 00:01
https://www.acmicpc.net/problem/1175 1175번: 배달 어제 선물을 모두 포장한 민식이는 이제 선물을 배달하려고 한다. 민식이가 선물을 배달할 곳은 이 문제를 읽는 사람들이 앉아 있는 교실이다. 교실은 직사각형모양이고, 모두 같은 크기의 정사 www.acmicpc.net 문제 해석 직사각형으로 이루어진 교실에 선물을 배달하고 싶다. 지도가 주어지는데 4가지 종류로 식별합니다. S : 지금 민식이가 있는 위치, 배달을 시작하는 곳이며 1개가 존재 C : 민식이가 반드시 선물을 배달해야 하는 곳. 정확하게 2개 존재 # : 민식이가 갈 수 없는 곳이다. . : 민식이가 자유롭게 지나갈 수 있는 곳 동서남북으로 이동하는데 1분 걸리며 네가지 방향 중 한 방향으로 이동할 수 있다. ..
-
[Git] 소스 트리 다운로드 및 설치Git 2022. 4. 26. 13:43
소스 트리란? 형상관리를 하기 위해 Git을 사용하는데 이를 사용하기위한 GUI 툴입니다. 예를들어 Git은 리눅스 SourceTree는 윈도우라는 느낌으로 이해하면 좋을것 같습니다. 소스트리 다운로드 및 설치 아래 링크는 SourceTree 공식 홈페이지입니다. https://www.sourcetreeapp.com/ Sourcetree | Free Git GUI for Mac and Windows A Git GUI that offers a visual representation of your repositories. Sourcetree is a free Git client for Windows and Mac. www.sourcetreeapp.com 1. 홈페이지에 접속하고 Download for Win..
-
Spring Boot + MySQL 연동(feat. Spring initializr)프로젝트/게시판 프로젝트 2022. 4. 26. 02:19
https://start.spring.io/ Proejct : Gradle Project Language : Java Packaging : Jar(REST API server로 만들기 때문에 JSP필요 x) - Spring 문서에서도 JSP를 피하라고 명시 Java : 11(16으로 변경해서 사용 예정) Dependencies : Lombok, Spring Web, Spring Data JPA, MySQL Driver 이제 하단의 GENERATE를 눌러보겠습니다. 압축을 풀어주고 Anthill 폴더를 C:\intellij폴더 안에 넣어주겠습니다 이후에 Intellij를 실행! File -> Open... 선택 Anthill의 build.gradle 선택하고 OK Open as Project 클릭 Trus..
-
[프로그래머스] 2022 KAKAO BLIND RECRUITMENT 신고 결과 받기 - 자바(JAVA)알고리즘/프로그래머스 2022. 4. 26. 00:01
https://programmers.co.kr/learn/courses/30/lessons/92334?language=java# 코딩테스트 연습 - 신고 결과 받기 문제 설명 신입사원 무지는 게시판 불량 이용자를 신고하고 처리 결과를 메일로 발송하는 시스템을 개발하려 합니다. 무지가 개발하려는 시스템은 다음과 같습니다. 각 유저는 한 번에 한 명의 programmers.co.kr 문제 해석 불량 이용자를 신고하려고 합니다. 각 유저는 한 번에 한 명의 유저를 신고하는데 신고 횟수에 제한은 없습니다. 한 유저를 여러 번 신고할 수도 있지만, 동일한 유저에 대한 신고 횟수는 1회로 처리합니다. k번 이상 신고된 유저는 게시판 이용이 정지되며, 모든 유저에게 정지 사실을 메일로 보냅니다. 이때 유저별로 메일을..
-
DB Connection Pool이란CS/데이터베이스 2022. 4. 25. 01:16
DB Connection Pool이란? DB Connection이란 DB를 사용하기 위해 DB와 애플리케이션 간 통신을 할 수 있는 수단입니다. 여기에 Pooling이라는 기법을 도입하려 DB Connection Pool이라고 부릅니다. 즉, 커넥션 풀은 데이터베이스와 연결된 커넥션을 미리 만들어 풀에서 관리하고, 필요시 이를 사용하고 반환하는 기법입니다. 위의 그림처럼 유저가 Web에 접속하게 되고 DB자원을 요청하게 되면 Connection Pool에 의해 관리되는 미리 생성된 5개의 Connection에서 사용 가능한 Connection을 사용하여 DB에 요청하게 됩니다. DB Connection Pool을 사용하는 이유? 우선 DB에 query를 날리기위해서는 DB Connection이 필요합니다..
-
[백준] 2206번 : 벽 부수고 이동하기 - 자바(JAVA)알고리즘/백준 2022. 4. 25. 00:01
https://www.acmicpc.net/problem/2206 2206번: 벽 부수고 이동하기 N×M의 행렬로 표현되는 맵이 있다. 맵에서 0은 이동할 수 있는 곳을 나타내고, 1은 이동할 수 없는 벽이 있는 곳을 나타낸다. 당신은 (1, 1)에서 (N, M)의 위치까지 이동하려 하는데, 이때 최단 경로 www.acmicpc.net 문제 해석 N x M의 행렬로 표현되는 맵이 있습니다. 맵에서 0은 이동할 수 있는 곳, 1은 이동할 수 없는 벽으로 표시됩니다. (1,1)에서 (N, M)의 위치로 최단경로로 이동하려고 합니다 이때 시작하는 칸과 끝나는 칸도 포함해서 셉니다. 만약 이동하는 도중에 한 개의 벽을 부수고 이동하는 것이 좀 더 경로가 짧아진다면, 벽을 한 개까지 부수고 이동해도 됩니다. 문제..
-
테스트 코드 - 회원 관리 예제 실습(스프링 통합 테스트)테스트코드(Test Code) 2022. 4. 24. 15:26
이전에 했던 test는 순수하게 자바로 진행했지만 DB 정보들을 Spring이 가지고 있기 때문에 스프링과 함께 통합 테스트를 진행해야 합니다. 1. test/java/hello.hellospring.service 패키지에 MemberServiceIntegrationTest.java를 생성합니다. package hello.hellospring.service; import static org.junit.jupiter.api.Assertions.assertThrows; import java.util.List; import org.assertj.core.api.Assertions; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Bef..