sergiooooo's blog

By sergiooooo, history, 5 days ago, In English

I am using polygon and code forces to set up problems for students in my university, however, I am struggling with finding the right way to set up the judge for some cases. For example, let's take the problem where they have a tree and an integer $$$k$$$ and they have to find the number of nodes at level $$$k$$$. If they need to take the node values from the user, how can I know the tree shape they go for?

Let's say there are 3 nodes and their values are 14 15 16, since it is not necessarily a BST, it can be a tree entirely skewed to the left or right or have any of these nodes as roots with others as it is children. Maybe it would be safe to assume that the first value is for the root node but what to do after? I am new to this and lost when it comes to the sample input/output to include along with the judge configuration.

 
 
 
 
  • Vote: I like it
  • +4
  • Vote: I do not like it