Coins (AtCoder DP I) | Probability DP Explained | 2D to 1D Space Optimization
In this video, we solve the ๐๐จ๐ข๐ง๐ฌ problem from the ๐๐ญ๐๐จ๐๐๐ซ ๐๐๐ฎ๐๐๐ญ๐ข๐จ๐ง๐๐ฅ ๐๐ ๐๐จ๐ง๐ญ๐๐ฌ๐ญ (๐๐ซ๐จ๐๐ฅ๐๐ฆ ๐).โฃ โฃ This problem explores a unique use-case of ๐ฉ๐ซ๐จ๐๐๐๐ข๐ฅ๐ข๐ญ๐ฒ-๐๐๐ฌ๐๐ ๐๐ฒ๐ง๐๐ฆ๐ข๐ ๐ฉ๐ซ๐จ๐ ๐ซ๐๐ฆ๐ฆ๐ข๐ง๐ , where we are given the probabilities of getting heads for each coin, and we must calculate the probability of getting more heads than tails after flipping all coins.โฃ โฃ We discuss:โฃ - Why a greedy or brute-force approach failsโฃ - How to build the recursive relation for probability DPโฃ - The bottom-up DP table constructionโฃ - How we optimize space from 2D to 1Dโฃ - And how to use fixed + setprecision(10) for precise answersโฃ โฃ This problem is part of our dynamic programming series that goes from complete beginner to advanced level. Problems are taken from ๐๐ญ๐๐จ๐๐๐ซ, ๐๐๐๐, ๐๐จ๐๐๐๐จ๐ซ๐๐๐ฌ, ๐๐๐๐ญ๐๐จ๐๐, and more.โฃ โฃ Problem link : https://atcoder.jp/contests/dp/tasks/dp_iโฃ โฃ #AtCoderDP #ProbabilityDP #DynamicProgramming #CoinsDP #DPOptimizationโฃ
Download
0 formatsNo download links available.