From 7ca4884cac27f82adaa69734725278abe59d28e6 Mon Sep 17 00:00:00 2001 From: aiden0413 Date: Thu, 30 Oct 2025 16:35:37 +0900 Subject: [PATCH 1/3] =?UTF-8?q?[6=EC=A3=BC=EC=B0=A8]=2024416=20=EB=AC=B8?= =?UTF-8?q?=EC=A0=9C=ED=92=80=EC=9D=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- seokjun/week6/24416.py | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 seokjun/week6/24416.py diff --git a/seokjun/week6/24416.py b/seokjun/week6/24416.py new file mode 100644 index 0000000..eabca73 --- /dev/null +++ b/seokjun/week6/24416.py @@ -0,0 +1,2 @@ +n=int(input()) +print(round((((1+(5**.5))/2)**n-((1-(5**.5))/2)**n)/(5**.5)),n-2) \ No newline at end of file From cc65aa17e31697b53d8fa15f7165f5b5504da23b Mon Sep 17 00:00:00 2001 From: aiden0413 Date: Thu, 30 Oct 2025 19:49:50 +0900 Subject: [PATCH 2/3] cache,dp --- seokjun/week6/24416(1).py | 0 seokjun/week6/24416(2).py | 9 +++++++++ 2 files changed, 9 insertions(+) create mode 100644 seokjun/week6/24416(1).py create mode 100644 seokjun/week6/24416(2).py diff --git a/seokjun/week6/24416(1).py b/seokjun/week6/24416(1).py new file mode 100644 index 0000000..e69de29 diff --git a/seokjun/week6/24416(2).py b/seokjun/week6/24416(2).py new file mode 100644 index 0000000..342f6d9 --- /dev/null +++ b/seokjun/week6/24416(2).py @@ -0,0 +1,9 @@ +n=int(input()) + +f1=0 +f2=f3=1 +for _ in range(3,n+1): + f1=f2+f3 + f2,f3=f3,f1 + +print(f1,n-2) \ No newline at end of file From 103696fa4c164843bdf8cb19630734bab2024488 Mon Sep 17 00:00:00 2001 From: aiden0413 Date: Thu, 30 Oct 2025 19:50:00 +0900 Subject: [PATCH 3/3] 1 --- seokjun/week6/24416(1).py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/seokjun/week6/24416(1).py b/seokjun/week6/24416(1).py index e69de29..c72b216 100644 --- a/seokjun/week6/24416(1).py +++ b/seokjun/week6/24416(1).py @@ -0,0 +1,11 @@ +from functools import* + +n=int(input()) + +@cache +def fib(n): + if n==1 or n==2: + return 1 + return fib(n-1)+fib(n-2) + +print(fib(n),n-2) \ No newline at end of file