Блог пользователя ritik26

Автор ritik26, история, 3 месяца назад, По-английски

I am learning Binary Lifting. Can someone suggest some good problems?

How to identify if a problems requires Binary Lifting technique to solve? From what I learned is that the every node must have one outdegree. Are there more?

Thank you for your time !!

  • Проголосовать: нравится
  • +8
  • Проголосовать: не нравится

»
3 месяца назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Auto comment: topic has been updated by ritik26 (previous revision, new revision, compare).

»
3 месяца назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Try cses problems. I remembered there were good binary lifting problems.

»
3 месяца назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

binary lifting is useful for LCA queries, maybe you can solve LCA problems, there are some good LCA problems on cf

»
3 месяца назад, # |
  Проголосовать: нравится -8 Проголосовать: не нравится

These two articles from USACO Guide and this blog entry here, for something more advanced are pretty good for a start.

In terms of your other question, what you want to do is to either find a tree or a tree like structure you can do binary lifting on, or you can even do it on a functional graph just as well.

»
3 месяца назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

This recent problem Shortest Distances 101 from Codechef Starters is the best problem on Binary Lifting for beginners (mostly because everywhere else it's taught, it's clubbed with Trees, LCA, tin, tout, etc, forcing you to learn a lot of new things at the same time). However, this problem only deals with binary lifting on array, so it's easy to visualize the actual potential of what Binary Lifting can do.

Another good problem on Binary Lifting on arrays is ABC367E: Permute K times from a recent Atcoder contest.

If you think you understand Binary Lifting, try implementing an RMQ data structure for solving CSES: Static Range Minimum Queries using only Binary Lifting.

Sample Submission

»
3 месяца назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится
»
3 месяца назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

After you've solved some simple problems from CSES and USACO Guide you could try this (the problem not the subtasks). You might not loove the UI but this problem is quite good.

It isn't immediately obvious how you would use binary lifting. If you are stuck and need help feel free to message me.

»
3 месяца назад, # |
  Проголосовать: нравится +1 Проголосовать: не нравится

Here are some good problems from codeforces problemset that can be solved using binary lifting

  1. 191C — Fools and Roads

  2. 1328E — Tree Queries

  3. 1702G2 — Passable Paths

  4. 832D — Misha, Grisha and Underground