10. Implicit Graphs & State Spaces | BFS (Codeforces Getting Zero)
Kicking off Phase 3: Implicit Graphs. Up until now, we have relied on explicitly allocated memory structures like adjacency lists and 2D grid matrices to define our networks. In this lecture, we strip away that memory overhead and traverse pure mathematical logic. We tackle Codeforces "Getting Zero" by treating integer values as nodes and arithmetic operations as directed edges. By combining this implicit state space with the reverse-graph logic we mastered in Phase 2, we run a single wave backward from our target state (0) to precompute the shortest path to all possible 32,768 states. This allows us to resolve any number of queries with O(1) lookups. We also break down the critical modulo wrap-around math required when reversing a "multiply by 2" operation. π Problem Link: https://codeforces.com/contest/1661/problem/B π πππ₯ππ¨π¦π ππ¨ ππ‘π ππ‘ππ§π§ππ₯!β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£ β£β£β£β£β£β£ I create content on Competitive Programming, Data Structures & Algorithms (DSA), and now Software Development with Go. If you find this video helpful, donβt forget to: π Like the video π¬ Comment your doubts/questions (I reply to everyone!) π Subscribe and turn on notifications to never miss upcoming tutorials β£β£β£β£β£β£ π ππ¨π§π§πππ π°π’ππ‘ π¦π:β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£β£ β£β£β£β£β£β£ π¦ X: https://x.com/Yash_Poonia_ πΌ LinkedIn: https://www.linkedin.com/in/yashpoonia/ π» GitHub: https://github.com/yash7xm/ π Discord: https://discord.gg/dAp2PbKFpV #BFS #CompetitiveProgramming #GraphTheory #Codeforces #Algorithms #Cplusplus #SoftwareEngineering
Download
0 formatsNo download links available.