11484 - Document Object Model

All about problems in Volume 114. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

Post Reply
sreejond
New poster
Posts: 32
Joined: Fri May 23, 2008 6:16 pm
Contact:

11484 - Document Object Model

Post by sreejond »

hello,
i need some critical i/o for this problem.
can anyone help me??
thanks in advance.

sreejon
cuet,06
andmej
Experienced poster
Posts: 158
Joined: Sun Feb 04, 2007 7:45 pm
Location: Medellin, Colombia

Re: 11484 - Document Object Model

Post by andmej »

Try this one:

Code: Select all

6
<n value='parent'>
<n value='child'>
</n>
<n value='me'>
</n>
</n>
8
parent
parent
first_child
next_sibling
previous_sibling
previous_sibling
next_sibling
first_child

12
<n value='a'>
<n value='b'>
</n>
<n value='c'>
</n>
<n value='d'>
</n>
<n value='e'>
<n value='f'>
</n>
</n>
</n>
32
next_sibling
previous_sibling
first_child
parent
parent
first_child
next_sibling
next_sibling
next_sibling
next_sibling
next_sibling
next_sibling
next_sibling
next_sibling
next_sibling
next_sibling
first_child
previous_sibling
parent
parent
first_child
next_sibling
next_sibling
next_sibling
next_sibling
next_sibling
previous_sibling
next_sibling
first_child
previous_sibling
parent
parent

4
<n value='parent'>
<n value='child'>
</n>
</n>
6
next_sibling
first_child
first_child
parent
parent
parent

0

Correct output is:

Code: Select all

Case 1:
parent
parent
child
me
child
child
me
me
Case 2:
a
a
b
a
a
b
c
d
e
e
e
e
e
e
e
e
f
f
e
a
b
c
d
e
e
e
d
e
f
f
e
a
Case 3:
parent
child
child
parent
parent
parent
Runtime errors in Pascal are reported as Wrong Answers by the online judge. Be careful.

Are you dreaming right now?
http://www.dreamviews.com
brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: 11484 - Document Object Model

Post by brianfry713 »

The sample input is wrong.
It should be:

Code: Select all

4
<n value='parent'>
<n value='child'>
</n>
</n>
2
next_sibling
first_child
0
Check input and AC output for thousands of problems on uDebug!
Post Reply

Return to “Volume 114 (11400-11499)”