일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
- PrefixSum
- algorithm
- Unity
- Bronze
- C++11
- binary search
- effective C++
- Project
- Modern C++
- LEVEL2
- 8-Puzzle
- BFS
- two pointer
- Gold
- SWEA
- trie
- Euclidean
- knapsack Problem
- stack
- 프로그래머스
- programmers
- smart pointer
- 3D RPG
- BOJ
- algoritm
- Greedy
- Silver
- Zenject
- level1
- level3
- Today
- Total
목록Study/Algorithms Practice (124)
Patrick's Devlog
1. 개요 https://www.acmicpc.net/problem/7490 7490번: 0 만들기 각 테스트 케이스에 대해 ASCII 순서에 따라 결과가 0이 되는 모든 수식을 출력한다. 각 테스트 케이스의 결과는 한 줄을 띄워 구분한다. www.acmicpc.net 1-1. 설명 1부터 N까지 수를 오름차순으로 쓴 수열 1, 2, ... N을 생각해보자. 그리고 +, -, 공백을 숫자 사이에 삽입한다. 여기서 +는 더하기, -는 빼기, 공백은 숫자를 이어붙이는 것을 뜻한다. 이렇게 만든 수식의 값을 계산하고 그 결과가 0이 될 수 있는지 살펴본다. N이 주어졌을 때 수식의 결과가 0이되는 모든 수식을 찾는 프로그램을 작성한다. 1-2. 제한 사항 - 첫 줄에 테스트 케이스 개수가 주어지며, 테스트 케..
1. 개요 https://www.acmicpc.net/problem/1253 1253번: 좋다 첫째 줄에는 수의 개수 N(1 ≤ N ≤ 2,000), 두 번째 줄에는 i번째 수를 나타내는 Ai가 N개 주어진다. (|Ai| ≤ 1,000,000,000, Ai는 정수) www.acmicpc.net 1-1. 설명 N개의 수 중 어떤 수가 다른 수 두 개의 합으로 나타낼 수 있다면 그 수를 좋다고 한다. N개의 수가 주어지면 그 중 좋은 수의 개수는 몇개인지 출력하는 프로그램을 작성한다. 1-2. 제한 사항 - 첫 줄에 수의 개수 N이 주어지며, N은 1 이상 2,000 이하 - 둘째 줄에는 i번째 수를 나타내는 A_i가 N개 주어짐 2. 구현 2-1. 풀이 풀이는 이분탐색과 투포인터로 나눠지는데, 투포인터를 ..
1. 개요 https://www.acmicpc.net/problem/9465 9465번: 스티커 첫째 줄에 테스트 케이스의 개수 T가 주어진다. 각 테스트 케이스의 첫째 줄에는 n (1 ≤ n ≤ 100,000)이 주어진다. 다음 두 줄에는 n개의 정수가 주어지며, 각 정수는 그 위치에 해당하는 스티커의 www.acmicpc.net 1-1. 설명 상근이 여동생 상냥이는 문반구에서 스티커 2n개를 구매했다. 스티커는 2행 n열로 배치되어 있다. 이를 이용해 책상을 꾸미려고 하나, 스티커의 품질은 좋지않다. 한장을 떼면 스티커와 변을 공유하는 스티커는 모두 찢어져서 사용할 수 없게된다. 모든 스티커를 붙일 수 없게된 상냥이는 각 스티커에 점수를 매기고, 점수 합이 최대가 되게 스티커를 떼내려고 한다. 최대 ..
1. 개요 https://www.acmicpc.net/problem/13549 13549번: 숨바꼭질 3 수빈이는 동생과 숨바꼭질을 하고 있다. 수빈이는 현재 점 N(0 ≤ N ≤ 100,000)에 있고, 동생은 점 K(0 ≤ K ≤ 100,000)에 있다. 수빈이는 걷거나 순간이동을 할 수 있다. 만약, 수빈이의 위치가 X일 www.acmicpc.net 1-1. 설명 앞선 문제 숨바꼭질과 동일하게 수빈이는 동생을 찾을 수 있는 가장 빠른 시간을 구하는 것이다. 달라진 점은 순간이동 할 때 시간이 들지 않는다는 것이다. 1-2. 제한 사항 - 첫 줄에 수빈이 위치 N, 동생 위치 K가 주어짐 2. 구현 2-1. 풀이 처음에는 앞전에 풀었던 BFS에 조건을 더 추가하면 문제가 풀릴 것이라 생각하여 BFS로..
1. 개요 https://www.acmicpc.net/problem/1697 1697번: 숨바꼭질 수빈이는 동생과 숨바꼭질을 하고 있다. 수빈이는 현재 점 N(0 ≤ N ≤ 100,000)에 있고, 동생은 점 K(0 ≤ K ≤ 100,000)에 있다. 수빈이는 걷거나 순간이동을 할 수 있다. 만약, 수빈이의 위치가 X일 www.acmicpc.net 1-1. 설명 수빈이는 동생과 숨바꼭질을 한다. 수빈이는 현재 점 N에 있고, 동생은 점 K에 있다. 수빈이는 걷거나 순간이동이 가능한데, 걸을 때 1초후 +1이거나 -1 하면 된다. 순간이동을 할 때에는 *2를 해준 위치로 이동하게 된다. 수빈이와 동생 위치가 주어졌을 때, 수빈이가 동생을 찾을 수 있는 가장 빠른 시간이 몇 초 후인지 구하는 프로그램을 작성..
1. 개요 https://www.acmicpc.net/problem/1965 1965번: 상자넣기 정육면체 모양의 상자가 일렬로 늘어서 있다. 상자마다 크기가 주어져 있는데, 앞에 있는 상자의 크기가 뒤에 있는 상자의 크기보다 작으면, 앞에 있는 상자를 뒤에 있는 상자 안에 넣을 수가 www.acmicpc.net 1-1. 설명 정육면체 모양 상자가 일렬로 늘어서있다. 상자마다 크기가 주어져 있는데, 앞에 있는 상자의 크기가 뒤에 있는 상자의 크기보다 작으면 앞에 있는 상자를 뒤에 있는 상자 안에 넣을 수 있다. 상자의 크기가 주어질 때, 한번에 넣을 수 있는 최대 상자 개수를 출력하는 프로그램을 작성한다. 1-2. 제한 사항 - 파일의 첫번째 줄은 상자의 개수 n을 나타내며, n은 1 이상 1,000 이..
1. 개요 https://www.acmicpc.net/problem/11279 11279번: 최대 힙 첫째 줄에 연산의 개수 N(1 ≤ N ≤ 100,000)이 주어진다. 다음 N개의 줄에는 연산에 대한 정보를 나타내는 정수 x가 주어진다. 만약 x가 자연수라면 배열에 x라는 값을 넣는(추가하는) 연산이고, x가 0 www.acmicpc.net 1-1. 설명 널리 알려진 자료구조 중 최대 힙이 존재한다. 최대 힙을 이용해 다음과 같은 연산을 지원하는 프로그램을 작성한다. - 배열에 자연수 x를 넣음 - 배열에서 가장 큰 값 출력, 그 값 제거 프로그램은 처음 비어있는 배열에서 시작한다. 1-2. 제한 사항 - 첫 줄에 연산 개수 N이 주어지며 N은 1 이상 100,000 이하 - 다음 N개 줄에는 연산에..
1. 개요 https://www.acmicpc.net/problem/5972 5972번: 택배 배송 농부 현서는 농부 찬홍이에게 택배를 배달해줘야 합니다. 그리고 지금, 갈 준비를 하고 있습니다. 평화롭게 가려면 가는 길에 만나는 모든 소들에게 맛있는 여물을 줘야 합니다. 물론 현서는 www.acmicpc.net 1-1. 설명 현서는 찬홍이에게 택배를 배달해야 한다. 평화롭게 가려면 가는길에 만나는 소들에게 맛잇는 여물을 줘야한다. 여기서 최소한의 소들을 만나며 지나가고 싶다. 현서는 헛간 1에 있고, 찬홍이는 N에 있다. 이때 현서가 선택할 수 있는 최선의 통로를 구하는 프로그램을 작성한다. 1-2. 제한 사항 - 첫줄에 N과 M이 주어지며, N과 M은 1 이상 50,000 이하 - 둘째 줄부터 M+1..