831 - Document Validator

All about problems in Volume 8. 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
Fernandez Jose
New poster
Posts: 8
Joined: Wed Sep 18, 2002 2:10 am

831 - Document Validator

Post by Fernandez Jose »

I've made an automata and, on my pc, solves any input. So I guess what is making the program to get WA over and over is the character set. Is it diferent in Linux and DOS?

Many thanks.
jos

Mariano
New poster
Posts: 2
Joined: Sun Sep 22, 2002 1:42 am
Location: Buenos Aires, Argentina
Contact:

I guess not

Post by Mariano »

I wrote a simple program which works correctly on each input I generate,
but the Judge does not like it. I :-? If the judge judging correctly?

-- m

Nenad
New poster
Posts: 2
Joined: Tue Oct 08, 2002 12:35 pm

Post by Nenad »

Well, I tried also this problem, and got WA. Tested several things, so maybe someone can find it usefull. Note that info is not 100% accurate, since it was obtained by timing loops:

- there are 6 test cases in judge input
- there are exactly 6 blank lines in input
- all cases have at least one semantic and one structural tag
- appears to be none dataless semantic tag , i.e. no {semtag}
- about 13 text lines max per case
- i get same number of correct results (2 out of 6) regardless of:
> allowing spaces inside tag, i.e. [ tagname [
> allowing case insensitive tags, i.e [data[ = [DAta[
> allowing same name semantic and structural tags, i.e. {mem} [mem[
> allowing tags continued in next line


I suspect there is some error in judge test case.

Fix
New poster
Posts: 2
Joined: Sun Apr 24, 2005 1:20 pm

Post by Fix »

I know it's too late for all who wrote in this post because now is 2,5 years later. I'm writting because it could be useful for those who have problems with problem 831:

I finally had an acceped response from de judge. (well, I really had P.E, but I don't know why).

There are some points that one has to be present in that problem:

- Any tag name is formed only by letters (capital or not) and numbers.
- My program is case sensitive, so [DAta[ and [data[ are different tags.
- Spaces are not allowed inside the tag because tag names can only have letters and numbers, so [ tagname [ is not a valid tag. i.e.
[memo[ blablablablabla [me
mo[
is NOT allowed.
- A tag name can't contain LF character (0x0A), so a tag name won't appear cut at the end of a line.
- Semantic tags don't have any kind of tags inside them, so opening curly brackets and opening and closing square brackets ( {,],[) must be ignored. In other words, you have to ignore all characters until a closing curly bracket appears.
- When an opening tag (either structural or semantic) appears, the next closing tag must close it (if the tag is structural, the tag name must be the same). If not, the output must be ERROR.
- If a closing tag appears and it hasn't been opened, the output must be ERROR.
- For the output: A tag name can't be repeated in either semantic and strucutral, but we can have the same tag name for both (i.e. {mem} [mem[).

I hope to have been useful

PD: My presentation is

STRUCTURAL TAGS
...tags...
SEMANTIC TAGS
...tags...
----BLANK LINE-----
ERROR
----BLANK LINE-----
...
...
...
STRUCTURAL TAGS
...tags...
SEMANTIC TAGS
...tags...
----BLANK LINE-----
STRUCTURAL TAGS
...tags...
SEMANTIC TAGS
...tags...
----BLANK LINE-----

If anybody knows why the judge gives me a P.E. I would like to know it.

Abednego
A great helper
Posts: 281
Joined: Tue Sep 10, 2002 5:14 am
Location: Mountain View, CA, USA
Contact:

Post by Abednego »

Thank you very much for explaining it. It was not at all clear to me that brackets inside {} should be ignored. Here are some sample inputs/outputs.

Code: Select all

21

[memo[
[de[ Comiss ao Cient fica do MIUP ]de]
[para[ Todos os Concorrentes ]para]
[data[{bold 2001.set.25}]data]
[mensagem[
[parag[Devem ter o m aximo cuidado na leitura dos enunciados.]parag]
[parag[Desejamos a todos {desejo Calma} e {desejo Boa Sorte}!]parag]
]mensagem]
]memo]

[[]]

[a [] a]

[a []a]

[a ]]a ]

[ a[]a ]

[ a]]a]

[ a]] a]

]a]

[b[]a]

[a#[]a#]

[a[]]

[a[]a)

[a(]a]

[a[]b]

[a[]A]

{7a a}

{a [b[]b]}

{a}

{a {b c}}

{a [b[}]b]

Code: Select all

STRUCTURAL TAGS
memo
de
para
data
mensagem
parag
SEMANTIC TAGS
bold
desejo

ERROR

ERROR

ERROR

ERROR

ERROR

ERROR

ERROR

ERROR

ERROR

ERROR

ERROR

ERROR

ERROR

ERROR

ERROR

ERROR

STRUCTURAL TAGS
SEMANTIC TAGS
a

STRUCTURAL TAGS
SEMANTIC TAGS
a

ERROR

ERROR
By the way, you get Presentation Error because you print one extra blank line at the end. There should be a blank line _between_ cases, not _after_ each case.
If only I had as much free time as I did in college...

Post Reply

Return to “Volume 8 (800-899)”