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 1471. Distance in the Tree

dfs+rmq=wa3?
Posted by quick(YarSU) 7 Mar 2011 14:24
answer = D[ a ] + D[ b ] - 2 * D[ c ]?
or smth special???

thx
Re: dfs+rmq=wa3?
Posted by Vitalii Arbuzov 17 Apr 2011 15:13


Edited by author 24.04.2011 03:04
Re: dfs+rmq=wa3?
Posted by Vitalii Arbuzov 24 Apr 2011 03:04
Got AC with dfs + rmq. Check your solution accurately.
Maybe this test case will help you:
7
0 2 1
1 2 2
2 3 4
3 4 8
4 5 16
4 6 32
5
0 1
0 3
2 5
1 6
1 5
Answer:
3
5
28
46
30
Re: dfs+rmq=wa3?
Posted by Abzal 22 Aug 2011 23:43
My programm passes this test, but i have crash(access violation)...