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 a branch contains 0 apples...
Posted by RightAnswer 31 Jul 2001 15:35
I've found that when there is a branch containing
0 apples, both Lintao's program and the judge-data
think it's not a branch, so the tree may be smaller
than n nodes; and the result is calculated from taking away
n-q-1 branches from this smaller tree, not from preserving
q branches.
It's a quite subtle error. :)
You are RightAnswer. I agree with you.
> I've found that when there is a branch containing
> 0 apples, both Lintao's program and the judge-data
> think it's not a branch, so the tree may be smaller
> than n nodes; and the result is calculated from taking
away
> n-q-1 branches from this smaller tree, not from
preserving
> q branches.
> It's a quite subtle error. :)
>
Why does this happen?
Posted by AOY++ 12 Aug 2001 13:41
> I've found that when there is a branch containing
> 0 apples, both Lintao's program and the judge-data
> think it's not a branch, so the tree may be smaller
> than n nodes; and the result is calculated from taking
away
> n-q-1 branches from this smaller tree, not from
preserving
> q branches.
> It's a quite subtle error. :)
>

My program just had an "accepted". But I think the judge-
program is wrong.