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

Автор Shayan, 4 дня назад, По-английски

Note: The text editorials will be provided by the authors of the round. This video tutorial acts as an additional resource for those who prefer video over text, not as a substitute for the text editorial.

2033A — Sakurako and Kosuke

Video

2033B — Sakurako and Water

Video

2033C — Sakurako's Field Trip

Video

2033D — Kousuke's Assignment

Video

2033E — Sakurako, Kosuke, and the Permutation

Video

2033F — Kosuke's Sloth

Video
Разбор задач Codeforces Round 981 (Div. 3)
  • Проголосовать: нравится
  • +17
  • Проголосовать: не нравится

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

No G?

  • »
    »
    3 дня назад, # ^ |
      Проголосовать: нравится +3 Проголосовать: не нравится
»
4 дня назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Where is G?

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

plz tell me when Tutorial (en) will appear,thx

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

How this got hacked on tle https://mirror.codeforces.com/contest/2033/submission/287798279 ? Pretty sure this is O(N) only.

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

Hi,in problem F I dont get the part why the length of the period is O(k) can someone elaborate on that?

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

downvotes is crazy

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

Most of them in top 10 of the official standings have cheated. No doubt about it. I feel useless doing contests now...

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

G can be solved with binary uplifting. For each v,k there are 2 way: travel from v to the lowest leaf in the subtree at v; or move up k0 <= k ancestors and travel down.
Use binary uplifting for when moving up.

  • »
    »
    3 дня назад, # ^ |
      Проголосовать: нравится +5 Проголосовать: не нравится

    Can you explain more?

    With binary lifting I understood that I need to reach the _k_th ancestor of vi in logn. Then need to find the deepest node from that _k_th ancestor excluding vi.

    How to do this excluding?

    • »
      »
      »
      2 дня назад, # ^ |
        Проголосовать: нравится 0 Проголосовать: не нравится

      First, for each node, we calculate the deepest child, the parent, the longest path if moving up the parent and down another subtree. So we have all calculated k=1 for all nodes. For each node i, if kth ancestor is j, we have: 2*k th ancestor of i = kth ancestor of i; max_path_from_i_up_to_2*k = max(path_from_i_up_to_k, k + path_from_j_up_to_k).

      For binary lifting we travel up the ancestors and update the longest path.

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

c is much harder than d e f...