Skip to content

Conversation

@oncsr
Copy link
Contributor

@oncsr oncsr commented Mar 20, 2025

🧷 문제 링크

https://www.acmicpc.net/problem/24885

🧭 풀이 시간

18분
image

👀 체감 난이도

✏️ 문제 설명

과거로 돌아가 주식으로 돈을 벌려고 한다. 규칙은 아래와 같다.
image
주식을 매수할 때는 현재 가지고 있는 돈의 정확히 K배를 대출받아서 살 수 있을만큼 최대한 매수를 해야 하고,
매도할 때는 항상 가지고 있는 모든 주식을 매도해야 한다.

N일 동안의 주가가 주어지면, 최대로 가질 수 있는 돈이 얼마인지 구해보자.

🔍 풀이 방법

[사용한 알고리즘]

  • 완탐

직접 시뮬레이션하는 느낌으로 재귀+완탐 써서 해결했다.

⏳ 회고

구현이 좀 까다로웠다

@oncsr oncsr added the success 👍 해설을 보지 않고 풀었을 때 label Mar 20, 2025
@ShinHeeEul ShinHeeEul merged commit 12fc622 into main Mar 20, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

success 👍 해설을 보지 않고 풀었을 때

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants