Hi guys,
I'm trying to solve this problem: spoj.pl/problems/TREEISO/4
but it's driving me crazy!!
I'm using the O(n Log n) version of the algorithm "AHU" but it's giving me a (Wrong Answer) over and over again.
the algorithm is:
1- calculating the centre of tree
2 - building the tree levels and save it in array of vectors for each tree: vector [10000][2]
3 - apply the "AHU" algorithm level by level and save tuples of the nodes in array of strings for each tree: string[100000][2]
note: I'm clearing these arrays after solving a level, in other meaning, no 2 levels are saved on memory in the same time.
Would you please provide me with some tricky test cases so I can test my code on?
Thank you in advance!
created
last reply
- 1
reply
- 126
views
- 2
users
- 2
links