목록스택 (41)
넘치게 채우기
https://www.acmicpc.net/problem/19832BOJ - 19832 - Configuration file문제 유형: 문자열 처리, 파싱, 스택, 해시문제 난이도: Gold IV시간 제한: 2초메모리 제한: 512MB 문제Vadim develops a parser for configuration files of his project. A configuration file consists of blocks delimited with braces: "{" marks the beginning of the block, and "}" marks the end of the block. Blocks can be nested. One block can contains several other bloc..
https://leetcode.com/problems/recover-a-tree-from-preorder-traversal/description/leetcode - Recover a Tree From Preorder Traversal문제 유형: 스택, 트리, dfs, 문자열 처리문제 난이도: Hard 문제We run a preorder depth-first search (DFS) on the root of a binary tree.At each node in this traversal, we output D dashes (where D is the depth of this node), then we output the value of this node. If the depth of a node is D..
https://leetcode.com/problems/remove-all-occurrences-of-a-substring/description/leetcode - Remove All Occurrences of a Substring문제 유형: 스택, 문자열 처리문제 난이도: Medium 문제Given two strings s and part, perform the following operation on s until all occurrences of the substring part are removed:Find the leftmost occurrence of the substring part and remove it from s.Return s after removing all occurrences o..

https://www.acmicpc.net/problem/6549BOJ - 히스토그램에서 가장 큰 직사각형문제 유형: 히스토그램, 스택(모노토닉 스택), 세그먼트 트리, 분할 정복, 투 포인터문제 난이도: Platinum V시간 제한: 1초메모리 제한: 256MB 문제히스토그램은 직사각형 여러 개가 아래쪽으로 정렬되어 있는 도형이다. 각 직사각형은 같은 너비를 가지고 있지만, 높이는 서로 다를 수도 있다. 예를 들어, 왼쪽 그림은 높이가 2, 1, 4, 5, 1, 3, 3이고 너비가 1인 직사각형으로 이루어진 히스토그램이다.히스토그램에서 가장 넓이가 큰 직사각형을 구하는 프로그램을 작성하시오. 입력입력은 테스트 케이스 여러 개로 이루어져 있다. 각 테스트 케이스는 한 줄로 이루어져 있고, 직사각형의 수 ..
https://leetcode.com/problems/clear-digits/description/leetcode - Clear Digits문제 유형: 스택, 문자열 처리문제 난이도: Easy 문제You are given a string s.Your task is to remove all digits by doing this operation repeatedly:Delete the first digit and the closest non-digit character to its left.Return the resulting string after removing all digits. 문자열 s를 받습니다.당신의 임무는 다음을 반복적으로 수행하는 것 입니다:첫 번째 숫자를 지우고 왼쪽의 숫자가 아닌 문자를..

https://www.acmicpc.net/problem/1918BOJ - 후위 표기식문제 유형: 스택, 문자열 처리, 트리문제 난이도: Gold II시간 제한: 2초메모리 제한: 128MB 문제수식은 일반적으로 3가지 표기법으로 표현할 수 있다. 연산자가 피연산자 가운데 위치하는 중위 표기법(일반적으로 우리가 쓰는 방법이다), 연산자가 피연산자 앞에 위치하는 전위 표기법(prefix notation), 연산자가 피연산자 뒤에 위치하는 후위 표기법(postfix notation)이 그것이다. 예를 들어 중위 표기법으로 표현된 a+b는 전위 표기법으로는 +ab이고, 후위 표기법으로는 ab+가 된다.이 문제에서 우리가 다룰 표기법은 후위 표기법이다. 후위 표기법은 위에서 말한 법과 같이 연산자가 피연산자 뒤..
https://www.acmicpc.net/problem/9935BOJ - 문자열 폭발문제 유형: 스택, 문자열 처리문제 난이도: Gold IV시간 제한: 2초메모리 제한: 128MB 문제상근이는 문자열에 폭발 문자열을 심어 놓았다. 폭발 문자열이 폭발하면 그 문자는 문자열에서 사라지며, 남은 문자열은 합쳐지게 된다.폭발은 다음과 같은 과정으로 진행된다.문자열이 폭발 문자열을 포함하고 있는 경우에, 모든 폭발 문자열이 폭발하게 된다. 남은 문자열을 순서대로 이어 붙여 새로운 문자열을 만든다.새로 생긴 문자열에 폭발 문자열이 포함되어 있을 수도 있다.폭발은 폭발 문자열이 문자열에 없을 때까지 계속된다.상근이는 모든 폭발이 끝난 후에 어떤 문자열이 남는지 구해보려고 한다. 남아있는 문자가 없는 경우가 있다...
https://leetcode.com/problems/parsing-a-boolean-expression/description/?envType=daily-question&envId=2024-10-20leetcode - Parsing A Boolean Expression문제 유형: 문자열 처리, 스택, 구현문제 난이도: Hard 문제A boolean expression is an expression that evaluates to either true or false. It can be in one of the following shapes:'t' that evaluates to true.'f' that evaluates to false.'!(subExpr)' that evaluates to the log..
https://leetcode.com/problems/maximum-width-ramp/description/?envType=daily-question&envId=2024-10-10leetcode - Maximum Width Ramp문제 유형 : 스택, 모노토닉 스택문제 난이도 : Medium 문제A ramp in an integer array nums is a pair (i, j) for which i and nums[i] width of such a ramp is j - i.Given an integer array nums, return the maximum width of a ramp in nums. If there is no ramp in nums, return 0. 정수 배열 nums의 ra..
https://leetcode.com/problems/minimum-add-to-make-parentheses-valid/description/?envType=daily-question&envId=2024-10-09LeetCode - Minimum Add to Make Parentheses Valid문제 유형: 스택문제 난이도 : Medium 문제A parentheses string is valid if and only if:It is the empty string,It can be written as AB (A concatenated with B), where A and B are valid strings, orIt can be written as (A), where A is a valid string..