You can use several words in query to find by all of them at the same time. In addition, if you are lucky search understands word forms and some synonyms. It supports search by title and author. Examples:

  • 305 — search for 305, most probably it will find blogs about the Round 305
  • andrew stankevich contests — search for words "andrew", "stankevich" and "contests" at the same time
  • user:mikemirzayanov title:testlib — search containing "testlib" in title by MikeMirzayanov
  • "vk cup" — use quotes to find phrase as is
  • title:educational — search in title

Results

1.

tabulation

Last visit:  5 years ago
Registered:  5 years ago
2.
By adityakumar25005, 16 months ago, In English
Tabulation dp + space optimization + dp optimization <h3>How To Convert Recursive Code to Tabulation</h3> Let's take the <a href="https://leetcode.com/problems/unique-paths/description/">Unique Paths</a> problem for an example.(please read the problem before reading this blog) recursive code ```c++ int n,m; int dp[101][101]; int solve(int i,int j){ if(i==n-1&&j==m-1){ //base case return 1; } if(dp[i][j]!=-1)return dp[i][j]; //memoization int ans=0; if(i+1<n){ ans+=solve(i+1,j); //move down } if(j+1<m){ ans+=solve(i,j+1); //move right } return dp[i][j]=ans; } int main(){ cin>>n>>m; memset(dp,-1,sizeof(dp)); cout<<solve(0,0)<<endl; //0,0 initial position return 0; } ``` tabulation is a bottom up approach so for i we need to calculate i+1 first and same for j<br> for this problem the tabulation loops will look like this ```c++ for(in...
Tabulation dp + space optimization + dp optimization, How To Convert Recursive Code to Tabulation , ```c++ //recursive //tabulation int ans=0, tabulation is a bottom up approach so for i we need to calculate i+1 first and same for j for

Full text and comments »

  • Vote: I like it
  • +12
  • Vote: I do not like it

3.
By abhaysp, history, 3 years ago, In English
DP: Converting a memoized solution to tabulated one I started practicing some DP problems. For some easy problems (like when there's only 1 arg whose value is changing in each recursive call) I'm able to change the memoized solution to tabulated solution. But I'm finding it hard for to do this when there are `>= 2 args` whose value is changing in each recursive call (and which are not very straightforward). For ex:. Here's one question from leetcode contest (I hope pasting leetcode link here is not a problem): https://leetcode.com/contest/weekly-contest-359/problems/maximize-the-profit-as-the-salesman/ I was able to write a recursive (and thus memoized solution) but I couldn't figure out how to do it in tabulated form Here's the memoized solution: ~~~~~ class Solution { vector<vector<int>> space; public: int maximizeTheProfit(int n, vector<vector<int>>& offers) { int on = (int)offers.size(); sort(offers.begin(), offers.end(), [&](vector<int>& o1, vector<int>& o2) { return...
that in tabulation, the prev should look between the `i` (i.e., from outer loop) and `on` (i.e, ; } }; ~~~~~ For tabulation, I understand that outer loop should look like this: ~~~~~ for, For tabulation, I understand that outer loop should look like this:

Full text and comments »

  • Vote: I like it
  • +16
  • Vote: I do not like it

4.
By OSt, 14 years ago, translation, In English
Web service for defrost standings of competition — S4RiS StanD Good afternoon. Today I want to share with the public my little project (which was part of my thesis), service on the "defrost" the results of the competition format ACM ICPC &mdash; "System for Right Solutions Standings Dancing" (S4RiS StanD). Hosted on [github](https://github.com/OStrekalovsky/S4RiS-StanD). #### Introduction In 2011, my team is still held in the semifinals, where at the close I saw the live operation of such a system ITMO. The feeling was strong. But after analyzing the work and reviewing captured my video, I realized that it is possible to improve this implementation, make it open to and more modest, local competitions, the participants were able to watch in awe tabulation of results. It was chosen as part of my thesis was used already in one competition and received a logical extension. <p> [cut] </p> #### About the service and its features Service is just a web page with a core written in JS and requires no "server" scripts. Therefore, this service ...
, local competitions, the participants were able to watch in awe tabulation of results. It was chosen, tabulation of results. It was chosen as part of my thesis was used already in one competition and

Full text and comments »

  • Vote: I like it
  • +133
  • Vote: I do not like it

5.
By dapingguo8, 5 months ago, In English
Codeforces Round 1092 (Div. 1, Div. 2, Based on THUPC 2026 — Finals) Editorial We apologize for both the late editorial and the statement leaking issues. Unfortunately, as the problem authors, we never had any chances to prevent the leaking. Still, feel free to downvote if you have dissatisfaction due to these. But what so ever, we hope you can enjoy the problems. [problem:2216A] Idea by [user:Warriors_Cat,2026-04-13] <spoiler summary="Solution"> The method is simple: for $i = k, k - 1, \dots, 1$ successively, we adjust the courses at the $i$-th level of course wish one by one directly to the $(k+1)$-th level. It is easy to check that the adjustment is valid. The number of steps is at most $nk \le 1000$. </spoiler> <spoiler summary="Code(C++)"> ~~~~~ #include <iostream> #include <cstdio> #include <algorithm> #include <cstring> #include <cstdlib> using namespace std; #define ll long long #define rep(i, x, y) for(int i = x; i <= y; ++i) #define per(i, x, y) for(int i = x; i >= y; --i) inline int read(){ int x = 0, f = 1; cha...
)$. Next, this problem has an interesting property (which I discovered through tabulation): when, Next, this problem has an interesting property (which I discovered through tabulation): when $f_k(n

Full text and comments »

  • Vote: I like it
  • +80
  • Vote: I do not like it

6.
By NotSharwan, history, 7 years ago, In English
Dyanamic Programming # Dynamic Programming There were huge number of sources on the internet on this topic but still we (me and my friend) couldn't understand any of it for a very long time until we fiddled with code and tracked the output for every change in the input. So this repository is exactly created for people like us to make the transition from [greedy](https://en.wikipedia.org/wiki/Greedy_algorithm) to dynamic programming easier. This will just be an introduction to dynamic programming, so that one can pick it up from there. I have added additional sources for practice and other online tutorials that I found a little helpful at the end and will continue to do so as I find something new. It is for programmers who are comfortable with brute-force and might not the serve the purpose for absolute beginners. Contributions or suggestions are welcome. ## Definition So what's dynamic programming? Let's first look at a more formal definition. Dynamic programming (also known as dynamic optimiz...
acquired our solution in bottom up fashion(tabulation method) from the sub-problems. There's another, built up our solution or in DP terms we have acquired our solution in bottom up fashion(tabulation

Full text and comments »

  • Vote: I like it
  • +26
  • Vote: I do not like it

7.
By Sal3h.Sa3d, history, 2 years ago, In English
Exploring Dynamic Programming: A Comprehensive Guide Hey Codeforces community! Today, let's dive deep into the fascinating world of Dynamic Programming (DP). Whether you're a beginner looking to grasp the basics or an experienced coder seeking advanced techniques, this guide aims to provide a comprehensive overview of DP concepts and applications. **What is Dynamic Programming?** Dynamic Programming is a powerful algorithmic technique used to solve problems by breaking them down into simpler subproblems and storing the solutions to these subproblems to avoid redundant calculations. It's particularly useful for optimization problems where we seek to maximize or minimize certain criteria. **Basic Concepts** 1. Memoization vs. Tabulation: Discuss the two main approaches to implementing DP &mdash; memoization (top-down) and tabulation (bottom-up) 2.State Definition: Explain what a "state" means in DP and how to define it based on the problem's constraints. 3. Transition Function: Illustrate how to derive the transition fu...
. Tabulation: Discuss the two main approaches to implementing DP — memoization (top-down) and, 1. Memoization vs. Tabulation: Discuss the two main approaches to implementing DP &mdash

Full text and comments »

  • Vote: I like it
  • -22
  • Vote: I do not like it

8.
By RushabhMehta2005, history, 18 months ago, In English
My Learnings from Educational Codeforces Round 175 Div 2 Solved &mdash; 3 (A, B, C) Upsolved &mdash; 1 (D) Problem A: Naively we cannot iterate on n as n ≤ 10 ** 9 Let: i mod 3 = i mod 5 = x ⇒ x = i mod 3 and x = i mod 5 ⇒ x = i mod (15) [Chinese Remainder Theorem you can think] ⇒ x = i mod (15) should be 0, 1, 2 ……. as 3 < 5 we cannot have 3, 4 ⇒ just compute how many times numbers of the form 15k, 15k + 1, 15k + 2 come in interval [0, n] ⇒ number of complete 15 number blocks = n // 15 and size of last (partial) 15 group = n % 15 + 1 ⇒ just compute: ans := (n // 15) * 3 + min(3, n % 15 + 1) Problem B: Naively cannot simulate the given algorithm as k ≤ 10 ** 18 But seeing as n ≤ 2 * 10 ** 5, we can see an O(n) solution maybe Observation: in given string, at an index i, if count(L) becomes equal to x + count(R), we have reached origin and then as per the problem, we have to start back from index 0 in given string ⇒ this means that we are going to keep doing this cyclically until the time is up. ...
implementation: adjacency list repr, and use DFS/BFS for computing level of each node. then simpletabulation, simple tabulation for dp, also modular arithmetic has to be done as per problem

Full text and comments »

  • Vote: I like it
  • +1
  • Vote: I do not like it

9.
By trekhleb, history, 8 years ago, In English
Dynamic Programming vs Divide-and-Conquer ## TL;DR In this article I’m trying to explain the difference/similarities between dynamic programing and divide and conquer approaches based on two examples: [binary search](https://github.com/trekhleb/javascript-algorithms/tree/master/src/algorithms/search/binary-search) and [minimum edit distance](https://github.com/trekhleb/javascript-algorithms/tree/master/src/algorithms/string/levenshtein-distance) (Levenshtein distance). ## The Problem When I [started to learn algorithms](https://github.com/trekhleb/javascript-algorithms) it was hard for me to understand the main idea of dynamic programming (**DP**) and how it is different from divide-and-conquer (**DC**) approach. When it gets to comparing those two paradigms usually Fibonacci function comes to the rescue as great example. But when we’re trying to solve the same problem using both DP and DC approaches to explain each of them, it feels for me like we may lose valuable detail that might help to catch the difference faste...
conquer approach with **memoization** or **tabulation** technic., extends divide and conquer approach with **memoization** or **tabulation** technic. Let’s go step, sub-problems the caching of sub-problem solutions becomes possible and thus memoization/tabulation, ** and **tabulation**) that both have a purpose of storing and re-using sub-problems solutions that, **Tabulation (bottom-up cache filling)** is similar but focuses on filling the entries of the cache, You may read more about memoization and tabulation comparison [here](https://programming.guide

Full text and comments »

  • Vote: I like it
  • +12
  • Vote: I do not like it

10.
By pjha2186, history, 3 years ago, In English
Dynaminc Programming in C++ **Dynamic Programming** is a technique used in computer programming to solve complex problems by breaking them down into simple subproblems. It is a useful approach for solving optimization problems that involve finding the best solution among a set of possible solutions. The key idea of **Dynamic Programming** is to store the results of subproblems in memory so that they can be used to solve larger problems. This technique is also known as memoization. By storing the results of subproblems, **Dynamic Programming** reduces the number of computations required to solve a problem, making it more efficient than other approaches. **Dynamic Programming** is used in a wide range of applications, including computer science, engineering, finance, and economics. It is particularly useful in areas where optimization problems are common, such as scheduling, resource allocation, and route planning. One of the most famous examples of Dynamic Programming is the Knapsack Problem, which involv...
fun(n-1, heights,dp); } ~~~~~ :)Frog Jump — By Using Tabulation [T.C=O(n), S.C=O(n, :)Frog Jump — By Using Tabulation [T.C=O(n), S.C=O(n)]

Full text and comments »

  • Vote: I like it
  • -25
  • Vote: I do not like it

11.
By R.A.N.K.A., history, 6 years ago, In English
Longest Common Subsequence Problem Link : https://www.interviewbit.com/problems/longest-common-subsequence/ Can anyone help me out. why this code is giving time limit error(tle): ~~~~~ int fun(vector<vector<int> > &dp,int i,int j,string s1,string s2) { if(i==s1.length()|| j==s2.length()) return 0; int &ans=dp[i][j]; if(ans!=-1) return ans; ans=max(fun(dp,i,j+1,s1,s2),fun(dp,i+1,j,s1,s2)); if(s1[i]==s2[j]) ans=max(ans,1+fun(dp,i+1,j+1,s1,s2)); return ans; } int Solution::solve(string s1, string s2) { if(!s1.length() || !s2.length()) return 0; int n=s1.size(),m=s2.size(); vector<vector<int> > dp(n,vector<int> (m,-1)); return fun(dp,0,0,s1,s2); } ~~~~~ and why this code get accepted: × ~~~~~ int Solution::solve(string s1, string s2) { if(!s1.length() || !s2.length()) return 0; int n=s1.size(),m=s2.size(),i,j; vector<vector<int> > dp(n+1,vector<int> (m+1,0)); fo...
) memoization gives tle and tabulation passes the constraints why?? Thanks in advance., both solutions have time complexity O(m*n) memoization gives tle and tabulation passes the

Full text and comments »

  • Vote: I like it
  • -10
  • Vote: I do not like it

12.
By Satya900, history, 2 years ago, In English
Mastering Dynamic Programming: Best Practices and Methods Mastering Dynamic Programming: Best Practices and Methods ================== Dynamic programming (DP) is a powerful technique used to solve complex problems by breaking them down into simpler subproblems. It is particularly effective for optimization problems where the solution can be constructed from solutions to smaller subproblems. To excel in DP, it is essential to follow best practices and methods. This article outlines key strategies to master dynamic programming. ### 1. Understand the Problem Thoroughly Before diving into coding, ensure you fully comprehend the problem at hand. Analyze how the problem can be broken down into smaller, manageable parts. Understand the relationship between these parts and identify whether the problem exhibits overlapping subproblems and optimal substructure. This foundational step is crucial for applying dynamic programming effectively. ### 2. Define the State Defining the state or subproblem is a critical step in dynamic programming....
overlapping subproblems. - **Bottom-Up Approach (Tabulation)**: In this method, you iteratively, - **Bottom-Up Approach (Tabulation)**: In this method, you iteratively build up the solution from

Full text and comments »

  • Vote: I like it
  • -18
  • Vote: I do not like it

13.
By ahnaf_cp, history, 20 months ago, In English
Beginner DSA Curriculum Made by Me Hello, Codeforces community! As a beginner in competitive programming, diving into Data Structures and Algorithms (DSA) can feel overwhelming. To make it more approachable, I decided to create my own DSA curriculum tailored for beginners like myself. This curriculum is structured, beginner-friendly, and covers the essential concepts you need to progress in problem-solving and competitive programming. I’d love to share it with you all! Let’s dive in. --- ## Why Create This Curriculum? When I started my journey in programming, I faced these common challenges: - Lack of a clear roadmap. - Getting stuck on advanced topics without mastering the basics. - Feeling lost with random tutorials and problem sets. This curriculum addresses these issues by providing a **structured, progressive approach** to learning DSA. It’s designed to build a solid foundation, grow confidence, and gradually tackle harder problems. --- ## Curriculum Overview ### 1. **Foundations of...
- Fibonacci Sequence (Tabulation and Memoization) - Basic 0/1 Knapsack Problem

Full text and comments »

  • Vote: I like it
  • -5
  • Vote: I do not like it

14.
By Bakry, history, 9 years ago, In English
Dynamic Programming Memoization vs Tabulation Hello , I saw most of programmers in Codeforces use Tabulation more than Memoization So , Why most of competitive programmers use Tabulation instead of memoization ?
Dynamic Programming Memoization vs Tabulation, Hello , I saw most of programmers in Codeforces use Tabulation more than Memoization So , Why, I saw most of programmers in Codeforces use Tabulation more than Memoization So , Why most of

Full text and comments »

  • Vote: I like it
  • +6
  • Vote: I do not like it

15.
By Mahmud_Saikat, history, 3 years ago, In English
Why memoization needs more states than tabulation? Is there any case where memoization approach requires more states than tabulation? I have heard that tabulation and memoization only differs by some memory efficiency and time efficiency. But now I am facing a problem where the tabulation solution only needs a state, "amount". I tried to implement it using memoization but there I must keep track of the "index", otherwise it gives wrong answer. problem link: https://cses.fi/problemset/task/1636/ tabulation solution (accepted) with 1D dp : https://cses.fi/paste/d2e2d0644e0a8603822f62/ tabulation solution (accepted) with 2D dp : https://cses.fi/paste/d40aa6fee8c71199825f90/ memoization solution (TLE) with 2D dp : https://cses.fi/paste/972af1e5f43728b8825fa2/ memoization solution for this problem with 1D dp seems like does no exist.
Why memoization needs more states than tabulation?, But now I am facing a problem where the tabulation solution only needs a state, "amount". I tried, I have heard that tabulation and memoization only differs by some memory efficiency and time, Is there any case where memoization approach requires more states than tabulation?, tabulation solution (accepted) with 1D dp : https://cses.fi/paste/d2e2d0644e0a8603822f62/, tabulation solution (accepted) with 2D dp : https://cses.fi/paste/d40aa6fee8c71199825f90/

Full text and comments »

  • Vote: I like it
  • +1
  • Vote: I do not like it

16.
By VIKRAM91, history, 8 years ago, In English
Why is my recursive solution of this(link given) spoj problem giving me WA? I was doing [this Spoj problem](http://www.spoj.com/problems/MMAXPER/) and written tabulation method which got accepted, then I have written recursive solution but this gave me the wrong solution(WA), Where is my recursive solution is wrong:- Below is my tabulation solution which got AC:- #include<bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; int a[n]={0}; int b[n]={0}; for(int i=0;i<n;i++){ cin>>a[i]>>b[i]; } int dp[n][2]={{0}}; dp[0][0]=b[0]; dp[0][1]=a[0]; for(int i=1;i<n;i++){ int x=dp[i-1][0]+abs(a[i]-a[i-1])+b[i]; int y=dp[i-1][1]+abs(a[i]-b[i-1])+b[i]; int s=dp[i-1][0]+abs(b[i]-a[i-1])+a[i]; int t=dp[i-1][1]+abs(b[i]-b[i-1])+a[i]; dp[i][0]=max(x,y); dp[i][1]=max(s,t); } cout<<max(dp[n-1][0],dp[n-1][1]); return 0; } And below is my recursive solution which is giving me...
2). Can we do all dp problem with tabulation and memoization i.e if we can do with memoization than, Below is my tabulation solution which got AC:-, I was doing [this Spoj problem](http://www.spoj.com/problems/MMAXPER/) and writtentabulation

Full text and comments »

  • Vote: I like it
  • -5
  • Vote: I do not like it

17.
By MikeMirzayanov, 16 years ago, translation, In English
The Cormen Medal <img src="http://assets.codeforces.com/images/cormen-en.jpg" style="margin:0 1em;float:right;"> <p> Good day! </p> <p> We are pleased to inform you that on the night of December 31, 2010 on January 1, 2011 will be not only fireworks, champagne, gifts and presents, but we will summarize the <a href="http://codeforces.me/">Codeforces</a> year. Great news that <a href="http://en.wikipedia.org/wiki/Thomas_H._Cormen">Thomas Cormen</a> gave permission to use his name in Codeforces annual award. So, we are pleased to announce the annual Codeforces award — <b>the Cormen Medal</b>! </p> <p> It will be three awards this year: </p> <ul> <li>the best Codeforces participant</li> <li>the best secondary school Codeforces participant (based on <a href="http://codeforces.me/blog/entry/753">Winter Programming School Olympiads for Schoolchildred</a> results) </li> <li>the best problemsetter</li> </ul> <p> The first of the medals will be awarded to participant who will have the hi...
for Codeforces competitions (Codeforces team members not considered in the tabulation of results)., not considered in the tabulation of results). Wish you high ratings,, MikeMirzayanov

Full text and comments »

  • Vote: I like it
  • +45
  • Vote: I do not like it

18.
By Xenomorphing_19, 5 years ago, In English
Target Sum Problem | Tabulation Method WA | Recursion with memoization AC I've been trying a [Problem: Target Sum](https://leetcode.com/problems/target-sum/) in Dynamic Programming. I tried solving it by two methods: 1. recursion with memorization 2. Tabular DP In the second method, I'm receiving a WA verdict for the cases having all the elements equal. I've checked multiple sources if there is an error in my code but the codes which I found on those sites are also giving wrong answers[identical to my code]. I am unable to get my code work correctly. Here are both the codes I've written. Thanks in Advance. Tabular DP ~~~~~ class Solution { public: int findTargetSumWays(vector<int>& nums, int target) { int sum=0; for(auto it:nums) sum+=it; int n=nums.size(); sum+=target; if(sum%2!=0) return 0; sum/=2; int dp[n+1][sum+1]; sort(nums.begin(),nums.end()); for(int i=0;i<=sum;i++) dp[0][i]=0; for(int i=0;i<=n;i++) dp[i][0]=1; for(int i=1;i<=n;i++) ...
Target Sum Problem | Tabulation Method WA | Recursion with memoization AC

Full text and comments »

  • Vote: I like it
  • +7
  • Vote: I do not like it

19.
By proCoderVP, history, 3 years ago, In English
Minimum number of elements which are not part of Increasing or decreasing subsequence in array Hello everyone, I wanted help in one question of dynamic programming. Given an array find the minimum number of elements which are not part of Increasing or Decreasing subsequence. For example array = [7, 8, 1, 2, 4, 6, 3, 5, 2, 1, 8, 7] optimally we can select, increasing = [1, 2, 4, 5, 8], decreasing = [7, 6, 3, 2, 1], only 2 elements are not part of any sequence, hence answer for this case is 2. array = [1, 4, 2, 3, 3, 2, 4, 1] optimally we can select, increasing = [1, 2, 3, 4], decreasing = [4, 3, 2, 1], no element remains, hence answer for this case is 0. There is one solution available [top down memoization solution](https://www.geeksforgeeks.org/minimum-number-of-elements-which-are-not-part-of-increasing-or-decreasing-subsequence-in-array/). It is a 3D DP solution. I was thinking to change the problem to find the maximum number of elements that can be part of increasing or decreasing subsequence and subtract it from total number of elements to get th...
problem using tabulation and explain? Thank you.

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it

20.
By I_m_sfg, history, 2 years ago, In English
Struggling with tabulation dp Greetings to everyone, I am struggling with tabulation dp. I am solving the DP question by memorizing, but not all questions should be solved by memorizing, and memorizing adds an extra O(n) space. Please give me some resources and questions where I can learn tabular DP.
Struggling with tabulation dp, Greetings to everyone, I am struggling with tabulation dp. I am solving the DP question by

Full text and comments »

  • Vote: I like it
  • +11
  • Vote: I do not like it

21.
By raghavmangla04, history, 3 years ago, In English
DP problem with one of the states being related to the current diagonal line, from abc 311 Here is the link to the problem: https://atcoder.jp/contests/abc311/tasks/abc311_f Problem Statement basically states that there is a grid of characters of size n*m if grid[i][j]=='.' that means square(i,j) is white if grid[i][j]=='#' that means square(i,j) is black necessary condition for grid to be beautiful is that if square (i,j) is black , square (i+1,j) and square(i+1,j+1) should also be black we can repaint a white cell to a black cell, and were asked to find the number of beautiful grids possible I wanted to ask about the dp solution of this problem using memoization instead of tabulation, like what exactly the transitions would be in memoized solution (Pls ignore grammatical errors)
instead of tabulation, like what exactly the transitions would be in memoized solution (Pls ignore, I wanted to ask about the dp solution of this problem using memoization instead oftabulation, like

Full text and comments »

Tags dp
  • Vote: I like it
  • 0
  • Vote: I do not like it

22.
By Garvit_2013, history, 4 years ago, In English
Help in iterative DP solution Can anybody give me the iterative DP solution for the problem ? I have solved using Memoization but unable to make a tabulation solution using same concept. Problem: [https://leetcode.com/problems/two-city-scheduling/](https://leetcode.com/problems/two-city-scheduling/) My Memoization Solution: [https://leetcode.com/playground/SaUz7Rr6](https://leetcode.com/playground/SaUz7Rr6) Thanks in Advance
but unable to make a tabulation solution using same concept. Problem: [https://leetcode.com, I have solved using Memoization but unable to make a tabulation solution using same concept.

Full text and comments »

  • Vote: I like it
  • -12
  • Vote: I do not like it

23.
By nikhil09.dixit, history, 9 months ago, In English
Launching My CSES Dynamic Programming Video Series! Hi everyone! I’ve recently started a YouTube channel where I am uploading detailed solutions to the Dynamic Programming section of the CSES Problem Set. If you’re someone who wants to master DP from the ground up with clean explanations, multiple approaches, and real coding walkthroughs, this might be useful for you. I have already uploaded solutions to 5 questions(RECURSION+TABULATION) CSES DP Playlist Launch Video: https://www.youtube.com/watch?v=gElByOcqJRQ YouTube Channel: https://www.youtube.com/@NikhilDixit-k1e Also share, subscribe and like my channel !!
might be useful for you. I have already uploaded solutions to 5 questions(RECURSION+TABULATION, I have already uploaded solutions to 5 questions(RECURSION+TABULATION)

Full text and comments »

  • Vote: I like it
  • +2
  • Vote: I do not like it

24.
By insider_pants, history, 6 years ago, In English
In bottom up dynamic programing, do the order of for loop matter? I'm doing dynamic programming problems and I have found a weird thing that if I change the order of the for loops in the tabulation DP, one of my solution gives TLE whereas by changing the order of loops, it got accepted. Here's the problem im doing [E. Tree Queries](https://codeforces.me/contest/1328/problem/E) from recent div 3 contest. In this question I'm pre calculating LCA using binary lifting but during precalculation, the change in order of loops gives tle and other got accepted. here's the accepted version [74428570](https://codeforces.me/contest/1328/submission/74428570) and here's the TLE solution [74926625](https://codeforces.me/contest/1328/submission/74926625). The only difference is in find_ancestor function where I changes the order of the for loop. If changing order of for loop do matter then why I got TLE instead of WA? Thanks
the for loops in the tabulation DP, one of my solution gives TLE whereas by changing the order of

Full text and comments »

  • Vote: I like it
  • -3
  • Vote: I do not like it

25.
By Bakry, history, 9 years ago, In English
DP Tabulation Anyone have good resources for tabulation in DP
DP Tabulation, Anyone have good resources for tabulation in DP

Full text and comments »

  • Vote: I like it
  • -32
  • Vote: I do not like it

26.
By krish2004, history, 2 years ago, In English
Need a suggestion from candidate master or above. How to approach problems for DP? and as a beginner should I start approaching the question in tabulation method or in recursive method and then change it to the tabulation method ?
tabulation method or in recursive method and then change it to the tabulation method ?

Full text and comments »

Tags dp
  • Vote: I like it
  • -24
  • Vote: I do not like it

27.
By Ankit_12, history, 5 years ago, In English
Dynamic Prgramming Question? Recursively or Not? Hello Everyone I have a question related to Dynamic Programming. Whenever you are trying to solve DP question in the ongoing contest you first think recursive or you directly write the code in tabulation format.
tabulation format.

Full text and comments »

  • Vote: I like it
  • +1
  • Vote: I do not like it