From 1df14f20c5ff322dbf8ad4f5291ab2c708dc5dc2 Mon Sep 17 00:00:00 2001 From: yubin Date: Mon, 19 Feb 2024 15:31:38 +0900 Subject: [PATCH] 29-xxubin04 --- ...2\224 \355\230\270\353\236\221\354\235\264.py" | 15 +++++++++++++++ xxubin04/README.md | 4 +++- 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 "xxubin04/DP/2502_\353\226\241 \353\250\271\353\212\224 \355\230\270\353\236\221\354\235\264.py" diff --git "a/xxubin04/DP/2502_\353\226\241 \353\250\271\353\212\224 \355\230\270\353\236\221\354\235\264.py" "b/xxubin04/DP/2502_\353\226\241 \353\250\271\353\212\224 \355\230\270\353\236\221\354\235\264.py" new file mode 100644 index 0000000..b531878 --- /dev/null +++ "b/xxubin04/DP/2502_\353\226\241 \353\250\271\353\212\224 \355\230\270\353\236\221\354\235\264.py" @@ -0,0 +1,15 @@ +input = open(0).readline + +days, tteok_num = map(int, input().split()) + +for i in range(1, tteok_num): + for j in range(i, tteok_num): + a = i; b = j + for k in range(2, days): + temp = a + b + a = b + b = temp + + if temp == tteok_num: + print(f"{i}\n{j}") + exit() \ No newline at end of file diff --git a/xxubin04/README.md b/xxubin04/README.md index 67dbd0f..9c3b134 100644 --- a/xxubin04/README.md +++ b/xxubin04/README.md @@ -28,4 +28,6 @@ | 24차시 | 2024.01.29 | DP | [1495]기타리스트 | https://github.com/AlgoLeadMe/AlgoLeadMe-3/pull/86 | | 25차시 | 2024.02.01 | 구현 | [13]Roman to Integer | https://github.com/AlgoLeadMe/AlgoLeadMe-3/pull/91 | | 26차시 | 2024.02.05 | 에라토스테네스의 체 | [4948]베르트랑 공준 | https://github.com/AlgoLeadMe/AlgoLeadMe-3/pull/94 | -| 27차시 | 2024.02.08 | 수학 | [2885]초콜릿 식사 | https://github.com/AlgoLeadMe/AlgoLeadMe-3/pull/98 | \ No newline at end of file +| 27차시 | 2024.02.08 | 수학 | [2885]초콜릿 식사 | https://github.com/AlgoLeadMe/AlgoLeadMe-3/pull/98 | +| 28차시 | 2024.02.15 | 이진탐색 | [2805]나무 자르기 | https://github.com/AlgoLeadMe/AlgoLeadMe-3/pull/108 | +| 29차시 | 2024.02.19 | DP | [2502]떡 먹는 호랑이 | https://github.com/AlgoLeadMe/AlgoLeadMe-3/pull/110 | \ No newline at end of file