couldn't understand logic of taking max(it1+1, it2) could you make it more simple.

lest take an example of a tree with three child and k = 4. each child return (1 → 2) so answer is 18 but by doing your logic calculation 26.

Read more… (44 words)

Active In

Competitive Programming

Artificial Intelligence

USA Computing Olympiad

Algorithms and Data Structures

Deep Learning

Featured Contributions

comment in this discussion

couldn't understand logic of taking max(it1+1, it2) could you make it more simple.

lest take an example of a tree with three child and k = 4. each child return (1 → 2) so answer is 18 but by doing your logic calculation 26.

Read more… (44 words)

comment in this discussion

Hi, In the codechef there is condition i < j ? could you explain after sorting how it is still valid i < j

Read more… (24 words)