Pagini recente » Diferente pentru problema/gradina3 intre reviziile 2 si 1 | Diferente pentru problema/tenerife intre reviziile 8 si 9 | Istoria paginii problema/pod | Diferente pentru problema/shield intre reviziile 54 si 28 | Diferente pentru problema/sumtree intre reviziile 28 si 29
Nu exista diferente intre titluri.
Diferente intre continut:
== include(page="template/taskheader" task_id="sumtree") ==
You are given a tree with $N$ nodes. Each node has values assigned to it, <tex> value_i </tex>. You must calculate the sum cost of every pair nodes $(u, v)$, where <tex>gcd(value_u, value_v) > 1</tex> and $u$ ≠ $v$. For a pair of nodes <tex>(u, v)<tex>, we define the cost of that path to be the sum of value of all nodes that lie inside the $(u, v)$ path.
You are given a tree with $N$ nodes. Each node has values assigned to it, <tex> value_i </tex>. You must calculate the sum cost of every pair nodes $(u, v)$, where <tex>gcd(value_u, value_v) > 1</tex> and $u$ ≠ $v$. For a pair of nodes $(u, v)$, we define the cost of that path to be the sum of value of all nodes that lie inside the $(u, v)$ path.
h2. Date de intrare
Nu exista diferente intre securitate.
Topicul de forum nu a fost schimbat.