@coder.plus.1: 🪨 GỘP ĐÁ: vì sao luôn gộp HAI ĐỐNG NHỎ NHẤT? (Thuật toán Huffman) 5 đống sỏi 4, 2, 7, 3, 5. Mỗi lần gộp hai đống, công sức bằng tổng hai đống. ❌ Gộp từ trái sang phải: 56 ❌ Gộp hai đống lớn nhất: 68 ✅ Gộp hai đống nhỏ nhất: 47 (tối ưu!) Trong video (Bài 7, Chương 3: Tham lam với hàng đợi ưu tiên): 1️⃣ Thử ba quy tắc, vì sao "đống lớn nên gộp càng muộn càng tốt" 2️⃣ Cây gộp: chi phí = Σ khối lượng × độ sâu 3️⃣ Chứng minh bằng đổi chỗ lá trên cây: 68 → 53 → … → 47 4️⃣ Mã Huffman nén dữ liệu: tổng số bit cũng là 47! 5️⃣ priority_queue với greater, chạy tay từng bước 6️⃣ Code C++ O(n log n), vì sao phải long long 7️⃣ Cảnh giác: chỉ được gộp kề nhau thì phải dùng quy hoạch động (48, không phải 47) 8️⃣ Mở rộng: cắt gỗ, gộp k đống, đổ xăng; các bẫy thường gặp 📌 Nhớ nhanh: đống lớn gộp càng muộn càng tốt. Lưu lại để ôn thi HSG Tin, Olympic và ICPC nhé! 💾 === HASHTAG === #codeplus #thamlam #greedy #huffman #priorityqueue #hangdoiuutien #thuattoan #hsgtin #olympictinhoc #cpp #laptrinh #hoclaptrinh #competitiveprogramming

codeplus
codeplus
Open In TikTok:
Region: VN
Friday 16 October 2026 19:27:40 GMT
4064
153
0
9

Music

Download

Comments

There are no more comments for this video.
To see more videos from user @coder.plus.1, please go to the Tikwm homepage.

Other Videos

🇩🇪 JAPAN 🇯🇵 vs CHINA 🇨🇳 vs GERMANY 🇩🇪 — WHO BUILDS THE BEST CARS? 🚘🔥 The global automobile market is flooded with Chinese vehicles, and China’s automotive industry is growing rapidly. But when it comes to heritage, engineering excellence, driving comfort, safety, and timeless luxury, German and Japanese manufacturers have built reputations that are hard to ignore. And when we talk about German automotive excellence, one name stands above the crowd: Mercedes-Benz — The Best or Nothing! ⭐🇩🇪 From its iconic design and luxurious interiors to its powerful performance and precision engineering, Mercedes-Benz represents generations of German automotive innovation. It’s not just about getting from point A to point B; it’s about the experience, prestige, and confidence behind the wheel. 🇩🇪 Germany: Engineering, luxury, performance, and prestige. 🇯🇵 Japan: Reliability, efficiency, and long-term dependability. 🇨🇳 China: Rapid innovation, advanced technology, and competitive pricing. Chinese brands are making impressive progress, but established German and Japanese brands still have strong advantages in many areas, including brand heritage, engineering experience, and global reputation. My personal choice? Germany all the way! 🇩🇪❤️ East or West, German engineering is hard to beat! And when the badge says Mercedes-Benz, you know you’re looking at a legend. 👑🚘 💬 Your turn: Which would you choose — German luxury 🇩🇪, Japanese reliability 🇯🇵, or Chinese innovation 🇨🇳? Let the debate begin! 🔥👇 please comment  #MercedesBenz #AutomotiveInnovation #TheBestOrNothing 🇩🇪🚘🔥#Nostalgia #FYP
🇩🇪 JAPAN 🇯🇵 vs CHINA 🇨🇳 vs GERMANY 🇩🇪 — WHO BUILDS THE BEST CARS? 🚘🔥 The global automobile market is flooded with Chinese vehicles, and China’s automotive industry is growing rapidly. But when it comes to heritage, engineering excellence, driving comfort, safety, and timeless luxury, German and Japanese manufacturers have built reputations that are hard to ignore. And when we talk about German automotive excellence, one name stands above the crowd: Mercedes-Benz — The Best or Nothing! ⭐🇩🇪 From its iconic design and luxurious interiors to its powerful performance and precision engineering, Mercedes-Benz represents generations of German automotive innovation. It’s not just about getting from point A to point B; it’s about the experience, prestige, and confidence behind the wheel. 🇩🇪 Germany: Engineering, luxury, performance, and prestige. 🇯🇵 Japan: Reliability, efficiency, and long-term dependability. 🇨🇳 China: Rapid innovation, advanced technology, and competitive pricing. Chinese brands are making impressive progress, but established German and Japanese brands still have strong advantages in many areas, including brand heritage, engineering experience, and global reputation. My personal choice? Germany all the way! 🇩🇪❤️ East or West, German engineering is hard to beat! And when the badge says Mercedes-Benz, you know you’re looking at a legend. 👑🚘 💬 Your turn: Which would you choose — German luxury 🇩🇪, Japanese reliability 🇯🇵, or Chinese innovation 🇨🇳? Let the debate begin! 🔥👇 please comment #MercedesBenz #AutomotiveInnovation #TheBestOrNothing 🇩🇪🚘🔥#Nostalgia #FYP

About