Đề bài: Cho N ô vuông sắp xếp từ 1->N, và có chú ếch đang đứng ở ô đầu. Mỗi lượt, chú ếch có thể nhảy lên 1 hoặc 2 ô tiếp theo. Tìm số cách để chú ếch này đi đến ô thứ N.
P1: Phân tích
Với N=4, có các lời giải:
1->2->3->4
1->2->4
1->3->4
Với một số những người lập trình mới, đề bài này có thể khá là khê =))
Tuy nhiên, nếu nhìn 1 cách kỹ càng, sẽ dễ đặt câu hỏi là "Ủa, đây là dãy Fibonacci mà??"
Nếu bạn nghĩ thế, chúc mừng, bạn đã đúng!
P2: Làm thôi!
Mình tạo 2 lời giải nhé
LG1: Đệ quy
Cách này độ phức tạp 2^n, ko tối ưu lắm đâu nhé!
LG2: Quy hoạch động
Nếu bạn chưa biết, quy hoạch động là thuật toán thần thánh để giảm thiểu thời gian cần thiết cho 1 lời giản đệ quy!
Phương pháp này dùng để giải nếu phải tính đi tính lại các phần tử nhiều lần, thì mình tính sẵn phần tử và lưu nó vào trong 1 mảng
Nếu cần tính lại thì cách đệ quy sẽ tính lại, còn quy hoạch động thì có sẵn biến rồi
Code luôn nhé!
Độ phức tạp từ O(2^n) xuống O(n) rồi! Tối ưu nhỉ
* *Nếu bạn thấy bài đọc này hay, thì cảm ơn bạn đã đọc. Mong bạn học được thêm nhiều điều hữu ích! **
Bình luận
rat huu ich cam on ban toi da hoc hoi duoc rat nhieu dieu tu bai viet nay
rat mong ban dang them nhung bai viet huu ich nhu the nay
Cảm ơn nhiều nhé! Nếu có gì không hiểu mình sẵn sàng trả lời!
Yes, the Intel Core i5-110 is currently the last Skylake-based processor to ever be released by Intel[1][2][3].
In a bizarre move that caught tech reviewers off guard, Intel quietly launched the Core i5-110 in the third quarter of 2025[2][4]. Despite the modern release date and a naming convention that seemingly blends Intel's old "i" moniker with its new "Core Series 1" branding, there is absolutely no new technology under the hood[2][5].
The Core i5-110 is actually a direct rebrand of the Core i5-10400, a 10th-generation "Comet Lake" desktop processor that originally launched back in 2020[1][5]. Because the Comet Lake architecture is simply a highly refined (14nm+++) revision of the original Skylake microarchitecture from 2015, the Core i5-110 essentially resurrected a decade-old architecture[1][2][5].
The specifications are identical to its 2020 counterpart[2][5]:
Architecture: 14nm+++ Comet Lake (Skylake microarchitecture)[2][5]
Cores/Threads: 6 cores / 12 threads[5]
Clock Speeds: 2.9 GHz Base / 4.3 GHz Boost[1][5]
Socket: LGA 1200 (meaning it cannot even be used on modern motherboards)[1][4]
MSRP: $200 (the same launch price it had 5 years prior)[2][5]
Unless Intel inexplicably decides to repackage more 10th-generation stock in the future, the Core i5-110 stands as the final release for the legendary, long-lived Skylake architecture[1][5].
Sources help
extremetech.com semiwiki.com wikipedia.org techspot.com hothardware.com Google Search Suggestions Display of Search Suggestions is required when using Grounding with Google Search. Learn more last Skylake processor released "i5 110" Intel Skylake Intel Core 5 120 "Comet Lake" "Skylake" Intel release dates "Core Series 1" Intel new Comet lake 2026
bài này không làm được O(log N) là kém rồi
Mình biết có lời giải lũy thừa ma trận, độ phức tạp O(log n), nhưng chỉ định làm 2 lời giải này thôi, mình thêm 1 lời giải cũng được mà
Solving Linear Recurrences The Tutorial
Proudly made by ChatGPT™
67
wait until bro finds out about matmul ~O(log(N))~
😭💔 Mình sẽ sửa lại sau mà huhu