You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This discussion was converted from issue #84 on September 15, 2026 11:06.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Problem link
https://leetcode.com/problems/champagne-tower
Problem Summary
샴페인 잔이 피라미드 형식으로 쌓여있고 맨 위의 잔에 샴페인을 부었을 때 특정 행, 열에 샴페인이 얼마나 차있는지 출력하는 문제.

Solution
처음에 테스트로 직접 한번씩 부었는데 당연히 시간초과가 난다.
수학적으로 가능한가 싶었는데 그냥 돌려주면 된다. 단 한번씩 붓는게 아니고 처음에 전부 부어주었다고 가정하면 된다. 넘치는 양을 다음 잔에 부어주면서 죽 돌려주면 된다.
시간복잡도는 O(N^2)
Source Code
All reactions