Quantcast
Channel: CodeChef Discuss - latest questions
Viewing all articles
Browse latest Browse all 39796

How to solve GTREE - "TREE GCD" ?

$
0
0

Problem Link (Contest) - https://www.codechef.com/LOCAUG17/problems/GTREE

I tried to solve the above problem from LoC AUG 2017 and wrote a brute force solution (by doing a DFS from each node in its subtree) that fetched 30 pts but couldn't come up with an approach to solve this problem completely.

Can someone explain how to solve this problem?


Viewing all articles
Browse latest Browse all 39796

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>