Doubts in questions

Revision en1, by electro177, 2021-07-30 16:12:12

Hello codeforces,hope we all are doing well:)i have some doubts in some question which came in my coding test

1)Given a undirected tree,you are at the root node .some of the nodes have cake in them and you takes one secong to walk over one edge.find the minimum time to catch all the cakes and come back to the stating node(root node in which you were standing at time=0) (i thought it might be dfs but do not know how to come up with it)

constraints:N<=1e4;(no of nodes)

2)About modulo for large number: p=2^(100)-1 and q=2^(1000001)-1 how to find p*inverse(q),where inverse(q) is the inverse modulo of q with 10^9+7.I have no clue bec for smaller number we could do iterative thing

Tags #dfs, modular inverse


  Rev. Lang. By When Δ Comment
en1 English electro177 2021-07-30 16:12:12 716 Initial revision (published)