Skip to main content
Felipe's user avatar
Felipe's user avatar
Felipe's user avatar
Felipe
  • Member for 9 years, 3 months
  • Last seen more than a month ago
awarded
awarded
awarded
awarded
awarded
awarded
awarded
awarded
awarded
awarded
awarded
awarded
comment
Sum of all paths between all pairs of nodes in a tree
your code fail with the following input: 1 5 2 1 50 3 2 50 4 3 50 5 3 50
Loading…
comment
Count solutions of a equation with a constraint
i don't use y >= 0 because it can cause division by 0 here z /= (x + y). And the case where x = 0 and y = 0 in the formula gives n = 0 (only in this case).
revised
Count solutions of a equation with a constraint
edited tag for call attention of someone who knows solve this problem
Loading…
Loading…