You are not logged in. Please login at to post your questions!


Difficulty in solving CNTTREE from SPOJ.

I was looking attempting the problem CNTTREE from SPOJ, but I am completely clueless on how to solve such problems. I don't even understood the sample test case.

This problem is also there on codechef, I looked at the editorial but appeared very overwhelming.

Can anyone please explain how to solve this problem, with the background of such problems.

asked 14 May, 08:06

arpit728's gravatar image

accept rate: 10%

// I don't even understood the sample test case. Make sure you know the definition of Diameter of a tree, as well the meaning of a subtree.

(15 May, 15:30) sorb19974★


Can you please explain.

(16 May, 22:39) arpit7281★

@vivek_1998299 @vijju123

Can you please check this out?

(19 May, 13:23) arpit7281★
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:


question asked: 14 May, 08:06

question was seen: 124 times

last updated: 19 May, 13:23