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

Автор repeating, история, 9 лет назад, По-английски

Hi

These are some problems about Centroid Decomposition , you can learn this algorithm here .

Its complexity is O(nlogn)

I hope these problems would be useful for you :)

If there are another problems on CF please put it on comment !!

UPD : The list has been updated

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

»
9 лет назад, скрыть # |
 
Проголосовать: нравится +14 Проголосовать: не нравится

Great job :D Thank you :)

»
9 лет назад, скрыть # |
 
Проголосовать: нравится +17 Проголосовать: не нравится

Here's a nice problem about Centroid Decomposition : Race (although it's from IOI '11 not codeforces)

»
9 лет назад, скрыть # |
 
Проголосовать: нравится -7 Проголосовать: не нравится

The complexity is always O(nlogn) ?

So it doesn't depend on the problem or on the requested queries ?

  • »
    »
    9 лет назад, скрыть # ^ |
    ← Rev. 3  
    Проголосовать: нравится +21 Проголосовать: не нравится

    Lol, don't try to memorize it. Understand why it is O(N*logN). You build the centroid-decomposition-tree. The tree has logN levels. From each level, you do a DFS and visit atmost N nodes in total. So, you perform NlogN operations. If you do other stuff while visiting the nodes, the complexity will change too. For example, if after visiting each node, you insert into some global set, you introduce another logN factor. So, yes, it depends on the problem and the requested queries. O(NlogN) is just the bound on the total number of nodes you visit during the DFSs (a particular node may be visited multiple times from different centroids).

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

Mahmoud and a xor trip usually fails with cd due to the tight time limit. O(nlognlogM) is sadly too much.

»
9 лет назад, скрыть # |
← Rev. 3  
Проголосовать: нравится +14 Проголосовать: не нравится

if you want you can add these problems :

150E — Freezing with Style

293E — Close Vertices

»
9 лет назад, скрыть # |
 
Проголосовать: нравится +8 Проголосовать: не нравится

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

»
9 лет назад, скрыть # |
 
Проголосовать: нравится +10 Проголосовать: не нравится
»
9 лет назад, скрыть # |
 
Проголосовать: нравится -10 Проголосовать: не нравится

why just problems on CF ?

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

Tree2 from Timus can be solved using multiple techniques and Centroid Decomposition is one of them

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

Can anyone help me with Centroid Decomposition approach to the problem 161D("Distance in Tree")(http://codeforces.me/contest/161/problem/D)

»
9 лет назад, скрыть # |
 
Проголосовать: нравится +8 Проголосовать: не нравится

Don't get angry if I mention this problem even if it's not on CF: I think is very interesting Centroid Decomposition problem, and it's pretty difficult. https://csacademy.com/contest/archive/task/flareon

»
9 лет назад, скрыть # |
 
Проголосовать: нравится +8 Проголосовать: не нравится
»
8 лет назад, скрыть # |
 
Проголосовать: нравится +6 Проголосовать: не нравится

Can someone explain the solution of 766E — Mahmoud and a xor trip with Centroid Decomposition? Thanks in advance!

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

Can anyone tell the centroid decomposition solution to 161D? I did it using a n*k dp.

»
8 лет назад, скрыть # |
 
Проголосовать: нравится -9 Проголосовать: не нравится

766E , centroid decomposition is not fast enough..

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

1156D - 0-1-Tree also can be solved using Centroid Decomposition.

Spoiler
»
7 лет назад, скрыть # |
 
Проголосовать: нравится +5 Проголосовать: не нравится

A recent problem of CF 563 Div2 : F. Ehab and the Big Finale

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

If anyone have solved all the questions then please share the submission link.