ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1018. Binary Apple Tree

When Q = N-1
Posted by Moonlight [LNU] 15 Jan 2011 14:49
When Q = N-1 you shouldn't remove any branch. I don't know why, but it works and my application was accepted. Otherwise you will get WA #1.
Re: When Q = N-1
Posted by Vlad 31 Mar 2011 17:23
A tree with N nodes has exactly N-1 edges.
So if you want to preserve Q=N-1 edges, then it's no mystery that you shouldn't remove any branches :)