![](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbFxOEm%2FbtqBDb0E33s%2FZvQ5RfQWaev5WdmKjZlYN0%2Fimg.png)
https://www.acmicpc.net/problem/1463 ๋์ ๋ต ์ฐ์ฐ์ ์ฐ์ ์์๋ฅผ ๋งค๊ฒผ์ 1๋นผ๊ธฐ 1๋นผ๊ณ 2๋๋๊ธฐ ์ด๋ฌํ ๊ฐ์ ์ ์์ ๊ณ์ฐ๋ง์ผ๋ก ํ์ ํ๋์ ๋ฌธ์ ๊ฐ ์์์ง ์๋ ์ถ๋ค. ์ฐ์ฐ์ ์ฐ์ ์์๋ฅผ ๋๋ ๊ฒ์ ์๋ฏธ๊ฐ ์์ ๋ค๋ฅธ ๋ต (2020-04-19 ์์ ) ๋์ ๊ณํ๋ฒ(Dynamic programming)์ ์ด์ฉํ๋ ๋ฐฉ๋ฒ ๋์ ๊ณํ๋ฒ์ ์ด๋ค ๋ฌธ์ ์ ๋ต์ ๋ฉ๋ชจ๋ฆฌ์ ์ ์ฅํด๋์๋ค๊ฐ ๋ค์ ๊ฐ์ ๊ตฌํด์ผํ ๋ ์ค๋ณต๊ณ์ฐ์ด ํ์์๊ฒ ๊ฐ์ ธ๋ค ์ฐ๋ ๊ธฐ๋ฒ์ด๋ค. x = int(input()) count = 0 minimum = [x] def cal(x): # ์ฃผ์ด์ง ํ๋ ฌ์ ๋ชจ๋ ์ ๊ฐ๊ฐ์ ๋ํด์ -1, 3์ผ๋ก ๋๋๊ธฐ, 2๋ก ๋๋๊ธฐ์ 3๊ฐ์ง ์ฐ์ฐ์ ๋ชจ..
Comment