분류 전체보기
-
[DP] 오르막 수 (11057)(C++)BOJ C++ 알고리즘 공부 2024. 1. 24. 01:32
https://www.acmicpc.net/problem/11057 11057번: 오르막 수 오르막 수는 수의 자리가 오름차순을 이루는 수를 말한다. 이때, 인접한 수가 같아도 오름차순으로 친다. 예를 들어, 2234와 3678, 11119는 오르막 수이지만, 2232, 3676, 91111은 오르막 수가 아니다. 수 www.acmicpc.net 1. 문제 개요 수의 자리가 오름차순을 이루는 수를 오르막 수라고 할때, 수의 길이 N으로 만들 수 있는 오르막 수의 개수를 구하는 문제. 이때, 인접한 수가 같아도 오름차순으로 친다. 예를 들어, 1234, 1113 등이 오르막 수이다. 2. 입출력 3. 문제 풀이 N*M의 2차원 배열을 사용하여 N자리 오르막 수 중 숫자 M으로 끝나는 수의 개수를 구한 후,..
-
[DP] 1로 만들기 (1463)(C++)BOJ C++ 알고리즘 공부 2024. 1. 22. 17:01
1. 문제 개요 정수 N이 주어졌을 때, N이 3으로 나누어 떨어지면 3으로 나누기, 2로 나누어 떨어지면 2로 나누기, N에서 1을 빼기, 이렇게 세 가지의 연산을 사용하여 N을 최대한 빠르게 1로 만드는 문제이다. 사용한 연산의 최솟값을 구한다. 2. 입출력 3. 문제 풀이 다이나믹 프로그래밍을 통해 주어진 수를 1로 만들 수 있는 연산의 조합 중 최솟값을 구한다. 예를 들어, 주어진 수가 10인 경우, 10은 5에 2를 곱하거나, 9에 1을 더하여 만들 수 있다. 그렇다면 10이 1이 되는 최솟값은 숫자 5가 1이 되는 연산의 최솟값+1과 숫자 9가 1이 되는 연산의 최솟값 둘 중에 더 작은 값을 채택하면 된다. 이를 수식으로 나타내면 다음과 같다. count[10] = min(count[9]+1,..
-
[에드혹] 오락실에 간 총총이 (26071)(C++)BOJ C++ 알고리즘 공부 2023. 6. 1. 17:12
https://www.acmicpc.net/problem/26071 26071번: 오락실에 간 총총이 모든 곰곰이를 하나의 칸에 모으기 위해, 총총이가 최소 몇 번 버튼을 눌러야 하는지 구하시오. www.acmicpc.net 1. 문제 개요 게임의 화면은 NxN 크기의 칸으로 나누어져 있고, 각 칸에는 곰곰이가 있거나 또는 비어있다. 화면에는 최소 한 마리의 곰곰이가 존재한다. 게임은 상하좌우 네 개의 버튼을 눌러서 진행할 수 있다. 각 버튼을 누르게 되면, 화면에 있는 모든 곰곰이들이 그 버튼에 해당하는 방향으로 한 칸 움직이게 된다. 만약 이미 화면의 끝에 있어서 그 방향으로 이동하지 못하는 곰곰이들은 가만히 있는다. 버튼을 잘 눌러서 모든 곰곰이들을 하나의 칸에 모으게 되면, 승리하게 된다. 승리하..
-
[이분탐색] 가장 긴 증가하는 부분 수열 2(12015)(C++)BOJ C++ 알고리즘 공부 2023. 3. 17. 15:05
1. 문제 개요 수열 A가 주어졌을 때, 가장 긴 증가하는 부분 수열을 구하는 프로그램을 작성하시오. 예를 들어, 수열 A = {10, 20, 10, 30, 20, 50} 인 경우에 가장 긴 증가하는 부분 수열은 A = {10, 20, 10, 30, 20, 50} 이고, 길이는 4이다. 2. 입출력 3. 문제 풀이 https://www.crocus.co.kr/913 lower_bound, upper_bound 이용 방법 algorithm 헤더에 존재하는lower_bound와 upper_bound는 다음과 같은 의미를 가진다. lower_bound(first iterator, last iterator, value) vector를 기준으로 설명한다면 벡터의 첫 이터레이터(vector.begin()) 그리고 ..
-
[이분탐색] K번째 수(1300)(C++)BOJ C++ 알고리즘 공부 2023. 3. 16. 16:13
https://www.acmicpc.net/problem/1300 1300번: K번째 수 세준이는 크기가 N×N인 배열 A를 만들었다. 배열에 들어있는 수 A[i][j] = i×j 이다. 이 수를 일차원 배열 B에 넣으면 B의 크기는 N×N이 된다. B를 오름차순 정렬했을 때, B[k]를 구해보자. 배열 A와 B www.acmicpc.net 1. 문제 개요 세준이는 크기가 N×N인 배열 A를 만들었다. 배열에 들어있는 수 A[i][j] = i×j 이다. 이 수를 일차원 배열 B에 넣으면 B의 크기는 N×N이 된다. B를 오름차순 정렬했을 때, B[k]를 구해보자. 배열 A와 B의 인덱스는 1부터 시작한다. 2. 입출력 3. 문제 풀이 다음과 같이 2차원 배열에 들어있는 원소의 값이 인덱스의 곱(ixj)일..
-
R-CNN 논문 읽기Computer Vision 2023. 3. 14. 15:49
R-CNN 논문 목차 0. Abstract 1. Introduction 2. Object detection with R-CNN 0. Abstract 이 논문에서는 R-CNN(Regions with CNN features)이라는 객체 검출 알고리즘을 제안합니다. R-CNN은 PASCAL VOC 2012 데이터셋에서 이전 최고 결과에 비해 mAP(mean average precision)를 30% 이상 개선했습니다. R-CNN은 다음의 두 가지 핵심적인 방법을 결합했습니다. CNN과 영역 제안(region proposal)을 결합하여 detection을 수행 라벨링된 훈련 데이터가 부족한 경우에 pre-trained CNN을 사용하고, fine-tuning을 진행 R-CNN은 ILSVRC 2013 dete..
-
OHEM 논문 읽기Computer Vision 2023. 3. 8. 17:55
논문 링크 : https://arxiv.org/pdf/1604.03540.pdf 목차 0. Abstract 1. Introduction 2. Related work 3. Overview of Fast R-CNN 4. Our approach 5. Analyzing online hard example mining 0. Abstract 본 논문에서는 online hard example mining (OHEM) 알고리즘을 제시합니다. 이는 영역 기반(region-based) ConvNet detector를 훈련하기 위한 간단하면서도 놀랍도록 효과적인 알고리즘입니다. Detection 데이터셋에는 어려운 예제에 비해 쉬운 예제가 압도적으로 많습니다. 따라서 어려운 예제를 자동으로 선택하면 훈련이 보다 효과적이고 ..
-
[이분탐색] 공유기 설치(2110)(C++)BOJ C++ 알고리즘 공부 2023. 3. 8. 13:02
https://www.acmicpc.net/problem/2110 2110번: 공유기 설치 첫째 줄에 집의 개수 N (2 ≤ N ≤ 200,000)과 공유기의 개수 C (2 ≤ C ≤ N)이 하나 이상의 빈 칸을 사이에 두고 주어진다. 둘째 줄부터 N개의 줄에는 집의 좌표를 나타내는 xi (0 ≤ xi ≤ 1,000,000,000)가 www.acmicpc.net 1. 문제 개요 도현이의 집 N개가 수직선 위에 있다. 각각의 집의 좌표는 x1, ..., xN이고, 집 여러개가 같은 좌표를 가지는 일은 없다. 도현이는 언제 어디서나 와이파이를 즐기기 위해서 집에 공유기 C개를 설치하려고 한다. 최대한 많은 곳에서 와이파이를 사용하려고 하기 때문에, 한 집에는 공유기를 하나만 설치할 수 있고, 가장 인접한 두..