Chef and Pairs | PAIRCNT | CODECHEF JULY CHALLENGE

Thunder Bitz
Jul 2, 2021

--

Codechef

View problem on codechef

You are given a tree (connected, undirected, acyclic graph) consisting of NN nodes. Based on this tree, you have to answer QQ queries.

Each query is of the form:

- K D V1 V2 ⋯ VKK D V1 V2 ⋯ VK — output the number of pairs (i,j)(i,j), 1≤i

--

--

No responses yet