A problem that I've been stuck on for a long while now

Revision en1, by Alex7, 2016-05-22 16:40:19

You're given a rooted tree with N nodes and Q queries in each query you have an integer K and you want to delete the nodes of the tree the only restriction of deleting some node is that it must be either the root or its parent must be deleted and you can delete at most K nodes each second, what is the minimum time for deleting all nodes?

N <= 10^6 Q <= 10^6

Problem Link

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English Alex7 2016-05-22 16:40:19 476 Initial revision (published)