https://www.acmicpc.net/problem/2002n: number of cars passing through tunnel.dae: car number list written by 대식.carToIndexMap: a map data structu
https://www.acmicpc.net/problem/4889If the parenthsis is eqaul to '{', just add to stack.If the parenthisis is equal to '}', check weather stack
https://www.acmicpc.net/problem/5525s: input string that is only consisted of 'I' and 'O'n: number of 'O'm: length of sstart: every index of 'I'c
https://www.acmicpc.net/problem/18111n : length of heightm : length of widthb : initial number of blockland : 2-dimension array (n x m)low : min
https://www.acmicpc.net/problem/18111n : length of heightm : length of widthb : initial number of blockland : 2-dimension array (n x m)low : min
https://www.acmicpc.net/problem/15685예제 입력 1 (Problem Link 참고)0 : 11 : 22 : 3 -> 23 : 3 -> 0 -> 3 -> 2즉, 3번째 커브에 대한 direction은 2번째 커브에 대한 directi
https://www.acmicpc.net/problem/12100moveBoard(direction) 함수에 대한 이해를 돕기 위한 블로그 (https://jellyinghead.tistory.com/53)Time : O(N^2)Space : O(N
문제링크n : 세로m : 가로r : 회전 횟수sub : 한 번 회전 시, 필요한 회전 수Time : O(r x N), N = min(n, m)Space : O(n x m)
미세먼지 확산에 따른 변화량에 대한 2차원 배열을 사용하여 변화량을 적용합니다.시계방향, 반시계방향에 대한 이동에 대한 처리는 다음과 같습니다.반시계방향의 경우 시계방향(↑, →, ↓, ←)으로 이동시키면, swap 과정 없이 이동시킬 수 있습니다.시계방향의 경우 반시
Problem LinkFind all dijkstra results of vertexes.If the start node is same as "x", accumulate all distance results of vertexes.Otherwise, accumulate
Problem linkSort number list in ascending order.Iterate 0, n - 1 with index i.Iterate 0, n - 1 with index j except (i == j) to avoid duplicate positio
problem linkTo find the number of intersected cable, find B's index corresponding to A's value which means Ai.With the index, count how many visited m
problem linksimple segment tree problemonly update in-range index of segment tree to reduce time complexityO(N)
problem linkIf i(th) village is excellent village, the adjacent village (child villages) must not be excellent village.If i(th) village is not excelle
문제링크Brute-ForceIf the distance between enemies is smaller than the sum of each enemy's range, union each parent.Then, find the number of group using m
문제링크h <= o 라는 조건이 없기 때문에 시작점과 도착점을 통일시켜주기 위해 h <= o 조건을 구현해줍니다.도착점을 기준으로 오름차순 정렬을 합니다.0부터 (n-1)까지 순회를 합니다.최소힙에 시작점을 넣어주고, peek 값이 (현재 도착점 - d) 값
문제링크입력 x에 대해 오름차순으로 정렬합니다.시작 정보(0번째 인덱스)를 저장하고, 1부터 (n-1)번째까지 순회합니다.분리된 선인지 더 긴 선 정보가 있는지 확인하면서 길이를 누적해주고 길이 정보를 변경시켜줍니다.분리된 선을 만났을 때에만 길이를 누적해주기 때문에
문제링크i번째 숫자가 i번째 이후 숫자보다 작은 경우의 수를 계산하면 될 것이라고 생각하여 Heap을 사용하여 해결해보려 했지만 시간 초과가 발생하였고, 세그먼트 트리를 사용하여 시간 초과를 해결해보고자 했지만 결국 틀렸다는 결과를 얻게 되어 가정이 잘못되었음을 깨달았
문제링크조합과 BFS 탐색이 결합된 문제입니다.처음엔 DFS 탐색 또는 BFS 탐색을 통해 Y가 4번 나오면 멈추고 총 7번의 탐색이 일어났을 때 정답 카운트를 높이는 백트래킹을 구현하려고 했지만, 아래와 같은 테스트 케이스는 DFS와 BFS를 통해 해결하지 못하는 한