**All Section Mixed Editorial**

**Sorting and Searching**

**Dynamic Programming**

**Graph**

**Range Queries**

**Tree**

**Mathematics**

**String**

If I have missed some, let me know...

# | User | Rating |
---|---|---|

1 | tourist | 3750 |

2 | Benq | 3726 |

3 | cnnfls_csy | 3690 |

4 | Radewoosh | 3649 |

5 | jiangly | 3631 |

6 | orzdevinwang | 3558 |

7 | -0.5 | 3545 |

8 | inaFSTream | 3477 |

9 | fantasy | 3468 |

10 | Rebelz | 3415 |

# | User | Contrib. |
---|---|---|

1 | adamant | 178 |

2 | awoo | 167 |

3 | BledDest | 165 |

4 | Um_nik | 164 |

5 | maroonrk | 163 |

6 | SecondThread | 158 |

7 | nor | 156 |

8 | -is-this-fft- | 154 |

9 | kostka | 146 |

10 | TheScrasse | 143 |

If I have missed some, let me know...

↑

↓

Codeforces (c) Copyright 2010-2023 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Sep/21/2023 12:53:55 (k2).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|

I think you should add Williams 12 hour CSES problem set stream too. It has one of the neatest solutions to these problem.

Here's the link to it.

Thanks added...

That Link Introduction to DP on Trees || CSES Tree algorithms || Video lectures is broken, it should be Introduction to DP on Trees || CSES Tree algorithms || Video lectures

Thanks updated...

Thank you, Really helpful.

U can add this too under dp section- video editorial Youtube Link

Thanks added

couldn't thank you more bro!

And this

Thanks added

hello sahal,I bet you've solved the whole cses problem set by now, but you're still in pupil...does that mean even after knowing all those algos and techniques and solving more than 2000 problem on cf, it's still not worth to reach stable specialist

He obviously hasn't solved every problem on CSES. Finding blogs with solutions is not the same as actually solving the problems. Also, you definitely don't need to know everything from CSES to become a specialist.

There isn't a topic for problem "path queries" in trees problems, is it similar to a problem before it ?? I tried to solve it but couldn't figure out the solution, any hints please ? Thanks in advance.

It uses the same technique as in the previous one, "Subtree Queries," which is euler tour.

Ok, after I did euler tour on the tree, is it just segment tree? Or are there something else?

just that, you can use a BIT if you'd like

hmmm, ok I will try that. thanks..

For each node v, call value[v] as the value assigned to the node and sum[v] as the sum from root of the tree to that node v.

For each node v, we will store sum[v] in its euler tour location.

Incrementing the value of node v by x, increases root to node sum values for all the nodes in the subtree of v by x. Since subtrees correspond to subarrays, this is an equivalent range increment operation on an array.

Finding the sum of values on a u-v path is equal to sum[u] + sum[v] — 2*sum[lca] + value[lca]. sum[u], sum[v], sum[lca] are all just values in the euler tour array.

So effectively, we need to support two operations on the euler tour array: 1. Performing Range increment on an subarray. 2. Querying value at index on an array.

Both of these operations can be simultaneously supported by either a binary indexed tree or a segment tree. (with segment tree you'll need to implement lazy prop, but with BIT its far simpler).

Yes, I already did that thanks for your explanation but my question was for the next problem "Path Queries II", in this problem a simple euler tour and segment tree won't be enough you need something more complex which is heavy-light decomposition. but even the HLD solution is not enough because its time complexity is O(q * log^2(n)) and that is a TLE for sure. so my question is what is the approach for this problem after knowing that HLD is not enough? is it link-cut trees? or there is something else ?