[Baekjoon] 2243 – 사탕상자

https://www.acmicpc.net/problem/2243 📖 문제 해석하기 이 문제는 동적으로 변화하는 사탕상자에서 순위 기반 조회를 효율적으로 수행하는 문제입니다. 수정이는 사탕상자에 사탕을 넣거나 빼면서, 동시에 “몇 번째로 맛있는 사탕”을 꺼내야 합니다. 구체적으로 살펴보면, 각 사탕은 1부터 1,000,000까지의 맛 점수를 가지며(1이 가장 맛있음), 우리는 다음 두 가지 연산을 처리해야 합니다: 예를 들어, 사탕상자에 맛 점수가 [3, 3, 5, 7, 7,…

Maximum Number of Groups With Increasing Length

📚 Interpreting the Problem Imagine you’re given a list of limits, where each number in the list represents how many times that index can be used in total. You’re tasked with forming groups using numbers from 0 up to n-1, but with two essential conditions: Your goal is to determine the maximum number of such groups that…