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 1069. Prufer Code

help??? tests???
Posted by marius dumitran 13 Oct 2006 04:06
i have tried this problem several years....while preparing for contests and it's always WA and it's not at all the heardest of problems.....
i made an O (n log n) alg using heaps ....as usual
it's WA at test 2

could someone put some tests around??? i ageve my self some and nothing....bad
could somebody explain why??????????????:
1 2 3 2 3
my result:
1: 2 4
2: 1 3 6
3: 2 5
4: 1
5: 3
6: 2
AC result:
1: 2 4
2: 1 3 6
3: 2 5
4: 1
5: 1  //5 is not even conected to 1???????
6: 3




Edited by author 13.10.2006 04:08

Edited by author 13.10.2006 04:40
Re: help??? tests???
Posted by ChBlossom 20 Sep 2007 17:07
Is this input legal?
It seems that the last number will always be N, or the sequence itself is not legal.
Re: help??? tests???
Posted by Ulugbek#& 13 Jun 2020 10:13
It's incorrect input, you cannot find a tree that satisfies your input
marius dumitran wrote 13 October 2006 04:06
i have tried this problem several years....while preparing for contests and it's always WA and it's not at all the heardest of problems.....
i made an O (n log n) alg using heaps ....as usual
it's WA at test 2

could someone put some tests around??? i ageve my self some and nothing....bad
could somebody explain why??????????????:
1 2 3 2 3
my result:
1: 2 4
2: 1 3 6
3: 2 5
4: 1
5: 3
6: 2
AC result:
1: 2 4
2: 1 3 6
3: 2 5
4: 1
5: 1  //5 is not even conected to 1???????
6: 3




Edited by author 13.10.2006 04:08

Edited by author 13.10.2006 04:40