question about tree [solved]

Revision en2, by NeoYL, 2023-12-18 12:23:52

classical problem: add delta to all nodes on the path to u->v, it is basically adding delta to u and v, then val[lca(u,v)]-=delta, then just use dfs to find answer.

My question is to ask: is there a way to answer online?

Like let us say we have q<=1e5 queries and n<=1e5: is there a way to find value of a node during queries? (just curious)

Tags tree

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English NeoYL 2023-12-18 12:23:52 65
en1 English NeoYL 2023-05-02 10:26:28 425 Initial revision (published)